@formio/js 5.0.0-rc.51 → 5.0.0-rc.52

Sign up to get free protection for your applications and to get access to all the features.
@@ -387,7 +387,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
387
387
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
388
388
 
389
389
  "use strict";
390
- eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.jsonLogic = void 0;\nconst json_logic_js_1 = __importDefault(__webpack_require__(/*! json-logic-js */ \"./node_modules/json-logic-js/logic.js\"));\nexports.jsonLogic = json_logic_js_1.default;\nconst _ = __importStar(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst date_1 = __webpack_require__(/*! ../../utils/date */ \"./node_modules/@formio/core/lib/utils/date.js\");\nconst operators_1 = __webpack_require__(/*! ./operators */ \"./node_modules/@formio/core/lib/modules/jsonlogic/operators.js\");\n// Configure JsonLogic\noperators_1.lodashOperators.forEach((name) => {\n if (_[name]) {\n json_logic_js_1.default.add_operation(`_${name}`, _[name]);\n }\n});\n// Retrieve Any Date\njson_logic_js_1.default.add_operation('getDate', (date) => {\n return (0, date_1.dayjs)(date).toISOString();\n});\n// Set Relative Minimum Date\njson_logic_js_1.default.add_operation('relativeMinDate', (relativeMinDate) => {\n return (0, date_1.dayjs)().subtract(relativeMinDate, 'days').toISOString();\n});\n// Set Relative Maximum Date\njson_logic_js_1.default.add_operation('relativeMaxDate', (relativeMaxDate) => {\n return (0, date_1.dayjs)().add(relativeMaxDate, 'days').toISOString();\n});\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/modules/jsonlogic/jsonLogic.js?");
390
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.jsonLogic = void 0;\nconst json_logic_js_1 = __importDefault(__webpack_require__(/*! json-logic-js */ \"./node_modules/json-logic-js/logic.js\"));\nexports.jsonLogic = json_logic_js_1.default;\nconst date_1 = __webpack_require__(/*! ../../utils/date */ \"./node_modules/@formio/core/lib/utils/date.js\");\nconst operators_1 = __webpack_require__(/*! ./operators */ \"./node_modules/@formio/core/lib/modules/jsonlogic/operators.js\");\n// Configure JsonLogic\nfor (let operator in operators_1._) {\n json_logic_js_1.default.add_operation(`_${operator}`, operators_1._[operator]);\n}\n// Retrieve Any Date\njson_logic_js_1.default.add_operation('getDate', (date) => {\n return (0, date_1.dayjs)(date).toISOString();\n});\n// Set Relative Minimum Date\njson_logic_js_1.default.add_operation('relativeMinDate', (relativeMinDate) => {\n return (0, date_1.dayjs)().subtract(relativeMinDate, 'days').toISOString();\n});\n// Set Relative Maximum Date\njson_logic_js_1.default.add_operation('relativeMaxDate', (relativeMaxDate) => {\n return (0, date_1.dayjs)().add(relativeMaxDate, 'days').toISOString();\n});\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/modules/jsonlogic/jsonLogic.js?");
391
391
 
392
392
  /***/ }),
393
393
 
@@ -395,10 +395,10 @@ eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ?
395
395
  /*!**********************************************************************!*\
396
396
  !*** ./node_modules/@formio/core/lib/modules/jsonlogic/operators.js ***!
397
397
  \**********************************************************************/
398
- /***/ (function(__unused_webpack_module, exports) {
398
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
399
399
 
400
400
  "use strict";
401
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.lodashOperators = void 0;\n// Use only immutable useful functions from Lodash.\n// Visit https://lodash.com/docs for more info.\nexports.lodashOperators = [\n // Array\n 'chunk',\n 'compact',\n 'concat',\n 'difference',\n 'drop',\n 'dropRight',\n 'findIndex',\n 'findLastIndex',\n 'first',\n 'flatten',\n 'flattenDeep',\n 'flattenDepth',\n 'fromPairs',\n 'head',\n 'indexOf',\n 'initial',\n 'intersection',\n 'intersectionBy',\n 'intersectionWith',\n 'join',\n 'last',\n 'lastIndexOf',\n 'nth',\n 'slice',\n 'sortedIndex',\n 'sortedIndexBy',\n 'sortedIndexOf',\n 'sortedLastIndex',\n 'sortedLastIndexBy',\n 'sortedLastIndexOf',\n 'sortedUniq',\n 'sortedUniqBy',\n 'tail',\n 'take',\n 'takeRight',\n 'takeRightWhile',\n 'takeWhile',\n 'union',\n 'unionBy',\n 'unionWith',\n 'uniq',\n 'uniqBy',\n 'uniqWith',\n 'unzip',\n 'unzipWith',\n 'without',\n 'xor',\n 'xorBy',\n 'xorWith',\n 'zip',\n 'zipObject',\n 'zipObjectDeep',\n 'zipWith',\n // Collection\n 'countBy',\n 'every',\n 'filter',\n 'find',\n 'findLast',\n 'flatMap',\n 'flatMapDeep',\n 'flatMapDepth',\n 'groupBy',\n 'includes',\n 'invokeMap',\n 'keyBy',\n 'map',\n 'orderBy',\n 'partition',\n 'reduce',\n 'reduceRight',\n 'reject',\n 'sample',\n 'sampleSize',\n 'shuffle',\n 'size',\n 'some',\n 'sortBy',\n // Date\n 'now',\n // Function\n 'flip',\n 'negate',\n 'overArgs',\n 'partial',\n 'partialRight',\n 'rearg',\n 'rest',\n 'spread',\n // Lang\n 'castArray',\n 'clone',\n 'cloneDeep',\n 'cloneDeepWith',\n 'cloneDeep',\n 'conformsTo',\n 'eq',\n 'gt',\n 'gte',\n 'isArguments',\n 'isArray',\n 'isArrayBuffer',\n 'isArrayLike',\n 'isArrayLikeObject',\n 'isBoolean',\n 'isBuffer',\n 'isDate',\n 'isElement',\n 'isEmpty',\n 'isEqual',\n 'isEqualWith',\n 'isError',\n 'isFinite',\n 'isFunction',\n 'isInteger',\n 'isLength',\n 'isMap',\n 'isMatch',\n 'isMatchWith',\n 'isNaN',\n 'isNative',\n 'isNil',\n 'isNull',\n 'isNumber',\n 'isObject',\n 'isObjectLike',\n 'isPlainObject',\n 'isRegExp',\n 'isSafeInteger',\n 'isSet',\n 'isString',\n 'isSymbol',\n 'isTypedArray',\n 'isUndefined',\n 'isWeakMap',\n 'isWeakSet',\n 'lt',\n 'lte',\n 'toArray',\n 'toFinite',\n 'toInteger',\n 'toLength',\n 'toNumber',\n 'toPlainObject',\n 'toSafeInteger',\n 'toString',\n // Math\n 'add',\n 'ceil',\n 'divide',\n 'floor',\n 'max',\n 'maxBy',\n 'mean',\n 'meanBy',\n 'min',\n 'minBy',\n 'multiply',\n 'round',\n 'subtract',\n 'sum',\n 'sumBy',\n // Number\n 'clamp',\n 'inRange',\n 'random',\n // Object\n 'at',\n 'entries',\n 'entriesIn',\n 'findKey',\n 'findLastKey',\n 'functions',\n 'functionsIn',\n 'get',\n 'has',\n 'hasIn',\n 'invert',\n 'invertBy',\n 'invoke',\n 'keys',\n 'keysIn',\n 'mapKeys',\n 'mapValues',\n 'omit',\n 'omitBy',\n 'pick',\n 'pickBy',\n 'result',\n 'toPairs',\n 'toPairsIn',\n 'transform',\n 'values',\n 'valuesIn',\n // String\n 'camelCase',\n 'capitalize',\n 'deburr',\n 'endsWith',\n 'escape',\n 'escapeRegExp',\n 'kebabCase',\n 'lowerCase',\n 'lowerFirst',\n 'pad',\n 'padEnd',\n 'padStart',\n 'parseInt',\n 'repeat',\n 'replace',\n 'snakeCase',\n 'split',\n 'startCase',\n 'startsWith',\n 'toLower',\n 'toUpper',\n 'trim',\n 'trimEnd',\n 'trimStart',\n 'truncate',\n 'unescape',\n 'upperCase',\n 'upperFirst',\n 'words',\n // Util\n 'cond',\n 'conforms',\n 'constant',\n 'defaultTo',\n 'flow',\n 'flowRight',\n 'identity',\n 'iteratee',\n 'matches',\n 'matchesProperty',\n 'method',\n 'methodOf',\n 'nthArg',\n 'over',\n 'overEvery',\n 'overSome',\n 'property',\n 'propertyOf',\n 'range',\n 'rangeRight',\n 'stubArray',\n 'stubFalse',\n 'stubObject',\n 'stubString',\n 'stubTrue',\n 'times',\n 'toPath',\n 'uniqueId',\n];\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/modules/jsonlogic/operators.js?");
401
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports._ = void 0;\n// Use only immutable useful functions from Lodash.\n// Visit https://lodash.com/docs for more info.\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nexports._ = {\n chunk: lodash_1.chunk,\n compact: lodash_1.compact,\n concat: lodash_1.concat,\n difference: lodash_1.difference,\n drop: lodash_1.drop,\n dropRight: lodash_1.dropRight,\n findIndex: lodash_1.findIndex,\n findLastIndex: lodash_1.findLastIndex,\n first: lodash_1.first,\n flatten: lodash_1.flatten,\n flattenDeep: lodash_1.flattenDeep,\n flattenDepth: lodash_1.flattenDepth,\n fromPairs: lodash_1.fromPairs,\n head: lodash_1.head,\n indexOf: lodash_1.indexOf,\n initial: lodash_1.initial,\n intersection: lodash_1.intersection,\n intersectionBy: lodash_1.intersectionBy,\n intersectionWith: lodash_1.intersectionWith,\n join: lodash_1.join,\n last: lodash_1.last,\n lastIndexOf: lodash_1.lastIndexOf,\n nth: lodash_1.nth,\n slice: lodash_1.slice,\n sortedIndex: lodash_1.sortedIndex,\n sortedIndexBy: lodash_1.sortedIndexBy,\n sortedIndexOf: lodash_1.sortedIndexOf,\n sortedLastIndex: lodash_1.sortedLastIndex,\n sortedLastIndexBy: lodash_1.sortedLastIndexBy,\n sortedLastIndexOf: lodash_1.sortedLastIndexOf,\n sortedUniq: lodash_1.sortedUniq,\n sortedUniqBy: lodash_1.sortedUniqBy,\n tail: lodash_1.tail,\n take: lodash_1.take,\n takeRight: lodash_1.takeRight,\n takeRightWhile: lodash_1.takeRightWhile,\n takeWhile: lodash_1.takeWhile,\n union: lodash_1.union,\n unionBy: lodash_1.unionBy,\n unionWith: lodash_1.unionWith,\n uniq: lodash_1.uniq,\n uniqBy: lodash_1.uniqBy,\n uniqWith: lodash_1.uniqWith,\n unzip: lodash_1.unzip,\n unzipWith: lodash_1.unzipWith,\n without: lodash_1.without,\n xor: lodash_1.xor,\n xorBy: lodash_1.xorBy,\n xorWith: lodash_1.xorWith,\n zip: lodash_1.zip,\n zipObject: lodash_1.zipObject,\n zipObjectDeep: lodash_1.zipObjectDeep,\n zipWith: lodash_1.zipWith,\n countBy: lodash_1.countBy,\n every: lodash_1.every,\n filter: lodash_1.filter,\n find: lodash_1.find,\n findLast: lodash_1.findLast,\n flatMap: lodash_1.flatMap,\n flatMapDeep: lodash_1.flatMapDeep,\n flatMapDepth: lodash_1.flatMapDepth,\n groupBy: lodash_1.groupBy,\n includes: lodash_1.includes,\n invokeMap: lodash_1.invokeMap,\n keyBy: lodash_1.keyBy,\n map: lodash_1.map,\n orderBy: lodash_1.orderBy,\n partition: lodash_1.partition,\n reduce: lodash_1.reduce,\n reduceRight: lodash_1.reduceRight,\n reject: lodash_1.reject,\n sample: lodash_1.sample,\n sampleSize: lodash_1.sampleSize,\n shuffle: lodash_1.shuffle,\n size: lodash_1.size,\n some: lodash_1.some,\n sortBy: lodash_1.sortBy,\n now: lodash_1.now,\n flip: lodash_1.flip,\n negate: lodash_1.negate,\n overArgs: lodash_1.overArgs,\n partial: lodash_1.partial,\n partialRight: lodash_1.partialRight,\n rearg: lodash_1.rearg,\n rest: lodash_1.rest,\n spread: lodash_1.spread,\n castArray: lodash_1.castArray,\n clone: lodash_1.clone,\n cloneDeepWith: lodash_1.cloneDeepWith,\n cloneDeep: lodash_1.cloneDeep,\n conformsTo: lodash_1.conformsTo,\n eq: lodash_1.eq,\n gt: lodash_1.gt,\n gte: lodash_1.gte,\n isArguments: lodash_1.isArguments,\n isArray: lodash_1.isArray,\n isArrayBuffer: lodash_1.isArrayBuffer,\n isArrayLike: lodash_1.isArrayLike,\n isArrayLikeObject: lodash_1.isArrayLikeObject,\n isBoolean: lodash_1.isBoolean,\n isBuffer: lodash_1.isBuffer,\n isDate: lodash_1.isDate,\n isElement: lodash_1.isElement,\n isEmpty: lodash_1.isEmpty,\n isEqual: lodash_1.isEqual,\n isEqualWith: lodash_1.isEqualWith,\n isError: lodash_1.isError,\n isFinite: lodash_1.isFinite,\n isFunction: lodash_1.isFunction,\n isInteger: lodash_1.isInteger,\n isLength: lodash_1.isLength,\n isMap: lodash_1.isMap,\n isMatch: lodash_1.isMatch,\n isMatchWith: lodash_1.isMatchWith,\n isNaN: lodash_1.isNaN,\n isNative: lodash_1.isNative,\n isNil: lodash_1.isNil,\n isNull: lodash_1.isNull,\n isNumber: lodash_1.isNumber,\n isObject: lodash_1.isObject,\n isObjectLike: lodash_1.isObjectLike,\n isPlainObject: lodash_1.isPlainObject,\n isRegExp: lodash_1.isRegExp,\n isSafeInteger: lodash_1.isSafeInteger,\n isSet: lodash_1.isSet,\n isString: lodash_1.isString,\n isSymbol: lodash_1.isSymbol,\n isTypedArray: lodash_1.isTypedArray,\n isUndefined: lodash_1.isUndefined,\n isWeakMap: lodash_1.isWeakMap,\n isWeakSet: lodash_1.isWeakSet,\n lt: lodash_1.lt,\n lte: lodash_1.lte,\n toArray: lodash_1.toArray,\n toFinite: lodash_1.toFinite,\n toInteger: lodash_1.toInteger,\n toLength: lodash_1.toLength,\n toNumber: lodash_1.toNumber,\n toPlainObject: lodash_1.toPlainObject,\n toSafeInteger: lodash_1.toSafeInteger,\n toString: lodash_1.toString,\n add: lodash_1.add,\n ceil: lodash_1.ceil,\n divide: lodash_1.divide,\n floor: lodash_1.floor,\n max: lodash_1.max,\n maxBy: lodash_1.maxBy,\n mean: lodash_1.mean,\n meanBy: lodash_1.meanBy,\n min: lodash_1.min,\n minBy: lodash_1.minBy,\n multiply: lodash_1.multiply,\n round: lodash_1.round,\n subtract: lodash_1.subtract,\n sum: lodash_1.sum,\n sumBy: lodash_1.sumBy,\n clamp: lodash_1.clamp,\n inRange: lodash_1.inRange,\n random: lodash_1.random,\n at: lodash_1.at,\n entries: lodash_1.entries,\n entriesIn: lodash_1.entriesIn,\n findKey: lodash_1.findKey,\n findLastKey: lodash_1.findLastKey,\n functions: lodash_1.functions,\n functionsIn: lodash_1.functionsIn,\n get: lodash_1.get,\n has: lodash_1.has,\n hasIn: lodash_1.hasIn,\n invert: lodash_1.invert,\n invertBy: lodash_1.invertBy,\n invoke: lodash_1.invoke,\n keys: lodash_1.keys,\n keysIn: lodash_1.keysIn,\n mapKeys: lodash_1.mapKeys,\n mapValues: lodash_1.mapValues,\n omit: lodash_1.omit,\n omitBy: lodash_1.omitBy,\n pick: lodash_1.pick,\n pickBy: lodash_1.pickBy,\n result: lodash_1.result,\n toPairs: lodash_1.toPairs,\n toPairsIn: lodash_1.toPairsIn,\n transform: lodash_1.transform,\n values: lodash_1.values,\n valuesIn: lodash_1.valuesIn,\n camelCase: lodash_1.camelCase,\n capitalize: lodash_1.capitalize,\n deburr: lodash_1.deburr,\n endsWith: lodash_1.endsWith,\n escape: lodash_1.escape,\n escapeRegExp: lodash_1.escapeRegExp,\n kebabCase: lodash_1.kebabCase,\n lowerCase: lodash_1.lowerCase,\n lowerFirst: lodash_1.lowerFirst,\n pad: lodash_1.pad,\n padEnd: lodash_1.padEnd,\n padStart: lodash_1.padStart,\n parseInt: lodash_1.parseInt,\n repeat: lodash_1.repeat,\n replace: lodash_1.replace,\n snakeCase: lodash_1.snakeCase,\n split: lodash_1.split,\n startCase: lodash_1.startCase,\n startsWith: lodash_1.startsWith,\n toLower: lodash_1.toLower,\n toUpper: lodash_1.toUpper,\n trim: lodash_1.trim,\n trimEnd: lodash_1.trimEnd,\n trimStart: lodash_1.trimStart,\n truncate: lodash_1.truncate,\n unescape: lodash_1.unescape,\n upperCase: lodash_1.upperCase,\n upperFirst: lodash_1.upperFirst,\n words: lodash_1.words,\n cond: lodash_1.cond,\n conforms: lodash_1.conforms,\n constant: lodash_1.constant,\n defaultTo: lodash_1.defaultTo,\n flow: lodash_1.flow,\n flowRight: lodash_1.flowRight,\n identity: lodash_1.identity,\n iteratee: lodash_1.iteratee,\n matches: lodash_1.matches,\n matchesProperty: lodash_1.matchesProperty,\n method: lodash_1.method,\n methodOf: lodash_1.methodOf,\n nthArg: lodash_1.nthArg,\n over: lodash_1.over,\n overEvery: lodash_1.overEvery,\n overSome: lodash_1.overSome,\n property: lodash_1.property,\n propertyOf: lodash_1.propertyOf,\n range: lodash_1.range,\n rangeRight: lodash_1.rangeRight,\n stubArray: lodash_1.stubArray,\n stubFalse: lodash_1.stubFalse,\n stubObject: lodash_1.stubObject,\n stubString: lodash_1.stubString,\n stubTrue: lodash_1.stubTrue,\n times: lodash_1.times,\n toPath: lodash_1.toPath,\n uniqueId: lodash_1.uniqueId\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/modules/jsonlogic/operators.js?");
402
402
 
403
403
  /***/ }),
404
404
 
@@ -409,7 +409,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
409
409
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
410
410
 
411
411
  "use strict";
412
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.calculateProcessInfo = exports.calculateProcess = exports.calculateProcessSync = exports.shouldCalculate = void 0;\nconst jsonlogic_1 = __importDefault(__webpack_require__(/*! ../../modules/jsonlogic */ \"./node_modules/@formio/core/lib/modules/jsonlogic/index.js\"));\nconst set_1 = __importDefault(__webpack_require__(/*! lodash/set */ \"./node_modules/lodash/set.js\"));\nconst Evaluator = jsonlogic_1.default.evaluator;\nconst shouldCalculate = (context) => {\n const { component, config } = context;\n if (!component.calculateValue ||\n ((config === null || config === void 0 ? void 0 : config.server) && !component.calculateServer)) {\n return false;\n }\n return true;\n};\nexports.shouldCalculate = shouldCalculate;\nconst calculateProcessSync = (context) => {\n const { component, data, evalContext, scope, path, value } = context;\n if (!(0, exports.shouldCalculate)(context)) {\n return;\n }\n const evalContextValue = evalContext ? evalContext(context) : context;\n evalContextValue.value = value || null;\n if (!scope.calculated)\n scope.calculated = [];\n let newValue = Evaluator.evaluate(component.calculateValue, evalContextValue, 'value');\n // Only set a new value if it is not \"null\" which would be the case if no calculation occurred.\n if (newValue !== null) {\n scope.calculated.push({\n path,\n value: newValue\n });\n (0, set_1.default)(data, path, newValue);\n }\n return;\n};\nexports.calculateProcessSync = calculateProcessSync;\nconst calculateProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.calculateProcessSync)(context);\n});\nexports.calculateProcess = calculateProcess;\nexports.calculateProcessInfo = {\n name: 'calculate',\n process: exports.calculateProcess,\n processSync: exports.calculateProcessSync,\n shouldProcess: exports.shouldCalculate,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/calculation/index.js?");
412
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.calculateProcessInfo = exports.calculateProcess = exports.calculateProcessSync = exports.shouldCalculate = void 0;\nconst jsonlogic_1 = __importDefault(__webpack_require__(/*! ../../modules/jsonlogic */ \"./node_modules/@formio/core/lib/modules/jsonlogic/index.js\"));\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst Evaluator = jsonlogic_1.default.evaluator;\nconst shouldCalculate = (context) => {\n const { component, config } = context;\n if (!component.calculateValue ||\n ((config === null || config === void 0 ? void 0 : config.server) && !component.calculateServer)) {\n return false;\n }\n return true;\n};\nexports.shouldCalculate = shouldCalculate;\nconst calculateProcessSync = (context) => {\n const { component, data, evalContext, scope, path, value } = context;\n if (!(0, exports.shouldCalculate)(context)) {\n return;\n }\n const evalContextValue = evalContext ? evalContext(context) : context;\n evalContextValue.value = value || null;\n if (!scope.calculated)\n scope.calculated = [];\n let newValue = Evaluator.evaluate(component.calculateValue, evalContextValue, 'value');\n // Only set a new value if it is not \"null\" which would be the case if no calculation occurred.\n if (newValue !== null) {\n scope.calculated.push({\n path,\n value: newValue\n });\n (0, lodash_1.set)(data, path, newValue);\n }\n return;\n};\nexports.calculateProcessSync = calculateProcessSync;\nconst calculateProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.calculateProcessSync)(context);\n});\nexports.calculateProcess = calculateProcess;\nexports.calculateProcessInfo = {\n name: 'calculate',\n process: exports.calculateProcess,\n processSync: exports.calculateProcessSync,\n shouldProcess: exports.shouldCalculate,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/calculation/index.js?");
413
413
 
414
414
  /***/ }),
415
415
 
@@ -420,7 +420,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
420
420
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
421
421
 
422
422
  "use strict";
423
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.clearHiddenProcessInfo = exports.clearHiddenProcess = void 0;\nconst unset_1 = __importDefault(__webpack_require__(/*! lodash/unset */ \"./node_modules/lodash/unset.js\"));\n/**\n * This processor function checks components for the `hidden` property and unsets corresponding data\n */\nconst clearHiddenProcess = (context) => {\n var _a;\n const { component, data, path, value, scope } = context;\n if (!scope.clearHidden) {\n scope.clearHidden = {};\n }\n const conditionallyHidden = (_a = scope.conditionals) === null || _a === void 0 ? void 0 : _a.find((cond) => {\n return cond.path === path;\n });\n if ((conditionallyHidden === null || conditionallyHidden === void 0 ? void 0 : conditionallyHidden.conditionallyHidden) &&\n (value !== undefined) &&\n (!component.hasOwnProperty('clearOnHide') || component.clearOnHide)) {\n (0, unset_1.default)(data, path);\n scope.clearHidden[path] = true;\n }\n};\nexports.clearHiddenProcess = clearHiddenProcess;\nexports.clearHiddenProcessInfo = {\n name: 'clearHidden',\n shouldProcess: () => true,\n processSync: exports.clearHiddenProcess,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/clearHidden.js?");
423
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.clearHiddenProcessInfo = exports.clearHiddenProcess = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/**\n * This processor function checks components for the `hidden` property and unsets corresponding data\n */\nconst clearHiddenProcess = (context) => {\n var _a;\n const { component, data, path, value, scope } = context;\n if (!scope.clearHidden) {\n scope.clearHidden = {};\n }\n const conditionallyHidden = (_a = scope.conditionals) === null || _a === void 0 ? void 0 : _a.find((cond) => {\n return cond.path === path;\n });\n if ((conditionallyHidden === null || conditionallyHidden === void 0 ? void 0 : conditionallyHidden.conditionallyHidden) &&\n (value !== undefined) &&\n (!component.hasOwnProperty('clearOnHide') || component.clearOnHide)) {\n (0, lodash_1.unset)(data, path);\n scope.clearHidden[path] = true;\n }\n};\nexports.clearHiddenProcess = clearHiddenProcess;\nexports.clearHiddenProcessInfo = {\n name: 'clearHidden',\n shouldProcess: () => true,\n processSync: exports.clearHiddenProcess,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/clearHidden.js?");
424
424
 
425
425
  /***/ }),
426
426
 
@@ -431,7 +431,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
431
431
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
432
432
 
433
433
  "use strict";
434
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.conditionProcessInfo = exports.simpleConditionProcessInfo = exports.customConditionProcessInfo = exports.conditionProcessSync = exports.conditionProcess = exports.simpleConditionProcessSync = exports.simpleConditionProcess = exports.customConditionProcessSync = exports.customConditionProcess = exports.conditionalProcess = exports.isConditionallyHidden = exports.isSimpleConditionallyHidden = exports.isCustomConditionallyHidden = exports.hasConditions = void 0;\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst set_1 = __importDefault(__webpack_require__(/*! lodash/set */ \"./node_modules/lodash/set.js\"));\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst conditions_1 = __webpack_require__(/*! ../../utils/conditions */ \"./node_modules/@formio/core/lib/utils/conditions.js\");\nconst skipOnServer = (context) => {\n const { component, config } = context;\n const clearOnHide = component.hasOwnProperty('clearOnHide') ? component.clearOnHide : true;\n if ((config === null || config === void 0 ? void 0 : config.server) && !clearOnHide) {\n // No need to run conditionals on server unless clearOnHide is set.\n return true;\n }\n return false;\n};\nconst hasCustomConditions = (context) => {\n const { component } = context;\n return !!component.customConditional;\n};\nconst hasSimpleConditions = (context) => {\n const { component } = context;\n const { conditional } = component;\n if ((0, conditions_1.isLegacyConditional)(conditional) ||\n (0, conditions_1.isSimpleConditional)(conditional) ||\n (0, conditions_1.isJSONConditional)(conditional)) {\n return true;\n }\n return false;\n};\nconst hasConditions = (context) => {\n return hasSimpleConditions(context) || hasCustomConditions(context);\n};\nexports.hasConditions = hasConditions;\nconst isCustomConditionallyHidden = (context) => {\n if (!hasCustomConditions(context)) {\n return false;\n }\n const { component } = context;\n const { customConditional } = component;\n let show = null;\n if (customConditional) {\n show = (0, conditions_1.checkCustomConditional)(customConditional, context, 'show');\n }\n if (show === null) {\n return false;\n }\n return !show;\n};\nexports.isCustomConditionallyHidden = isCustomConditionallyHidden;\nconst isSimpleConditionallyHidden = (context) => {\n if (!hasSimpleConditions(context)) {\n return false;\n }\n const { component } = context;\n const { conditional } = component;\n let show = null;\n if ((0, conditions_1.isJSONConditional)(conditional)) {\n show = (0, conditions_1.checkJsonConditional)(conditional, context);\n }\n if ((0, conditions_1.isLegacyConditional)(conditional)) {\n show = (0, conditions_1.checkLegacyConditional)(conditional, context);\n }\n if ((0, conditions_1.isSimpleConditional)(conditional)) {\n show = (0, conditions_1.checkSimpleConditional)(conditional, context);\n }\n if (show === null || show === undefined) {\n return false;\n }\n return !show;\n};\nexports.isSimpleConditionallyHidden = isSimpleConditionallyHidden;\nconst isConditionallyHidden = (context) => {\n return (0, exports.isCustomConditionallyHidden)(context) || (0, exports.isSimpleConditionallyHidden)(context);\n};\nexports.isConditionallyHidden = isConditionallyHidden;\nconst conditionalProcess = (context, isHidden) => {\n const { component, data, row, scope, path } = context;\n if (!(0, exports.hasConditions)(context)) {\n return;\n }\n if (!scope.conditionals) {\n scope.conditionals = [];\n }\n let conditionalComp = scope.conditionals.find((cond) => (cond.path === path));\n if (!conditionalComp) {\n conditionalComp = { path, conditionallyHidden: false };\n scope.conditionals.push(conditionalComp);\n }\n if (skipOnServer(context)) {\n return false;\n }\n conditionalComp.conditionallyHidden = conditionalComp.conditionallyHidden || isHidden(context);\n if (conditionalComp.conditionallyHidden) {\n const info = (0, formUtil_1.componentInfo)(component);\n if (info.hasColumns || info.hasComps || info.hasRows) {\n // If this is a container component, we need to add all the child components as conditionally hidden as well.\n utils_1.Utils.eachComponentData([component], row, (comp, data, compRow, compPath) => {\n var _a;\n if (comp !== component) {\n (_a = scope.conditionals) === null || _a === void 0 ? void 0 : _a.push({ path: (0, formUtil_1.getComponentPath)(comp, compPath), conditionallyHidden: true });\n }\n (0, set_1.default)(comp, 'hidden', true);\n });\n }\n else {\n (0, set_1.default)(component, 'hidden', true);\n }\n }\n};\nexports.conditionalProcess = conditionalProcess;\nconst customConditionProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.customConditionProcessSync)(context);\n});\nexports.customConditionProcess = customConditionProcess;\nconst customConditionProcessSync = (context) => {\n return (0, exports.conditionalProcess)(context, exports.isCustomConditionallyHidden);\n};\nexports.customConditionProcessSync = customConditionProcessSync;\nconst simpleConditionProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.simpleConditionProcessSync)(context);\n});\nexports.simpleConditionProcess = simpleConditionProcess;\nconst simpleConditionProcessSync = (context) => {\n return (0, exports.conditionalProcess)(context, exports.isSimpleConditionallyHidden);\n};\nexports.simpleConditionProcessSync = simpleConditionProcessSync;\nconst conditionProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.conditionProcessSync)(context);\n});\nexports.conditionProcess = conditionProcess;\nconst conditionProcessSync = (context) => {\n return (0, exports.conditionalProcess)(context, exports.isConditionallyHidden);\n};\nexports.conditionProcessSync = conditionProcessSync;\nexports.customConditionProcessInfo = {\n name: 'customConditions',\n process: exports.customConditionProcess,\n processSync: exports.customConditionProcessSync,\n shouldProcess: hasCustomConditions,\n};\nexports.simpleConditionProcessInfo = {\n name: 'simpleConditions',\n process: exports.simpleConditionProcess,\n processSync: exports.simpleConditionProcessSync,\n shouldProcess: hasSimpleConditions,\n};\nexports.conditionProcessInfo = {\n name: 'conditions',\n process: exports.conditionProcess,\n processSync: exports.conditionProcessSync,\n shouldProcess: hasSimpleConditions,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/conditions/index.js?");
434
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.conditionProcessInfo = exports.simpleConditionProcessInfo = exports.customConditionProcessInfo = exports.conditionProcessSync = exports.conditionProcess = exports.simpleConditionProcessSync = exports.simpleConditionProcess = exports.customConditionProcessSync = exports.customConditionProcess = exports.conditionalProcess = exports.isConditionallyHidden = exports.isSimpleConditionallyHidden = exports.isCustomConditionallyHidden = exports.hasConditions = void 0;\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst conditions_1 = __webpack_require__(/*! ../../utils/conditions */ \"./node_modules/@formio/core/lib/utils/conditions.js\");\nconst skipOnServer = (context) => {\n const { component, config } = context;\n const clearOnHide = component.hasOwnProperty('clearOnHide') ? component.clearOnHide : true;\n if ((config === null || config === void 0 ? void 0 : config.server) && !clearOnHide) {\n // No need to run conditionals on server unless clearOnHide is set.\n return true;\n }\n return false;\n};\nconst hasCustomConditions = (context) => {\n const { component } = context;\n return !!component.customConditional;\n};\nconst hasSimpleConditions = (context) => {\n const { component } = context;\n const { conditional } = component;\n if ((0, conditions_1.isLegacyConditional)(conditional) ||\n (0, conditions_1.isSimpleConditional)(conditional) ||\n (0, conditions_1.isJSONConditional)(conditional)) {\n return true;\n }\n return false;\n};\nconst hasConditions = (context) => {\n return hasSimpleConditions(context) || hasCustomConditions(context);\n};\nexports.hasConditions = hasConditions;\nconst isCustomConditionallyHidden = (context) => {\n if (!hasCustomConditions(context)) {\n return false;\n }\n const { component } = context;\n const { customConditional } = component;\n let show = null;\n if (customConditional) {\n show = (0, conditions_1.checkCustomConditional)(customConditional, context, 'show');\n }\n if (show === null) {\n return false;\n }\n return !show;\n};\nexports.isCustomConditionallyHidden = isCustomConditionallyHidden;\nconst isSimpleConditionallyHidden = (context) => {\n if (!hasSimpleConditions(context)) {\n return false;\n }\n const { component } = context;\n const { conditional } = component;\n let show = null;\n if ((0, conditions_1.isJSONConditional)(conditional)) {\n show = (0, conditions_1.checkJsonConditional)(conditional, context);\n }\n if ((0, conditions_1.isLegacyConditional)(conditional)) {\n show = (0, conditions_1.checkLegacyConditional)(conditional, context);\n }\n if ((0, conditions_1.isSimpleConditional)(conditional)) {\n show = (0, conditions_1.checkSimpleConditional)(conditional, context);\n }\n if (show === null || show === undefined) {\n return false;\n }\n return !show;\n};\nexports.isSimpleConditionallyHidden = isSimpleConditionallyHidden;\nconst isConditionallyHidden = (context) => {\n return (0, exports.isCustomConditionallyHidden)(context) || (0, exports.isSimpleConditionallyHidden)(context);\n};\nexports.isConditionallyHidden = isConditionallyHidden;\nconst conditionalProcess = (context, isHidden) => {\n const { component, data, row, scope, path } = context;\n if (!(0, exports.hasConditions)(context)) {\n return;\n }\n if (!scope.conditionals) {\n scope.conditionals = [];\n }\n let conditionalComp = scope.conditionals.find((cond) => (cond.path === path));\n if (!conditionalComp) {\n conditionalComp = { path, conditionallyHidden: false };\n scope.conditionals.push(conditionalComp);\n }\n if (skipOnServer(context)) {\n return false;\n }\n conditionalComp.conditionallyHidden = conditionalComp.conditionallyHidden || isHidden(context);\n if (conditionalComp.conditionallyHidden) {\n const info = (0, formUtil_1.componentInfo)(component);\n if (info.hasColumns || info.hasComps || info.hasRows) {\n // If this is a container component, we need to add all the child components as conditionally hidden as well.\n utils_1.Utils.eachComponentData([component], row, (comp, data, compRow, compPath) => {\n var _a;\n if (comp !== component) {\n (_a = scope.conditionals) === null || _a === void 0 ? void 0 : _a.push({ path: (0, formUtil_1.getComponentPath)(comp, compPath), conditionallyHidden: true });\n }\n (0, lodash_1.set)(comp, 'hidden', true);\n });\n }\n else {\n (0, lodash_1.set)(component, 'hidden', true);\n }\n }\n};\nexports.conditionalProcess = conditionalProcess;\nconst customConditionProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.customConditionProcessSync)(context);\n});\nexports.customConditionProcess = customConditionProcess;\nconst customConditionProcessSync = (context) => {\n return (0, exports.conditionalProcess)(context, exports.isCustomConditionallyHidden);\n};\nexports.customConditionProcessSync = customConditionProcessSync;\nconst simpleConditionProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.simpleConditionProcessSync)(context);\n});\nexports.simpleConditionProcess = simpleConditionProcess;\nconst simpleConditionProcessSync = (context) => {\n return (0, exports.conditionalProcess)(context, exports.isSimpleConditionallyHidden);\n};\nexports.simpleConditionProcessSync = simpleConditionProcessSync;\nconst conditionProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.conditionProcessSync)(context);\n});\nexports.conditionProcess = conditionProcess;\nconst conditionProcessSync = (context) => {\n return (0, exports.conditionalProcess)(context, exports.isConditionallyHidden);\n};\nexports.conditionProcessSync = conditionProcessSync;\nexports.customConditionProcessInfo = {\n name: 'customConditions',\n process: exports.customConditionProcess,\n processSync: exports.customConditionProcessSync,\n shouldProcess: hasCustomConditions,\n};\nexports.simpleConditionProcessInfo = {\n name: 'simpleConditions',\n process: exports.simpleConditionProcess,\n processSync: exports.simpleConditionProcessSync,\n shouldProcess: hasSimpleConditions,\n};\nexports.conditionProcessInfo = {\n name: 'conditions',\n process: exports.conditionProcess,\n processSync: exports.conditionProcessSync,\n shouldProcess: hasSimpleConditions,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/conditions/index.js?");
435
435
 
436
436
  /***/ }),
437
437
 
@@ -442,7 +442,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
442
442
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
443
443
 
444
444
  "use strict";
445
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.defaultValueProcessInfo = exports.serverDefaultValueProcessInfo = exports.customDefaultValueProcessInfo = exports.defaultValueProcessSync = exports.defaultValueProcess = exports.serverDefaultValueProcessSync = exports.serverDefaultValueProcess = exports.customDefaultValueProcessSync = exports.customDefaultValueProcess = exports.hasDefaultValue = exports.hasServerDefaultValue = exports.hasCustomDefaultValue = void 0;\nconst jsonlogic_1 = __importDefault(__webpack_require__(/*! ../../modules/jsonlogic */ \"./node_modules/@formio/core/lib/modules/jsonlogic/index.js\"));\nconst has_1 = __importDefault(__webpack_require__(/*! lodash/has */ \"./node_modules/lodash/has.js\"));\nconst set_1 = __importDefault(__webpack_require__(/*! lodash/set */ \"./node_modules/lodash/set.js\"));\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst Evaluator = jsonlogic_1.default.evaluator;\nconst hasCustomDefaultValue = (context) => {\n const { component } = context;\n if (!component.customDefaultValue) {\n return false;\n }\n return true;\n};\nexports.hasCustomDefaultValue = hasCustomDefaultValue;\nconst hasServerDefaultValue = (context) => {\n const { component } = context;\n if (!component.hasOwnProperty('defaultValue')) {\n return false;\n }\n return true;\n};\nexports.hasServerDefaultValue = hasServerDefaultValue;\nconst hasDefaultValue = (context) => {\n return (0, exports.hasCustomDefaultValue)(context) || (0, exports.hasServerDefaultValue)(context);\n};\nexports.hasDefaultValue = hasDefaultValue;\nconst customDefaultValueProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.customDefaultValueProcessSync)(context);\n});\nexports.customDefaultValueProcess = customDefaultValueProcess;\nconst customDefaultValueProcessSync = (context) => {\n const { component, row, data, scope, evalContext, path } = context;\n if (!(0, exports.hasCustomDefaultValue)(context)) {\n return;\n }\n if (!scope.defaultValues)\n scope.defaultValues = [];\n if ((0, has_1.default)(row, (0, formUtil_1.getComponentKey)(component))) {\n return;\n }\n let defaultValue = null;\n if (component.customDefaultValue) {\n const evalContextValue = evalContext ? evalContext(context) : context;\n evalContextValue.value = null;\n defaultValue = Evaluator.evaluate(component.customDefaultValue, evalContextValue, 'value');\n if (component.multiple && !Array.isArray(defaultValue)) {\n defaultValue = defaultValue ? [defaultValue] : [];\n }\n scope.defaultValues.push({\n path,\n value: defaultValue\n });\n }\n if (defaultValue !== null && defaultValue !== undefined) {\n (0, set_1.default)(data, path, defaultValue);\n }\n};\nexports.customDefaultValueProcessSync = customDefaultValueProcessSync;\nconst serverDefaultValueProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.serverDefaultValueProcessSync)(context);\n});\nexports.serverDefaultValueProcess = serverDefaultValueProcess;\nconst serverDefaultValueProcessSync = (context) => {\n const { component, row, data, scope, path } = context;\n if (!(0, exports.hasServerDefaultValue)(context)) {\n return;\n }\n if (!scope.defaultValues)\n scope.defaultValues = [];\n if ((0, has_1.default)(row, (0, formUtil_1.getComponentKey)(component))) {\n return;\n }\n let defaultValue = null;\n if (component.defaultValue !== undefined &&\n component.defaultValue !== null) {\n defaultValue = component.defaultValue;\n if (component.multiple && !Array.isArray(defaultValue)) {\n defaultValue = defaultValue ? [defaultValue] : [];\n }\n scope.defaultValues.push({\n path,\n value: defaultValue\n });\n }\n if (defaultValue !== null && defaultValue !== undefined) {\n (0, set_1.default)(data, path, defaultValue);\n }\n};\nexports.serverDefaultValueProcessSync = serverDefaultValueProcessSync;\nconst defaultValueProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.defaultValueProcessSync)(context);\n});\nexports.defaultValueProcess = defaultValueProcess;\nconst defaultValueProcessSync = (context) => {\n (0, exports.customDefaultValueProcessSync)(context);\n (0, exports.serverDefaultValueProcessSync)(context);\n};\nexports.defaultValueProcessSync = defaultValueProcessSync;\nexports.customDefaultValueProcessInfo = {\n name: 'customDefaultValue',\n process: exports.customDefaultValueProcess,\n processSync: exports.customDefaultValueProcessSync,\n shouldProcess: exports.hasCustomDefaultValue,\n};\nexports.serverDefaultValueProcessInfo = {\n name: 'serverDefaultValue',\n process: exports.serverDefaultValueProcess,\n processSync: exports.serverDefaultValueProcessSync,\n shouldProcess: exports.hasServerDefaultValue,\n};\nexports.defaultValueProcessInfo = {\n name: 'defaultValue',\n process: exports.defaultValueProcess,\n processSync: exports.defaultValueProcessSync,\n shouldProcess: exports.hasDefaultValue,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/defaultValue/index.js?");
445
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.defaultValueProcessInfo = exports.serverDefaultValueProcessInfo = exports.customDefaultValueProcessInfo = exports.defaultValueProcessSync = exports.defaultValueProcess = exports.serverDefaultValueProcessSync = exports.serverDefaultValueProcess = exports.customDefaultValueProcessSync = exports.customDefaultValueProcess = exports.hasDefaultValue = exports.hasServerDefaultValue = exports.hasCustomDefaultValue = void 0;\nconst jsonlogic_1 = __importDefault(__webpack_require__(/*! ../../modules/jsonlogic */ \"./node_modules/@formio/core/lib/modules/jsonlogic/index.js\"));\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst Evaluator = jsonlogic_1.default.evaluator;\nconst hasCustomDefaultValue = (context) => {\n const { component } = context;\n if (!component.customDefaultValue) {\n return false;\n }\n return true;\n};\nexports.hasCustomDefaultValue = hasCustomDefaultValue;\nconst hasServerDefaultValue = (context) => {\n const { component } = context;\n if (!component.hasOwnProperty('defaultValue')) {\n return false;\n }\n return true;\n};\nexports.hasServerDefaultValue = hasServerDefaultValue;\nconst hasDefaultValue = (context) => {\n return (0, exports.hasCustomDefaultValue)(context) || (0, exports.hasServerDefaultValue)(context);\n};\nexports.hasDefaultValue = hasDefaultValue;\nconst customDefaultValueProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.customDefaultValueProcessSync)(context);\n});\nexports.customDefaultValueProcess = customDefaultValueProcess;\nconst customDefaultValueProcessSync = (context) => {\n const { component, row, data, scope, evalContext, path } = context;\n if (!(0, exports.hasCustomDefaultValue)(context)) {\n return;\n }\n if (!scope.defaultValues)\n scope.defaultValues = [];\n if ((0, lodash_1.has)(row, (0, formUtil_1.getComponentKey)(component))) {\n return;\n }\n let defaultValue = null;\n if (component.customDefaultValue) {\n const evalContextValue = evalContext ? evalContext(context) : context;\n evalContextValue.value = null;\n defaultValue = Evaluator.evaluate(component.customDefaultValue, evalContextValue, 'value');\n if (component.multiple && !Array.isArray(defaultValue)) {\n defaultValue = defaultValue ? [defaultValue] : [];\n }\n scope.defaultValues.push({\n path,\n value: defaultValue\n });\n }\n if (defaultValue !== null && defaultValue !== undefined) {\n (0, lodash_1.set)(data, path, defaultValue);\n }\n};\nexports.customDefaultValueProcessSync = customDefaultValueProcessSync;\nconst serverDefaultValueProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.serverDefaultValueProcessSync)(context);\n});\nexports.serverDefaultValueProcess = serverDefaultValueProcess;\nconst serverDefaultValueProcessSync = (context) => {\n const { component, row, data, scope, path } = context;\n if (!(0, exports.hasServerDefaultValue)(context)) {\n return;\n }\n if (!scope.defaultValues)\n scope.defaultValues = [];\n if ((0, lodash_1.has)(row, (0, formUtil_1.getComponentKey)(component))) {\n return;\n }\n let defaultValue = null;\n if (component.defaultValue !== undefined &&\n component.defaultValue !== null) {\n defaultValue = component.defaultValue;\n if (component.multiple && !Array.isArray(defaultValue)) {\n defaultValue = defaultValue ? [defaultValue] : [];\n }\n scope.defaultValues.push({\n path,\n value: defaultValue\n });\n }\n if (defaultValue !== null && defaultValue !== undefined) {\n (0, lodash_1.set)(data, path, defaultValue);\n }\n};\nexports.serverDefaultValueProcessSync = serverDefaultValueProcessSync;\nconst defaultValueProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.defaultValueProcessSync)(context);\n});\nexports.defaultValueProcess = defaultValueProcess;\nconst defaultValueProcessSync = (context) => {\n (0, exports.customDefaultValueProcessSync)(context);\n (0, exports.serverDefaultValueProcessSync)(context);\n};\nexports.defaultValueProcessSync = defaultValueProcessSync;\nexports.customDefaultValueProcessInfo = {\n name: 'customDefaultValue',\n process: exports.customDefaultValueProcess,\n processSync: exports.customDefaultValueProcessSync,\n shouldProcess: exports.hasCustomDefaultValue,\n};\nexports.serverDefaultValueProcessInfo = {\n name: 'serverDefaultValue',\n process: exports.serverDefaultValueProcess,\n processSync: exports.serverDefaultValueProcessSync,\n shouldProcess: exports.hasServerDefaultValue,\n};\nexports.defaultValueProcessInfo = {\n name: 'defaultValue',\n process: exports.defaultValueProcess,\n processSync: exports.defaultValueProcessSync,\n shouldProcess: exports.hasDefaultValue,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/defaultValue/index.js?");
446
446
 
447
447
  /***/ }),
448
448
 
@@ -464,7 +464,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
464
464
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
465
465
 
466
466
  "use strict";
467
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.fetchProcessInfo = exports.fetchProcess = exports.shouldFetch = void 0;\nconst get_1 = __importDefault(__webpack_require__(/*! lodash/get */ \"./node_modules/lodash/get.js\"));\nconst set_1 = __importDefault(__webpack_require__(/*! lodash/set */ \"./node_modules/lodash/set.js\"));\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst shouldFetch = (context) => {\n const { component, config } = context;\n if (component.type !== 'datasource' ||\n ((config === null || config === void 0 ? void 0 : config.server) && !(0, get_1.default)(component, 'trigger.server', false))) {\n return false;\n }\n return true;\n};\nexports.shouldFetch = shouldFetch;\nconst fetchProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n var _a;\n const { component, row, evalContext, path, scope, config } = context;\n let _fetch = null;\n try {\n _fetch = context.fetch ? context.fetch : fetch;\n }\n catch (err) {\n _fetch = null;\n }\n if (!_fetch) {\n console.log('You must provide a fetch interface to the fetch processor.');\n return;\n }\n if (!(0, exports.shouldFetch)(context)) {\n return;\n }\n if (!scope.fetched)\n scope.fetched = {};\n const evalContextValue = evalContext ? evalContext(context) : context;\n const url = utils_1.Evaluator.interpolateString((0, get_1.default)(component, 'fetch.url', ''), evalContextValue);\n if (!url) {\n return;\n }\n const request = {\n method: (0, get_1.default)(component, 'fetch.method', 'get').toUpperCase(),\n headers: {}\n };\n if ((config === null || config === void 0 ? void 0 : config.headers) &&\n (component === null || component === void 0 ? void 0 : component.fetch) &&\n ((_a = component === null || component === void 0 ? void 0 : component.fetch) === null || _a === void 0 ? void 0 : _a.forwardHeaders)) {\n request.headers = JSON.parse(JSON.stringify(config.headers));\n delete request.headers['host'];\n delete request.headers['content-length'];\n delete request.headers['content-type'];\n delete request.headers['connection'];\n delete request.headers['cache-control'];\n }\n request.headers['Accept'] = '*/*';\n request.headers['user-agent'] = 'Form.io DataSource Component';\n (0, get_1.default)(component, 'fetch.headers', []).map((header) => {\n header.value = utils_1.Evaluator.interpolateString(header.value, evalContextValue);\n if (header.value && header.key) {\n request.headers[header.key] = header.value;\n }\n return header;\n });\n if ((0, get_1.default)(component, 'fetch.authenticate', false) && (config === null || config === void 0 ? void 0 : config.tokens)) {\n Object.assign(request.headers, config.tokens);\n }\n const body = (0, get_1.default)(component, 'fetch.specifyBody', '');\n if (request.method === 'POST') {\n request.body = JSON.stringify(utils_1.Evaluator.evaluate(body, evalContextValue, 'body'));\n }\n try {\n // Perform the fetch.\n const result = yield (yield _fetch(url, request)).json();\n const mapFunction = (0, get_1.default)(component, 'fetch.mapFunction');\n // Set the row data of the fetched value.\n const key = (0, formUtil_1.getComponentKey)(component);\n (0, set_1.default)(row, key, mapFunction ? utils_1.Evaluator.evaluate(mapFunction, Object.assign(Object.assign({}, evalContextValue), { responseData: result }), 'value') : result);\n // Make sure the value does not get filtered for now...\n if (!scope.filter)\n scope.filter = {};\n scope.filter[path] = true;\n scope.fetched[path] = true;\n }\n catch (err) {\n console.log(err.message);\n }\n});\nexports.fetchProcess = fetchProcess;\nexports.fetchProcessInfo = {\n name: 'fetch',\n process: exports.fetchProcess,\n shouldProcess: exports.shouldFetch,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/fetch/index.js?");
467
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.fetchProcessInfo = exports.fetchProcess = exports.shouldFetch = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst shouldFetch = (context) => {\n const { component, config } = context;\n if (component.type !== 'datasource' ||\n ((config === null || config === void 0 ? void 0 : config.server) && !(0, lodash_1.get)(component, 'trigger.server', false))) {\n return false;\n }\n return true;\n};\nexports.shouldFetch = shouldFetch;\nconst fetchProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n var _a;\n const { component, row, evalContext, path, scope, config } = context;\n let _fetch = null;\n try {\n _fetch = context.fetch ? context.fetch : fetch;\n }\n catch (err) {\n _fetch = null;\n }\n if (!_fetch) {\n console.log('You must provide a fetch interface to the fetch processor.');\n return;\n }\n if (!(0, exports.shouldFetch)(context)) {\n return;\n }\n if (!scope.fetched)\n scope.fetched = {};\n const evalContextValue = evalContext ? evalContext(context) : context;\n const url = utils_1.Evaluator.interpolateString((0, lodash_1.get)(component, 'fetch.url', ''), evalContextValue);\n if (!url) {\n return;\n }\n const request = {\n method: (0, lodash_1.get)(component, 'fetch.method', 'get').toUpperCase(),\n headers: {}\n };\n if ((config === null || config === void 0 ? void 0 : config.headers) &&\n (component === null || component === void 0 ? void 0 : component.fetch) &&\n ((_a = component === null || component === void 0 ? void 0 : component.fetch) === null || _a === void 0 ? void 0 : _a.forwardHeaders)) {\n request.headers = JSON.parse(JSON.stringify(config.headers));\n delete request.headers['host'];\n delete request.headers['content-length'];\n delete request.headers['content-type'];\n delete request.headers['connection'];\n delete request.headers['cache-control'];\n }\n request.headers['Accept'] = '*/*';\n request.headers['user-agent'] = 'Form.io DataSource Component';\n (0, lodash_1.get)(component, 'fetch.headers', []).map((header) => {\n header.value = utils_1.Evaluator.interpolateString(header.value, evalContextValue);\n if (header.value && header.key) {\n request.headers[header.key] = header.value;\n }\n return header;\n });\n if ((0, lodash_1.get)(component, 'fetch.authenticate', false) && (config === null || config === void 0 ? void 0 : config.tokens)) {\n Object.assign(request.headers, config.tokens);\n }\n const body = (0, lodash_1.get)(component, 'fetch.specifyBody', '');\n if (request.method === 'POST') {\n request.body = JSON.stringify(utils_1.Evaluator.evaluate(body, evalContextValue, 'body'));\n }\n try {\n // Perform the fetch.\n const result = yield (yield _fetch(url, request)).json();\n const mapFunction = (0, lodash_1.get)(component, 'fetch.mapFunction');\n // Set the row data of the fetched value.\n const key = (0, formUtil_1.getComponentKey)(component);\n (0, lodash_1.set)(row, key, mapFunction ? utils_1.Evaluator.evaluate(mapFunction, Object.assign(Object.assign({}, evalContextValue), { responseData: result }), 'value') : result);\n // Make sure the value does not get filtered for now...\n if (!scope.filter)\n scope.filter = {};\n scope.filter[path] = true;\n scope.fetched[path] = true;\n }\n catch (err) {\n console.log(err.message);\n }\n});\nexports.fetchProcess = fetchProcess;\nexports.fetchProcessInfo = {\n name: 'fetch',\n process: exports.fetchProcess,\n shouldProcess: exports.shouldFetch,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/fetch/index.js?");
468
468
 
469
469
  /***/ }),
470
470
 
@@ -475,7 +475,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
475
475
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
476
476
 
477
477
  "use strict";
478
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.filterProcessInfo = exports.filterPostProcess = exports.filterProcess = exports.filterProcessSync = void 0;\nconst set_1 = __importDefault(__webpack_require__(/*! lodash/set */ \"./node_modules/lodash/set.js\"));\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst filterProcessSync = (context) => {\n const { scope, component } = context;\n let { value } = context;\n const absolutePath = (0, formUtil_1.getComponentAbsolutePath)(component);\n if (!scope.filter)\n scope.filter = {};\n if (value !== undefined) {\n const modelType = utils_1.Utils.getModelType(component);\n switch (modelType) {\n case 'dataObject':\n scope.filter[absolutePath] = {\n compModelType: modelType,\n include: true,\n value: { data: {} }\n };\n break;\n case 'array':\n scope.filter[absolutePath] = {\n compModelType: modelType,\n include: true,\n };\n break;\n case 'object':\n if (component.type !== 'container') {\n scope.filter[absolutePath] = {\n compModelType: modelType,\n include: true,\n };\n }\n break;\n default:\n scope.filter[absolutePath] = {\n compModelType: modelType,\n include: true,\n };\n break;\n }\n }\n};\nexports.filterProcessSync = filterProcessSync;\nconst filterProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.filterProcessSync)(context);\n});\nexports.filterProcess = filterProcess;\nconst filterPostProcess = (context) => {\n const { scope, submission } = context;\n const filtered = {};\n for (const path in scope.filter) {\n if (scope.filter[path].include) {\n let value = (0, lodash_1.get)(submission === null || submission === void 0 ? void 0 : submission.data, path);\n if ((0, lodash_1.isObject)(value) && (0, lodash_1.isObject)(scope.filter[path].value)) {\n if (scope.filter[path].compModelType === 'dataObject') {\n value = Object.assign(Object.assign(Object.assign({}, value), scope.filter[path].value), { data: value === null || value === void 0 ? void 0 : value.data });\n }\n else {\n value = Object.assign(Object.assign({}, value), scope.filter[path].value);\n }\n }\n (0, set_1.default)(filtered, path, value);\n }\n }\n context.data = filtered;\n};\nexports.filterPostProcess = filterPostProcess;\nexports.filterProcessInfo = {\n name: 'filter',\n process: exports.filterProcess,\n processSync: exports.filterProcessSync,\n postProcess: exports.filterPostProcess,\n shouldProcess: (context) => true,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/filter/index.js?");
478
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.filterProcessInfo = exports.filterPostProcess = exports.filterProcess = exports.filterProcessSync = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst lodash_2 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst filterProcessSync = (context) => {\n const { scope, component } = context;\n let { value } = context;\n const absolutePath = (0, formUtil_1.getComponentAbsolutePath)(component);\n if (!scope.filter)\n scope.filter = {};\n if (value !== undefined) {\n const modelType = utils_1.Utils.getModelType(component);\n switch (modelType) {\n case 'dataObject':\n scope.filter[absolutePath] = {\n compModelType: modelType,\n include: true,\n value: { data: {} }\n };\n break;\n case 'array':\n scope.filter[absolutePath] = {\n compModelType: modelType,\n include: true,\n };\n break;\n case 'object':\n if (component.type !== 'container') {\n scope.filter[absolutePath] = {\n compModelType: modelType,\n include: true,\n };\n }\n break;\n default:\n scope.filter[absolutePath] = {\n compModelType: modelType,\n include: true,\n };\n break;\n }\n }\n};\nexports.filterProcessSync = filterProcessSync;\nconst filterProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.filterProcessSync)(context);\n});\nexports.filterProcess = filterProcess;\nconst filterPostProcess = (context) => {\n const { scope, submission } = context;\n const filtered = {};\n for (const path in scope.filter) {\n if (scope.filter[path].include) {\n let value = (0, lodash_2.get)(submission === null || submission === void 0 ? void 0 : submission.data, path);\n if ((0, lodash_2.isObject)(value) && (0, lodash_2.isObject)(scope.filter[path].value)) {\n if (scope.filter[path].compModelType === 'dataObject') {\n value = Object.assign(Object.assign(Object.assign({}, value), scope.filter[path].value), { data: value === null || value === void 0 ? void 0 : value.data });\n }\n else {\n value = Object.assign(Object.assign({}, value), scope.filter[path].value);\n }\n }\n (0, lodash_1.set)(filtered, path, value);\n }\n }\n context.data = filtered;\n};\nexports.filterPostProcess = filterPostProcess;\nexports.filterProcessInfo = {\n name: 'filter',\n process: exports.filterProcess,\n processSync: exports.filterProcessSync,\n postProcess: exports.filterPostProcess,\n shouldProcess: (context) => true,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/filter/index.js?");
479
479
 
480
480
  /***/ }),
481
481
 
@@ -508,7 +508,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
508
508
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
509
509
 
510
510
  "use strict";
511
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.normalizeProcessInfo = exports.normalizeProcessSync = exports.normalizeProcess = void 0;\nconst get_1 = __importDefault(__webpack_require__(/*! lodash/get */ \"./node_modules/lodash/get.js\"));\nconst set_1 = __importDefault(__webpack_require__(/*! lodash/set */ \"./node_modules/lodash/set.js\"));\nconst isString_1 = __importDefault(__webpack_require__(/*! lodash/isString */ \"./node_modules/lodash/isString.js\"));\nconst toString_1 = __importDefault(__webpack_require__(/*! lodash/toString */ \"./node_modules/lodash/toString.js\"));\nconst isNil_1 = __importDefault(__webpack_require__(/*! lodash/isNil */ \"./node_modules/lodash/isNil.js\"));\nconst isObject_1 = __importDefault(__webpack_require__(/*! lodash/isObject */ \"./node_modules/lodash/isObject.js\"));\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst customParseFormat_1 = __importDefault(__webpack_require__(/*! dayjs/plugin/customParseFormat */ \"./node_modules/dayjs/plugin/customParseFormat.js\"));\ndayjs_1.default.extend(customParseFormat_1.default);\nconst isAddressComponent = (component) => component.type === \"address\";\nconst isDayComponent = (component) => component.type === \"day\";\nconst isEmailComponent = (component) => component.type === \"email\";\nconst isRadioComponent = (component) => component.type === \"radio\";\nconst isRecaptchaComponent = (component) => component.type === \"recaptcha\";\nconst isSelectComponent = (component) => component.type === \"select\";\nconst isSelectBoxesComponent = (component) => component.type === \"selectboxes\";\nconst isTagsComponent = (component) => component.type === \"tags\";\nconst isTextFieldComponent = (component) => component.type === \"textfield\";\nconst isTimeComponent = (component) => component.type === \"time\";\nconst normalizeAddressComponentValue = (component, value) => {\n if (!component.multiple && Boolean(component.enableManualMode) && value && !value.mode) {\n return {\n mode: 'autocomplete',\n address: value,\n };\n }\n return value;\n};\nconst getLocaleDateFormatInfo = (locale = 'en') => {\n const formatInfo = {};\n const day = 21;\n const exampleDate = new Date(2017, 11, day);\n const localDateString = exampleDate.toLocaleDateString(locale);\n formatInfo.dayFirst = localDateString.slice(0, 2) === day.toString();\n return formatInfo;\n};\nconst getLocaleDayFirst = (component, form) => {\n var _a;\n if (component.useLocaleSettings) {\n return getLocaleDateFormatInfo((_a = form.options) === null || _a === void 0 ? void 0 : _a.language).dayFirst;\n }\n return component.dayFirst;\n};\nconst normalizeDayComponentValue = (component, form, value) => {\n // TODO: this is a quick and dirty port of the Day component's normalizeValue method, may need some updates\n const valueMask = /^\\d{2}\\/\\d{2}\\/\\d{4}$/;\n const isDayFirst = getLocaleDayFirst(component, form);\n const showDay = !(0, get_1.default)(component, 'fields.day.hide', false);\n const showMonth = !(0, get_1.default)(component, 'fields.month.hide', false);\n const showYear = !(0, get_1.default)(component, 'fields.year.hide', false);\n if (!value || valueMask.test(value)) {\n return value;\n }\n let dateParts = [];\n const valueParts = value.split('/');\n const [DAY, MONTH, YEAR] = component.dayFirst ? [0, 1, 2] : [1, 0, 2];\n const defaultValue = component.defaultValue ? component.defaultValue.split('/') : '';\n const getNextPart = (shouldTake, defaultValue) => dateParts.push(shouldTake ? valueParts.shift() : defaultValue);\n if (isDayFirst) {\n getNextPart(showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(showMonth, defaultValue ? defaultValue[MONTH] : '00');\n if (!isDayFirst) {\n getNextPart(showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(showYear, defaultValue ? defaultValue[YEAR] : '0000');\n return dateParts.join('/');\n};\nconst normalizeRadioComponentValue = (value) => {\n const isEquivalent = (0, toString_1.default)(value) === Number(value).toString();\n if (!isNaN(parseFloat(value)) && isFinite(value) && isEquivalent) {\n return +value;\n }\n if (value === 'true') {\n return true;\n }\n if (value === 'false') {\n return false;\n }\n return value;\n};\nconst normalizeSingleSelectComponentValue = (component, value) => {\n if ((0, isNil_1.default)(value)) {\n return;\n }\n const valueIsObject = (0, isObject_1.default)(value);\n //check if value equals to default emptyValue\n if (valueIsObject && Object.keys(value).length === 0) {\n return value;\n }\n const dataType = component.dataType || 'auto';\n const normalize = {\n value,\n number() {\n const numberValue = Number(this.value);\n const isEquivalent = value.toString() === numberValue.toString();\n if (!Number.isNaN(numberValue) && Number.isFinite(numberValue) && value !== '' && isEquivalent) {\n this.value = numberValue;\n }\n return this;\n },\n boolean() {\n if ((0, isString_1.default)(this.value) && (this.value.toLowerCase() === 'true' || this.value.toLowerCase() === 'false')) {\n this.value = (this.value.toLowerCase() === 'true');\n }\n return this;\n },\n string() {\n this.value = String(this.value);\n return this;\n },\n object() {\n return this;\n },\n auto() {\n if ((0, isObject_1.default)(this.value)) {\n this.value = this.object().value;\n }\n else {\n this.value = this.string().number().boolean().value;\n }\n return this;\n }\n };\n try {\n return normalize[dataType]().value;\n }\n catch (err) {\n console.warn('Failed to normalize value', err);\n return value;\n }\n};\nconst normalizeSelectComponentValue = (component, value) => {\n if (component.multiple && Array.isArray(value)) {\n return value.map((singleValue) => normalizeSingleSelectComponentValue(component, singleValue));\n }\n return normalizeSingleSelectComponentValue(component, value);\n};\nconst normalizeSelectBoxesComponentValue = (value) => {\n if (!value) {\n value = {};\n }\n if (typeof value !== 'object') {\n if (typeof value === 'string') {\n return {\n [value]: true\n };\n }\n else {\n return {};\n }\n }\n if (Array.isArray(value)) {\n return value.reduce((acc, curr) => {\n return Object.assign(Object.assign({}, acc), { [curr]: true });\n }, {});\n }\n return value;\n};\nconst normalizeTagsComponentValue = (component, value) => {\n const delimiter = component.delimeter || ',';\n if ((!component.hasOwnProperty('storeas') || component.storeas === 'string') && Array.isArray(value)) {\n return value.join(delimiter);\n }\n else if (component.storeas === 'array' && typeof value === 'string') {\n return value.split(delimiter).filter(result => result);\n }\n return value;\n};\nconst normalizeMaskValue = (component, defaultValues, value, path) => {\n if (component.inputMasks && component.inputMasks.length > 0) {\n if (!value || typeof value !== 'object') {\n return {\n value: value,\n maskName: component.inputMasks[0].label\n };\n }\n if (!value.value) {\n const defaultValue = defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.find((defaultValue) => defaultValue.path === path);\n value.value = Array.isArray(defaultValue) && defaultValue.length > 0 ? defaultValue[0] : defaultValue;\n }\n }\n return value;\n};\nconst normalizeTextFieldComponentValue = (component, defaultValues, value, path) => {\n // If the component has truncate multiple spaces enabled, then normalize the value to remove extra spaces.\n if (component.truncateMultipleSpaces && typeof value === 'string') {\n value = value.trim().replace(/\\s{2,}/g, ' ');\n }\n if (component.allowMultipleMasks && component.inputMasks && component.inputMasks.length > 0) {\n if (Array.isArray(value)) {\n return value.map((val) => normalizeMaskValue(component, defaultValues, val, path));\n }\n else {\n return normalizeMaskValue(component, defaultValues, value, path);\n }\n }\n return value;\n};\n// Allow submissions of time components in their visual \"format\" property by coercing them to the \"dataFormat\" property\n// i.e. \"HH:mm\" -> \"HH:mm:ss\"\nconst normalizeTimeComponentValue = (component, value) => {\n const defaultDataFormat = 'HH:mm:ss';\n const defaultFormat = 'HH:mm';\n if ((0, dayjs_1.default)(value, component.format || defaultFormat, true).isValid()) {\n return (0, dayjs_1.default)(value, component.format || defaultFormat, true).format(component.dataFormat || defaultDataFormat);\n }\n return value;\n};\nconst normalizeProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.normalizeProcessSync)(context);\n});\nexports.normalizeProcess = normalizeProcess;\nconst normalizeProcessSync = (context) => {\n const { component, form, scope, path, data, value } = context;\n if (!scope.normalize) {\n scope.normalize = {};\n }\n let { defaultValues } = scope;\n scope.normalize[path] = {\n type: component.type,\n normalized: false\n };\n // First check for component-type-specific transformations\n if (isAddressComponent(component)) {\n (0, set_1.default)(data, path, normalizeAddressComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n else if (isDayComponent(component)) {\n (0, set_1.default)(data, path, normalizeDayComponentValue(component, form, value));\n scope.normalize[path].normalized = true;\n }\n else if (isEmailComponent(component)) {\n if (value && typeof value === 'string') {\n (0, set_1.default)(data, path, value.toLowerCase());\n scope.normalize[path].normalized = true;\n }\n }\n else if (isRadioComponent(component)) {\n (0, set_1.default)(data, path, normalizeRadioComponentValue(value));\n scope.normalize[path].normalized = true;\n }\n else if (isSelectComponent(component)) {\n (0, set_1.default)(data, path, normalizeSelectComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n else if (isSelectBoxesComponent(component)) {\n (0, set_1.default)(data, path, normalizeSelectBoxesComponentValue(value));\n scope.normalize[path].normalized = true;\n }\n else if (isTagsComponent(component)) {\n (0, set_1.default)(data, path, normalizeTagsComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n else if (isTextFieldComponent(component)) {\n (0, set_1.default)(data, path, normalizeTextFieldComponentValue(component, defaultValues, value, path));\n scope.normalize[path].normalized = true;\n }\n else if (isTimeComponent(component)) {\n (0, set_1.default)(data, path, normalizeTimeComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n // Next perform component-type-agnostic transformations (i.e. super())\n if (component.multiple && !Array.isArray(value)) {\n (0, set_1.default)(data, path, value ? [value] : []);\n scope.normalize[path].normalized = true;\n }\n};\nexports.normalizeProcessSync = normalizeProcessSync;\nexports.normalizeProcessInfo = {\n name: 'normalize',\n shouldProcess: () => true,\n process: exports.normalizeProcess,\n processSync: exports.normalizeProcessSync\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/normalize/index.js?");
511
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.normalizeProcessInfo = exports.normalizeProcessSync = exports.normalizeProcess = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst customParseFormat_1 = __importDefault(__webpack_require__(/*! dayjs/plugin/customParseFormat */ \"./node_modules/dayjs/plugin/customParseFormat.js\"));\ndayjs_1.default.extend(customParseFormat_1.default);\nconst isAddressComponent = (component) => component.type === \"address\";\nconst isDayComponent = (component) => component.type === \"day\";\nconst isEmailComponent = (component) => component.type === \"email\";\nconst isRadioComponent = (component) => component.type === \"radio\";\nconst isRecaptchaComponent = (component) => component.type === \"recaptcha\";\nconst isSelectComponent = (component) => component.type === \"select\";\nconst isSelectBoxesComponent = (component) => component.type === \"selectboxes\";\nconst isTagsComponent = (component) => component.type === \"tags\";\nconst isTextFieldComponent = (component) => component.type === \"textfield\";\nconst isTimeComponent = (component) => component.type === \"time\";\nconst normalizeAddressComponentValue = (component, value) => {\n if (!component.multiple && Boolean(component.enableManualMode) && value && !value.mode) {\n return {\n mode: 'autocomplete',\n address: value,\n };\n }\n return value;\n};\nconst getLocaleDateFormatInfo = (locale = 'en') => {\n const formatInfo = {};\n const day = 21;\n const exampleDate = new Date(2017, 11, day);\n const localDateString = exampleDate.toLocaleDateString(locale);\n formatInfo.dayFirst = localDateString.slice(0, 2) === day.toString();\n return formatInfo;\n};\nconst getLocaleDayFirst = (component, form) => {\n var _a;\n if (component.useLocaleSettings) {\n return getLocaleDateFormatInfo((_a = form.options) === null || _a === void 0 ? void 0 : _a.language).dayFirst;\n }\n return component.dayFirst;\n};\nconst normalizeDayComponentValue = (component, form, value) => {\n // TODO: this is a quick and dirty port of the Day component's normalizeValue method, may need some updates\n const valueMask = /^\\d{2}\\/\\d{2}\\/\\d{4}$/;\n const isDayFirst = getLocaleDayFirst(component, form);\n const showDay = !(0, lodash_1.get)(component, 'fields.day.hide', false);\n const showMonth = !(0, lodash_1.get)(component, 'fields.month.hide', false);\n const showYear = !(0, lodash_1.get)(component, 'fields.year.hide', false);\n if (!value || valueMask.test(value)) {\n return value;\n }\n let dateParts = [];\n const valueParts = value.split('/');\n const [DAY, MONTH, YEAR] = component.dayFirst ? [0, 1, 2] : [1, 0, 2];\n const defaultValue = component.defaultValue ? component.defaultValue.split('/') : '';\n const getNextPart = (shouldTake, defaultValue) => dateParts.push(shouldTake ? valueParts.shift() : defaultValue);\n if (isDayFirst) {\n getNextPart(showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(showMonth, defaultValue ? defaultValue[MONTH] : '00');\n if (!isDayFirst) {\n getNextPart(showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(showYear, defaultValue ? defaultValue[YEAR] : '0000');\n return dateParts.join('/');\n};\nconst normalizeRadioComponentValue = (value) => {\n const isEquivalent = (0, lodash_1.toString)(value) === Number(value).toString();\n if (!isNaN(parseFloat(value)) && isFinite(value) && isEquivalent) {\n return +value;\n }\n if (value === 'true') {\n return true;\n }\n if (value === 'false') {\n return false;\n }\n return value;\n};\nconst normalizeSingleSelectComponentValue = (component, value) => {\n if ((0, lodash_1.isNil)(value)) {\n return;\n }\n const valueIsObject = (0, lodash_1.isObject)(value);\n //check if value equals to default emptyValue\n if (valueIsObject && Object.keys(value).length === 0) {\n return value;\n }\n const dataType = component.dataType || 'auto';\n const normalize = {\n value,\n number() {\n const numberValue = Number(this.value);\n const isEquivalent = value.toString() === numberValue.toString();\n if (!Number.isNaN(numberValue) && Number.isFinite(numberValue) && value !== '' && isEquivalent) {\n this.value = numberValue;\n }\n return this;\n },\n boolean() {\n if ((0, lodash_1.isString)(this.value) && (this.value.toLowerCase() === 'true' || this.value.toLowerCase() === 'false')) {\n this.value = (this.value.toLowerCase() === 'true');\n }\n return this;\n },\n string() {\n this.value = String(this.value);\n return this;\n },\n object() {\n return this;\n },\n auto() {\n if ((0, lodash_1.isObject)(this.value)) {\n this.value = this.object().value;\n }\n else {\n this.value = this.string().number().boolean().value;\n }\n return this;\n }\n };\n try {\n return normalize[dataType]().value;\n }\n catch (err) {\n console.warn('Failed to normalize value', err);\n return value;\n }\n};\nconst normalizeSelectComponentValue = (component, value) => {\n if (component.multiple && Array.isArray(value)) {\n return value.map((singleValue) => normalizeSingleSelectComponentValue(component, singleValue));\n }\n return normalizeSingleSelectComponentValue(component, value);\n};\nconst normalizeSelectBoxesComponentValue = (value) => {\n if (!value) {\n value = {};\n }\n if (typeof value !== 'object') {\n if (typeof value === 'string') {\n return {\n [value]: true\n };\n }\n else {\n return {};\n }\n }\n if (Array.isArray(value)) {\n return value.reduce((acc, curr) => {\n return Object.assign(Object.assign({}, acc), { [curr]: true });\n }, {});\n }\n return value;\n};\nconst normalizeTagsComponentValue = (component, value) => {\n const delimiter = component.delimeter || ',';\n if ((!component.hasOwnProperty('storeas') || component.storeas === 'string') && Array.isArray(value)) {\n return value.join(delimiter);\n }\n else if (component.storeas === 'array' && typeof value === 'string') {\n return value.split(delimiter).filter(result => result);\n }\n return value;\n};\nconst normalizeMaskValue = (component, defaultValues, value, path) => {\n if (component.inputMasks && component.inputMasks.length > 0) {\n if (!value || typeof value !== 'object') {\n return {\n value: value,\n maskName: component.inputMasks[0].label\n };\n }\n if (!value.value) {\n const defaultValue = defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.find((defaultValue) => defaultValue.path === path);\n value.value = Array.isArray(defaultValue) && defaultValue.length > 0 ? defaultValue[0] : defaultValue;\n }\n }\n return value;\n};\nconst normalizeTextFieldComponentValue = (component, defaultValues, value, path) => {\n // If the component has truncate multiple spaces enabled, then normalize the value to remove extra spaces.\n if (component.truncateMultipleSpaces && typeof value === 'string') {\n value = value.trim().replace(/\\s{2,}/g, ' ');\n }\n if (component.allowMultipleMasks && component.inputMasks && component.inputMasks.length > 0) {\n if (Array.isArray(value)) {\n return value.map((val) => normalizeMaskValue(component, defaultValues, val, path));\n }\n else {\n return normalizeMaskValue(component, defaultValues, value, path);\n }\n }\n return value;\n};\n// Allow submissions of time components in their visual \"format\" property by coercing them to the \"dataFormat\" property\n// i.e. \"HH:mm\" -> \"HH:mm:ss\"\nconst normalizeTimeComponentValue = (component, value) => {\n const defaultDataFormat = 'HH:mm:ss';\n const defaultFormat = 'HH:mm';\n if ((0, dayjs_1.default)(value, component.format || defaultFormat, true).isValid()) {\n return (0, dayjs_1.default)(value, component.format || defaultFormat, true).format(component.dataFormat || defaultDataFormat);\n }\n return value;\n};\nconst normalizeProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.normalizeProcessSync)(context);\n});\nexports.normalizeProcess = normalizeProcess;\nconst normalizeProcessSync = (context) => {\n const { component, form, scope, path, data, value } = context;\n if (!scope.normalize) {\n scope.normalize = {};\n }\n let { defaultValues } = scope;\n scope.normalize[path] = {\n type: component.type,\n normalized: false\n };\n // First check for component-type-specific transformations\n if (isAddressComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeAddressComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n else if (isDayComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeDayComponentValue(component, form, value));\n scope.normalize[path].normalized = true;\n }\n else if (isEmailComponent(component)) {\n if (value && typeof value === 'string') {\n (0, lodash_1.set)(data, path, value.toLowerCase());\n scope.normalize[path].normalized = true;\n }\n }\n else if (isRadioComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeRadioComponentValue(value));\n scope.normalize[path].normalized = true;\n }\n else if (isSelectComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeSelectComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n else if (isSelectBoxesComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeSelectBoxesComponentValue(value));\n scope.normalize[path].normalized = true;\n }\n else if (isTagsComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeTagsComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n else if (isTextFieldComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeTextFieldComponentValue(component, defaultValues, value, path));\n scope.normalize[path].normalized = true;\n }\n else if (isTimeComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeTimeComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n // Next perform component-type-agnostic transformations (i.e. super())\n if (component.multiple && !Array.isArray(value)) {\n (0, lodash_1.set)(data, path, value ? [value] : []);\n scope.normalize[path].normalized = true;\n }\n};\nexports.normalizeProcessSync = normalizeProcessSync;\nexports.normalizeProcessInfo = {\n name: 'normalize',\n shouldProcess: () => true,\n process: exports.normalizeProcess,\n processSync: exports.normalizeProcessSync\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/normalize/index.js?");
512
512
 
513
513
  /***/ }),
514
514
 
@@ -519,7 +519,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
519
519
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
520
520
 
521
521
  "use strict";
522
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.populateProcessInfo = exports.populateProcessSync = void 0;\nconst set_1 = __importDefault(__webpack_require__(/*! lodash/set */ \"./node_modules/lodash/set.js\"));\nconst get_1 = __importDefault(__webpack_require__(/*! lodash/get */ \"./node_modules/lodash/get.js\"));\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\n// This processor ensures that a \"linked\" row context is provided to every component.\nconst populateProcessSync = (context) => {\n const { component, path, scope } = context;\n const { data } = scope;\n const compDataPath = (0, formUtil_1.componentPath)(component, (0, formUtil_1.getContextualRowPath)(component, path));\n const compData = (0, get_1.default)(data, compDataPath);\n if (!scope.populated)\n scope.populated = [];\n switch ((0, formUtil_1.getModelType)(component)) {\n case 'array':\n if (!compData || !compData.length) {\n (0, set_1.default)(data, compDataPath, [{}]);\n scope.row = (0, get_1.default)(data, compDataPath)[0];\n scope.populated.push({\n path,\n row: (0, get_1.default)(data, compDataPath)[0]\n });\n }\n break;\n case 'dataObject':\n case 'object':\n if (!compData || typeof compData !== 'object') {\n (0, set_1.default)(data, compDataPath, {});\n scope.row = (0, get_1.default)(data, compDataPath);\n scope.populated.push({\n path,\n row: (0, get_1.default)(data, compDataPath)\n });\n }\n break;\n }\n};\nexports.populateProcessSync = populateProcessSync;\nexports.populateProcessInfo = {\n name: 'populate',\n shouldProcess: (context) => true,\n processSync: exports.populateProcessSync,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/populate/index.js?");
522
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.populateProcessInfo = exports.populateProcessSync = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\n// This processor ensures that a \"linked\" row context is provided to every component.\nconst populateProcessSync = (context) => {\n const { component, path, scope } = context;\n const { data } = scope;\n const compDataPath = (0, formUtil_1.componentPath)(component, (0, formUtil_1.getContextualRowPath)(component, path));\n const compData = (0, lodash_1.get)(data, compDataPath);\n if (!scope.populated)\n scope.populated = [];\n switch ((0, formUtil_1.getModelType)(component)) {\n case 'array':\n if (!compData || !compData.length) {\n (0, lodash_1.set)(data, compDataPath, [{}]);\n scope.row = (0, lodash_1.get)(data, compDataPath)[0];\n scope.populated.push({\n path,\n row: (0, lodash_1.get)(data, compDataPath)[0]\n });\n }\n break;\n case 'dataObject':\n case 'object':\n if (!compData || typeof compData !== 'object') {\n (0, lodash_1.set)(data, compDataPath, {});\n scope.row = (0, lodash_1.get)(data, compDataPath);\n scope.populated.push({\n path,\n row: (0, lodash_1.get)(data, compDataPath)\n });\n }\n break;\n }\n};\nexports.populateProcessSync = populateProcessSync;\nexports.populateProcessInfo = {\n name: 'populate',\n shouldProcess: (context) => true,\n processSync: exports.populateProcessSync,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/populate/index.js?");
523
523
 
524
524
  /***/ }),
525
525
 
@@ -640,7 +640,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
640
640
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
641
641
 
642
642
  "use strict";
643
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateAvailableItemsInfo = exports.validateAvailableItemsSync = exports.shouldValidate = exports.validateAvailableItems = void 0;\nconst isEmpty_1 = __importDefault(__webpack_require__(/*! lodash/isEmpty */ \"./node_modules/lodash/isEmpty.js\"));\nconst error_1 = __webpack_require__(/*! ../../../error */ \"./node_modules/@formio/core/lib/error/index.js\");\nconst utils_1 = __webpack_require__(/*! ../../../utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@formio/core/lib/process/validation/util.js\");\nfunction isValidatableRadioComponent(component) {\n var _a;\n return (component &&\n component.type === 'radio' &&\n !!((_a = component.validate) === null || _a === void 0 ? void 0 : _a.onlyAvailableItems) &&\n component.dataSrc === 'values');\n}\nfunction isValidateableSelectComponent(component) {\n var _a;\n return (component &&\n !!((_a = component.validate) === null || _a === void 0 ? void 0 : _a.hasOwnProperty('onlyAvailableItems')) &&\n component.type === 'select' &&\n component.dataSrc !== 'resource');\n}\nfunction mapDynamicValues(component, values) {\n return values.map((value) => {\n if (component.valueProperty) {\n return value[component.valueProperty];\n }\n return value;\n });\n}\nfunction mapStaticValues(values) {\n return values.map((obj) => obj.value);\n}\nfunction getAvailableSelectValues(component, context) {\n return __awaiter(this, void 0, void 0, function* () {\n switch (component.dataSrc) {\n case 'values':\n if (Array.isArray(component.data.values)) {\n return mapStaticValues(component.data.values);\n }\n throw new error_1.ProcessorError(`Failed to validate available values in static values select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n case 'json': {\n if (typeof component.data.json === 'string') {\n try {\n return mapDynamicValues(component, JSON.parse(component.data.json));\n }\n catch (err) {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': ${err}`, context, 'validate:validateAvailableItems');\n }\n }\n else if (Array.isArray(component.data.json)) {\n // TODO: need to retype this\n return mapDynamicValues(component, component.data.json);\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n }\n case 'custom':\n const customItems = utils_1.Evaluator.evaluate(component.data.custom, {\n values: [],\n }, 'values');\n if ((0, util_1.isPromise)(customItems)) {\n const resolvedCustomItems = yield customItems;\n if (Array.isArray(resolvedCustomItems)) {\n return resolvedCustomItems;\n }\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n if (Array.isArray(customItems)) {\n return customItems;\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n default:\n throw new error_1.ProcessorError(`Failed to validate available values in select component '${component.key}': data source ${component.dataSrc} is not valid}`, context, 'validate:validateAvailableItems');\n }\n });\n}\nfunction getAvailableSelectValuesSync(component, context) {\n var _a;\n switch (component.dataSrc) {\n case 'values':\n if (Array.isArray((_a = component.data) === null || _a === void 0 ? void 0 : _a.values)) {\n return mapStaticValues(component.data.values);\n }\n throw new error_1.ProcessorError(`Failed to validate available values in static values select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n case 'json': {\n if (typeof component.data.json === 'string') {\n try {\n return mapDynamicValues(component, JSON.parse(component.data.json));\n }\n catch (err) {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': ${err}`, context, 'validate:validateAvailableItems');\n }\n }\n else if (Array.isArray(component.data.json)) {\n // TODO: need to retype this\n return mapDynamicValues(component, component.data.json);\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n }\n case 'custom':\n const customItems = utils_1.Evaluator.evaluate(component.data.custom, {\n values: [],\n }, 'values');\n if (Array.isArray(customItems)) {\n return customItems;\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n default:\n throw new error_1.ProcessorError(`Failed to validate available values in select component '${component.key}': data source ${component.dataSrc} is not valid}`, context, 'validate:validateAvailableItems');\n }\n}\nfunction compareComplexValues(valueA, valueB, context) {\n if (!(0, util_1.isObject)(valueA) || !(0, util_1.isObject)(valueB)) {\n return false;\n }\n try {\n // TODO: we need to have normalized values here at this moment, otherwise\n // this won't work\n return JSON.stringify(valueA) === JSON.stringify(valueB);\n }\n catch (err) {\n throw new error_1.ProcessorError(`Error while comparing available values: ${err}`, context, 'validate:validateAvailableItems');\n }\n}\nconst validateAvailableItems = (context) => __awaiter(void 0, void 0, void 0, function* () {\n const { component, value } = context;\n const error = new error_1.FieldError('invalidOption', context, 'onlyAvailableItems');\n try {\n if (isValidatableRadioComponent(component)) {\n if (value == null || (0, isEmpty_1.default)(value)) {\n return null;\n }\n const values = component.values;\n if (values) {\n return values.findIndex(({ value: optionValue }) => optionValue === value) !== -1\n ? null\n : error;\n }\n return null;\n }\n else if (isValidateableSelectComponent(component)) {\n if (value == null || (0, isEmpty_1.default)(value)) {\n return null;\n }\n const values = yield getAvailableSelectValues(component, context);\n if (values) {\n if ((0, util_1.isObject)(value)) {\n return values.find((optionValue) => compareComplexValues(optionValue, value, context)) !==\n undefined\n ? null\n : error;\n }\n return values.find((optionValue) => optionValue === value) !== undefined ? null : error;\n }\n }\n }\n catch (err) {\n throw new error_1.ProcessorError(err.message || err, context, 'validate:validateAvailableItems');\n }\n return null;\n});\nexports.validateAvailableItems = validateAvailableItems;\nconst shouldValidate = (context) => {\n const { component, value } = context;\n if (value == null || (0, isEmpty_1.default)(value)) {\n return false;\n }\n if (isValidatableRadioComponent(component)) {\n return true;\n }\n if (isValidateableSelectComponent(component)) {\n return true;\n }\n return false;\n};\nexports.shouldValidate = shouldValidate;\nconst validateAvailableItemsSync = (context) => {\n const { component, value } = context;\n const error = new error_1.FieldError('invalidOption', context, 'onlyAvailableItems');\n try {\n if (!(0, exports.shouldValidate)(context)) {\n return null;\n }\n if (isValidatableRadioComponent(component)) {\n const values = component.values;\n if (values) {\n return values.findIndex(({ value: optionValue }) => optionValue === value) !== -1\n ? null\n : error;\n }\n return null;\n }\n else if (isValidateableSelectComponent(component)) {\n const values = getAvailableSelectValuesSync(component, context);\n if (values) {\n if ((0, util_1.isObject)(value)) {\n return values.find((optionValue) => compareComplexValues(optionValue, value, context)) !==\n undefined\n ? null\n : error;\n }\n return values.find((optionValue) => optionValue === value) !== undefined ? null : error;\n }\n }\n }\n catch (err) {\n throw new error_1.ProcessorError(err.message || err, context, 'validate:validateAvailableItems');\n }\n return null;\n};\nexports.validateAvailableItemsSync = validateAvailableItemsSync;\nexports.validateAvailableItemsInfo = {\n name: 'validateAvailableItems',\n process: exports.validateAvailableItems,\n processSync: exports.validateAvailableItemsSync,\n shouldProcess: exports.shouldValidate\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/validation/rules/validateAvailableItems.js?");
643
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateAvailableItemsInfo = exports.validateAvailableItemsSync = exports.shouldValidate = exports.validateAvailableItems = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst error_1 = __webpack_require__(/*! ../../../error */ \"./node_modules/@formio/core/lib/error/index.js\");\nconst utils_1 = __webpack_require__(/*! ../../../utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@formio/core/lib/process/validation/util.js\");\nfunction isValidatableRadioComponent(component) {\n var _a;\n return (component &&\n component.type === 'radio' &&\n !!((_a = component.validate) === null || _a === void 0 ? void 0 : _a.onlyAvailableItems) &&\n component.dataSrc === 'values');\n}\nfunction isValidateableSelectComponent(component) {\n var _a;\n return (component &&\n !!((_a = component.validate) === null || _a === void 0 ? void 0 : _a.hasOwnProperty('onlyAvailableItems')) &&\n component.type === 'select' &&\n component.dataSrc !== 'resource');\n}\nfunction mapDynamicValues(component, values) {\n return values.map((value) => {\n if (component.valueProperty) {\n return value[component.valueProperty];\n }\n return value;\n });\n}\nfunction mapStaticValues(values) {\n return values.map((obj) => obj.value);\n}\nfunction getAvailableSelectValues(component, context) {\n return __awaiter(this, void 0, void 0, function* () {\n switch (component.dataSrc) {\n case 'values':\n if (Array.isArray(component.data.values)) {\n return mapStaticValues(component.data.values);\n }\n throw new error_1.ProcessorError(`Failed to validate available values in static values select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n case 'json': {\n if (typeof component.data.json === 'string') {\n try {\n return mapDynamicValues(component, JSON.parse(component.data.json));\n }\n catch (err) {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': ${err}`, context, 'validate:validateAvailableItems');\n }\n }\n else if (Array.isArray(component.data.json)) {\n // TODO: need to retype this\n return mapDynamicValues(component, component.data.json);\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n }\n case 'custom':\n const customItems = utils_1.Evaluator.evaluate(component.data.custom, {\n values: [],\n }, 'values');\n if ((0, util_1.isPromise)(customItems)) {\n const resolvedCustomItems = yield customItems;\n if (Array.isArray(resolvedCustomItems)) {\n return resolvedCustomItems;\n }\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n if (Array.isArray(customItems)) {\n return customItems;\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n default:\n throw new error_1.ProcessorError(`Failed to validate available values in select component '${component.key}': data source ${component.dataSrc} is not valid}`, context, 'validate:validateAvailableItems');\n }\n });\n}\nfunction getAvailableSelectValuesSync(component, context) {\n var _a;\n switch (component.dataSrc) {\n case 'values':\n if (Array.isArray((_a = component.data) === null || _a === void 0 ? void 0 : _a.values)) {\n return mapStaticValues(component.data.values);\n }\n throw new error_1.ProcessorError(`Failed to validate available values in static values select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n case 'json': {\n if (typeof component.data.json === 'string') {\n try {\n return mapDynamicValues(component, JSON.parse(component.data.json));\n }\n catch (err) {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': ${err}`, context, 'validate:validateAvailableItems');\n }\n }\n else if (Array.isArray(component.data.json)) {\n // TODO: need to retype this\n return mapDynamicValues(component, component.data.json);\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n }\n case 'custom':\n const customItems = utils_1.Evaluator.evaluate(component.data.custom, {\n values: [],\n }, 'values');\n if (Array.isArray(customItems)) {\n return customItems;\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n default:\n throw new error_1.ProcessorError(`Failed to validate available values in select component '${component.key}': data source ${component.dataSrc} is not valid}`, context, 'validate:validateAvailableItems');\n }\n}\nfunction compareComplexValues(valueA, valueB, context) {\n if (!(0, util_1.isObject)(valueA) || !(0, util_1.isObject)(valueB)) {\n return false;\n }\n try {\n // TODO: we need to have normalized values here at this moment, otherwise\n // this won't work\n return JSON.stringify(valueA) === JSON.stringify(valueB);\n }\n catch (err) {\n throw new error_1.ProcessorError(`Error while comparing available values: ${err}`, context, 'validate:validateAvailableItems');\n }\n}\nconst validateAvailableItems = (context) => __awaiter(void 0, void 0, void 0, function* () {\n const { component, value } = context;\n const error = new error_1.FieldError('invalidOption', context, 'onlyAvailableItems');\n try {\n if (isValidatableRadioComponent(component)) {\n if (value == null || (0, lodash_1.isEmpty)(value)) {\n return null;\n }\n const values = component.values;\n if (values) {\n return values.findIndex(({ value: optionValue }) => optionValue === value) !== -1\n ? null\n : error;\n }\n return null;\n }\n else if (isValidateableSelectComponent(component)) {\n if (value == null || (0, lodash_1.isEmpty)(value)) {\n return null;\n }\n const values = yield getAvailableSelectValues(component, context);\n if (values) {\n if ((0, util_1.isObject)(value)) {\n return values.find((optionValue) => compareComplexValues(optionValue, value, context)) !==\n undefined\n ? null\n : error;\n }\n return values.find((optionValue) => optionValue === value) !== undefined ? null : error;\n }\n }\n }\n catch (err) {\n throw new error_1.ProcessorError(err.message || err, context, 'validate:validateAvailableItems');\n }\n return null;\n});\nexports.validateAvailableItems = validateAvailableItems;\nconst shouldValidate = (context) => {\n const { component, value } = context;\n if (value == null || (0, lodash_1.isEmpty)(value)) {\n return false;\n }\n if (isValidatableRadioComponent(component)) {\n return true;\n }\n if (isValidateableSelectComponent(component)) {\n return true;\n }\n return false;\n};\nexports.shouldValidate = shouldValidate;\nconst validateAvailableItemsSync = (context) => {\n const { component, value } = context;\n const error = new error_1.FieldError('invalidOption', context, 'onlyAvailableItems');\n try {\n if (!(0, exports.shouldValidate)(context)) {\n return null;\n }\n if (isValidatableRadioComponent(component)) {\n const values = component.values;\n if (values) {\n return values.findIndex(({ value: optionValue }) => optionValue === value) !== -1\n ? null\n : error;\n }\n return null;\n }\n else if (isValidateableSelectComponent(component)) {\n const values = getAvailableSelectValuesSync(component, context);\n if (values) {\n if ((0, util_1.isObject)(value)) {\n return values.find((optionValue) => compareComplexValues(optionValue, value, context)) !==\n undefined\n ? null\n : error;\n }\n return values.find((optionValue) => optionValue === value) !== undefined ? null : error;\n }\n }\n }\n catch (err) {\n throw new error_1.ProcessorError(err.message || err, context, 'validate:validateAvailableItems');\n }\n return null;\n};\nexports.validateAvailableItemsSync = validateAvailableItemsSync;\nexports.validateAvailableItemsInfo = {\n name: 'validateAvailableItems',\n process: exports.validateAvailableItems,\n processSync: exports.validateAvailableItemsSync,\n shouldProcess: exports.shouldValidate\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/validation/rules/validateAvailableItems.js?");
644
644
 
645
645
  /***/ }),
646
646
 
@@ -717,7 +717,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
717
717
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
718
718
 
719
719
  "use strict";
720
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateMaskInfo = exports.validateMaskSync = exports.validateMask = exports.shouldValidate = exports.matchInputMask = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst error_1 = __webpack_require__(/*! ../../../error */ \"./node_modules/@formio/core/lib/error/index.js\");\nif (typeof document === 'undefined') {\n __webpack_require__.g.document = {\n createElement: () => ({\n setAttribute: () => { },\n })\n };\n __webpack_require__.g.navigator = {\n userAgent: ''\n };\n __webpack_require__.g.window = {\n document: __webpack_require__.g.document,\n addEventListener: () => { },\n Event: () => { },\n navigator: __webpack_require__.g.navigator\n };\n}\nconst inputmask_1 = __importDefault(__webpack_require__(/*! inputmask */ \"./node_modules/@formio/core/node_modules/inputmask/index.js\"));\nconst isMaskType = (obj) => {\n return ((obj === null || obj === void 0 ? void 0 : obj.maskName) &&\n typeof (obj === null || obj === void 0 ? void 0 : obj.maskName) === 'string' &&\n (obj === null || obj === void 0 ? void 0 : obj.value) &&\n typeof (obj === null || obj === void 0 ? void 0 : obj.value) === 'string');\n};\nconst isValidatableComponent = (component) => {\n // For some reason we skip mask validation for time components\n return ((component && component.type && component.type !== 'time') &&\n (component && component.hasOwnProperty('inputMask') && !!component.inputMask) ||\n (component && component.hasOwnProperty('inputMasks') && !(0, lodash_1.isEmpty)(component.inputMasks)));\n};\nfunction getMaskByLabel(component, maskName) {\n var _a;\n if (maskName) {\n const inputMask = (_a = component.inputMasks) === null || _a === void 0 ? void 0 : _a.find((inputMask) => {\n return inputMask.label === maskName;\n });\n return inputMask ? inputMask.mask : undefined;\n }\n return;\n}\nfunction getInputMask(mask, placeholderChar) {\n if (mask instanceof Array) {\n return mask;\n }\n const maskArray = [];\n for (let i = 0; i < mask.length; i++) {\n switch (mask[i]) {\n case '9':\n maskArray.push(/\\d/);\n break;\n case 'A':\n maskArray.push(/[a-zA-Z]/);\n break;\n case 'a':\n maskArray.push(/[a-z]/);\n break;\n case '*':\n maskArray.push(/[a-zA-Z0-9]/);\n break;\n // If char which is used inside mask placeholder was used in the mask, replace it with space to prevent errors\n case placeholderChar:\n maskArray.push(' ');\n break;\n default:\n maskArray.push(mask[i]);\n break;\n }\n }\n return maskArray;\n}\nfunction matchInputMask(value, inputMask) {\n if (!inputMask) {\n return true;\n }\n // If value is longer than mask, it isn't valid.\n if (value.length > inputMask.length) {\n return false;\n }\n for (let i = 0; i < inputMask.length; i++) {\n const char = value[i];\n const charPart = inputMask[i];\n if (charPart instanceof RegExp) {\n if (!charPart.test(char)) {\n return false;\n }\n continue;\n }\n else if (charPart !== char) {\n return false;\n }\n }\n return true;\n}\nexports.matchInputMask = matchInputMask;\nconst shouldValidate = (context) => {\n var _a;\n const { component, value } = context;\n if (!isValidatableComponent(component) || !value) {\n return false;\n }\n if (value == null) {\n return false;\n }\n if (component.allowMultipleMasks && ((_a = component.inputMasks) === null || _a === void 0 ? void 0 : _a.length)) {\n const mask = value && isMaskType(value) ? value : undefined;\n const formioInputMask = getMaskByLabel(component, mask === null || mask === void 0 ? void 0 : mask.maskName);\n if (formioInputMask && !getInputMask(formioInputMask)) {\n return false;\n }\n }\n else if (!getInputMask(component.inputMask || '')) {\n return false;\n }\n return true;\n};\nexports.shouldValidate = shouldValidate;\nconst validateMask = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.validateMaskSync)(context);\n});\nexports.validateMask = validateMask;\n// TODO: this function has side effects\nconst validateMaskSync = (context) => {\n var _a;\n const { component, value } = context;\n if (!(0, exports.shouldValidate)(context)) {\n return null;\n }\n let inputMask;\n let maskValue;\n if (component.allowMultipleMasks && ((_a = component.inputMasks) === null || _a === void 0 ? void 0 : _a.length)) {\n const mask = value && isMaskType(value) ? value : undefined;\n const formioInputMask = getMaskByLabel(component, mask === null || mask === void 0 ? void 0 : mask.maskName);\n if (formioInputMask) {\n inputMask = formioInputMask;\n }\n maskValue = mask === null || mask === void 0 ? void 0 : mask.value;\n }\n else {\n inputMask = component.inputMask || '';\n }\n if (!inputMask) {\n return null;\n }\n if (value && inputMask && typeof value === 'string' && component.type === 'textfield') {\n return inputmask_1.default.isValid(value, { mask: inputMask.toString() }) ? null : new error_1.FieldError('mask', context);\n }\n let inputMaskArr = getInputMask(inputMask);\n if (value != null && inputMaskArr) {\n const error = new error_1.FieldError('mask', context);\n return matchInputMask(maskValue || value, inputMaskArr) ? null : error;\n }\n return null;\n};\nexports.validateMaskSync = validateMaskSync;\nexports.validateMaskInfo = {\n name: 'validateMask',\n process: exports.validateMask,\n processSync: exports.validateMaskSync,\n shouldProcess: exports.shouldValidate,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/validation/rules/validateMask.js?");
720
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateMaskInfo = exports.validateMaskSync = exports.validateMask = exports.shouldValidate = exports.matchInputMask = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst error_1 = __webpack_require__(/*! ../../../error */ \"./node_modules/@formio/core/lib/error/index.js\");\nconst inputmask_1 = __importDefault(__webpack_require__(/*! inputmask */ \"./node_modules/inputmask/dist/inputmask.js\"));\nconst isMaskType = (obj) => {\n return ((obj === null || obj === void 0 ? void 0 : obj.maskName) &&\n typeof (obj === null || obj === void 0 ? void 0 : obj.maskName) === 'string' &&\n (obj === null || obj === void 0 ? void 0 : obj.value) &&\n typeof (obj === null || obj === void 0 ? void 0 : obj.value) === 'string');\n};\nconst isValidatableComponent = (component) => {\n // For some reason we skip mask validation for time components\n return ((component && component.type && component.type !== 'time') &&\n (component && component.hasOwnProperty('inputMask') && !!component.inputMask) ||\n (component && component.hasOwnProperty('inputMasks') && !(0, lodash_1.isEmpty)(component.inputMasks)));\n};\nfunction getMaskByLabel(component, maskName) {\n var _a;\n if (maskName) {\n const inputMask = (_a = component.inputMasks) === null || _a === void 0 ? void 0 : _a.find((inputMask) => {\n return inputMask.label === maskName;\n });\n return inputMask ? inputMask.mask : undefined;\n }\n return;\n}\nfunction getInputMask(mask, placeholderChar) {\n if (mask instanceof Array) {\n return mask;\n }\n const maskArray = [];\n for (let i = 0; i < mask.length; i++) {\n switch (mask[i]) {\n case '9':\n maskArray.push(/\\d/);\n break;\n case 'A':\n maskArray.push(/[a-zA-Z]/);\n break;\n case 'a':\n maskArray.push(/[a-z]/);\n break;\n case '*':\n maskArray.push(/[a-zA-Z0-9]/);\n break;\n // If char which is used inside mask placeholder was used in the mask, replace it with space to prevent errors\n case placeholderChar:\n maskArray.push(' ');\n break;\n default:\n maskArray.push(mask[i]);\n break;\n }\n }\n return maskArray;\n}\nfunction matchInputMask(value, inputMask) {\n if (!inputMask) {\n return true;\n }\n // If value is longer than mask, it isn't valid.\n if (value.length > inputMask.length) {\n return false;\n }\n for (let i = 0; i < inputMask.length; i++) {\n const char = value[i];\n const charPart = inputMask[i];\n if (charPart instanceof RegExp) {\n if (!charPart.test(char)) {\n return false;\n }\n continue;\n }\n else if (charPart !== char) {\n return false;\n }\n }\n return true;\n}\nexports.matchInputMask = matchInputMask;\nconst shouldValidate = (context) => {\n var _a;\n const { component, value } = context;\n if (!isValidatableComponent(component) || !value) {\n return false;\n }\n if (value == null) {\n return false;\n }\n if (component.allowMultipleMasks && ((_a = component.inputMasks) === null || _a === void 0 ? void 0 : _a.length)) {\n const mask = value && isMaskType(value) ? value : undefined;\n const formioInputMask = getMaskByLabel(component, mask === null || mask === void 0 ? void 0 : mask.maskName);\n if (formioInputMask && !getInputMask(formioInputMask)) {\n return false;\n }\n }\n else if (!getInputMask(component.inputMask || '')) {\n return false;\n }\n return true;\n};\nexports.shouldValidate = shouldValidate;\nconst validateMask = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.validateMaskSync)(context);\n});\nexports.validateMask = validateMask;\n// TODO: this function has side effects\nconst validateMaskSync = (context) => {\n var _a;\n const { component, value } = context;\n if (!(0, exports.shouldValidate)(context)) {\n return null;\n }\n let inputMask;\n let maskValue;\n if (component.allowMultipleMasks && ((_a = component.inputMasks) === null || _a === void 0 ? void 0 : _a.length)) {\n const mask = value && isMaskType(value) ? value : undefined;\n const formioInputMask = getMaskByLabel(component, mask === null || mask === void 0 ? void 0 : mask.maskName);\n if (formioInputMask) {\n inputMask = formioInputMask;\n }\n maskValue = mask === null || mask === void 0 ? void 0 : mask.value;\n }\n else {\n inputMask = component.inputMask || '';\n }\n if (!inputMask) {\n return null;\n }\n if (value && inputMask && typeof value === 'string' && component.type === 'textfield') {\n return inputmask_1.default.isValid(value, { mask: inputMask.toString() }) ? null : new error_1.FieldError('mask', context);\n }\n let inputMaskArr = getInputMask(inputMask);\n if (value != null && inputMaskArr) {\n const error = new error_1.FieldError('mask', context);\n return matchInputMask(maskValue || value, inputMaskArr) ? null : error;\n }\n return null;\n};\nexports.validateMaskSync = validateMaskSync;\nexports.validateMaskInfo = {\n name: 'validateMask',\n process: exports.validateMask,\n processSync: exports.validateMaskSync,\n shouldProcess: exports.shouldValidate,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/validation/rules/validateMask.js?");
721
721
 
722
722
  /***/ }),
723
723
 
@@ -1630,7 +1630,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
1630
1630
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1631
1631
 
1632
1632
  "use strict";
1633
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.isComponentDataEmpty = exports.getEmptyValue = exports.findComponent = exports.applyFormChanges = exports.generateFormChange = exports.getStrings = exports.getValue = exports.escapeRegExCharacters = exports.formatAsCurrency = exports.parseFloatExt = exports.hasCondition = exports.removeComponent = exports.searchComponents = exports.getComponent = exports.matchComponent = exports.isLayoutComponent = exports.getComponentActualValue = exports.getComponentData = exports.eachComponentAsync = exports.eachComponent = exports.componentInfo = exports.getContextualRowData = exports.getContextualRowPath = exports.getComponentKey = exports.eachComponentData = exports.eachComponentDataAsync = exports.componentChildPath = exports.componentPath = exports.isComponentNestedDataType = exports.isComponentModelType = exports.getComponentPath = exports.getComponentAbsolutePath = exports.getModelType = exports.MODEL_TYPES = exports.uniqueName = exports.guid = exports.flattenComponents = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst fast_json_patch_1 = __webpack_require__(/*! fast-json-patch */ \"./node_modules/fast-json-patch/index.mjs\");\nconst Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"./node_modules/@formio/core/lib/utils/Evaluator.js\");\n/**\n * Flatten the form components for data manipulation.\n *\n * @param {Object} components\n * The components to iterate.\n * @param {Boolean} includeAll\n * Whether or not to include layout components.\n *\n * @returns {Object}\n * The flattened components map.\n */\nfunction flattenComponents(components, includeAll) {\n const flattened = {};\n eachComponent(components, (component, path) => {\n flattened[path] = component;\n }, includeAll);\n return flattened;\n}\nexports.flattenComponents = flattenComponents;\nfunction guid() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\nexports.guid = guid;\n/**\n * Make a filename guaranteed to be unique.\n * @param name\n * @param template\n * @param evalContext\n * @returns {string}\n */\nfunction uniqueName(name, template, evalContext) {\n template = template || \"{{fileName}}-{{guid}}\";\n //include guid in template anyway, to prevent overwriting issue if filename matches existing file\n if (!template.includes(\"{{guid}}\")) {\n template = `${template}-{{guid}}`;\n }\n const parts = name.split(\".\");\n let fileName = parts.slice(0, parts.length - 1).join(\".\");\n const extension = parts.length > 1 ? `.${(0, lodash_1.last)(parts)}` : \"\";\n //allow only 100 characters from original name to avoid issues with filename length restrictions\n fileName = fileName.substr(0, 100);\n evalContext = Object.assign(evalContext || {}, {\n fileName,\n guid: guid(),\n });\n //only letters, numbers, dots, dashes, underscores and spaces are allowed. Anything else will be replaced with dash\n const uniqueName = `${Evaluator_1.Evaluator.interpolate(template, evalContext)}${extension}`.replace(/[^0-9a-zA-Z.\\-_ ]/g, \"-\");\n return uniqueName;\n}\nexports.uniqueName = uniqueName;\nexports.MODEL_TYPES = {\n array: [\n 'datagrid',\n 'editgrid',\n 'datatable',\n 'dynamicWizard',\n ],\n dataObject: [\n 'form'\n ],\n object: [\n 'container',\n 'address'\n ],\n map: [\n 'datamap'\n ],\n content: [\n 'htmlelement',\n 'content'\n ],\n layout: [\n 'table',\n 'tabs',\n 'well',\n 'columns',\n 'fieldset',\n 'panel',\n 'tabs'\n ],\n};\nfunction getModelType(component) {\n if (isComponentNestedDataType(component)) {\n if (isComponentModelType(component, 'dataObject')) {\n return 'dataObject';\n }\n if (isComponentModelType(component, 'array')) {\n return 'array';\n }\n return 'object';\n }\n if ((component.input === false) || isComponentModelType(component, 'layout')) {\n return 'inherit';\n }\n if (getComponentKey(component)) {\n return 'value';\n }\n return 'inherit';\n}\nexports.getModelType = getModelType;\nfunction getComponentAbsolutePath(component) {\n let paths = [component.path];\n while (component.parent) {\n component = component.parent;\n // We only need to do this for nested forms because they reset the data contexts for the children.\n if (isComponentModelType(component, 'dataObject')) {\n paths[paths.length - 1] = `data.${paths[paths.length - 1]}`;\n paths.push(component.path);\n }\n }\n return paths.reverse().join('.');\n}\nexports.getComponentAbsolutePath = getComponentAbsolutePath;\nfunction getComponentPath(component, path) {\n const key = getComponentKey(component);\n if (!key) {\n return path;\n }\n if (!path) {\n return key;\n }\n if (path.match(new RegExp(`${key}$`))) {\n return path;\n }\n return (getModelType(component) === 'inherit') ? `${path}.${key}` : path;\n}\nexports.getComponentPath = getComponentPath;\nfunction isComponentModelType(component, modelType) {\n return component.modelType === modelType || exports.MODEL_TYPES[modelType].includes(component.type);\n}\nexports.isComponentModelType = isComponentModelType;\nfunction isComponentNestedDataType(component) {\n return component.tree || isComponentModelType(component, 'array') ||\n isComponentModelType(component, 'dataObject') ||\n isComponentModelType(component, 'object') ||\n isComponentModelType(component, 'map');\n}\nexports.isComponentNestedDataType = isComponentNestedDataType;\nfunction componentPath(component, parentPath) {\n parentPath = component.parentPath || parentPath;\n const key = getComponentKey(component);\n if (!key) {\n // If the component does not have a key, then just always return the parent path.\n return parentPath || '';\n }\n return parentPath ? `${parentPath}.${key}` : key;\n}\nexports.componentPath = componentPath;\nconst componentChildPath = (component, parentPath, path) => {\n parentPath = component.parentPath || parentPath;\n path = path || componentPath(component, parentPath);\n // See if we are a nested component.\n if (component.components && Array.isArray(component.components)) {\n if (isComponentModelType(component, 'dataObject')) {\n return `${path}.data`;\n }\n if (isComponentModelType(component, 'array')) {\n return `${path}[0]`;\n }\n if (isComponentNestedDataType(component)) {\n return path;\n }\n return parentPath === undefined ? path : parentPath;\n }\n return path;\n};\nexports.componentChildPath = componentChildPath;\n// Async each component data.\nconst eachComponentDataAsync = (components_1, data_1, fn_1, ...args_1) => __awaiter(void 0, [components_1, data_1, fn_1, ...args_1], void 0, function* (components, data, fn, path = \"\", index, parent, includeAll = false) {\n if (!components || !data) {\n return;\n }\n return yield eachComponentAsync(components, (component, compPath, componentComponents, compParent) => __awaiter(void 0, void 0, void 0, function* () {\n const row = getContextualRowData(component, compPath, data);\n if ((yield fn(component, data, row, compPath, componentComponents, index, compParent)) === true) {\n return true;\n }\n if (isComponentNestedDataType(component)) {\n const value = (0, lodash_1.get)(data, compPath, data);\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n yield (0, exports.eachComponentDataAsync)(component.components, data, fn, `${compPath}[${i}]`, i, component, includeAll);\n }\n return true;\n }\n else if ((0, lodash_1.isEmpty)(row) && !includeAll) {\n // Tree components may submit empty objects; since we've already evaluated the parent tree/layout component, we won't worry about constituent elements\n return true;\n }\n if (isComponentModelType(component, 'dataObject')) {\n // No need to bother processing all the children data if there is no data for this form.\n if ((0, lodash_1.has)(data, component.path)) {\n // For nested forms, we need to reset the \"data\" and \"path\" objects for all of the children components, and then re-establish the data when it is done.\n const childPath = (0, exports.componentChildPath)(component, path, compPath);\n const childData = (0, lodash_1.get)(data, childPath, null);\n yield (0, exports.eachComponentDataAsync)(component.components, childData, fn, '', index, component, includeAll);\n (0, lodash_1.set)(data, childPath, childData);\n }\n }\n else {\n yield (0, exports.eachComponentDataAsync)(component.components, data, fn, (0, exports.componentChildPath)(component, path, compPath), index, component, includeAll);\n }\n return true;\n }\n else {\n return false;\n }\n }), true, path, parent);\n});\nexports.eachComponentDataAsync = eachComponentDataAsync;\nconst eachComponentData = (components, data, fn, path = \"\", index, parent, includeAll = false) => {\n if (!components || !data) {\n return;\n }\n return eachComponent(components, (component, compPath, componentComponents, compParent) => {\n const row = getContextualRowData(component, compPath, data);\n if (fn(component, data, row, compPath, componentComponents, index, compParent) === true) {\n return true;\n }\n if (isComponentNestedDataType(component)) {\n const value = (0, lodash_1.get)(data, compPath, data);\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n (0, exports.eachComponentData)(component.components, data, fn, `${compPath}[${i}]`, i, component, includeAll);\n }\n return true;\n }\n else if ((0, lodash_1.isEmpty)(row) && !includeAll) {\n // Tree components may submit empty objects; since we've already evaluated the parent tree/layout component, we won't worry about constituent elements\n return true;\n }\n if (isComponentModelType(component, 'dataObject')) {\n // No need to bother processing all the children data if there is no data for this form.\n if ((0, lodash_1.has)(data, component.path)) {\n // For nested forms, we need to reset the \"data\" and \"path\" objects for all of the children components, and then re-establish the data when it is done.\n const childPath = (0, exports.componentChildPath)(component, path, compPath);\n const childData = (0, lodash_1.get)(data, childPath, {});\n (0, exports.eachComponentData)(component.components, childData, fn, '', index, component, includeAll);\n (0, lodash_1.set)(data, childPath, childData);\n }\n }\n else {\n (0, exports.eachComponentData)(component.components, data, fn, (0, exports.componentChildPath)(component, path, compPath), index, component, includeAll);\n }\n return true;\n }\n else {\n return false;\n }\n }, true, path, parent);\n};\nexports.eachComponentData = eachComponentData;\nfunction getComponentKey(component) {\n if (component.type === 'checkbox' &&\n component.inputType === 'radio' &&\n component.name) {\n return component.name;\n }\n return component.key;\n}\nexports.getComponentKey = getComponentKey;\nfunction getContextualRowPath(component, path) {\n return path.replace(new RegExp(`\\.?${getComponentKey(component)}$`), '');\n}\nexports.getContextualRowPath = getContextualRowPath;\nfunction getContextualRowData(component, path, data) {\n const rowPath = getContextualRowPath(component, path);\n return rowPath ? (0, lodash_1.get)(data, rowPath, null) : data;\n}\nexports.getContextualRowData = getContextualRowData;\nfunction componentInfo(component) {\n const hasColumns = component.columns && Array.isArray(component.columns);\n const hasRows = component.rows && Array.isArray(component.rows);\n const hasComps = component.components && Array.isArray(component.components);\n return {\n hasColumns,\n hasRows,\n hasComps,\n iterable: hasColumns || hasRows || hasComps || isComponentModelType(component, 'content'),\n };\n}\nexports.componentInfo = componentInfo;\n/**\n * Iterate through each component within a form.\n *\n * @param {Object} components\n * The components to iterate.\n * @param {Function} fn\n * The iteration function to invoke for each component.\n * @param {Boolean} includeAll\n * Whether or not to include layout components.\n * @param {String} path\n * The current data path of the element. Example: data.user.firstName\n * @param {Object} parent\n * The parent object.\n */\nfunction eachComponent(components, fn, includeAll, path, parent) {\n if (!components)\n return;\n path = path || \"\";\n components.forEach((component) => {\n if (!component) {\n return;\n }\n const info = componentInfo(component);\n let noRecurse = false;\n // Keep track of parent references.\n if (parent) {\n // Ensure we don't create infinite JSON structures.\n Object.defineProperty(component, 'parent', {\n enumerable: false,\n writable: true,\n value: JSON.parse(JSON.stringify(parent))\n });\n Object.defineProperty(component.parent, 'parent', {\n enumerable: false,\n writable: true,\n value: parent.parent\n });\n Object.defineProperty(component.parent, 'path', {\n enumerable: false,\n writable: true,\n value: parent.path\n });\n delete component.parent.components;\n delete component.parent.componentMap;\n delete component.parent.columns;\n delete component.parent.rows;\n }\n Object.defineProperty(component, 'path', {\n enumerable: false,\n writable: true,\n value: componentPath(component, path)\n });\n if (includeAll || component.tree || !info.iterable) {\n noRecurse = fn(component, component.path, components, parent);\n }\n if (!noRecurse) {\n if (info.hasColumns) {\n component.columns.forEach((column) => eachComponent(column.components, fn, includeAll, path, parent ? component : null));\n }\n else if (info.hasRows) {\n component.rows.forEach((row) => {\n if (Array.isArray(row)) {\n row.forEach((column) => eachComponent(column.components, fn, includeAll, path, parent ? component : null));\n }\n });\n }\n else if (info.hasComps) {\n eachComponent(component.components, fn, includeAll, (0, exports.componentChildPath)(component, path), parent ? component : null);\n }\n }\n });\n}\nexports.eachComponent = eachComponent;\n// Async each component.\nfunction eachComponentAsync(components_2, fn_1) {\n return __awaiter(this, arguments, void 0, function* (components, fn, includeAll = false, path = \"\", parent) {\n var _a, _b;\n if (!components)\n return;\n for (let i = 0; i < components.length; i++) {\n if (!components[i]) {\n continue;\n }\n let component = components[i];\n const info = componentInfo(component);\n // Keep track of parent references.\n if (parent) {\n // Ensure we don't create infinite JSON structures.\n Object.defineProperty(component, 'parent', {\n enumerable: false,\n writable: true,\n value: JSON.parse(JSON.stringify(parent))\n });\n Object.defineProperty(component.parent, 'parent', {\n enumerable: false,\n writable: true,\n value: parent.parent\n });\n Object.defineProperty(component.parent, 'path', {\n enumerable: false,\n writable: true,\n value: parent.path\n });\n delete component.parent.components;\n delete component.parent.componentMap;\n delete component.parent.columns;\n delete component.parent.rows;\n }\n Object.defineProperty(component, 'path', {\n enumerable: false,\n writable: true,\n value: componentPath(component, path)\n });\n if (includeAll || component.tree || !info.iterable) {\n if (yield fn(component, component.path, components, parent)) {\n continue;\n }\n }\n if (info.hasColumns) {\n for (let j = 0; j < component.columns.length; j++) {\n yield eachComponentAsync((_a = component.columns[j]) === null || _a === void 0 ? void 0 : _a.components, fn, includeAll, path, parent ? component : null);\n }\n }\n else if (info.hasRows) {\n for (let j = 0; j < component.rows.length; j++) {\n let row = component.rows[j];\n if (Array.isArray(row)) {\n for (let k = 0; k < row.length; k++) {\n yield eachComponentAsync((_b = row[k]) === null || _b === void 0 ? void 0 : _b.components, fn, includeAll, path, parent ? component : null);\n }\n }\n }\n }\n else if (info.hasComps) {\n yield eachComponentAsync(component.components, fn, includeAll, (0, exports.componentChildPath)(component, path), parent ? component : null);\n }\n }\n });\n}\nexports.eachComponentAsync = eachComponentAsync;\n// Provided components, data, and a key, this will return the components data.\nfunction getComponentData(components, data, path) {\n const compData = { component: null, data: null };\n (0, exports.eachComponentData)(components, data, (component, data, row, compPath) => {\n if (compPath === path) {\n compData.component = component;\n compData.data = row;\n return true;\n }\n });\n return compData;\n}\nexports.getComponentData = getComponentData;\nfunction getComponentActualValue(component, compPath, data, row) {\n var _a, _b;\n // The compPath here will NOT contain the indexes for DataGrids and EditGrids.\n //\n // a[0].b[2].c[3].d\n //\n // Because of this, we will need to determine our parent component path (not data path),\n // and find the \"row\" based comp path.\n //\n // a[0].b[2].c[3].d => a.b.c.d\n //\n if ((_a = component.parent) === null || _a === void 0 ? void 0 : _a.path) {\n const parentCompPath = (_b = component.parent) === null || _b === void 0 ? void 0 : _b.path.replace(/\\[[0-9]+\\]/g, '');\n compPath = compPath.replace(parentCompPath, '');\n compPath = (0, lodash_1.trim)(compPath, '. ');\n }\n let value = null;\n if (row) {\n value = (0, lodash_1.get)(row, compPath);\n }\n if (data && (0, lodash_1.isNil)(value)) {\n value = (0, lodash_1.get)(data, compPath);\n }\n if ((0, lodash_1.isNil)(value) || ((0, lodash_1.isObject)(value) && (0, lodash_1.isEmpty)(value))) {\n value = '';\n }\n return value;\n}\nexports.getComponentActualValue = getComponentActualValue;\n/**\n * Determine if a component is a layout component or not.\n *\n * @param {Object} component\n * The component to check.\n *\n * @returns {Boolean}\n * Whether or not the component is a layout component.\n */\nfunction isLayoutComponent(component) {\n return Boolean((component.columns && Array.isArray(component.columns)) ||\n (component.rows && Array.isArray(component.rows)) ||\n (component.components && Array.isArray(component.components)));\n}\nexports.isLayoutComponent = isLayoutComponent;\n/**\n * Matches if a component matches the query.\n *\n * @param component\n * @param query\n * @return {boolean}\n */\nfunction matchComponent(component, query) {\n if ((0, lodash_1.isString)(query)) {\n return (component.key === query) || (component.path === query);\n }\n else {\n let matches = false;\n (0, lodash_1.forOwn)(query, (value, key) => {\n matches = ((0, lodash_1.get)(component, key) === value);\n if (!matches) {\n return false;\n }\n });\n return matches;\n }\n}\nexports.matchComponent = matchComponent;\n/**\n * Get a component by its key\n *\n * @param {Object} components\n * The components to iterate.\n * @param {String|Object} key\n * The key of the component to get, or a query of the component to search.\n *\n * @returns {Object}\n * The component that matches the given key, or undefined if not found.\n */\nfunction getComponent(components, key, includeAll) {\n let result;\n eachComponent(components, (component, path) => {\n if ((path === key) || (component.path === key)) {\n result = component;\n return true;\n }\n }, includeAll);\n return result;\n}\nexports.getComponent = getComponent;\n/**\n * Finds a component provided a query of properties of that component.\n *\n * @param components\n * @param query\n * @return {*}\n */\nfunction searchComponents(components, query) {\n const results = [];\n eachComponent(components, (component) => {\n if (matchComponent(component, query)) {\n results.push(component);\n }\n }, true);\n return results;\n}\nexports.searchComponents = searchComponents;\n/**\n * Remove a component by path.\n *\n * @param components\n * @param path\n */\nfunction removeComponent(components, path) {\n // Using _.unset() leave a null value. Use Array splice instead.\n // @ts-ignore\n var index = path.pop();\n if (path.length !== 0) {\n components = (0, lodash_1.get)(components, path);\n }\n components.splice(index, 1);\n}\nexports.removeComponent = removeComponent;\n/**\n * Returns if this component has a conditional statement.\n *\n * @param component - The component JSON schema.\n *\n * @returns {boolean} - TRUE - This component has a conditional, FALSE - No conditional provided.\n */\nfunction hasCondition(component) {\n return Boolean((component.customConditional) ||\n (component.conditional && (component.conditional.when ||\n component.conditional.json ||\n component.conditional.condition)));\n}\nexports.hasCondition = hasCondition;\n/**\n * Extension of standard #parseFloat(value) function, that also clears input string.\n *\n * @param {any} value\n * The value to parse.\n *\n * @returns {Number}\n * Parsed value.\n */\nfunction parseFloatExt(value) {\n return parseFloat((0, lodash_1.isString)(value)\n ? value.replace(/[^\\de.+-]/gi, '')\n : value);\n}\nexports.parseFloatExt = parseFloatExt;\n/**\n * Formats provided value in way how Currency component uses it.\n *\n * @param {any} value\n * The value to format.\n *\n * @returns {String}\n * Value formatted for Currency component.\n */\nfunction formatAsCurrency(value) {\n const parsedValue = parseFloatExt(value);\n if (isNaN(parsedValue)) {\n return '';\n }\n const parts = (0, lodash_1.round)(parsedValue, 2)\n .toString()\n .split('.');\n parts[0] = (0, lodash_1.chunk)(Array.from(parts[0]).reverse(), 3)\n .reverse()\n .map((part) => part\n .reverse()\n .join(''))\n .join(',');\n parts[1] = (0, lodash_1.pad)(parts[1], 2, '0');\n return parts.join('.');\n}\nexports.formatAsCurrency = formatAsCurrency;\n/**\n * Escapes RegEx characters in provided String value.\n *\n * @param {String} value\n * String for escaping RegEx characters.\n * @returns {string}\n * String with escaped RegEx characters.\n */\nfunction escapeRegExCharacters(value) {\n return value.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, '\\\\$&');\n}\nexports.escapeRegExCharacters = escapeRegExCharacters;\n/**\n * Get the value for a component key, in the given submission.\n *\n * @param {Object} submission\n * A submission object to search.\n * @param {String} key\n * A for components API key to search for.\n */\nfunction getValue(submission, key) {\n const search = (data) => {\n if ((0, lodash_1.isPlainObject)(data)) {\n if ((0, lodash_1.has)(data, key)) {\n return (0, lodash_1.get)(data, key);\n }\n let value = null;\n (0, lodash_1.forOwn)(data, (prop) => {\n const result = search(prop);\n if (!(0, lodash_1.isNil)(result)) {\n value = result;\n return false;\n }\n });\n return value;\n }\n else {\n return null;\n }\n };\n return search(submission.data);\n}\nexports.getValue = getValue;\n/**\n * Iterate over all components in a form and get string values for translation.\n * @param form\n */\nfunction getStrings(form) {\n const properties = ['label', 'title', 'legend', 'tooltip', 'description', 'placeholder', 'prefix', 'suffix', 'errorLabel', 'content', 'html'];\n const strings = [];\n eachComponent(form.components, (component) => {\n properties.forEach(property => {\n if (component.hasOwnProperty(property) && component[property]) {\n strings.push({\n key: component.key,\n type: component.type,\n property,\n string: component[property]\n });\n }\n });\n if ((!component.dataSrc || component.dataSrc === 'values') && component.hasOwnProperty('values') && Array.isArray(component.values) && component.values.length) {\n component.values.forEach((value, index) => {\n strings.push({\n key: component.key,\n property: `value[${index}].label`,\n string: component.values[index].label\n });\n });\n }\n // Hard coded values from Day component\n if (component.type === 'day') {\n [\n 'day',\n 'month',\n 'year',\n 'Day',\n 'Month',\n 'Year',\n 'january',\n 'february',\n 'march',\n 'april',\n 'may',\n 'june',\n 'july',\n 'august',\n 'september',\n 'october',\n 'november',\n 'december'\n ].forEach(string => {\n strings.push({\n key: component.key,\n property: 'day',\n string,\n });\n });\n if (component.fields.day.placeholder) {\n strings.push({\n key: component.key,\n property: 'fields.day.placeholder',\n string: component.fields.day.placeholder,\n });\n }\n if (component.fields.month.placeholder) {\n strings.push({\n key: component.key,\n property: 'fields.month.placeholder',\n string: component.fields.month.placeholder,\n });\n }\n if (component.fields.year.placeholder) {\n strings.push({\n key: component.key,\n property: 'fields.year.placeholder',\n string: component.fields.year.placeholder,\n });\n }\n }\n if (component.type === 'editgrid') {\n const string = component.addAnother || 'Add Another';\n if (component.addAnother) {\n strings.push({\n key: component.key,\n property: 'addAnother',\n string,\n });\n }\n }\n if (component.type === 'select') {\n [\n 'loading...',\n 'Type to search'\n ].forEach(string => {\n strings.push({\n key: component.key,\n property: 'select',\n string,\n });\n });\n }\n }, true);\n return strings;\n}\nexports.getStrings = getStrings;\n// ?????????????????????????\n// questionable section\nfunction generateFormChange(type, data) {\n let change;\n switch (type) {\n case 'add':\n change = {\n op: 'add',\n key: data.component.key,\n container: data.parent.key, // Parent component\n path: data.path, // Path to container within parent component.\n index: data.index, // Index of component in parent container.\n component: data.component\n };\n break;\n case 'edit':\n change = {\n op: 'edit',\n key: data.originalComponent.key,\n patches: (0, fast_json_patch_1.compare)(data.originalComponent, data.component)\n };\n // Don't save if nothing changed.\n if (!change.patches.length) {\n change = null;\n }\n break;\n case 'remove':\n change = {\n op: 'remove',\n key: data.component.key,\n };\n break;\n }\n return change;\n}\nexports.generateFormChange = generateFormChange;\nfunction applyFormChanges(form, changes) {\n const failed = [];\n changes.forEach(function (change) {\n var found = false;\n switch (change.op) {\n case 'add':\n var newComponent = change.component;\n // Find the container to set the component in.\n findComponent(form.components, change.container, null, function (parent) {\n if (!change.container) {\n parent = form;\n }\n // A move will first run an add so remove any existing components with matching key before inserting.\n findComponent(form.components, change.key, null, function (component, path) {\n // If found, use the existing component. (If someone else edited it, the changes would be here)\n newComponent = component;\n removeComponent(form.components, path);\n });\n found = true;\n var container = (0, lodash_1.get)(parent, change.path);\n container.splice(change.index, 0, newComponent);\n });\n break;\n case 'remove':\n findComponent(form.components, change.key, null, function (component, path) {\n found = true;\n const oldComponent = (0, lodash_1.get)(form.components, path);\n if (oldComponent.key !== component.key) {\n path.pop();\n }\n removeComponent(form.components, path);\n });\n break;\n case 'edit':\n findComponent(form.components, change.key, null, function (component, path) {\n found = true;\n try {\n const oldComponent = (0, lodash_1.get)(form.components, path);\n const newComponent = (0, fast_json_patch_1.applyPatch)(component, change.patches).newDocument;\n if (oldComponent.key !== newComponent.key) {\n path.pop();\n }\n (0, lodash_1.set)(form.components, path, newComponent);\n }\n catch (err) {\n failed.push(change);\n }\n });\n break;\n case 'move':\n break;\n }\n if (!found) {\n failed.push(change);\n }\n });\n return {\n form,\n failed\n };\n}\nexports.applyFormChanges = applyFormChanges;\n/**\n* This function will find a component in a form and return the component AND THE PATH to the component in the form.\n* Path to the component is stored as an array of nested components and their indexes.The Path is being filled recursively\n* when you iterating through the nested structure.\n* If the component is not found the callback won't be called and function won't return anything.\n*\n* @param components\n* @param key\n* @param fn\n* @param path\n* @returns {*}\n*/\nfunction findComponent(components, key, path, fn) {\n if (!components)\n return;\n path = path || [];\n if (!key) {\n return fn(components);\n }\n components.forEach(function (component, index) {\n var newPath = path.slice();\n // Add an index of the component it iterates through in nested structure\n newPath.push(index);\n if (!component)\n return;\n if (component.hasOwnProperty('columns') && Array.isArray(component.columns)) {\n newPath.push('columns');\n component.columns.forEach(function (column, index) {\n var colPath = newPath.slice();\n colPath.push(index);\n colPath.push('components');\n findComponent(column.components, key, colPath, fn);\n });\n }\n if (component.hasOwnProperty('rows') && Array.isArray(component.rows)) {\n newPath.push('rows');\n component.rows.forEach(function (row, index) {\n var rowPath = newPath.slice();\n rowPath.push(index);\n row.forEach(function (column, index) {\n var colPath = rowPath.slice();\n colPath.push(index);\n colPath.push('components');\n findComponent(column.components, key, colPath, fn);\n });\n });\n }\n if (component.hasOwnProperty('components') && Array.isArray(component.components)) {\n newPath.push('components');\n findComponent(component.components, key, newPath, fn);\n }\n if (component.key === key) {\n //Final callback if the component is found\n fn(component, newPath, components);\n }\n });\n}\nexports.findComponent = findComponent;\nconst isCheckboxComponent = (component) => component.type === 'checkbox';\nconst isDataGridComponent = (component) => component.type === 'datagrid';\nconst isEditGridComponent = (component) => component.type === 'editgrid';\nconst isDataTableComponent = (component) => component.type === 'datatable';\nconst hasChildComponents = (component) => component.components != null;\nconst isDateTimeComponent = (component) => component.type === 'datetime';\nconst isSelectBoxesComponent = (component) => component.type === 'selectboxes';\nconst isTextAreaComponent = (component) => component.type === 'textarea';\nconst isTextFieldComponent = (component) => component.type === 'textfield';\nfunction getEmptyValue(component) {\n switch (component.type) {\n case 'textarea':\n case 'textfield':\n case 'time':\n case 'datetime':\n case 'day':\n return '';\n case 'datagrid':\n case 'editgrid':\n return [];\n default:\n return null;\n }\n}\nexports.getEmptyValue = getEmptyValue;\nconst replaceBlanks = (value) => {\n const nbsp = '<p>&nbsp;</p>';\n const br = '<p><br></p>';\n const brNbsp = '<p><br>&nbsp;</p>';\n const regExp = new RegExp(`^${nbsp}|${nbsp}$|^${br}|${br}$|^${brNbsp}|${brNbsp}$`, 'g');\n return typeof value === 'string' ? value.replace(regExp, '').trim() : value;\n};\nfunction trimBlanks(value) {\n if (!value) {\n return value;\n }\n if (Array.isArray(value)) {\n value = value.map((val) => replaceBlanks(val));\n }\n else {\n value = replaceBlanks(value);\n }\n return value;\n}\nfunction isValueEmpty(component, value) {\n const compValueIsEmptyArray = ((0, lodash_1.isArray)(value) && value.length === 1) ? (0, lodash_1.isEqual)(value[0], getEmptyValue(component)) : false;\n return value == null || value === '' || ((0, lodash_1.isArray)(value) && value.length === 0) || compValueIsEmptyArray;\n}\nfunction isComponentDataEmpty(component, data, path) {\n var _a;\n const value = (0, lodash_1.get)(data, path);\n if (isCheckboxComponent(component)) {\n return isValueEmpty(component, value) || value === false;\n }\n else if (isDataGridComponent(component) || isEditGridComponent(component) || isDataTableComponent(component) || hasChildComponents(component)) {\n if ((_a = component.components) === null || _a === void 0 ? void 0 : _a.length) {\n let childrenEmpty = true;\n // wrap component in an array to let eachComponentData handle introspection to child components (e.g. this will be different\n // for data grids versus nested forms, etc.)\n (0, exports.eachComponentData)([component], data, (thisComponent, data, row, path, components, index) => {\n if (component.key === thisComponent.key)\n return;\n if (!isComponentDataEmpty(thisComponent, data, path)) {\n childrenEmpty = false;\n }\n });\n return isValueEmpty(component, value) || childrenEmpty;\n }\n return isValueEmpty(component, value);\n }\n else if (isDateTimeComponent(component)) {\n return isValueEmpty(component, value) || value.toString() === 'Invalid date';\n }\n else if (isSelectBoxesComponent(component)) {\n let selectBoxEmpty = true;\n for (const key in value) {\n if (value[key]) {\n selectBoxEmpty = false;\n break;\n }\n }\n return isValueEmpty(component, value) || selectBoxEmpty;\n }\n else if (isTextAreaComponent(component)) {\n const isPlain = !component.wysiwyg && !component.editor;\n return isPlain ? typeof value === 'string' ? isValueEmpty(component, value.trim()) : isValueEmpty(component, value) : isValueEmpty(component, trimBlanks(value));\n }\n else if (isTextFieldComponent(component)) {\n if (component.allowMultipleMasks && !!component.inputMasks && !!component.inputMasks.length) {\n return isValueEmpty(component, value) || (component.multiple ? value.length === 0 : (!value.maskName || !value.value));\n }\n return isValueEmpty(component, value === null || value === void 0 ? void 0 : value.toString().trim());\n }\n return isValueEmpty(component, value);\n}\nexports.isComponentDataEmpty = isComponentDataEmpty;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/utils/formUtil.js?");
1633
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.isComponentDataEmpty = exports.getEmptyValue = exports.findComponent = exports.applyFormChanges = exports.generateFormChange = exports.getStrings = exports.getValue = exports.escapeRegExCharacters = exports.formatAsCurrency = exports.parseFloatExt = exports.hasCondition = exports.removeComponent = exports.searchComponents = exports.getComponent = exports.matchComponent = exports.isLayoutComponent = exports.getComponentActualValue = exports.getComponentData = exports.eachComponentAsync = exports.eachComponent = exports.componentInfo = exports.getContextualRowData = exports.getContextualRowPath = exports.getComponentKey = exports.eachComponentData = exports.eachComponentDataAsync = exports.componentChildPath = exports.componentPath = exports.isComponentNestedDataType = exports.isComponentModelType = exports.getComponentPath = exports.getComponentAbsolutePath = exports.getModelType = exports.MODEL_TYPES = exports.uniqueName = exports.guid = exports.flattenComponents = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst fast_json_patch_1 = __webpack_require__(/*! fast-json-patch */ \"./node_modules/fast-json-patch/index.mjs\");\nconst Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"./node_modules/@formio/core/lib/utils/Evaluator.js\");\n/**\n * Flatten the form components for data manipulation.\n *\n * @param {Object} components\n * The components to iterate.\n * @param {Boolean} includeAll\n * Whether or not to include layout components.\n *\n * @returns {Object}\n * The flattened components map.\n */\nfunction flattenComponents(components, includeAll) {\n const flattened = {};\n eachComponent(components, (component, path) => {\n flattened[path] = component;\n }, includeAll);\n return flattened;\n}\nexports.flattenComponents = flattenComponents;\nfunction guid() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\nexports.guid = guid;\n/**\n * Make a filename guaranteed to be unique.\n * @param name\n * @param template\n * @param evalContext\n * @returns {string}\n */\nfunction uniqueName(name, template, evalContext) {\n template = template || \"{{fileName}}-{{guid}}\";\n //include guid in template anyway, to prevent overwriting issue if filename matches existing file\n if (!template.includes(\"{{guid}}\")) {\n template = `${template}-{{guid}}`;\n }\n const parts = name.split(\".\");\n let fileName = parts.slice(0, parts.length - 1).join(\".\");\n const extension = parts.length > 1 ? `.${(0, lodash_1.last)(parts)}` : \"\";\n //allow only 100 characters from original name to avoid issues with filename length restrictions\n fileName = fileName.substr(0, 100);\n evalContext = Object.assign(evalContext || {}, {\n fileName,\n guid: guid(),\n });\n //only letters, numbers, dots, dashes, underscores and spaces are allowed. Anything else will be replaced with dash\n const uniqueName = `${Evaluator_1.Evaluator.interpolate(template, evalContext)}${extension}`.replace(/[^0-9a-zA-Z.\\-_ ]/g, \"-\");\n return uniqueName;\n}\nexports.uniqueName = uniqueName;\nexports.MODEL_TYPES = {\n array: [\n 'datagrid',\n 'editgrid',\n 'datatable',\n 'dynamicWizard',\n ],\n dataObject: [\n 'form'\n ],\n object: [\n 'container',\n 'address'\n ],\n map: [\n 'datamap'\n ],\n content: [\n 'htmlelement',\n 'content'\n ],\n layout: [\n 'table',\n 'tabs',\n 'well',\n 'columns',\n 'fieldset',\n 'panel',\n 'tabs'\n ],\n};\nfunction getModelType(component) {\n if (isComponentNestedDataType(component)) {\n if (isComponentModelType(component, 'dataObject')) {\n return 'dataObject';\n }\n if (isComponentModelType(component, 'array')) {\n return 'array';\n }\n return 'object';\n }\n if ((component.input === false) || isComponentModelType(component, 'layout')) {\n return 'inherit';\n }\n if (getComponentKey(component)) {\n return 'value';\n }\n return 'inherit';\n}\nexports.getModelType = getModelType;\nfunction getComponentAbsolutePath(component) {\n let paths = [component.path];\n while (component.parent) {\n component = component.parent;\n // We only need to do this for nested forms because they reset the data contexts for the children.\n if (isComponentModelType(component, 'dataObject')) {\n paths[paths.length - 1] = `data.${paths[paths.length - 1]}`;\n paths.push(component.path);\n }\n }\n return paths.reverse().join('.');\n}\nexports.getComponentAbsolutePath = getComponentAbsolutePath;\nfunction getComponentPath(component, path) {\n const key = getComponentKey(component);\n if (!key) {\n return path;\n }\n if (!path) {\n return key;\n }\n if (path.match(new RegExp(`${key}$`))) {\n return path;\n }\n return (getModelType(component) === 'inherit') ? `${path}.${key}` : path;\n}\nexports.getComponentPath = getComponentPath;\nfunction isComponentModelType(component, modelType) {\n return component.modelType === modelType || exports.MODEL_TYPES[modelType].includes(component.type);\n}\nexports.isComponentModelType = isComponentModelType;\nfunction isComponentNestedDataType(component) {\n return component.tree || isComponentModelType(component, 'array') ||\n isComponentModelType(component, 'dataObject') ||\n isComponentModelType(component, 'object') ||\n isComponentModelType(component, 'map');\n}\nexports.isComponentNestedDataType = isComponentNestedDataType;\nfunction componentPath(component, parentPath) {\n parentPath = component.parentPath || parentPath;\n const key = getComponentKey(component);\n if (!key) {\n // If the component does not have a key, then just always return the parent path.\n return parentPath || '';\n }\n return parentPath ? `${parentPath}.${key}` : key;\n}\nexports.componentPath = componentPath;\nconst componentChildPath = (component, parentPath, path) => {\n parentPath = component.parentPath || parentPath;\n path = path || componentPath(component, parentPath);\n // See if we are a nested component.\n if (component.components && Array.isArray(component.components)) {\n if (isComponentModelType(component, 'dataObject')) {\n return `${path}.data`;\n }\n if (isComponentModelType(component, 'array')) {\n return `${path}[0]`;\n }\n if (isComponentNestedDataType(component)) {\n return path;\n }\n return parentPath === undefined ? path : parentPath;\n }\n return path;\n};\nexports.componentChildPath = componentChildPath;\n// Async each component data.\nconst eachComponentDataAsync = (components_1, data_1, fn_1, ...args_1) => __awaiter(void 0, [components_1, data_1, fn_1, ...args_1], void 0, function* (components, data, fn, path = \"\", index, parent, includeAll = false) {\n if (!components || !data) {\n return;\n }\n return yield eachComponentAsync(components, (component, compPath, componentComponents, compParent) => __awaiter(void 0, void 0, void 0, function* () {\n const row = getContextualRowData(component, compPath, data);\n if ((yield fn(component, data, row, compPath, componentComponents, index, compParent)) === true) {\n return true;\n }\n if (isComponentNestedDataType(component)) {\n const value = (0, lodash_1.get)(data, compPath, data);\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n yield (0, exports.eachComponentDataAsync)(component.components, data, fn, `${compPath}[${i}]`, i, component, includeAll);\n }\n return true;\n }\n else if ((0, lodash_1.isEmpty)(row) && !includeAll) {\n // Tree components may submit empty objects; since we've already evaluated the parent tree/layout component, we won't worry about constituent elements\n return true;\n }\n if (isComponentModelType(component, 'dataObject')) {\n // No need to bother processing all the children data if there is no data for this form.\n if ((0, lodash_1.has)(data, component.path)) {\n // For nested forms, we need to reset the \"data\" and \"path\" objects for all of the children components, and then re-establish the data when it is done.\n const childPath = (0, exports.componentChildPath)(component, path, compPath);\n const childData = (0, lodash_1.get)(data, childPath, null);\n yield (0, exports.eachComponentDataAsync)(component.components, childData, fn, '', index, component, includeAll);\n (0, lodash_1.set)(data, childPath, childData);\n }\n }\n else {\n yield (0, exports.eachComponentDataAsync)(component.components, data, fn, (0, exports.componentChildPath)(component, path, compPath), index, component, includeAll);\n }\n return true;\n }\n else {\n return false;\n }\n }), true, path, parent);\n});\nexports.eachComponentDataAsync = eachComponentDataAsync;\nconst eachComponentData = (components, data, fn, path = \"\", index, parent, includeAll = false) => {\n if (!components || !data) {\n return;\n }\n return eachComponent(components, (component, compPath, componentComponents, compParent) => {\n const row = getContextualRowData(component, compPath, data);\n if (fn(component, data, row, compPath, componentComponents, index, compParent) === true) {\n return true;\n }\n if (isComponentNestedDataType(component)) {\n const value = (0, lodash_1.get)(data, compPath, data);\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n (0, exports.eachComponentData)(component.components, data, fn, `${compPath}[${i}]`, i, component, includeAll);\n }\n return true;\n }\n else if ((0, lodash_1.isEmpty)(row) && !includeAll) {\n // Tree components may submit empty objects; since we've already evaluated the parent tree/layout component, we won't worry about constituent elements\n return true;\n }\n if (isComponentModelType(component, 'dataObject')) {\n // No need to bother processing all the children data if there is no data for this form.\n if ((0, lodash_1.has)(data, component.path)) {\n // For nested forms, we need to reset the \"data\" and \"path\" objects for all of the children components, and then re-establish the data when it is done.\n const childPath = (0, exports.componentChildPath)(component, path, compPath);\n const childData = (0, lodash_1.get)(data, childPath, {});\n (0, exports.eachComponentData)(component.components, childData, fn, '', index, component, includeAll);\n (0, lodash_1.set)(data, childPath, childData);\n }\n }\n else {\n (0, exports.eachComponentData)(component.components, data, fn, (0, exports.componentChildPath)(component, path, compPath), index, component, includeAll);\n }\n return true;\n }\n else {\n return false;\n }\n }, true, path, parent);\n};\nexports.eachComponentData = eachComponentData;\nfunction getComponentKey(component) {\n if (component.type === 'checkbox' &&\n component.inputType === 'radio' &&\n component.name) {\n return component.name;\n }\n return component.key;\n}\nexports.getComponentKey = getComponentKey;\nfunction getContextualRowPath(component, path) {\n return path.replace(new RegExp(`\\.?${getComponentKey(component)}$`), '');\n}\nexports.getContextualRowPath = getContextualRowPath;\nfunction getContextualRowData(component, path, data) {\n const rowPath = getContextualRowPath(component, path);\n return rowPath ? (0, lodash_1.get)(data, rowPath, null) : data;\n}\nexports.getContextualRowData = getContextualRowData;\nfunction componentInfo(component) {\n const hasColumns = component.columns && Array.isArray(component.columns);\n const hasRows = component.rows && Array.isArray(component.rows);\n const hasComps = component.components && Array.isArray(component.components);\n return {\n hasColumns,\n hasRows,\n hasComps,\n iterable: hasColumns || hasRows || hasComps || isComponentModelType(component, 'content'),\n };\n}\nexports.componentInfo = componentInfo;\n/**\n * Iterate through each component within a form.\n *\n * @param {Object} components\n * The components to iterate.\n * @param {Function} fn\n * The iteration function to invoke for each component.\n * @param {Boolean} includeAll\n * Whether or not to include layout components.\n * @param {String} path\n * The current data path of the element. Example: data.user.firstName\n * @param {Object} parent\n * The parent object.\n */\nfunction eachComponent(components, fn, includeAll, path, parent) {\n if (!components)\n return;\n path = path || \"\";\n components.forEach((component) => {\n if (!component) {\n return;\n }\n const info = componentInfo(component);\n let noRecurse = false;\n // Keep track of parent references.\n if (parent) {\n // Ensure we don't create infinite JSON structures.\n Object.defineProperty(component, 'parent', {\n enumerable: false,\n writable: true,\n value: JSON.parse(JSON.stringify(parent))\n });\n Object.defineProperty(component.parent, 'parent', {\n enumerable: false,\n writable: true,\n value: parent.parent\n });\n Object.defineProperty(component.parent, 'path', {\n enumerable: false,\n writable: true,\n value: parent.path\n });\n delete component.parent.components;\n delete component.parent.componentMap;\n delete component.parent.columns;\n delete component.parent.rows;\n }\n Object.defineProperty(component, 'path', {\n enumerable: false,\n writable: true,\n value: componentPath(component, path)\n });\n if (includeAll || component.tree || !info.iterable) {\n noRecurse = fn(component, component.path, components, parent);\n }\n if (!noRecurse) {\n if (info.hasColumns) {\n component.columns.forEach((column) => eachComponent(column.components, fn, includeAll, path, parent ? component : null));\n }\n else if (info.hasRows) {\n component.rows.forEach((row) => {\n if (Array.isArray(row)) {\n row.forEach((column) => eachComponent(column.components, fn, includeAll, path, parent ? component : null));\n }\n });\n }\n else if (info.hasComps) {\n eachComponent(component.components, fn, includeAll, (0, exports.componentChildPath)(component, path), parent ? component : null);\n }\n }\n });\n}\nexports.eachComponent = eachComponent;\n// Async each component.\nfunction eachComponentAsync(components_2, fn_1) {\n return __awaiter(this, arguments, void 0, function* (components, fn, includeAll = false, path = \"\", parent) {\n var _a, _b;\n if (!components)\n return;\n for (let i = 0; i < components.length; i++) {\n if (!components[i]) {\n continue;\n }\n let component = components[i];\n const info = componentInfo(component);\n // Keep track of parent references.\n if (parent) {\n // Ensure we don't create infinite JSON structures.\n Object.defineProperty(component, 'parent', {\n enumerable: false,\n writable: true,\n value: JSON.parse(JSON.stringify(parent))\n });\n Object.defineProperty(component.parent, 'parent', {\n enumerable: false,\n writable: true,\n value: parent.parent\n });\n Object.defineProperty(component.parent, 'path', {\n enumerable: false,\n writable: true,\n value: parent.path\n });\n delete component.parent.components;\n delete component.parent.componentMap;\n delete component.parent.columns;\n delete component.parent.rows;\n }\n Object.defineProperty(component, 'path', {\n enumerable: false,\n writable: true,\n value: componentPath(component, path)\n });\n if (includeAll || component.tree || !info.iterable) {\n if (yield fn(component, component.path, components, parent)) {\n continue;\n }\n }\n if (info.hasColumns) {\n for (let j = 0; j < component.columns.length; j++) {\n yield eachComponentAsync((_a = component.columns[j]) === null || _a === void 0 ? void 0 : _a.components, fn, includeAll, path, parent ? component : null);\n }\n }\n else if (info.hasRows) {\n for (let j = 0; j < component.rows.length; j++) {\n let row = component.rows[j];\n if (Array.isArray(row)) {\n for (let k = 0; k < row.length; k++) {\n yield eachComponentAsync((_b = row[k]) === null || _b === void 0 ? void 0 : _b.components, fn, includeAll, path, parent ? component : null);\n }\n }\n }\n }\n else if (info.hasComps) {\n yield eachComponentAsync(component.components, fn, includeAll, (0, exports.componentChildPath)(component, path), parent ? component : null);\n }\n }\n });\n}\nexports.eachComponentAsync = eachComponentAsync;\n// Provided components, data, and a key, this will return the components data.\nfunction getComponentData(components, data, path) {\n const compData = { component: null, data: null };\n (0, exports.eachComponentData)(components, data, (component, data, row, compPath) => {\n if (compPath === path) {\n compData.component = component;\n compData.data = row;\n return true;\n }\n });\n return compData;\n}\nexports.getComponentData = getComponentData;\nfunction getComponentActualValue(component, compPath, data, row) {\n var _a, _b;\n // The compPath here will NOT contain the indexes for DataGrids and EditGrids.\n //\n // a[0].b[2].c[3].d\n //\n // Because of this, we will need to determine our parent component path (not data path),\n // and find the \"row\" based comp path.\n //\n // a[0].b[2].c[3].d => a.b.c.d\n //\n if ((_a = component.parent) === null || _a === void 0 ? void 0 : _a.path) {\n const parentCompPath = (_b = component.parent) === null || _b === void 0 ? void 0 : _b.path.replace(/\\[[0-9]+\\]/g, '');\n compPath = compPath.replace(parentCompPath, '');\n compPath = (0, lodash_1.trim)(compPath, '. ');\n }\n let value = null;\n if (row) {\n value = (0, lodash_1.get)(row, compPath);\n }\n if (data && (0, lodash_1.isNil)(value)) {\n value = (0, lodash_1.get)(data, compPath);\n }\n if ((0, lodash_1.isNil)(value) || ((0, lodash_1.isObject)(value) && (0, lodash_1.isEmpty)(value))) {\n value = '';\n }\n return value;\n}\nexports.getComponentActualValue = getComponentActualValue;\n/**\n * Determine if a component is a layout component or not.\n *\n * @param {Object} component\n * The component to check.\n *\n * @returns {Boolean}\n * Whether or not the component is a layout component.\n */\nfunction isLayoutComponent(component) {\n return Boolean((component.columns && Array.isArray(component.columns)) ||\n (component.rows && Array.isArray(component.rows)) ||\n (component.components && Array.isArray(component.components)));\n}\nexports.isLayoutComponent = isLayoutComponent;\n/**\n * Matches if a component matches the query.\n *\n * @param component\n * @param query\n * @return {boolean}\n */\nfunction matchComponent(component, query) {\n if ((0, lodash_1.isString)(query)) {\n return (component.key === query) || (component.path === query);\n }\n else {\n let matches = false;\n (0, lodash_1.forOwn)(query, (value, key) => {\n matches = ((0, lodash_1.get)(component, key) === value);\n if (!matches) {\n return false;\n }\n });\n return matches;\n }\n}\nexports.matchComponent = matchComponent;\n/**\n * Get a component by its key\n *\n * @param {Object} components - The components to iterate.\n * @param {String|Object} key - The key of the component to get, or a query of the component to search.\n * @returns {Component} - The component that matches the given key, or undefined if not found.\n */\nfunction getComponent(components, key, includeAll) {\n let result;\n eachComponent(components, (component, path) => {\n if ((path === key) || (component.path === key)) {\n result = component;\n return true;\n }\n }, includeAll);\n return result;\n}\nexports.getComponent = getComponent;\n/**\n * Finds a component provided a query of properties of that component.\n *\n * @param components\n * @param query\n * @return {*}\n */\nfunction searchComponents(components, query) {\n const results = [];\n eachComponent(components, (component) => {\n if (matchComponent(component, query)) {\n results.push(component);\n }\n }, true);\n return results;\n}\nexports.searchComponents = searchComponents;\n/**\n * Remove a component by path.\n *\n * @param components\n * @param path\n */\nfunction removeComponent(components, path) {\n // Using _.unset() leave a null value. Use Array splice instead.\n // @ts-ignore\n var index = path.pop();\n if (path.length !== 0) {\n components = (0, lodash_1.get)(components, path);\n }\n components.splice(index, 1);\n}\nexports.removeComponent = removeComponent;\n/**\n * Returns if this component has a conditional statement.\n *\n * @param component - The component JSON schema.\n *\n * @returns {boolean} - TRUE - This component has a conditional, FALSE - No conditional provided.\n */\nfunction hasCondition(component) {\n return Boolean((component.customConditional) ||\n (component.conditional && (component.conditional.when ||\n component.conditional.json ||\n component.conditional.conjunction)));\n}\nexports.hasCondition = hasCondition;\n/**\n * Extension of standard #parseFloat(value) function, that also clears input string.\n *\n * @param {any} value\n * The value to parse.\n *\n * @returns {Number}\n * Parsed value.\n */\nfunction parseFloatExt(value) {\n return parseFloat((0, lodash_1.isString)(value)\n ? value.replace(/[^\\de.+-]/gi, '')\n : value);\n}\nexports.parseFloatExt = parseFloatExt;\n/**\n * Formats provided value in way how Currency component uses it.\n *\n * @param {any} value\n * The value to format.\n *\n * @returns {String}\n * Value formatted for Currency component.\n */\nfunction formatAsCurrency(value) {\n const parsedValue = parseFloatExt(value);\n if (isNaN(parsedValue)) {\n return '';\n }\n const parts = (0, lodash_1.round)(parsedValue, 2)\n .toString()\n .split('.');\n parts[0] = (0, lodash_1.chunk)(Array.from(parts[0]).reverse(), 3)\n .reverse()\n .map((part) => part\n .reverse()\n .join(''))\n .join(',');\n parts[1] = (0, lodash_1.pad)(parts[1], 2, '0');\n return parts.join('.');\n}\nexports.formatAsCurrency = formatAsCurrency;\n/**\n * Escapes RegEx characters in provided String value.\n *\n * @param {String} value\n * String for escaping RegEx characters.\n * @returns {string}\n * String with escaped RegEx characters.\n */\nfunction escapeRegExCharacters(value) {\n return value.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, '\\\\$&');\n}\nexports.escapeRegExCharacters = escapeRegExCharacters;\n/**\n * Get the value for a component key, in the given submission.\n *\n * @param {Object} submission\n * A submission object to search.\n * @param {String} key\n * A for components API key to search for.\n */\nfunction getValue(submission, key) {\n const search = (data) => {\n if ((0, lodash_1.isPlainObject)(data)) {\n if ((0, lodash_1.has)(data, key)) {\n return (0, lodash_1.get)(data, key);\n }\n let value = null;\n (0, lodash_1.forOwn)(data, (prop) => {\n const result = search(prop);\n if (!(0, lodash_1.isNil)(result)) {\n value = result;\n return false;\n }\n });\n return value;\n }\n else {\n return null;\n }\n };\n return search(submission.data);\n}\nexports.getValue = getValue;\n/**\n * Iterate over all components in a form and get string values for translation.\n * @param form\n */\nfunction getStrings(form) {\n const properties = ['label', 'title', 'legend', 'tooltip', 'description', 'placeholder', 'prefix', 'suffix', 'errorLabel', 'content', 'html'];\n const strings = [];\n eachComponent(form.components, (component) => {\n properties.forEach(property => {\n if (component.hasOwnProperty(property) && component[property]) {\n strings.push({\n key: component.key,\n type: component.type,\n property,\n string: component[property]\n });\n }\n });\n if ((!component.dataSrc || component.dataSrc === 'values') && component.hasOwnProperty('values') && Array.isArray(component.values) && component.values.length) {\n component.values.forEach((value, index) => {\n strings.push({\n key: component.key,\n property: `value[${index}].label`,\n string: component.values[index].label\n });\n });\n }\n // Hard coded values from Day component\n if (component.type === 'day') {\n [\n 'day',\n 'month',\n 'year',\n 'Day',\n 'Month',\n 'Year',\n 'january',\n 'february',\n 'march',\n 'april',\n 'may',\n 'june',\n 'july',\n 'august',\n 'september',\n 'october',\n 'november',\n 'december'\n ].forEach(string => {\n strings.push({\n key: component.key,\n property: 'day',\n string,\n });\n });\n if (component.fields.day.placeholder) {\n strings.push({\n key: component.key,\n property: 'fields.day.placeholder',\n string: component.fields.day.placeholder,\n });\n }\n if (component.fields.month.placeholder) {\n strings.push({\n key: component.key,\n property: 'fields.month.placeholder',\n string: component.fields.month.placeholder,\n });\n }\n if (component.fields.year.placeholder) {\n strings.push({\n key: component.key,\n property: 'fields.year.placeholder',\n string: component.fields.year.placeholder,\n });\n }\n }\n if (component.type === 'editgrid') {\n const string = component.addAnother || 'Add Another';\n if (component.addAnother) {\n strings.push({\n key: component.key,\n property: 'addAnother',\n string,\n });\n }\n }\n if (component.type === 'select') {\n [\n 'loading...',\n 'Type to search'\n ].forEach(string => {\n strings.push({\n key: component.key,\n property: 'select',\n string,\n });\n });\n }\n }, true);\n return strings;\n}\nexports.getStrings = getStrings;\n// ?????????????????????????\n// questionable section\nfunction generateFormChange(type, data) {\n let change;\n switch (type) {\n case 'add':\n change = {\n op: 'add',\n key: data.component.key,\n container: data.parent.key, // Parent component\n path: data.path, // Path to container within parent component.\n index: data.index, // Index of component in parent container.\n component: data.component\n };\n break;\n case 'edit':\n change = {\n op: 'edit',\n key: data.originalComponent.key,\n patches: (0, fast_json_patch_1.compare)(data.originalComponent, data.component)\n };\n // Don't save if nothing changed.\n if (!change.patches.length) {\n change = null;\n }\n break;\n case 'remove':\n change = {\n op: 'remove',\n key: data.component.key,\n };\n break;\n }\n return change;\n}\nexports.generateFormChange = generateFormChange;\nfunction applyFormChanges(form, changes) {\n const failed = [];\n changes.forEach(function (change) {\n var found = false;\n switch (change.op) {\n case 'add':\n var newComponent = change.component;\n // Find the container to set the component in.\n findComponent(form.components, change.container, null, function (parent) {\n if (!change.container) {\n parent = form;\n }\n // A move will first run an add so remove any existing components with matching key before inserting.\n findComponent(form.components, change.key, null, function (component, path) {\n // If found, use the existing component. (If someone else edited it, the changes would be here)\n newComponent = component;\n removeComponent(form.components, path);\n });\n found = true;\n var container = (0, lodash_1.get)(parent, change.path);\n container.splice(change.index, 0, newComponent);\n });\n break;\n case 'remove':\n findComponent(form.components, change.key, null, function (component, path) {\n found = true;\n const oldComponent = (0, lodash_1.get)(form.components, path);\n if (oldComponent.key !== component.key) {\n path.pop();\n }\n removeComponent(form.components, path);\n });\n break;\n case 'edit':\n findComponent(form.components, change.key, null, function (component, path) {\n found = true;\n try {\n const oldComponent = (0, lodash_1.get)(form.components, path);\n const newComponent = (0, fast_json_patch_1.applyPatch)(component, change.patches).newDocument;\n if (oldComponent.key !== newComponent.key) {\n path.pop();\n }\n (0, lodash_1.set)(form.components, path, newComponent);\n }\n catch (err) {\n failed.push(change);\n }\n });\n break;\n case 'move':\n break;\n }\n if (!found) {\n failed.push(change);\n }\n });\n return {\n form,\n failed\n };\n}\nexports.applyFormChanges = applyFormChanges;\n/**\n* This function will find a component in a form and return the component AND THE PATH to the component in the form.\n* Path to the component is stored as an array of nested components and their indexes.The Path is being filled recursively\n* when you iterating through the nested structure.\n* If the component is not found the callback won't be called and function won't return anything.\n*\n* @param components\n* @param key\n* @param fn\n* @param path\n* @returns {*}\n*/\nfunction findComponent(components, key, path, fn) {\n if (!components)\n return;\n path = path || [];\n if (!key) {\n return fn(components);\n }\n components.forEach(function (component, index) {\n var newPath = path.slice();\n // Add an index of the component it iterates through in nested structure\n newPath.push(index);\n if (!component)\n return;\n if (component.hasOwnProperty('columns') && Array.isArray(component.columns)) {\n newPath.push('columns');\n component.columns.forEach(function (column, index) {\n var colPath = newPath.slice();\n colPath.push(index);\n colPath.push('components');\n findComponent(column.components, key, colPath, fn);\n });\n }\n if (component.hasOwnProperty('rows') && Array.isArray(component.rows)) {\n newPath.push('rows');\n component.rows.forEach(function (row, index) {\n var rowPath = newPath.slice();\n rowPath.push(index);\n row.forEach(function (column, index) {\n var colPath = rowPath.slice();\n colPath.push(index);\n colPath.push('components');\n findComponent(column.components, key, colPath, fn);\n });\n });\n }\n if (component.hasOwnProperty('components') && Array.isArray(component.components)) {\n newPath.push('components');\n findComponent(component.components, key, newPath, fn);\n }\n if (component.key === key) {\n //Final callback if the component is found\n fn(component, newPath, components);\n }\n });\n}\nexports.findComponent = findComponent;\nconst isCheckboxComponent = (component) => component.type === 'checkbox';\nconst isDataGridComponent = (component) => component.type === 'datagrid';\nconst isEditGridComponent = (component) => component.type === 'editgrid';\nconst isDataTableComponent = (component) => component.type === 'datatable';\nconst hasChildComponents = (component) => component.components != null;\nconst isDateTimeComponent = (component) => component.type === 'datetime';\nconst isSelectBoxesComponent = (component) => component.type === 'selectboxes';\nconst isTextAreaComponent = (component) => component.type === 'textarea';\nconst isTextFieldComponent = (component) => component.type === 'textfield';\nfunction getEmptyValue(component) {\n switch (component.type) {\n case 'textarea':\n case 'textfield':\n case 'time':\n case 'datetime':\n case 'day':\n return '';\n case 'datagrid':\n case 'editgrid':\n return [];\n default:\n return null;\n }\n}\nexports.getEmptyValue = getEmptyValue;\nconst replaceBlanks = (value) => {\n const nbsp = '<p>&nbsp;</p>';\n const br = '<p><br></p>';\n const brNbsp = '<p><br>&nbsp;</p>';\n const regExp = new RegExp(`^${nbsp}|${nbsp}$|^${br}|${br}$|^${brNbsp}|${brNbsp}$`, 'g');\n return typeof value === 'string' ? value.replace(regExp, '').trim() : value;\n};\nfunction trimBlanks(value) {\n if (!value) {\n return value;\n }\n if (Array.isArray(value)) {\n value = value.map((val) => replaceBlanks(val));\n }\n else {\n value = replaceBlanks(value);\n }\n return value;\n}\nfunction isValueEmpty(component, value) {\n const compValueIsEmptyArray = ((0, lodash_1.isArray)(value) && value.length === 1) ? (0, lodash_1.isEqual)(value[0], getEmptyValue(component)) : false;\n return value == null || value === '' || ((0, lodash_1.isArray)(value) && value.length === 0) || compValueIsEmptyArray;\n}\nfunction isComponentDataEmpty(component, data, path) {\n var _a;\n const value = (0, lodash_1.get)(data, path);\n if (isCheckboxComponent(component)) {\n return isValueEmpty(component, value) || value === false;\n }\n else if (isDataGridComponent(component) || isEditGridComponent(component) || isDataTableComponent(component) || hasChildComponents(component)) {\n if ((_a = component.components) === null || _a === void 0 ? void 0 : _a.length) {\n let childrenEmpty = true;\n // wrap component in an array to let eachComponentData handle introspection to child components (e.g. this will be different\n // for data grids versus nested forms, etc.)\n (0, exports.eachComponentData)([component], data, (thisComponent, data, row, path, components, index) => {\n if (component.key === thisComponent.key)\n return;\n if (!isComponentDataEmpty(thisComponent, data, path)) {\n childrenEmpty = false;\n }\n });\n return isValueEmpty(component, value) || childrenEmpty;\n }\n return isValueEmpty(component, value);\n }\n else if (isDateTimeComponent(component)) {\n return isValueEmpty(component, value) || value.toString() === 'Invalid date';\n }\n else if (isSelectBoxesComponent(component)) {\n let selectBoxEmpty = true;\n for (const key in value) {\n if (value[key]) {\n selectBoxEmpty = false;\n break;\n }\n }\n return isValueEmpty(component, value) || selectBoxEmpty;\n }\n else if (isTextAreaComponent(component)) {\n const isPlain = !component.wysiwyg && !component.editor;\n return isPlain ? typeof value === 'string' ? isValueEmpty(component, value.trim()) : isValueEmpty(component, value) : isValueEmpty(component, trimBlanks(value));\n }\n else if (isTextFieldComponent(component)) {\n if (component.allowMultipleMasks && !!component.inputMasks && !!component.inputMasks.length) {\n return isValueEmpty(component, value) || (component.multiple ? value.length === 0 : (!value.maskName || !value.value));\n }\n return isValueEmpty(component, value === null || value === void 0 ? void 0 : value.toString().trim());\n }\n return isValueEmpty(component, value);\n}\nexports.isComponentDataEmpty = isComponentDataEmpty;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/utils/formUtil.js?");
1634
1634
 
1635
1635
  /***/ }),
1636
1636
 
@@ -1942,76 +1942,6 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
1942
1942
 
1943
1943
  /***/ }),
1944
1944
 
1945
- /***/ "./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/dependencyLibs/inputmask.dependencyLib.js":
1946
- /*!*******************************************************************************************************************!*\
1947
- !*** ./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/dependencyLibs/inputmask.dependencyLib.js ***!
1948
- \*******************************************************************************************************************/
1949
- /***/ (function(module, exports, __webpack_require__) {
1950
-
1951
- eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n* dependencyLibs/inputmask.dependencyLib.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(/*! ../global/window */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/global/window.js\") ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(function(window) {\n var document = window.document;\n function indexOf(list, elem) {\n var i = 0, len = list.length;\n for (;i < len; i++) {\n if (list[i] === elem) {\n return i;\n }\n }\n return -1;\n }\n function isWindow(obj) {\n return obj != null && obj === obj.window;\n }\n function isArraylike(obj) {\n var length = \"length\" in obj && obj.length, ltype = typeof obj;\n if (ltype === \"function\" || isWindow(obj)) {\n return false;\n }\n if (obj.nodeType === 1 && length) {\n return true;\n }\n return ltype === \"array\" || length === 0 || typeof length === \"number\" && length > 0 && length - 1 in obj;\n }\n function isValidElement(elem) {\n return elem instanceof Element;\n }\n function DependencyLib(elem) {\n if (elem instanceof DependencyLib) {\n return elem;\n }\n if (!(this instanceof DependencyLib)) {\n return new DependencyLib(elem);\n }\n if (elem !== undefined && elem !== null && elem !== window) {\n this[0] = elem.nodeName ? elem : elem[0] !== undefined && elem[0].nodeName ? elem[0] : document.querySelector(elem);\n if (this[0] !== undefined && this[0] !== null) {\n this[0].eventRegistry = this[0].eventRegistry || {};\n }\n }\n }\n function getWindow(elem) {\n return isWindow(elem) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false;\n }\n DependencyLib.prototype = {\n on: function(events, handler) {\n if (isValidElement(this[0])) {\n var eventRegistry = this[0].eventRegistry, elem = this[0];\n var addEvent = function(ev, namespace) {\n if (elem.addEventListener) {\n elem.addEventListener(ev, handler, false);\n } else if (elem.attachEvent) {\n elem.attachEvent(\"on\" + ev, handler);\n }\n eventRegistry[ev] = eventRegistry[ev] || {};\n eventRegistry[ev][namespace] = eventRegistry[ev][namespace] || [];\n eventRegistry[ev][namespace].push(handler);\n };\n var _events = events.split(\" \");\n for (var endx = 0; endx < _events.length; endx++) {\n var nsEvent = _events[endx].split(\".\"), ev = nsEvent[0], namespace = nsEvent[1] || \"global\";\n addEvent(ev, namespace);\n }\n }\n return this;\n },\n off: function(events, handler) {\n if (isValidElement(this[0])) {\n var eventRegistry = this[0].eventRegistry, elem = this[0];\n var removeEvent = function(ev, namespace, handler) {\n if (ev in eventRegistry === true) {\n if (elem.removeEventListener) {\n elem.removeEventListener(ev, handler, false);\n } else if (elem.detachEvent) {\n elem.detachEvent(\"on\" + ev, handler);\n }\n if (namespace === \"global\") {\n for (var nmsp in eventRegistry[ev]) {\n eventRegistry[ev][nmsp].splice(eventRegistry[ev][nmsp].indexOf(handler), 1);\n }\n } else {\n eventRegistry[ev][namespace].splice(eventRegistry[ev][namespace].indexOf(handler), 1);\n }\n }\n };\n var resolveNamespace = function(ev, namespace) {\n var evts = [], hndx, hndL;\n if (ev.length > 0) {\n if (handler === undefined) {\n for (hndx = 0, hndL = eventRegistry[ev][namespace].length; hndx < hndL; hndx++) {\n evts.push({\n ev: ev,\n namespace: namespace && namespace.length > 0 ? namespace : \"global\",\n handler: eventRegistry[ev][namespace][hndx]\n });\n }\n } else {\n evts.push({\n ev: ev,\n namespace: namespace && namespace.length > 0 ? namespace : \"global\",\n handler: handler\n });\n }\n } else if (namespace.length > 0) {\n for (var evNdx in eventRegistry) {\n for (var nmsp in eventRegistry[evNdx]) {\n if (nmsp === namespace) {\n if (handler === undefined) {\n for (hndx = 0, hndL = eventRegistry[evNdx][nmsp].length; hndx < hndL; hndx++) {\n evts.push({\n ev: evNdx,\n namespace: nmsp,\n handler: eventRegistry[evNdx][nmsp][hndx]\n });\n }\n } else {\n evts.push({\n ev: evNdx,\n namespace: nmsp,\n handler: handler\n });\n }\n }\n }\n }\n }\n return evts;\n };\n var _events = events.split(\" \");\n for (var endx = 0; endx < _events.length; endx++) {\n var nsEvent = _events[endx].split(\".\"), offEvents = resolveNamespace(nsEvent[0], nsEvent[1]);\n for (var i = 0, offEventsL = offEvents.length; i < offEventsL; i++) {\n removeEvent(offEvents[i].ev, offEvents[i].namespace, offEvents[i].handler);\n }\n }\n }\n return this;\n },\n trigger: function(events) {\n if (isValidElement(this[0])) {\n var eventRegistry = this[0].eventRegistry, elem = this[0];\n var _events = typeof events === \"string\" ? events.split(\" \") : [ events.type ];\n for (var endx = 0; endx < _events.length; endx++) {\n var nsEvent = _events[endx].split(\".\"), ev = nsEvent[0], namespace = nsEvent[1] || \"global\";\n if (document !== undefined && namespace === \"global\") {\n var evnt, i, params = {\n bubbles: true,\n cancelable: true,\n detail: arguments[1]\n };\n if (document.createEvent) {\n try {\n evnt = new CustomEvent(ev, params);\n } catch (e) {\n evnt = document.createEvent(\"CustomEvent\");\n evnt.initCustomEvent(ev, params.bubbles, params.cancelable, params.detail);\n }\n if (events.type) DependencyLib.extend(evnt, events);\n elem.dispatchEvent(evnt);\n } else {\n evnt = document.createEventObject();\n evnt.eventType = ev;\n evnt.detail = arguments[1];\n if (events.type) DependencyLib.extend(evnt, events);\n elem.fireEvent(\"on\" + evnt.eventType, evnt);\n }\n } else if (eventRegistry[ev] !== undefined) {\n arguments[0] = arguments[0].type ? arguments[0] : DependencyLib.Event(arguments[0]);\n if (namespace === \"global\") {\n for (var nmsp in eventRegistry[ev]) {\n for (i = 0; i < eventRegistry[ev][nmsp].length; i++) {\n eventRegistry[ev][nmsp][i].apply(elem, arguments);\n }\n }\n } else {\n for (i = 0; i < eventRegistry[ev][namespace].length; i++) {\n eventRegistry[ev][namespace][i].apply(elem, arguments);\n }\n }\n }\n }\n }\n return this;\n }\n };\n DependencyLib.isFunction = function(obj) {\n return typeof obj === \"function\";\n };\n DependencyLib.noop = function() {};\n DependencyLib.isArray = Array.isArray;\n DependencyLib.inArray = function(elem, arr, i) {\n return arr == null ? -1 : indexOf(arr, elem, i);\n };\n DependencyLib.valHooks = undefined;\n DependencyLib.isPlainObject = function(obj) {\n if (typeof obj !== \"object\" || obj.nodeType || isWindow(obj)) {\n return false;\n }\n if (obj.constructor && !Object.hasOwnProperty.call(obj.constructor.prototype, \"isPrototypeOf\")) {\n return false;\n }\n return true;\n };\n DependencyLib.extend = function() {\n var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false;\n if (typeof target === \"boolean\") {\n deep = target;\n target = arguments[i] || {};\n i++;\n }\n if (typeof target !== \"object\" && !DependencyLib.isFunction(target)) {\n target = {};\n }\n if (i === length) {\n target = this;\n i--;\n }\n for (;i < length; i++) {\n if ((options = arguments[i]) != null) {\n for (name in options) {\n src = target[name];\n copy = options[name];\n if (target === copy) {\n continue;\n }\n if (deep && copy && (DependencyLib.isPlainObject(copy) || (copyIsArray = DependencyLib.isArray(copy)))) {\n if (copyIsArray) {\n copyIsArray = false;\n clone = src && DependencyLib.isArray(src) ? src : [];\n } else {\n clone = src && DependencyLib.isPlainObject(src) ? src : {};\n }\n target[name] = DependencyLib.extend(deep, clone, copy);\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n return target;\n };\n DependencyLib.each = function(obj, callback) {\n var value, i = 0;\n if (isArraylike(obj)) {\n for (var length = obj.length; i < length; i++) {\n value = callback.call(obj[i], i, obj[i]);\n if (value === false) {\n break;\n }\n }\n } else {\n for (i in obj) {\n value = callback.call(obj[i], i, obj[i]);\n if (value === false) {\n break;\n }\n }\n }\n return obj;\n };\n DependencyLib.data = function(owner, key, value) {\n if (value === undefined) {\n return owner.__data ? owner.__data[key] : null;\n } else {\n owner.__data = owner.__data || {};\n owner.__data[key] = value;\n }\n };\n if (typeof window.CustomEvent === \"function\") {\n DependencyLib.Event = window.CustomEvent;\n } else {\n DependencyLib.Event = function(event, params) {\n params = params || {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n var evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n DependencyLib.Event.prototype = window.Event.prototype;\n }\n return DependencyLib;\n});\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/dependencyLibs/inputmask.dependencyLib.js?");
1952
-
1953
- /***/ }),
1954
-
1955
- /***/ "./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/global/window.js":
1956
- /*!******************************************************************************************!*\
1957
- !*** ./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/global/window.js ***!
1958
- \******************************************************************************************/
1959
- /***/ (function(module, exports, __webpack_require__) {
1960
-
1961
- eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*!\n* global/window.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\nif (true) !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n return typeof window !== \"undefined\" ? window : new (eval(\"require('jsdom').JSDOM\"))(\"\").window;\n}).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); else {}\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/global/window.js?");
1962
-
1963
- /***/ }),
1964
-
1965
- /***/ "./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.date.extensions.js":
1966
- /*!******************************************************************************************************!*\
1967
- !*** ./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.date.extensions.js ***!
1968
- \******************************************************************************************************/
1969
- /***/ (function(module, exports, __webpack_require__) {
1970
-
1971
- eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n* inputmask.date.extensions.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(/*! ./inputmask */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js\") ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(function(Inputmask) {\n var $ = Inputmask.dependencyLib;\n var formatCode = {\n d: [ \"[1-9]|[12][0-9]|3[01]\", Date.prototype.setDate, \"day\", Date.prototype.getDate ],\n dd: [ \"0[1-9]|[12][0-9]|3[01]\", Date.prototype.setDate, \"day\", function() {\n return pad(Date.prototype.getDate.call(this), 2);\n } ],\n ddd: [ \"\" ],\n dddd: [ \"\" ],\n m: [ \"[1-9]|1[012]\", Date.prototype.setMonth, \"month\", function() {\n return Date.prototype.getMonth.call(this) + 1;\n } ],\n mm: [ \"0[1-9]|1[012]\", Date.prototype.setMonth, \"month\", function() {\n return pad(Date.prototype.getMonth.call(this) + 1, 2);\n } ],\n mmm: [ \"\" ],\n mmmm: [ \"\" ],\n yy: [ \"[0-9]{2}\", Date.prototype.setFullYear, \"year\", function() {\n return pad(Date.prototype.getFullYear.call(this), 2);\n } ],\n yyyy: [ \"[0-9]{4}\", Date.prototype.setFullYear, \"year\", function() {\n return pad(Date.prototype.getFullYear.call(this), 4);\n } ],\n h: [ \"[1-9]|1[0-2]\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n hh: [ \"0[1-9]|1[0-2]\", Date.prototype.setHours, \"hours\", function() {\n return pad(Date.prototype.getHours.call(this), 2);\n } ],\n hhh: [ \"[0-9]+\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n H: [ \"1?[0-9]|2[0-3]\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n HH: [ \"0[0-9]|1[0-9]|2[0-3]\", Date.prototype.setHours, \"hours\", function() {\n return pad(Date.prototype.getHours.call(this), 2);\n } ],\n HHH: [ \"[0-9]+\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n M: [ \"[1-5]?[0-9]\", Date.prototype.setMinutes, \"minutes\", Date.prototype.getMinutes ],\n MM: [ \"0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]\", Date.prototype.setMinutes, \"minutes\", function() {\n return pad(Date.prototype.getMinutes.call(this), 2);\n } ],\n ss: [ \"[0-5][0-9]\", Date.prototype.setSeconds, \"seconds\", function() {\n return pad(Date.prototype.getSeconds.call(this), 2);\n } ],\n l: [ \"[0-9]{3}\", Date.prototype.setMilliseconds, \"milliseconds\", function() {\n return pad(Date.prototype.getMilliseconds.call(this), 3);\n } ],\n L: [ \"[0-9]{2}\", Date.prototype.setMilliseconds, \"milliseconds\", function() {\n return pad(Date.prototype.getMilliseconds.call(this), 2);\n } ],\n t: [ \"[ap]\" ],\n tt: [ \"[ap]m\" ],\n T: [ \"[AP]\" ],\n TT: [ \"[AP]M\" ],\n Z: [ \"\" ],\n o: [ \"\" ],\n S: [ \"\" ]\n }, formatAlias = {\n isoDate: \"yyyy-mm-dd\",\n isoTime: \"HH:MM:ss\",\n isoDateTime: \"yyyy-mm-dd'T'HH:MM:ss\",\n isoUtcDateTime: \"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'\"\n };\n function getTokenizer(opts) {\n if (!opts.tokenizer) {\n var tokens = [];\n for (var ndx in formatCode) {\n if (tokens.indexOf(ndx[0]) === -1) tokens.push(ndx[0]);\n }\n opts.tokenizer = \"(\" + tokens.join(\"+|\") + \")+?|.\";\n opts.tokenizer = new RegExp(opts.tokenizer, \"g\");\n }\n return opts.tokenizer;\n }\n function isValidDate(dateParts, currentResult) {\n return !isFinite(dateParts.rawday) || dateParts.day == \"29\" && !isFinite(dateParts.rawyear) || new Date(dateParts.date.getFullYear(), isFinite(dateParts.rawmonth) ? dateParts.month : dateParts.date.getMonth() + 1, 0).getDate() >= dateParts.day ? currentResult : false;\n }\n function isDateInRange(dateParts, opts) {\n var result = true;\n if (opts.min) {\n if (dateParts[\"rawyear\"]) {\n var rawYear = dateParts[\"rawyear\"].replace(/[^0-9]/g, \"\"), minYear = opts.min.year.substr(0, rawYear.length);\n result = minYear <= rawYear;\n }\n if (dateParts[\"year\"] === dateParts[\"rawyear\"]) {\n if (opts.min.date.getTime() === opts.min.date.getTime()) {\n result = opts.min.date.getTime() <= dateParts.date.getTime();\n }\n }\n }\n if (result && opts.max && opts.max.date.getTime() === opts.max.date.getTime()) {\n result = opts.max.date.getTime() >= dateParts.date.getTime();\n }\n return result;\n }\n function parse(format, dateObjValue, opts, raw) {\n var mask = \"\", match;\n while (match = getTokenizer(opts).exec(format)) {\n if (dateObjValue === undefined) {\n if (formatCode[match[0]]) {\n mask += \"(\" + formatCode[match[0]][0] + \")\";\n } else {\n switch (match[0]) {\n case \"[\":\n mask += \"(\";\n break;\n\n case \"]\":\n mask += \")?\";\n break;\n\n default:\n mask += Inputmask.escapeRegex(match[0]);\n }\n }\n } else {\n if (formatCode[match[0]]) {\n if (raw !== true && formatCode[match[0]][3]) {\n var getFn = formatCode[match[0]][3];\n mask += getFn.call(dateObjValue.date);\n } else if (formatCode[match[0]][2]) mask += dateObjValue[\"raw\" + formatCode[match[0]][2]]; else mask += match[0];\n } else mask += match[0];\n }\n }\n return mask;\n }\n function pad(val, len) {\n val = String(val);\n len = len || 2;\n while (val.length < len) val = \"0\" + val;\n return val;\n }\n function analyseMask(maskString, format, opts) {\n var dateObj = {\n date: new Date(1, 0, 1)\n }, targetProp, mask = maskString, match, dateOperation, targetValidator;\n function extendProperty(value) {\n var correctedValue = value.replace(/[^0-9]/g, \"0\");\n if (correctedValue != value) {\n var enteredPart = value.replace(/[^0-9]/g, \"\"), min = (opts.min && opts.min[targetProp] || value).toString(), max = (opts.max && opts.max[targetProp] || value).toString();\n correctedValue = enteredPart + (enteredPart < min.slice(0, enteredPart.length) ? min.slice(enteredPart.length) : enteredPart > max.slice(0, enteredPart.length) ? max.slice(enteredPart.length) : correctedValue.toString().slice(enteredPart.length));\n }\n return correctedValue;\n }\n function setValue(dateObj, value, opts) {\n dateObj[targetProp] = extendProperty(value);\n dateObj[\"raw\" + targetProp] = value;\n if (dateOperation !== undefined) dateOperation.call(dateObj.date, targetProp == \"month\" ? parseInt(dateObj[targetProp]) - 1 : dateObj[targetProp]);\n }\n if (typeof mask === \"string\") {\n while (match = getTokenizer(opts).exec(format)) {\n var value = mask.slice(0, match[0].length);\n if (formatCode.hasOwnProperty(match[0])) {\n targetValidator = formatCode[match[0]][0];\n targetProp = formatCode[match[0]][2];\n dateOperation = formatCode[match[0]][1];\n setValue(dateObj, value, opts);\n }\n mask = mask.slice(value.length);\n }\n return dateObj;\n } else if (mask && typeof mask === \"object\" && mask.hasOwnProperty(\"date\")) {\n return mask;\n }\n return undefined;\n }\n Inputmask.extendAliases({\n datetime: {\n mask: function(opts) {\n formatCode.S = opts.i18n.ordinalSuffix.join(\"|\");\n opts.inputFormat = formatAlias[opts.inputFormat] || opts.inputFormat;\n opts.displayFormat = formatAlias[opts.displayFormat] || opts.displayFormat || opts.inputFormat;\n opts.outputFormat = formatAlias[opts.outputFormat] || opts.outputFormat || opts.inputFormat;\n opts.placeholder = opts.placeholder !== \"\" ? opts.placeholder : opts.inputFormat.replace(/[\\[\\]]/, \"\");\n opts.regex = parse(opts.inputFormat, undefined, opts);\n return null;\n },\n placeholder: \"\",\n inputFormat: \"isoDateTime\",\n displayFormat: undefined,\n outputFormat: undefined,\n min: null,\n max: null,\n i18n: {\n dayNames: [ \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\" ],\n monthNames: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\", \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ],\n ordinalSuffix: [ \"st\", \"nd\", \"rd\", \"th\" ]\n },\n postValidation: function(buffer, pos, currentResult, opts) {\n opts.min = analyseMask(opts.min, opts.inputFormat, opts);\n opts.max = analyseMask(opts.max, opts.inputFormat, opts);\n var result = currentResult, dateParts = analyseMask(buffer.join(\"\"), opts.inputFormat, opts);\n if (result && dateParts.date.getTime() === dateParts.date.getTime()) {\n result = isValidDate(dateParts, result);\n result = result && isDateInRange(dateParts, opts);\n }\n if (pos && result && currentResult.pos !== pos) {\n return {\n buffer: parse(opts.inputFormat, dateParts, opts),\n refreshFromBuffer: {\n start: pos,\n end: currentResult.pos\n }\n };\n }\n return result;\n },\n onKeyDown: function(e, buffer, caretPos, opts) {\n var input = this;\n if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {\n var today = new Date(), match, date = \"\";\n while (match = getTokenizer(opts).exec(opts.inputFormat)) {\n if (match[0].charAt(0) === \"d\") {\n date += pad(today.getDate(), match[0].length);\n } else if (match[0].charAt(0) === \"m\") {\n date += pad(today.getMonth() + 1, match[0].length);\n } else if (match[0] === \"yyyy\") {\n date += today.getFullYear().toString();\n } else if (match[0].charAt(0) === \"y\") {\n date += pad(today.getYear(), match[0].length);\n }\n }\n input.inputmask._valueSet(date);\n $(input).trigger(\"setvalue\");\n }\n },\n onUnMask: function(maskedValue, unmaskedValue, opts) {\n return parse(opts.outputFormat, analyseMask(maskedValue, opts.inputFormat, opts), opts, true);\n },\n casing: function(elem, test, pos, validPositions) {\n if (test.nativeDef.indexOf(\"[ap]\") == 0) return elem.toLowerCase();\n if (test.nativeDef.indexOf(\"[AP]\") == 0) return elem.toUpperCase();\n return elem;\n },\n insertMode: false,\n shiftPositions: false\n }\n });\n return Inputmask;\n});\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.date.extensions.js?");
1972
-
1973
- /***/ }),
1974
-
1975
- /***/ "./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.extensions.js":
1976
- /*!*************************************************************************************************!*\
1977
- !*** ./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.extensions.js ***!
1978
- \*************************************************************************************************/
1979
- /***/ (function(module, exports, __webpack_require__) {
1980
-
1981
- eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n* inputmask.extensions.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(/*! ./inputmask */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js\") ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(function(Inputmask) {\n Inputmask.extendDefinitions({\n A: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n casing: \"upper\"\n },\n \"&\": {\n validator: \"[0-9A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n casing: \"upper\"\n },\n \"#\": {\n validator: \"[0-9A-Fa-f]\",\n casing: \"upper\"\n }\n });\n Inputmask.extendAliases({\n cssunit: {\n regex: \"[+-]?[0-9]+\\\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)\"\n },\n url: {\n regex: \"(https?|ftp)//.*\",\n autoUnmask: false\n },\n ip: {\n mask: \"i[i[i]].i[i[i]].i[i[i]].i[i[i]]\",\n definitions: {\n i: {\n validator: function(chrs, maskset, pos, strict, opts) {\n if (pos - 1 > -1 && maskset.buffer[pos - 1] !== \".\") {\n chrs = maskset.buffer[pos - 1] + chrs;\n if (pos - 2 > -1 && maskset.buffer[pos - 2] !== \".\") {\n chrs = maskset.buffer[pos - 2] + chrs;\n } else chrs = \"0\" + chrs;\n } else chrs = \"00\" + chrs;\n return new RegExp(\"25[0-5]|2[0-4][0-9]|[01][0-9][0-9]\").test(chrs);\n }\n }\n },\n onUnMask: function(maskedValue, unmaskedValue, opts) {\n return maskedValue;\n },\n inputmode: \"numeric\"\n },\n email: {\n mask: \"*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]\",\n greedy: false,\n casing: \"lower\",\n onBeforePaste: function(pastedValue, opts) {\n pastedValue = pastedValue.toLowerCase();\n return pastedValue.replace(\"mailto:\", \"\");\n },\n definitions: {\n \"*\": {\n validator: \"[0-9\\uff11-\\uff19A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5!#$%&'*+/=?^_`{|}~-]\"\n },\n \"-\": {\n validator: \"[0-9A-Za-z-]\"\n }\n },\n onUnMask: function(maskedValue, unmaskedValue, opts) {\n return maskedValue;\n },\n inputmode: \"email\"\n },\n mac: {\n mask: \"##:##:##:##:##:##\"\n },\n vin: {\n mask: \"V{13}9{4}\",\n definitions: {\n V: {\n validator: \"[A-HJ-NPR-Za-hj-npr-z\\\\d]\",\n casing: \"upper\"\n }\n },\n clearIncomplete: true,\n autoUnmask: true\n }\n });\n return Inputmask;\n});\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.extensions.js?");
1982
-
1983
- /***/ }),
1984
-
1985
- /***/ "./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js":
1986
- /*!**************************************************************************************!*\
1987
- !*** ./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js ***!
1988
- \**************************************************************************************/
1989
- /***/ (function(module, exports, __webpack_require__) {
1990
-
1991
- eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n* inputmask.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(/*! ./dependencyLibs/inputmask.dependencyLib */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/dependencyLibs/inputmask.dependencyLib.js\"), __webpack_require__(/*! ./global/window */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/global/window.js\") ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(function($, window, undefined) {\n var document = window.document, ua = navigator.userAgent, ie = ua.indexOf(\"MSIE \") > 0 || ua.indexOf(\"Trident/\") > 0, mobile = isInputEventSupported(\"touchstart\"), iemobile = /iemobile/i.test(ua), iphone = /iphone/i.test(ua) && !iemobile;\n function Inputmask(alias, options, internal) {\n if (!(this instanceof Inputmask)) {\n return new Inputmask(alias, options, internal);\n }\n this.el = undefined;\n this.events = {};\n this.maskset = undefined;\n this.refreshValue = false;\n if (internal !== true) {\n if ($.isPlainObject(alias)) {\n options = alias;\n } else {\n options = options || {};\n if (alias) options.alias = alias;\n }\n this.opts = $.extend(true, {}, this.defaults, options);\n this.noMasksCache = options && options.definitions !== undefined;\n this.userOptions = options || {};\n this.isRTL = this.opts.numericInput;\n resolveAlias(this.opts.alias, options, this.opts);\n }\n }\n Inputmask.prototype = {\n dataAttribute: \"data-inputmask\",\n defaults: {\n placeholder: \"_\",\n optionalmarker: [ \"[\", \"]\" ],\n quantifiermarker: [ \"{\", \"}\" ],\n groupmarker: [ \"(\", \")\" ],\n alternatormarker: \"|\",\n escapeChar: \"\\\\\",\n mask: null,\n regex: null,\n oncomplete: $.noop,\n onincomplete: $.noop,\n oncleared: $.noop,\n repeat: 0,\n greedy: false,\n autoUnmask: false,\n removeMaskOnSubmit: false,\n clearMaskOnLostFocus: true,\n insertMode: true,\n clearIncomplete: false,\n alias: null,\n onKeyDown: $.noop,\n onBeforeMask: null,\n onBeforePaste: function(pastedValue, opts) {\n return $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(this, pastedValue, opts) : pastedValue;\n },\n onBeforeWrite: null,\n onUnMask: null,\n showMaskOnFocus: true,\n showMaskOnHover: true,\n onKeyValidation: $.noop,\n skipOptionalPartCharacter: \" \",\n numericInput: false,\n rightAlign: false,\n undoOnEscape: true,\n radixPoint: \"\",\n _radixDance: false,\n groupSeparator: \"\",\n keepStatic: null,\n positionCaretOnTab: true,\n tabThrough: false,\n supportsInputType: [ \"text\", \"tel\", \"url\", \"password\", \"search\" ],\n ignorables: [ 8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 229 ],\n isComplete: null,\n preValidation: null,\n postValidation: null,\n staticDefinitionSymbol: undefined,\n jitMasking: false,\n nullable: true,\n inputEventOnly: false,\n noValuePatching: false,\n positionCaretOnClick: \"lvp\",\n casing: null,\n inputmode: \"verbatim\",\n colorMask: false,\n disablePredictiveText: false,\n importDataAttributes: true,\n shiftPositions: true\n },\n definitions: {\n 9: {\n validator: \"[0-9\\uff11-\\uff19]\",\n definitionSymbol: \"*\"\n },\n a: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n definitionSymbol: \"*\"\n },\n \"*\": {\n validator: \"[0-9\\uff11-\\uff19A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\"\n }\n },\n aliases: {},\n masksCache: {},\n mask: function(elems) {\n var that = this;\n function importAttributeOptions(npt, opts, userOptions, dataAttribute) {\n if (opts.importDataAttributes === true) {\n var attrOptions = npt.getAttribute(dataAttribute), option, dataoptions, optionData, p;\n var importOption = function(option, optionData) {\n optionData = optionData !== undefined ? optionData : npt.getAttribute(dataAttribute + \"-\" + option);\n if (optionData !== null) {\n if (typeof optionData === \"string\") {\n if (option.indexOf(\"on\") === 0) optionData = window[optionData]; else if (optionData === \"false\") optionData = false; else if (optionData === \"true\") optionData = true;\n }\n userOptions[option] = optionData;\n }\n };\n if (attrOptions && attrOptions !== \"\") {\n attrOptions = attrOptions.replace(/'/g, '\"');\n dataoptions = JSON.parse(\"{\" + attrOptions + \"}\");\n }\n if (dataoptions) {\n optionData = undefined;\n for (p in dataoptions) {\n if (p.toLowerCase() === \"alias\") {\n optionData = dataoptions[p];\n break;\n }\n }\n }\n importOption(\"alias\", optionData);\n if (userOptions.alias) {\n resolveAlias(userOptions.alias, userOptions, opts);\n }\n for (option in opts) {\n if (dataoptions) {\n optionData = undefined;\n for (p in dataoptions) {\n if (p.toLowerCase() === option.toLowerCase()) {\n optionData = dataoptions[p];\n break;\n }\n }\n }\n importOption(option, optionData);\n }\n }\n $.extend(true, opts, userOptions);\n if (npt.dir === \"rtl\" || opts.rightAlign) {\n npt.style.textAlign = \"right\";\n }\n if (npt.dir === \"rtl\" || opts.numericInput) {\n npt.dir = \"ltr\";\n npt.removeAttribute(\"dir\");\n opts.isRTL = true;\n }\n return Object.keys(userOptions).length;\n }\n if (typeof elems === \"string\") {\n elems = document.getElementById(elems) || document.querySelectorAll(elems);\n }\n elems = elems.nodeName ? [ elems ] : elems;\n $.each(elems, function(ndx, el) {\n var scopedOpts = $.extend(true, {}, that.opts);\n if (importAttributeOptions(el, scopedOpts, $.extend(true, {}, that.userOptions), that.dataAttribute)) {\n var maskset = generateMaskSet(scopedOpts, that.noMasksCache);\n if (maskset !== undefined) {\n if (el.inputmask !== undefined) {\n el.inputmask.opts.autoUnmask = true;\n el.inputmask.remove();\n }\n el.inputmask = new Inputmask(undefined, undefined, true);\n el.inputmask.opts = scopedOpts;\n el.inputmask.noMasksCache = that.noMasksCache;\n el.inputmask.userOptions = $.extend(true, {}, that.userOptions);\n el.inputmask.isRTL = scopedOpts.isRTL || scopedOpts.numericInput;\n el.inputmask.el = el;\n el.inputmask.maskset = maskset;\n $.data(el, \"_inputmask_opts\", scopedOpts);\n maskScope.call(el.inputmask, {\n action: \"mask\"\n });\n }\n }\n });\n return elems && elems[0] ? elems[0].inputmask || this : this;\n },\n option: function(options, noremask) {\n if (typeof options === \"string\") {\n return this.opts[options];\n } else if (typeof options === \"object\") {\n $.extend(this.userOptions, options);\n if (this.el && noremask !== true) {\n this.mask(this.el);\n }\n return this;\n }\n },\n unmaskedvalue: function(value) {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"unmaskedvalue\",\n value: value\n });\n },\n remove: function() {\n return maskScope.call(this, {\n action: \"remove\"\n });\n },\n getemptymask: function() {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"getemptymask\"\n });\n },\n hasMaskedValue: function() {\n return !this.opts.autoUnmask;\n },\n isComplete: function() {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"isComplete\"\n });\n },\n getmetadata: function() {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"getmetadata\"\n });\n },\n isValid: function(value) {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"isValid\",\n value: value\n });\n },\n format: function(value, metadata) {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"format\",\n value: value,\n metadata: metadata\n });\n },\n setValue: function(value) {\n if (this.el) {\n $(this.el).trigger(\"setvalue\", [ value ]);\n }\n },\n analyseMask: function(mask, regexMask, opts) {\n var tokenizer = /(?:[?*+]|\\{[0-9\\+\\*]+(?:,[0-9\\+\\*]*)?(?:\\|[0-9\\+\\*]*)?\\})|[^.?*+^${[]()|\\\\]+|./g, regexTokenizer = /\\[\\^?]?(?:[^\\\\\\]]+|\\\\[\\S\\s]?)*]?|\\\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\\S\\s]?)|\\((?:\\?[:=!]?)?|(?:[?*+]|\\{[0-9]+(?:,[0-9]*)?\\})\\??|[^.?*+^${[()|\\\\]+|./g, escaped = false, currentToken = new MaskToken(), match, m, openenings = [], maskTokens = [], openingToken, currentOpeningToken, alternator, lastMatch, groupToken;\n function MaskToken(isGroup, isOptional, isQuantifier, isAlternator) {\n this.matches = [];\n this.openGroup = isGroup || false;\n this.alternatorGroup = false;\n this.isGroup = isGroup || false;\n this.isOptional = isOptional || false;\n this.isQuantifier = isQuantifier || false;\n this.isAlternator = isAlternator || false;\n this.quantifier = {\n min: 1,\n max: 1\n };\n }\n function insertTestDefinition(mtoken, element, position) {\n position = position !== undefined ? position : mtoken.matches.length;\n var prevMatch = mtoken.matches[position - 1];\n if (regexMask) {\n if (element.indexOf(\"[\") === 0 || escaped && /\\\\d|\\\\s|\\\\w]/i.test(element) || element === \".\") {\n mtoken.matches.splice(position++, 0, {\n fn: new RegExp(element, opts.casing ? \"i\" : \"\"),\n optionality: false,\n newBlockMarker: prevMatch === undefined ? \"master\" : prevMatch.def !== element,\n casing: null,\n def: element,\n placeholder: undefined,\n nativeDef: element\n });\n } else {\n if (escaped) element = element[element.length - 1];\n $.each(element.split(\"\"), function(ndx, lmnt) {\n prevMatch = mtoken.matches[position - 1];\n mtoken.matches.splice(position++, 0, {\n fn: null,\n optionality: false,\n newBlockMarker: prevMatch === undefined ? \"master\" : prevMatch.def !== lmnt && prevMatch.fn !== null,\n casing: null,\n def: opts.staticDefinitionSymbol || lmnt,\n placeholder: opts.staticDefinitionSymbol !== undefined ? lmnt : undefined,\n nativeDef: (escaped ? \"'\" : \"\") + lmnt\n });\n });\n }\n escaped = false;\n } else {\n var maskdef = (opts.definitions ? opts.definitions[element] : undefined) || Inputmask.prototype.definitions[element];\n if (maskdef && !escaped) {\n mtoken.matches.splice(position++, 0, {\n fn: maskdef.validator ? typeof maskdef.validator == \"string\" ? new RegExp(maskdef.validator, opts.casing ? \"i\" : \"\") : new function() {\n this.test = maskdef.validator;\n }() : new RegExp(\".\"),\n optionality: false,\n newBlockMarker: prevMatch === undefined ? \"master\" : prevMatch.def !== (maskdef.definitionSymbol || element),\n casing: maskdef.casing,\n def: maskdef.definitionSymbol || element,\n placeholder: maskdef.placeholder,\n nativeDef: element\n });\n } else {\n mtoken.matches.splice(position++, 0, {\n fn: null,\n optionality: false,\n newBlockMarker: prevMatch === undefined ? \"master\" : prevMatch.def !== element && prevMatch.fn !== null,\n casing: null,\n def: opts.staticDefinitionSymbol || element,\n placeholder: opts.staticDefinitionSymbol !== undefined ? element : undefined,\n nativeDef: (escaped ? \"'\" : \"\") + element\n });\n escaped = false;\n }\n }\n }\n function verifyGroupMarker(maskToken) {\n if (maskToken && maskToken.matches) {\n $.each(maskToken.matches, function(ndx, token) {\n var nextToken = maskToken.matches[ndx + 1];\n if ((nextToken === undefined || (nextToken.matches === undefined || nextToken.isQuantifier === false)) && token && token.isGroup) {\n token.isGroup = false;\n if (!regexMask) {\n insertTestDefinition(token, opts.groupmarker[0], 0);\n if (token.openGroup !== true) {\n insertTestDefinition(token, opts.groupmarker[1]);\n }\n }\n }\n verifyGroupMarker(token);\n });\n }\n }\n function defaultCase() {\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n insertTestDefinition(currentOpeningToken, m);\n if (currentOpeningToken.isAlternator) {\n alternator = openenings.pop();\n for (var mndx = 0; mndx < alternator.matches.length; mndx++) {\n if (alternator.matches[mndx].isGroup) alternator.matches[mndx].isGroup = false;\n }\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n currentOpeningToken.matches.push(alternator);\n } else {\n currentToken.matches.push(alternator);\n }\n }\n } else {\n insertTestDefinition(currentToken, m);\n }\n }\n function reverseTokens(maskToken) {\n function reverseStatic(st) {\n if (st === opts.optionalmarker[0]) st = opts.optionalmarker[1]; else if (st === opts.optionalmarker[1]) st = opts.optionalmarker[0]; else if (st === opts.groupmarker[0]) st = opts.groupmarker[1]; else if (st === opts.groupmarker[1]) st = opts.groupmarker[0];\n return st;\n }\n maskToken.matches = maskToken.matches.reverse();\n for (var match in maskToken.matches) {\n if (maskToken.matches.hasOwnProperty(match)) {\n var intMatch = parseInt(match);\n if (maskToken.matches[match].isQuantifier && maskToken.matches[intMatch + 1] && maskToken.matches[intMatch + 1].isGroup) {\n var qt = maskToken.matches[match];\n maskToken.matches.splice(match, 1);\n maskToken.matches.splice(intMatch + 1, 0, qt);\n }\n if (maskToken.matches[match].matches !== undefined) {\n maskToken.matches[match] = reverseTokens(maskToken.matches[match]);\n } else {\n maskToken.matches[match] = reverseStatic(maskToken.matches[match]);\n }\n }\n }\n return maskToken;\n }\n function groupify(matches) {\n var groupToken = new MaskToken(true);\n groupToken.openGroup = false;\n groupToken.matches = matches;\n return groupToken;\n }\n if (regexMask) {\n opts.optionalmarker[0] = undefined;\n opts.optionalmarker[1] = undefined;\n }\n while (match = regexMask ? regexTokenizer.exec(mask) : tokenizer.exec(mask)) {\n m = match[0];\n if (regexMask) {\n switch (m.charAt(0)) {\n case \"?\":\n m = \"{0,1}\";\n break;\n\n case \"+\":\n case \"*\":\n m = \"{\" + m + \"}\";\n break;\n }\n }\n if (escaped) {\n defaultCase();\n continue;\n }\n switch (m.charAt(0)) {\n case \"(?=\":\n break;\n\n case \"(?!\":\n break;\n\n case \"(?<=\":\n break;\n\n case \"(?<!\":\n break;\n\n case opts.escapeChar:\n escaped = true;\n if (regexMask) {\n defaultCase();\n }\n break;\n\n case opts.optionalmarker[1]:\n case opts.groupmarker[1]:\n openingToken = openenings.pop();\n openingToken.openGroup = false;\n if (openingToken !== undefined) {\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n currentOpeningToken.matches.push(openingToken);\n if (currentOpeningToken.isAlternator) {\n alternator = openenings.pop();\n for (var mndx = 0; mndx < alternator.matches.length; mndx++) {\n alternator.matches[mndx].isGroup = false;\n alternator.matches[mndx].alternatorGroup = false;\n }\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n currentOpeningToken.matches.push(alternator);\n } else {\n currentToken.matches.push(alternator);\n }\n }\n } else {\n currentToken.matches.push(openingToken);\n }\n } else defaultCase();\n break;\n\n case opts.optionalmarker[0]:\n openenings.push(new MaskToken(false, true));\n break;\n\n case opts.groupmarker[0]:\n openenings.push(new MaskToken(true));\n break;\n\n case opts.quantifiermarker[0]:\n var quantifier = new MaskToken(false, false, true);\n m = m.replace(/[{}]/g, \"\");\n var mqj = m.split(\"|\"), mq = mqj[0].split(\",\"), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = mq.length === 1 ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]);\n if (mq0 === \"*\" || mq0 === \"+\") {\n mq0 = mq1 === \"*\" ? 0 : 1;\n }\n quantifier.quantifier = {\n min: mq0,\n max: mq1,\n jit: mqj[1]\n };\n var matches = openenings.length > 0 ? openenings[openenings.length - 1].matches : currentToken.matches;\n match = matches.pop();\n if (match.isAlternator) {\n matches.push(match);\n matches = match.matches;\n var groupToken = new MaskToken(true);\n var tmpMatch = matches.pop();\n matches.push(groupToken);\n matches = groupToken.matches;\n match = tmpMatch;\n }\n if (!match.isGroup) {\n match = groupify([ match ]);\n }\n matches.push(match);\n matches.push(quantifier);\n break;\n\n case opts.alternatormarker:\n var groupQuantifier = function(matches) {\n var lastMatch = matches.pop();\n if (lastMatch.isQuantifier) {\n lastMatch = groupify([ matches.pop(), lastMatch ]);\n }\n return lastMatch;\n };\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1];\n if (currentOpeningToken.openGroup && (subToken.matches === undefined || subToken.isGroup === false && subToken.isAlternator === false)) {\n lastMatch = openenings.pop();\n } else {\n lastMatch = groupQuantifier(currentOpeningToken.matches);\n }\n } else {\n lastMatch = groupQuantifier(currentToken.matches);\n }\n if (lastMatch.isAlternator) {\n openenings.push(lastMatch);\n } else {\n if (lastMatch.alternatorGroup) {\n alternator = openenings.pop();\n lastMatch.alternatorGroup = false;\n } else {\n alternator = new MaskToken(false, false, false, true);\n }\n alternator.matches.push(lastMatch);\n openenings.push(alternator);\n if (lastMatch.openGroup) {\n lastMatch.openGroup = false;\n var alternatorGroup = new MaskToken(true);\n alternatorGroup.alternatorGroup = true;\n openenings.push(alternatorGroup);\n }\n }\n break;\n\n default:\n defaultCase();\n }\n }\n while (openenings.length > 0) {\n openingToken = openenings.pop();\n currentToken.matches.push(openingToken);\n }\n if (currentToken.matches.length > 0) {\n verifyGroupMarker(currentToken);\n maskTokens.push(currentToken);\n }\n if (opts.numericInput || opts.isRTL) {\n reverseTokens(maskTokens[0]);\n }\n return maskTokens;\n },\n positionColorMask: function(input, template) {\n input.style.left = template.offsetLeft + \"px\";\n }\n };\n Inputmask.extendDefaults = function(options) {\n $.extend(true, Inputmask.prototype.defaults, options);\n };\n Inputmask.extendDefinitions = function(definition) {\n $.extend(true, Inputmask.prototype.definitions, definition);\n };\n Inputmask.extendAliases = function(alias) {\n $.extend(true, Inputmask.prototype.aliases, alias);\n };\n Inputmask.format = function(value, options, metadata) {\n return Inputmask(options).format(value, metadata);\n };\n Inputmask.unmask = function(value, options) {\n return Inputmask(options).unmaskedvalue(value);\n };\n Inputmask.isValid = function(value, options) {\n return Inputmask(options).isValid(value);\n };\n Inputmask.remove = function(elems) {\n if (typeof elems === \"string\") {\n elems = document.getElementById(elems) || document.querySelectorAll(elems);\n }\n elems = elems.nodeName ? [ elems ] : elems;\n $.each(elems, function(ndx, el) {\n if (el.inputmask) el.inputmask.remove();\n });\n };\n Inputmask.setValue = function(elems, value) {\n if (typeof elems === \"string\") {\n elems = document.getElementById(elems) || document.querySelectorAll(elems);\n }\n elems = elems.nodeName ? [ elems ] : elems;\n $.each(elems, function(ndx, el) {\n if (el.inputmask) el.inputmask.setValue(value); else $(el).trigger(\"setvalue\", [ value ]);\n });\n };\n Inputmask.escapeRegex = function(str) {\n var specials = [ \"/\", \".\", \"*\", \"+\", \"?\", \"|\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", \"\\\\\", \"$\", \"^\" ];\n return str.replace(new RegExp(\"(\\\\\" + specials.join(\"|\\\\\") + \")\", \"gim\"), \"\\\\$1\");\n };\n Inputmask.keyCode = {\n BACKSPACE: 8,\n BACKSPACE_SAFARI: 127,\n DELETE: 46,\n DOWN: 40,\n END: 35,\n ENTER: 13,\n ESCAPE: 27,\n HOME: 36,\n INSERT: 45,\n LEFT: 37,\n PAGE_DOWN: 34,\n PAGE_UP: 33,\n RIGHT: 39,\n SPACE: 32,\n TAB: 9,\n UP: 38,\n X: 88,\n CONTROL: 17\n };\n Inputmask.dependencyLib = $;\n function resolveAlias(aliasStr, options, opts) {\n var aliasDefinition = Inputmask.prototype.aliases[aliasStr];\n if (aliasDefinition) {\n if (aliasDefinition.alias) resolveAlias(aliasDefinition.alias, undefined, opts);\n $.extend(true, opts, aliasDefinition);\n $.extend(true, opts, options);\n return true;\n } else if (opts.mask === null) {\n opts.mask = aliasStr;\n }\n return false;\n }\n function generateMaskSet(opts, nocache) {\n function generateMask(mask, metadata, opts) {\n var regexMask = false;\n if (mask === null || mask === \"\") {\n regexMask = opts.regex !== null;\n if (regexMask) {\n mask = opts.regex;\n mask = mask.replace(/^(\\^)(.*)(\\$)$/, \"$2\");\n } else {\n regexMask = true;\n mask = \".*\";\n }\n }\n if (mask.length === 1 && opts.greedy === false && opts.repeat !== 0) {\n opts.placeholder = \"\";\n }\n if (opts.repeat > 0 || opts.repeat === \"*\" || opts.repeat === \"+\") {\n var repeatStart = opts.repeat === \"*\" ? 0 : opts.repeat === \"+\" ? 1 : opts.repeat;\n mask = opts.groupmarker[0] + mask + opts.groupmarker[1] + opts.quantifiermarker[0] + repeatStart + \",\" + opts.repeat + opts.quantifiermarker[1];\n }\n var masksetDefinition, maskdefKey = regexMask ? \"regex_\" + opts.regex : opts.numericInput ? mask.split(\"\").reverse().join(\"\") : mask;\n if (Inputmask.prototype.masksCache[maskdefKey] === undefined || nocache === true) {\n masksetDefinition = {\n mask: mask,\n maskToken: Inputmask.prototype.analyseMask(mask, regexMask, opts),\n validPositions: {},\n _buffer: undefined,\n buffer: undefined,\n tests: {},\n excludes: {},\n metadata: metadata,\n maskLength: undefined,\n jitOffset: {}\n };\n if (nocache !== true) {\n Inputmask.prototype.masksCache[maskdefKey] = masksetDefinition;\n masksetDefinition = $.extend(true, {}, Inputmask.prototype.masksCache[maskdefKey]);\n }\n } else masksetDefinition = $.extend(true, {}, Inputmask.prototype.masksCache[maskdefKey]);\n return masksetDefinition;\n }\n var ms;\n if ($.isFunction(opts.mask)) {\n opts.mask = opts.mask(opts);\n }\n if ($.isArray(opts.mask)) {\n if (opts.mask.length > 1) {\n if (opts.keepStatic === null) {\n opts.keepStatic = \"auto\";\n for (var i = 0; i < opts.mask.length; i++) {\n if (opts.mask[i].charAt(0) !== opts.mask[0].charAt(0)) {\n opts.keepStatic = true;\n break;\n }\n }\n }\n var altMask = opts.groupmarker[0];\n $.each(opts.isRTL ? opts.mask.reverse() : opts.mask, function(ndx, msk) {\n if (altMask.length > 1) {\n altMask += opts.groupmarker[1] + opts.alternatormarker + opts.groupmarker[0];\n }\n if (msk.mask !== undefined && !$.isFunction(msk.mask)) {\n altMask += msk.mask;\n } else {\n altMask += msk;\n }\n });\n altMask += opts.groupmarker[1];\n return generateMask(altMask, opts.mask, opts);\n } else opts.mask = opts.mask.pop();\n }\n if (opts.mask && opts.mask.mask !== undefined && !$.isFunction(opts.mask.mask)) {\n ms = generateMask(opts.mask.mask, opts.mask, opts);\n } else {\n ms = generateMask(opts.mask, opts.mask, opts);\n }\n return ms;\n }\n function isInputEventSupported(eventName) {\n var el = document.createElement(\"input\"), evName = \"on\" + eventName, isSupported = evName in el;\n if (!isSupported) {\n el.setAttribute(evName, \"return;\");\n isSupported = typeof el[evName] === \"function\";\n }\n el = null;\n return isSupported;\n }\n function maskScope(actionObj, maskset, opts) {\n maskset = maskset || this.maskset;\n opts = opts || this.opts;\n var inputmask = this, el = this.el, isRTL = this.isRTL, undoValue, $el, skipKeyPressEvent = false, skipInputEvent = false, ignorable = false, maxLength, mouseEnter = false, colorMask, originalPlaceholder;\n var getMaskTemplate = function(baseOnInput, minimalPos, includeMode, noJit, clearOptionalTail) {\n var greedy = opts.greedy;\n if (clearOptionalTail) opts.greedy = false;\n minimalPos = minimalPos || 0;\n var maskTemplate = [], ndxIntlzr, pos = 0, test, testPos, lvp = getLastValidPosition();\n do {\n if (baseOnInput === true && getMaskSet().validPositions[pos]) {\n testPos = clearOptionalTail && getMaskSet().validPositions[pos].match.optionality === true && getMaskSet().validPositions[pos + 1] === undefined && (getMaskSet().validPositions[pos].generatedInput === true || getMaskSet().validPositions[pos].input == opts.skipOptionalPartCharacter && pos > 0) ? determineTestTemplate(pos, getTests(pos, ndxIntlzr, pos - 1)) : getMaskSet().validPositions[pos];\n test = testPos.match;\n ndxIntlzr = testPos.locator.slice();\n maskTemplate.push(includeMode === true ? testPos.input : includeMode === false ? test.nativeDef : getPlaceholder(pos, test));\n } else {\n testPos = getTestTemplate(pos, ndxIntlzr, pos - 1);\n test = testPos.match;\n ndxIntlzr = testPos.locator.slice();\n var jitMasking = noJit === true ? false : opts.jitMasking !== false ? opts.jitMasking : test.jit;\n if (jitMasking === false || jitMasking === undefined || typeof jitMasking === \"number\" && isFinite(jitMasking) && jitMasking > pos) {\n maskTemplate.push(includeMode === false ? test.nativeDef : getPlaceholder(pos, test));\n }\n }\n if (opts.keepStatic === \"auto\") {\n if (test.newBlockMarker && test.fn !== null) {\n opts.keepStatic = pos - 1;\n }\n }\n pos++;\n } while ((maxLength === undefined || pos < maxLength) && (test.fn !== null || test.def !== \"\") || minimalPos > pos);\n if (maskTemplate[maskTemplate.length - 1] === \"\") {\n maskTemplate.pop();\n }\n if (includeMode !== false || getMaskSet().maskLength === undefined) getMaskSet().maskLength = pos - 1;\n opts.greedy = greedy;\n return maskTemplate;\n };\n function getMaskSet() {\n return maskset;\n }\n function resetMaskSet(soft) {\n var maskset = getMaskSet();\n maskset.buffer = undefined;\n if (soft !== true) {\n maskset.validPositions = {};\n maskset.p = 0;\n }\n }\n function getLastValidPosition(closestTo, strict, validPositions) {\n var before = -1, after = -1, valids = validPositions || getMaskSet().validPositions;\n if (closestTo === undefined) closestTo = -1;\n for (var posNdx in valids) {\n var psNdx = parseInt(posNdx);\n if (valids[psNdx] && (strict || valids[psNdx].generatedInput !== true)) {\n if (psNdx <= closestTo) before = psNdx;\n if (psNdx >= closestTo) after = psNdx;\n }\n }\n return before === -1 || before == closestTo ? after : after == -1 ? before : closestTo - before < after - closestTo ? before : after;\n }\n function getDecisionTaker(tst) {\n var decisionTaker = tst.locator[tst.alternation];\n if (typeof decisionTaker == \"string\" && decisionTaker.length > 0) {\n decisionTaker = decisionTaker.split(\",\")[0];\n }\n return decisionTaker !== undefined ? decisionTaker.toString() : \"\";\n }\n function getLocator(tst, align) {\n var locator = (tst.alternation != undefined ? tst.mloc[getDecisionTaker(tst)] : tst.locator).join(\"\");\n if (locator !== \"\") while (locator.length < align) locator += \"0\";\n return locator;\n }\n function determineTestTemplate(pos, tests) {\n pos = pos > 0 ? pos - 1 : 0;\n var altTest = getTest(pos), targetLocator = getLocator(altTest), tstLocator, closest, bestMatch;\n for (var ndx = 0; ndx < tests.length; ndx++) {\n var tst = tests[ndx];\n tstLocator = getLocator(tst, targetLocator.length);\n var distance = Math.abs(tstLocator - targetLocator);\n if (closest === undefined || tstLocator !== \"\" && distance < closest || bestMatch && !opts.greedy && bestMatch.match.optionality && bestMatch.match.newBlockMarker === \"master\" && (!tst.match.optionality || !tst.match.newBlockMarker) || bestMatch && bestMatch.match.optionalQuantifier && !tst.match.optionalQuantifier) {\n closest = distance;\n bestMatch = tst;\n }\n }\n return bestMatch;\n }\n function getTestTemplate(pos, ndxIntlzr, tstPs) {\n return getMaskSet().validPositions[pos] || determineTestTemplate(pos, getTests(pos, ndxIntlzr ? ndxIntlzr.slice() : ndxIntlzr, tstPs));\n }\n function getTest(pos, tests) {\n if (getMaskSet().validPositions[pos]) {\n return getMaskSet().validPositions[pos];\n }\n return (tests || getTests(pos))[0];\n }\n function positionCanMatchDefinition(pos, def) {\n var valid = false, tests = getTests(pos);\n for (var tndx = 0; tndx < tests.length; tndx++) {\n if (tests[tndx].match && tests[tndx].match.def === def) {\n valid = true;\n break;\n }\n }\n return valid;\n }\n function getTests(pos, ndxIntlzr, tstPs) {\n var maskTokens = getMaskSet().maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr ? ndxIntlzr.slice() : [ 0 ], matches = [], insertStop = false, latestMatch, cacheDependency = ndxIntlzr ? ndxIntlzr.join(\"\") : \"\";\n function resolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) {\n function handleMatch(match, loopNdx, quantifierRecurse) {\n function isFirstMatch(latestMatch, tokenGroup) {\n var firstMatch = $.inArray(latestMatch, tokenGroup.matches) === 0;\n if (!firstMatch) {\n $.each(tokenGroup.matches, function(ndx, match) {\n if (match.isQuantifier === true) firstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]); else if (match.hasOwnProperty(\"matches\")) firstMatch = isFirstMatch(latestMatch, match);\n if (firstMatch) return false;\n });\n }\n return firstMatch;\n }\n function resolveNdxInitializer(pos, alternateNdx, targetAlternation) {\n var bestMatch, indexPos;\n if (getMaskSet().tests[pos] || getMaskSet().validPositions[pos]) {\n $.each(getMaskSet().tests[pos] || [ getMaskSet().validPositions[pos] ], function(ndx, lmnt) {\n if (lmnt.mloc[alternateNdx]) {\n bestMatch = lmnt;\n return false;\n }\n var alternation = targetAlternation !== undefined ? targetAlternation : lmnt.alternation, ndxPos = lmnt.locator[alternation] !== undefined ? lmnt.locator[alternation].toString().indexOf(alternateNdx) : -1;\n if ((indexPos === undefined || ndxPos < indexPos) && ndxPos !== -1) {\n bestMatch = lmnt;\n indexPos = ndxPos;\n }\n });\n }\n if (bestMatch) {\n var bestMatchAltIndex = bestMatch.locator[bestMatch.alternation];\n var locator = bestMatch.mloc[alternateNdx] || bestMatch.mloc[bestMatchAltIndex] || bestMatch.locator;\n return locator.slice((targetAlternation !== undefined ? targetAlternation : bestMatch.alternation) + 1);\n } else {\n return targetAlternation !== undefined ? resolveNdxInitializer(pos, alternateNdx) : undefined;\n }\n }\n function isSubsetOf(source, target) {\n function expand(pattern) {\n var expanded = [], start, end;\n for (var i = 0, l = pattern.length; i < l; i++) {\n if (pattern.charAt(i) === \"-\") {\n end = pattern.charCodeAt(i + 1);\n while (++start < end) expanded.push(String.fromCharCode(start));\n } else {\n start = pattern.charCodeAt(i);\n expanded.push(pattern.charAt(i));\n }\n }\n return expanded.join(\"\");\n }\n if (opts.regex && source.match.fn !== null && target.match.fn !== null) {\n return expand(target.match.def.replace(/[\\[\\]]/g, \"\")).indexOf(expand(source.match.def.replace(/[\\[\\]]/g, \"\"))) !== -1;\n }\n return source.match.def === target.match.nativeDef;\n }\n function staticCanMatchDefinition(source, target) {\n var sloc = source.locator.slice(source.alternation).join(\"\"), tloc = target.locator.slice(target.alternation).join(\"\"), canMatch = sloc == tloc;\n canMatch = canMatch && source.match.fn === null && target.match.fn !== null ? target.match.fn.test(source.match.def, getMaskSet(), pos, false, opts, false) : false;\n return canMatch;\n }\n function setMergeLocators(targetMatch, altMatch) {\n if (altMatch === undefined || targetMatch.alternation === altMatch.alternation && targetMatch.locator[targetMatch.alternation].toString().indexOf(altMatch.locator[altMatch.alternation]) === -1) {\n targetMatch.mloc = targetMatch.mloc || {};\n var locNdx = targetMatch.locator[targetMatch.alternation];\n if (locNdx === undefined) targetMatch.alternation = undefined; else {\n if (typeof locNdx === \"string\") locNdx = locNdx.split(\",\")[0];\n if (targetMatch.mloc[locNdx] === undefined) targetMatch.mloc[locNdx] = targetMatch.locator.slice();\n if (altMatch !== undefined) {\n for (var ndx in altMatch.mloc) {\n if (typeof ndx === \"string\") ndx = ndx.split(\",\")[0];\n if (targetMatch.mloc[ndx] === undefined) targetMatch.mloc[ndx] = altMatch.mloc[ndx];\n }\n targetMatch.locator[targetMatch.alternation] = Object.keys(targetMatch.mloc).join(\",\");\n }\n return true;\n }\n }\n return false;\n }\n if (testPos > 500 && quantifierRecurse !== undefined) {\n throw \"Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. \" + getMaskSet().mask;\n }\n if (testPos === pos && match.matches === undefined) {\n matches.push({\n match: match,\n locator: loopNdx.reverse(),\n cd: cacheDependency,\n mloc: {}\n });\n return true;\n } else if (match.matches !== undefined) {\n if (match.isGroup && quantifierRecurse !== match) {\n match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx, quantifierRecurse);\n if (match) return true;\n } else if (match.isOptional) {\n var optionalToken = match;\n match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);\n if (match) {\n $.each(matches, function(ndx, mtch) {\n mtch.match.optionality = true;\n });\n latestMatch = matches[matches.length - 1].match;\n if (quantifierRecurse === undefined && isFirstMatch(latestMatch, optionalToken)) {\n insertStop = true;\n testPos = pos;\n } else return true;\n }\n } else if (match.isAlternator) {\n var alternateToken = match, malternateMatches = [], maltMatches, currentMatches = matches.slice(), loopNdxCnt = loopNdx.length;\n var altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1;\n if (altIndex === -1 || typeof altIndex === \"string\") {\n var currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(), altIndexArr = [], amndx;\n if (typeof altIndex == \"string\") {\n altIndexArr = altIndex.split(\",\");\n } else {\n for (amndx = 0; amndx < alternateToken.matches.length; amndx++) {\n altIndexArr.push(amndx.toString());\n }\n }\n if (getMaskSet().excludes[pos]) {\n var altIndexArrClone = altIndexArr.slice();\n for (var i = 0, el = getMaskSet().excludes[pos].length; i < el; i++) {\n altIndexArr.splice(altIndexArr.indexOf(getMaskSet().excludes[pos][i].toString()), 1);\n }\n if (altIndexArr.length === 0) {\n getMaskSet().excludes[pos] = undefined;\n altIndexArr = altIndexArrClone;\n }\n }\n if (opts.keepStatic === true || isFinite(parseInt(opts.keepStatic)) && currentPos >= opts.keepStatic) altIndexArr = altIndexArr.slice(0, 1);\n var unMatchedAlternation = false;\n for (var ndx = 0; ndx < altIndexArr.length; ndx++) {\n amndx = parseInt(altIndexArr[ndx]);\n matches = [];\n ndxInitializer = typeof altIndex === \"string\" ? resolveNdxInitializer(testPos, amndx, loopNdxCnt) || ndxInitializerClone.slice() : ndxInitializerClone.slice();\n if (alternateToken.matches[amndx] && handleMatch(alternateToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse)) match = true; else if (ndx === 0) {\n unMatchedAlternation = true;\n }\n maltMatches = matches.slice();\n testPos = currentPos;\n matches = [];\n for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {\n var altMatch = maltMatches[ndx1], dropMatch = false;\n altMatch.match.jit = altMatch.match.jit || unMatchedAlternation;\n altMatch.alternation = altMatch.alternation || loopNdxCnt;\n setMergeLocators(altMatch);\n for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {\n var altMatch2 = malternateMatches[ndx2];\n if (typeof altIndex !== \"string\" || altMatch.alternation !== undefined && $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr) !== -1) {\n if (altMatch.match.nativeDef === altMatch2.match.nativeDef) {\n dropMatch = true;\n setMergeLocators(altMatch2, altMatch);\n break;\n } else if (isSubsetOf(altMatch, altMatch2)) {\n if (setMergeLocators(altMatch, altMatch2)) {\n dropMatch = true;\n malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch);\n }\n break;\n } else if (isSubsetOf(altMatch2, altMatch)) {\n setMergeLocators(altMatch2, altMatch);\n break;\n } else if (staticCanMatchDefinition(altMatch, altMatch2)) {\n if (setMergeLocators(altMatch, altMatch2)) {\n dropMatch = true;\n malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch);\n }\n break;\n }\n }\n }\n if (!dropMatch) {\n malternateMatches.push(altMatch);\n }\n }\n }\n matches = currentMatches.concat(malternateMatches);\n testPos = pos;\n insertStop = matches.length > 0;\n match = malternateMatches.length > 0;\n ndxInitializer = ndxInitializerClone.slice();\n } else match = handleMatch(alternateToken.matches[altIndex] || maskToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse);\n if (match) return true;\n } else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) {\n var qt = match;\n for (var qndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && testPos <= pos; qndx++) {\n var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1];\n match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), tokenGroup);\n if (match) {\n latestMatch = matches[matches.length - 1].match;\n latestMatch.optionalQuantifier = qndx >= qt.quantifier.min;\n latestMatch.jit = (qndx || 1) * tokenGroup.matches.indexOf(latestMatch) >= qt.quantifier.jit;\n if (latestMatch.optionalQuantifier && isFirstMatch(latestMatch, tokenGroup)) {\n insertStop = true;\n testPos = pos;\n break;\n }\n if (latestMatch.jit) {\n getMaskSet().jitOffset[pos] = tokenGroup.matches.indexOf(latestMatch);\n }\n return true;\n }\n }\n } else {\n match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);\n if (match) return true;\n }\n } else {\n testPos++;\n }\n }\n for (var tndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) {\n if (maskToken.matches[tndx].isQuantifier !== true) {\n var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse);\n if (match && testPos === pos) {\n return match;\n } else if (testPos > pos) {\n break;\n }\n }\n }\n }\n function mergeLocators(pos, tests) {\n var locator = [];\n if (!$.isArray(tests)) tests = [ tests ];\n if (tests.length > 0) {\n if (tests[0].alternation === undefined) {\n locator = determineTestTemplate(pos, tests.slice()).locator.slice();\n if (locator.length === 0) locator = tests[0].locator.slice();\n } else {\n $.each(tests, function(ndx, tst) {\n if (tst.def !== \"\") {\n if (locator.length === 0) locator = tst.locator.slice(); else {\n for (var i = 0; i < locator.length; i++) {\n if (tst.locator[i] && locator[i].toString().indexOf(tst.locator[i]) === -1) {\n locator[i] += \",\" + tst.locator[i];\n }\n }\n }\n }\n });\n }\n }\n return locator;\n }\n if (pos > -1) {\n if (ndxIntlzr === undefined) {\n var previousPos = pos - 1, test;\n while ((test = getMaskSet().validPositions[previousPos] || getMaskSet().tests[previousPos]) === undefined && previousPos > -1) {\n previousPos--;\n }\n if (test !== undefined && previousPos > -1) {\n ndxInitializer = mergeLocators(previousPos, test);\n cacheDependency = ndxInitializer.join(\"\");\n testPos = previousPos;\n }\n }\n if (getMaskSet().tests[pos] && getMaskSet().tests[pos][0].cd === cacheDependency) {\n return getMaskSet().tests[pos];\n }\n for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) {\n var match = resolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]);\n if (match && testPos === pos || testPos > pos) {\n break;\n }\n }\n }\n if (matches.length === 0 || insertStop) {\n matches.push({\n match: {\n fn: null,\n optionality: false,\n casing: null,\n def: \"\",\n placeholder: \"\"\n },\n locator: [],\n mloc: {},\n cd: cacheDependency\n });\n }\n if (ndxIntlzr !== undefined && getMaskSet().tests[pos]) {\n return $.extend(true, [], matches);\n }\n getMaskSet().tests[pos] = $.extend(true, [], matches);\n return getMaskSet().tests[pos];\n }\n function getBufferTemplate() {\n if (getMaskSet()._buffer === undefined) {\n getMaskSet()._buffer = getMaskTemplate(false, 1);\n if (getMaskSet().buffer === undefined) getMaskSet().buffer = getMaskSet()._buffer.slice();\n }\n return getMaskSet()._buffer;\n }\n function getBuffer(noCache) {\n if (getMaskSet().buffer === undefined || noCache === true) {\n getMaskSet().buffer = getMaskTemplate(true, getLastValidPosition(), true);\n if (getMaskSet()._buffer === undefined) getMaskSet()._buffer = getMaskSet().buffer.slice();\n }\n return getMaskSet().buffer;\n }\n function refreshFromBuffer(start, end, buffer) {\n var i, p;\n if (start === true) {\n resetMaskSet();\n start = 0;\n end = buffer.length;\n } else {\n for (i = start; i < end; i++) {\n delete getMaskSet().validPositions[i];\n }\n }\n p = start;\n for (i = start; i < end; i++) {\n resetMaskSet(true);\n if (buffer[i] !== opts.skipOptionalPartCharacter) {\n var valResult = isValid(p, buffer[i], true, true);\n if (valResult !== false) {\n resetMaskSet(true);\n p = valResult.caret !== undefined ? valResult.caret : valResult.pos + 1;\n }\n }\n }\n }\n function casing(elem, test, pos) {\n switch (opts.casing || test.casing) {\n case \"upper\":\n elem = elem.toUpperCase();\n break;\n\n case \"lower\":\n elem = elem.toLowerCase();\n break;\n\n case \"title\":\n var posBefore = getMaskSet().validPositions[pos - 1];\n if (pos === 0 || posBefore && posBefore.input === String.fromCharCode(Inputmask.keyCode.SPACE)) {\n elem = elem.toUpperCase();\n } else {\n elem = elem.toLowerCase();\n }\n break;\n\n default:\n if ($.isFunction(opts.casing)) {\n var args = Array.prototype.slice.call(arguments);\n args.push(getMaskSet().validPositions);\n elem = opts.casing.apply(this, args);\n }\n }\n return elem;\n }\n function checkAlternationMatch(altArr1, altArr2, na) {\n var altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = false, naArr = na !== undefined ? na.split(\",\") : [], naNdx;\n for (var i = 0; i < naArr.length; i++) {\n if ((naNdx = altArr1.indexOf(naArr[i])) !== -1) {\n altArr1.splice(naNdx, 1);\n }\n }\n for (var alndx = 0; alndx < altArr1.length; alndx++) {\n if ($.inArray(altArr1[alndx], altArrC) !== -1) {\n isMatch = true;\n break;\n }\n }\n return isMatch;\n }\n function alternate(pos, c, strict, fromSetValid, rAltPos) {\n var validPsClone = $.extend(true, {}, getMaskSet().validPositions), lastAlt, alternation, isValidRslt = false, altPos, prevAltPos, i, validPos, decisionPos, lAltPos = rAltPos !== undefined ? rAltPos : getLastValidPosition();\n if (lAltPos === -1 && rAltPos === undefined) {\n lastAlt = 0;\n prevAltPos = getTest(lastAlt);\n alternation = prevAltPos.alternation;\n } else {\n for (;lAltPos >= 0; lAltPos--) {\n altPos = getMaskSet().validPositions[lAltPos];\n if (altPos && altPos.alternation !== undefined) {\n if (prevAltPos && prevAltPos.locator[altPos.alternation] !== altPos.locator[altPos.alternation]) {\n break;\n }\n lastAlt = lAltPos;\n alternation = getMaskSet().validPositions[lastAlt].alternation;\n prevAltPos = altPos;\n }\n }\n }\n if (alternation !== undefined) {\n decisionPos = parseInt(lastAlt);\n getMaskSet().excludes[decisionPos] = getMaskSet().excludes[decisionPos] || [];\n if (pos !== true) {\n getMaskSet().excludes[decisionPos].push(getDecisionTaker(prevAltPos));\n }\n var validInputsClone = [], staticInputsBeforePos = 0;\n for (i = decisionPos; i < getLastValidPosition(undefined, true) + 1; i++) {\n validPos = getMaskSet().validPositions[i];\n if (validPos && validPos.generatedInput !== true) {\n validInputsClone.push(validPos.input);\n } else if (i < pos) staticInputsBeforePos++;\n delete getMaskSet().validPositions[i];\n }\n while (getMaskSet().excludes[decisionPos] && getMaskSet().excludes[decisionPos].length < 10) {\n var posOffset = staticInputsBeforePos * -1, validInputs = validInputsClone.slice();\n getMaskSet().tests[decisionPos] = undefined;\n resetMaskSet(true);\n isValidRslt = true;\n while (validInputs.length > 0) {\n var input = validInputs.shift();\n if (!(isValidRslt = isValid(getLastValidPosition(undefined, true) + 1, input, false, fromSetValid, true))) {\n break;\n }\n }\n if (isValidRslt && c !== undefined) {\n var targetLvp = getLastValidPosition(pos) + 1;\n for (i = decisionPos; i < getLastValidPosition() + 1; i++) {\n validPos = getMaskSet().validPositions[i];\n if ((validPos === undefined || validPos.match.fn == null) && i < pos + posOffset) {\n posOffset++;\n }\n }\n pos = pos + posOffset;\n isValidRslt = isValid(pos > targetLvp ? targetLvp : pos, c, strict, fromSetValid, true);\n }\n if (!isValidRslt) {\n resetMaskSet();\n prevAltPos = getTest(decisionPos);\n getMaskSet().validPositions = $.extend(true, {}, validPsClone);\n if (getMaskSet().excludes[decisionPos]) {\n var decisionTaker = getDecisionTaker(prevAltPos);\n if (getMaskSet().excludes[decisionPos].indexOf(decisionTaker) !== -1) {\n isValidRslt = alternate(pos, c, strict, fromSetValid, decisionPos - 1);\n break;\n }\n getMaskSet().excludes[decisionPos].push(decisionTaker);\n for (i = decisionPos; i < getLastValidPosition(undefined, true) + 1; i++) delete getMaskSet().validPositions[i];\n } else {\n isValidRslt = alternate(pos, c, strict, fromSetValid, decisionPos - 1);\n break;\n }\n } else break;\n }\n }\n getMaskSet().excludes[decisionPos] = undefined;\n return isValidRslt;\n }\n function isValid(pos, c, strict, fromSetValid, fromAlternate, validateOnly) {\n function isSelection(posObj) {\n return isRTL ? posObj.begin - posObj.end > 1 || posObj.begin - posObj.end === 1 : posObj.end - posObj.begin > 1 || posObj.end - posObj.begin === 1;\n }\n strict = strict === true;\n var maskPos = pos;\n if (pos.begin !== undefined) {\n maskPos = isRTL ? pos.end : pos.begin;\n }\n function _isValid(position, c, strict) {\n var rslt = false;\n $.each(getTests(position), function(ndx, tst) {\n var test = tst.match;\n getBuffer(true);\n rslt = test.fn != null ? test.fn.test(c, getMaskSet(), position, strict, opts, isSelection(pos)) : (c === test.def || c === opts.skipOptionalPartCharacter) && test.def !== \"\" ? {\n c: getPlaceholder(position, test, true) || test.def,\n pos: position\n } : false;\n if (rslt !== false) {\n var elem = rslt.c !== undefined ? rslt.c : c, validatedPos = position;\n elem = elem === opts.skipOptionalPartCharacter && test.fn === null ? getPlaceholder(position, test, true) || test.def : elem;\n if (rslt.remove !== undefined) {\n if (!$.isArray(rslt.remove)) rslt.remove = [ rslt.remove ];\n $.each(rslt.remove.sort(function(a, b) {\n return b - a;\n }), function(ndx, lmnt) {\n revalidateMask({\n begin: lmnt,\n end: lmnt + 1\n });\n });\n }\n if (rslt.insert !== undefined) {\n if (!$.isArray(rslt.insert)) rslt.insert = [ rslt.insert ];\n $.each(rslt.insert.sort(function(a, b) {\n return a - b;\n }), function(ndx, lmnt) {\n isValid(lmnt.pos, lmnt.c, true, fromSetValid);\n });\n }\n if (rslt !== true && rslt.pos !== undefined && rslt.pos !== position) {\n validatedPos = rslt.pos;\n }\n if (rslt !== true && rslt.pos === undefined && rslt.c === undefined) {\n return false;\n }\n if (!revalidateMask(pos, $.extend({}, tst, {\n input: casing(elem, test, validatedPos)\n }), fromSetValid, validatedPos)) {\n rslt = false;\n }\n return false;\n }\n });\n return rslt;\n }\n var result = true, positionsClone = $.extend(true, {}, getMaskSet().validPositions);\n if ($.isFunction(opts.preValidation) && !strict && fromSetValid !== true && validateOnly !== true) {\n result = opts.preValidation(getBuffer(), maskPos, c, isSelection(pos), opts, getMaskSet());\n }\n if (result === true) {\n trackbackPositions(undefined, maskPos, true);\n if (maxLength === undefined || maskPos < maxLength) {\n result = _isValid(maskPos, c, strict);\n if ((!strict || fromSetValid === true) && result === false && validateOnly !== true) {\n var currentPosValid = getMaskSet().validPositions[maskPos];\n if (currentPosValid && currentPosValid.match.fn === null && (currentPosValid.match.def === c || c === opts.skipOptionalPartCharacter)) {\n result = {\n caret: seekNext(maskPos)\n };\n } else {\n if ((opts.insertMode || getMaskSet().validPositions[seekNext(maskPos)] === undefined) && (!isMask(maskPos, true) || getMaskSet().jitOffset[maskPos])) {\n if (getMaskSet().jitOffset[maskPos] && getMaskSet().validPositions[seekNext(maskPos)] === undefined) {\n result = isValid(maskPos + getMaskSet().jitOffset[maskPos], c, strict);\n if (result !== false) result.caret = maskPos;\n } else for (var nPos = maskPos + 1, snPos = seekNext(maskPos); nPos <= snPos; nPos++) {\n result = _isValid(nPos, c, strict);\n if (result !== false) {\n result = trackbackPositions(maskPos, result.pos !== undefined ? result.pos : nPos) || result;\n maskPos = nPos;\n break;\n }\n }\n }\n }\n }\n }\n if (result === false && opts.keepStatic !== false && (opts.regex == null || isComplete(getBuffer())) && !strict && fromAlternate !== true) {\n result = alternate(maskPos, c, strict, fromSetValid);\n }\n if (result === true) {\n result = {\n pos: maskPos\n };\n }\n }\n if ($.isFunction(opts.postValidation) && result !== false && !strict && fromSetValid !== true && validateOnly !== true) {\n var postResult = opts.postValidation(getBuffer(true), pos.begin !== undefined ? isRTL ? pos.end : pos.begin : pos, result, opts);\n if (postResult !== undefined) {\n if (postResult.refreshFromBuffer && postResult.buffer) {\n var refresh = postResult.refreshFromBuffer;\n refreshFromBuffer(refresh === true ? refresh : refresh.start, refresh.end, postResult.buffer);\n }\n result = postResult === true ? result : postResult;\n }\n }\n if (result && result.pos === undefined) {\n result.pos = maskPos;\n }\n if (result === false || validateOnly === true) {\n resetMaskSet(true);\n getMaskSet().validPositions = $.extend(true, {}, positionsClone);\n }\n return result;\n }\n function trackbackPositions(originalPos, newPos, fillOnly) {\n var result;\n if (originalPos === undefined) {\n for (originalPos = newPos - 1; originalPos > 0; originalPos--) {\n if (getMaskSet().validPositions[originalPos]) break;\n }\n }\n for (var ps = originalPos; ps < newPos; ps++) {\n if (getMaskSet().validPositions[ps] === undefined && !isMask(ps, true)) {\n var vp = ps == 0 ? getTest(ps) : getMaskSet().validPositions[ps - 1];\n if (vp) {\n var tests = getTests(ps).slice();\n if (tests[tests.length - 1].match.def === \"\") tests.pop();\n var bestMatch = determineTestTemplate(ps, tests);\n bestMatch = $.extend({}, bestMatch, {\n input: getPlaceholder(ps, bestMatch.match, true) || bestMatch.match.def\n });\n bestMatch.generatedInput = true;\n revalidateMask(ps, bestMatch, true);\n if (fillOnly !== true) {\n var cvpInput = getMaskSet().validPositions[newPos].input;\n getMaskSet().validPositions[newPos] = undefined;\n result = isValid(newPos, cvpInput, true, true);\n }\n }\n }\n }\n return result;\n }\n function revalidateMask(pos, validTest, fromSetValid, validatedPos) {\n function IsEnclosedStatic(pos, valids, selection) {\n var posMatch = valids[pos];\n if (posMatch !== undefined && (posMatch.match.fn === null && posMatch.match.optionality !== true || posMatch.input === opts.radixPoint)) {\n var prevMatch = selection.begin <= pos - 1 ? valids[pos - 1] && valids[pos - 1].match.fn === null && valids[pos - 1] : valids[pos - 1], nextMatch = selection.end > pos + 1 ? valids[pos + 1] && valids[pos + 1].match.fn === null && valids[pos + 1] : valids[pos + 1];\n return prevMatch && nextMatch;\n }\n return false;\n }\n var begin = pos.begin !== undefined ? pos.begin : pos, end = pos.end !== undefined ? pos.end : pos;\n if (pos.begin > pos.end) {\n begin = pos.end;\n end = pos.begin;\n }\n validatedPos = validatedPos !== undefined ? validatedPos : begin;\n if (begin !== end || opts.insertMode && getMaskSet().validPositions[validatedPos] !== undefined && fromSetValid === undefined) {\n var positionsClone = $.extend(true, {}, getMaskSet().validPositions), lvp = getLastValidPosition(undefined, true), i;\n getMaskSet().p = begin;\n for (i = lvp; i >= begin; i--) {\n if (getMaskSet().validPositions[i] && getMaskSet().validPositions[i].match.nativeDef === \"+\") {\n opts.isNegative = false;\n }\n delete getMaskSet().validPositions[i];\n }\n var valid = true, j = validatedPos, vps = getMaskSet().validPositions, needsValidation = false, posMatch = j, i = j;\n if (validTest) {\n getMaskSet().validPositions[validatedPos] = $.extend(true, {}, validTest);\n posMatch++;\n j++;\n if (begin < end) i++;\n }\n for (;i <= lvp; i++) {\n var t = positionsClone[i];\n if (t !== undefined && (i >= end || i >= begin && t.generatedInput !== true && IsEnclosedStatic(i, positionsClone, {\n begin: begin,\n end: end\n }))) {\n while (getTest(posMatch).match.def !== \"\") {\n if (needsValidation === false && positionsClone[posMatch] && positionsClone[posMatch].match.nativeDef === t.match.nativeDef) {\n getMaskSet().validPositions[posMatch] = $.extend(true, {}, positionsClone[posMatch]);\n getMaskSet().validPositions[posMatch].input = t.input;\n trackbackPositions(undefined, posMatch, true);\n j = posMatch + 1;\n valid = true;\n } else if (opts.shiftPositions && positionCanMatchDefinition(posMatch, t.match.def)) {\n var result = isValid(posMatch, t.input, true, true);\n valid = result !== false;\n j = result.caret || result.insert ? getLastValidPosition() : posMatch + 1;\n needsValidation = true;\n } else {\n valid = t.generatedInput === true || t.input === opts.radixPoint && opts.numericInput === true;\n }\n if (valid) break;\n if (!valid && posMatch > end && isMask(posMatch, true) && (t.match.fn !== null || posMatch > getMaskSet().maskLength)) {\n break;\n }\n posMatch++;\n }\n if (getTest(posMatch).match.def == \"\") valid = false;\n posMatch = j;\n }\n if (!valid) break;\n }\n if (!valid) {\n getMaskSet().validPositions = $.extend(true, {}, positionsClone);\n resetMaskSet(true);\n return false;\n }\n } else if (validTest) {\n getMaskSet().validPositions[validatedPos] = $.extend(true, {}, validTest);\n }\n resetMaskSet(true);\n return true;\n }\n function isMask(pos, strict) {\n var test = getTestTemplate(pos).match;\n if (test.def === \"\") test = getTest(pos).match;\n if (test.fn != null) {\n return test.fn;\n }\n if (strict !== true && pos > -1) {\n var tests = getTests(pos);\n return tests.length > 1 + (tests[tests.length - 1].match.def === \"\" ? 1 : 0);\n }\n return false;\n }\n function seekNext(pos, newBlock) {\n var position = pos + 1;\n while (getTest(position).match.def !== \"\" && (newBlock === true && (getTest(position).match.newBlockMarker !== true || !isMask(position)) || newBlock !== true && !isMask(position))) {\n position++;\n }\n return position;\n }\n function seekPrevious(pos, newBlock) {\n var position = pos, tests;\n if (position <= 0) return 0;\n while (--position > 0 && (newBlock === true && getTest(position).match.newBlockMarker !== true || newBlock !== true && !isMask(position) && (tests = getTests(position), \n tests.length < 2 || tests.length === 2 && tests[1].match.def === \"\"))) {}\n return position;\n }\n function writeBuffer(input, buffer, caretPos, event, triggerEvents) {\n if (event && $.isFunction(opts.onBeforeWrite)) {\n var result = opts.onBeforeWrite.call(inputmask, event, buffer, caretPos, opts);\n if (result) {\n if (result.refreshFromBuffer) {\n var refresh = result.refreshFromBuffer;\n refreshFromBuffer(refresh === true ? refresh : refresh.start, refresh.end, result.buffer || buffer);\n buffer = getBuffer(true);\n }\n if (caretPos !== undefined) caretPos = result.caret !== undefined ? result.caret : caretPos;\n }\n }\n if (input !== undefined) {\n input.inputmask._valueSet(buffer.join(\"\"));\n if (caretPos !== undefined && (event === undefined || event.type !== \"blur\")) {\n caret(input, caretPos);\n } else renderColorMask(input, caretPos, buffer.length === 0);\n if (triggerEvents === true) {\n var $input = $(input), nptVal = input.inputmask._valueGet();\n skipInputEvent = true;\n $input.trigger(\"input\");\n setTimeout(function() {\n if (nptVal === getBufferTemplate().join(\"\")) {\n $input.trigger(\"cleared\");\n } else if (isComplete(buffer) === true) {\n $input.trigger(\"complete\");\n }\n }, 0);\n }\n }\n }\n function getPlaceholder(pos, test, returnPL) {\n test = test || getTest(pos).match;\n if (test.placeholder !== undefined || returnPL === true) {\n return $.isFunction(test.placeholder) ? test.placeholder(opts) : test.placeholder;\n } else if (test.fn === null) {\n if (pos > -1 && getMaskSet().validPositions[pos] === undefined) {\n var tests = getTests(pos), staticAlternations = [], prevTest;\n if (tests.length > 1 + (tests[tests.length - 1].match.def === \"\" ? 1 : 0)) {\n for (var i = 0; i < tests.length; i++) {\n if (tests[i].match.optionality !== true && tests[i].match.optionalQuantifier !== true && (tests[i].match.fn === null || (prevTest === undefined || tests[i].match.fn.test(prevTest.match.def, getMaskSet(), pos, true, opts) !== false))) {\n staticAlternations.push(tests[i]);\n if (tests[i].match.fn === null) prevTest = tests[i];\n if (staticAlternations.length > 1) {\n if (/[0-9a-bA-Z]/.test(staticAlternations[0].match.def)) {\n return opts.placeholder.charAt(pos % opts.placeholder.length);\n }\n }\n }\n }\n }\n }\n return test.def;\n }\n return opts.placeholder.charAt(pos % opts.placeholder.length);\n }\n function HandleNativePlaceholder(npt, value) {\n if (ie) {\n if (npt.inputmask._valueGet() !== value && (npt.placeholder !== value || npt.placeholder === \"\")) {\n var buffer = getBuffer().slice(), nptValue = npt.inputmask._valueGet();\n if (nptValue !== value) {\n var lvp = getLastValidPosition();\n if (lvp === -1 && nptValue === getBufferTemplate().join(\"\")) {\n buffer = [];\n } else if (lvp !== -1) {\n clearOptionalTail(buffer);\n }\n writeBuffer(npt, buffer);\n }\n }\n } else if (npt.placeholder !== value) {\n npt.placeholder = value;\n if (npt.placeholder === \"\") npt.removeAttribute(\"placeholder\");\n }\n }\n var EventRuler = {\n on: function(input, eventName, eventHandler) {\n var ev = function(e) {\n var that = this;\n if (that.inputmask === undefined && this.nodeName !== \"FORM\") {\n var imOpts = $.data(that, \"_inputmask_opts\");\n if (imOpts) new Inputmask(imOpts).mask(that); else EventRuler.off(that);\n } else if (e.type !== \"setvalue\" && this.nodeName !== \"FORM\" && (that.disabled || that.readOnly && !(e.type === \"keydown\" && (e.ctrlKey && e.keyCode === 67) || opts.tabThrough === false && e.keyCode === Inputmask.keyCode.TAB))) {\n e.preventDefault();\n } else {\n switch (e.type) {\n case \"input\":\n if (skipInputEvent === true) {\n skipInputEvent = false;\n return e.preventDefault();\n }\n if (mobile) {\n var args = arguments;\n setTimeout(function() {\n eventHandler.apply(that, args);\n caret(that, that.inputmask.caretPos, undefined, true);\n }, 0);\n return false;\n }\n break;\n\n case \"keydown\":\n skipKeyPressEvent = false;\n skipInputEvent = false;\n break;\n\n case \"keypress\":\n if (skipKeyPressEvent === true) {\n return e.preventDefault();\n }\n skipKeyPressEvent = true;\n break;\n\n case \"click\":\n if (iemobile || iphone) {\n var args = arguments;\n setTimeout(function() {\n eventHandler.apply(that, args);\n }, 0);\n return false;\n }\n break;\n }\n var returnVal = eventHandler.apply(that, arguments);\n if (returnVal === false) {\n e.preventDefault();\n e.stopPropagation();\n }\n return returnVal;\n }\n };\n input.inputmask.events[eventName] = input.inputmask.events[eventName] || [];\n input.inputmask.events[eventName].push(ev);\n if ($.inArray(eventName, [ \"submit\", \"reset\" ]) !== -1) {\n if (input.form !== null) $(input.form).on(eventName, ev);\n } else {\n $(input).on(eventName, ev);\n }\n },\n off: function(input, event) {\n if (input.inputmask && input.inputmask.events) {\n var events;\n if (event) {\n events = [];\n events[event] = input.inputmask.events[event];\n } else {\n events = input.inputmask.events;\n }\n $.each(events, function(eventName, evArr) {\n while (evArr.length > 0) {\n var ev = evArr.pop();\n if ($.inArray(eventName, [ \"submit\", \"reset\" ]) !== -1) {\n if (input.form !== null) $(input.form).off(eventName, ev);\n } else {\n $(input).off(eventName, ev);\n }\n }\n delete input.inputmask.events[eventName];\n });\n }\n }\n };\n var EventHandlers = {\n keydownEvent: function(e) {\n var input = this, $input = $(input), k = e.keyCode, pos = caret(input);\n if (k === Inputmask.keyCode.BACKSPACE || k === Inputmask.keyCode.DELETE || iphone && k === Inputmask.keyCode.BACKSPACE_SAFARI || e.ctrlKey && k === Inputmask.keyCode.X && !isInputEventSupported(\"cut\")) {\n e.preventDefault();\n handleRemove(input, k, pos);\n writeBuffer(input, getBuffer(true), getMaskSet().p, e, input.inputmask._valueGet() !== getBuffer().join(\"\"));\n } else if (k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN) {\n e.preventDefault();\n var caretPos = seekNext(getLastValidPosition());\n caret(input, e.shiftKey ? pos.begin : caretPos, caretPos, true);\n } else if (k === Inputmask.keyCode.HOME && !e.shiftKey || k === Inputmask.keyCode.PAGE_UP) {\n e.preventDefault();\n caret(input, 0, e.shiftKey ? pos.begin : 0, true);\n } else if ((opts.undoOnEscape && k === Inputmask.keyCode.ESCAPE || k === 90 && e.ctrlKey) && e.altKey !== true) {\n checkVal(input, true, false, undoValue.split(\"\"));\n $input.trigger(\"click\");\n } else if (k === Inputmask.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) {\n opts.insertMode = !opts.insertMode;\n input.setAttribute(\"im-insert\", opts.insertMode);\n } else if (opts.tabThrough === true && k === Inputmask.keyCode.TAB) {\n if (e.shiftKey === true) {\n if (getTest(pos.begin).match.fn === null) {\n pos.begin = seekNext(pos.begin);\n }\n pos.end = seekPrevious(pos.begin, true);\n pos.begin = seekPrevious(pos.end, true);\n } else {\n pos.begin = seekNext(pos.begin, true);\n pos.end = seekNext(pos.begin, true);\n if (pos.end < getMaskSet().maskLength) pos.end--;\n }\n if (pos.begin < getMaskSet().maskLength) {\n e.preventDefault();\n caret(input, pos.begin, pos.end);\n }\n }\n opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts);\n ignorable = $.inArray(k, opts.ignorables) !== -1;\n },\n keypressEvent: function(e, checkval, writeOut, strict, ndx) {\n var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode;\n if (checkval !== true && (!(e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable))) {\n if (k === Inputmask.keyCode.ENTER && undoValue !== getBuffer().join(\"\")) {\n undoValue = getBuffer().join(\"\");\n setTimeout(function() {\n $input.trigger(\"change\");\n }, 0);\n }\n return true;\n } else {\n if (k) {\n if (k === 46 && e.shiftKey === false && opts.radixPoint !== \"\") k = opts.radixPoint.charCodeAt(0);\n var pos = checkval ? {\n begin: ndx,\n end: ndx\n } : caret(input), forwardPosition, c = String.fromCharCode(k), offset = 0;\n if (opts._radixDance && opts.numericInput) {\n var caretPos = getBuffer().indexOf(opts.radixPoint.charAt(0)) + 1;\n if (pos.begin <= caretPos) {\n if (k === opts.radixPoint.charCodeAt(0)) offset = 1;\n pos.begin -= 1;\n pos.end -= 1;\n }\n }\n getMaskSet().writeOutBuffer = true;\n var valResult = isValid(pos, c, strict);\n if (valResult !== false) {\n resetMaskSet(true);\n forwardPosition = valResult.caret !== undefined ? valResult.caret : seekNext(valResult.pos.begin ? valResult.pos.begin : valResult.pos);\n getMaskSet().p = forwardPosition;\n }\n forwardPosition = (opts.numericInput && valResult.caret === undefined ? seekPrevious(forwardPosition) : forwardPosition) + offset;\n if (writeOut !== false) {\n setTimeout(function() {\n opts.onKeyValidation.call(input, k, valResult, opts);\n }, 0);\n if (getMaskSet().writeOutBuffer && valResult !== false) {\n var buffer = getBuffer();\n writeBuffer(input, buffer, forwardPosition, e, checkval !== true);\n }\n }\n e.preventDefault();\n if (checkval) {\n if (valResult !== false) valResult.forwardPosition = forwardPosition;\n return valResult;\n }\n }\n }\n },\n pasteEvent: function(e) {\n var input = this, ev = e.originalEvent || e, $input = $(input), inputValue = input.inputmask._valueGet(true), caretPos = caret(input), tempValue;\n if (isRTL) {\n tempValue = caretPos.end;\n caretPos.end = caretPos.begin;\n caretPos.begin = tempValue;\n }\n var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);\n if (valueBeforeCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(0, caretPos.begin).join(\"\")) valueBeforeCaret = \"\";\n if (valueAfterCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(caretPos.end).join(\"\")) valueAfterCaret = \"\";\n if (window.clipboardData && window.clipboardData.getData) {\n inputValue = valueBeforeCaret + window.clipboardData.getData(\"Text\") + valueAfterCaret;\n } else if (ev.clipboardData && ev.clipboardData.getData) {\n inputValue = valueBeforeCaret + ev.clipboardData.getData(\"text/plain\") + valueAfterCaret;\n } else return true;\n var pasteValue = inputValue;\n if ($.isFunction(opts.onBeforePaste)) {\n pasteValue = opts.onBeforePaste.call(inputmask, inputValue, opts);\n if (pasteValue === false) {\n return e.preventDefault();\n }\n if (!pasteValue) {\n pasteValue = inputValue;\n }\n }\n checkVal(input, false, false, pasteValue.toString().split(\"\"));\n writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()), e, undoValue !== getBuffer().join(\"\"));\n return e.preventDefault();\n },\n inputFallBackEvent: function(e) {\n function radixPointHandler(input, inputValue, caretPos) {\n if (inputValue.charAt(caretPos.begin - 1) === \".\" && opts.radixPoint !== \"\") {\n inputValue = inputValue.split(\"\");\n inputValue[caretPos.begin - 1] = opts.radixPoint.charAt(0);\n inputValue = inputValue.join(\"\");\n }\n return inputValue;\n }\n function ieMobileHandler(input, inputValue, caretPos) {\n if (iemobile) {\n var inputChar = inputValue.replace(getBuffer().join(\"\"), \"\");\n if (inputChar.length === 1) {\n var iv = inputValue.split(\"\");\n iv.splice(caretPos.begin, 0, inputChar);\n inputValue = iv.join(\"\");\n }\n }\n return inputValue;\n }\n var input = this, inputValue = input.inputmask._valueGet();\n if (getBuffer().join(\"\") !== inputValue) {\n var caretPos = caret(input);\n inputValue = radixPointHandler(input, inputValue, caretPos);\n inputValue = ieMobileHandler(input, inputValue, caretPos);\n if (getBuffer().join(\"\") !== inputValue) {\n var buffer = getBuffer().join(\"\"), offset = !opts.numericInput && inputValue.length > buffer.length ? -1 : 0, frontPart = inputValue.substr(0, caretPos.begin), backPart = inputValue.substr(caretPos.begin), frontBufferPart = buffer.substr(0, caretPos.begin + offset), backBufferPart = buffer.substr(caretPos.begin + offset);\n var selection = caretPos, entries = \"\", isEntry = false;\n if (frontPart !== frontBufferPart) {\n var fpl = (isEntry = frontPart.length >= frontBufferPart.length) ? frontPart.length : frontBufferPart.length, i;\n for (i = 0; frontPart.charAt(i) === frontBufferPart.charAt(i) && i < fpl; i++) ;\n if (isEntry) {\n selection.begin = i - offset;\n entries += frontPart.slice(i, selection.end);\n }\n }\n if (backPart !== backBufferPart) {\n if (backPart.length > backBufferPart.length) {\n entries += backPart.slice(0, 1);\n } else {\n if (backPart.length < backBufferPart.length) {\n selection.end += backBufferPart.length - backPart.length;\n if (!isEntry && opts.radixPoint !== \"\" && backPart === \"\" && frontPart.charAt(selection.begin + offset - 1) === opts.radixPoint) {\n selection.begin--;\n entries = opts.radixPoint;\n }\n }\n }\n }\n writeBuffer(input, getBuffer(), {\n begin: selection.begin + offset,\n end: selection.end + offset\n });\n if (entries.length > 0) {\n $.each(entries.split(\"\"), function(ndx, entry) {\n var keypress = new $.Event(\"keypress\");\n keypress.which = entry.charCodeAt(0);\n ignorable = false;\n EventHandlers.keypressEvent.call(input, keypress);\n });\n } else {\n if (selection.begin === selection.end - 1) {\n selection.begin = seekPrevious(selection.begin + 1);\n if (selection.begin === selection.end - 1) {\n caret(input, selection.begin);\n } else {\n caret(input, selection.begin, selection.end);\n }\n }\n var keydown = new $.Event(\"keydown\");\n keydown.keyCode = opts.numericInput ? Inputmask.keyCode.BACKSPACE : Inputmask.keyCode.DELETE;\n EventHandlers.keydownEvent.call(input, keydown);\n }\n e.preventDefault();\n }\n }\n },\n beforeInputEvent: function(e) {\n if (e.cancelable) {\n var input = this;\n switch (e.inputType) {\n case \"insertText\":\n $.each(e.data.split(\"\"), function(ndx, entry) {\n var keypress = new $.Event(\"keypress\");\n keypress.which = entry.charCodeAt(0);\n ignorable = false;\n EventHandlers.keypressEvent.call(input, keypress);\n });\n return e.preventDefault();\n\n case \"deleteContentBackward\":\n var keydown = new $.Event(\"keydown\");\n keydown.keyCode = Inputmask.keyCode.BACKSPACE;\n EventHandlers.keydownEvent.call(input, keydown);\n return e.preventDefault();\n\n case \"deleteContentForward\":\n var keydown = new $.Event(\"keydown\");\n keydown.keyCode = Inputmask.keyCode.DELETE;\n EventHandlers.keydownEvent.call(input, keydown);\n return e.preventDefault();\n }\n }\n },\n setValueEvent: function(e) {\n this.inputmask.refreshValue = false;\n var input = this, value = e && e.detail ? e.detail[0] : arguments[1], value = value || input.inputmask._valueGet(true);\n if ($.isFunction(opts.onBeforeMask)) value = opts.onBeforeMask.call(inputmask, value, opts) || value;\n value = value.toString().split(\"\");\n checkVal(input, true, false, value);\n undoValue = getBuffer().join(\"\");\n if ((opts.clearMaskOnLostFocus || opts.clearIncomplete) && input.inputmask._valueGet() === getBufferTemplate().join(\"\")) {\n input.inputmask._valueSet(\"\");\n }\n },\n focusEvent: function(e) {\n var input = this, nptValue = input.inputmask._valueGet();\n if (opts.showMaskOnFocus) {\n if (nptValue !== getBuffer().join(\"\")) {\n writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()));\n } else if (mouseEnter === false) {\n caret(input, seekNext(getLastValidPosition()));\n }\n }\n if (opts.positionCaretOnTab === true && mouseEnter === false) {\n EventHandlers.clickEvent.apply(input, [ e, true ]);\n }\n undoValue = getBuffer().join(\"\");\n },\n mouseleaveEvent: function(e) {\n var input = this;\n mouseEnter = false;\n if (opts.clearMaskOnLostFocus && document.activeElement !== input) {\n HandleNativePlaceholder(input, originalPlaceholder);\n }\n },\n clickEvent: function(e, tabbed) {\n function doRadixFocus(clickPos) {\n if (opts.radixPoint !== \"\") {\n var vps = getMaskSet().validPositions;\n if (vps[clickPos] === undefined || vps[clickPos].input === getPlaceholder(clickPos)) {\n if (clickPos < seekNext(-1)) return true;\n var radixPos = $.inArray(opts.radixPoint, getBuffer());\n if (radixPos !== -1) {\n for (var vp in vps) {\n if (radixPos < vp && vps[vp].input !== getPlaceholder(vp)) {\n return false;\n }\n }\n return true;\n }\n }\n }\n return false;\n }\n var input = this;\n setTimeout(function() {\n if (document.activeElement === input) {\n var selectedCaret = caret(input);\n if (tabbed) {\n if (isRTL) {\n selectedCaret.end = selectedCaret.begin;\n } else {\n selectedCaret.begin = selectedCaret.end;\n }\n }\n if (selectedCaret.begin === selectedCaret.end) {\n switch (opts.positionCaretOnClick) {\n case \"none\":\n break;\n\n case \"select\":\n caret(input, 0, getBuffer().length);\n break;\n\n case \"ignore\":\n caret(input, seekNext(getLastValidPosition()));\n break;\n\n case \"radixFocus\":\n if (doRadixFocus(selectedCaret.begin)) {\n var radixPos = getBuffer().join(\"\").indexOf(opts.radixPoint);\n caret(input, opts.numericInput ? seekNext(radixPos) : radixPos);\n break;\n }\n\n default:\n var clickPosition = selectedCaret.begin, lvclickPosition = getLastValidPosition(clickPosition, true), lastPosition = seekNext(lvclickPosition);\n if (clickPosition < lastPosition) {\n caret(input, !isMask(clickPosition, true) && !isMask(clickPosition - 1, true) ? seekNext(clickPosition) : clickPosition);\n } else {\n var lvp = getMaskSet().validPositions[lvclickPosition], tt = getTestTemplate(lastPosition, lvp ? lvp.match.locator : undefined, lvp), placeholder = getPlaceholder(lastPosition, tt.match);\n if (placeholder !== \"\" && getBuffer()[lastPosition] !== placeholder && tt.match.optionalQuantifier !== true && tt.match.newBlockMarker !== true || !isMask(lastPosition, opts.keepStatic) && tt.match.def === placeholder) {\n var newPos = seekNext(lastPosition);\n if (clickPosition >= newPos || clickPosition === lastPosition) {\n lastPosition = newPos;\n }\n }\n caret(input, lastPosition);\n }\n break;\n }\n }\n }\n }, 0);\n },\n cutEvent: function(e) {\n var input = this, $input = $(input), pos = caret(input), ev = e.originalEvent || e;\n var clipboardData = window.clipboardData || ev.clipboardData, clipData = isRTL ? getBuffer().slice(pos.end, pos.begin) : getBuffer().slice(pos.begin, pos.end);\n clipboardData.setData(\"text\", isRTL ? clipData.reverse().join(\"\") : clipData.join(\"\"));\n if (document.execCommand) document.execCommand(\"copy\");\n handleRemove(input, Inputmask.keyCode.DELETE, pos);\n writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join(\"\"));\n },\n blurEvent: function(e) {\n var $input = $(this), input = this;\n if (input.inputmask) {\n HandleNativePlaceholder(input, originalPlaceholder);\n var nptValue = input.inputmask._valueGet(), buffer = getBuffer().slice();\n if (nptValue !== \"\" || colorMask !== undefined) {\n if (opts.clearMaskOnLostFocus) {\n if (getLastValidPosition() === -1 && nptValue === getBufferTemplate().join(\"\")) {\n buffer = [];\n } else {\n clearOptionalTail(buffer);\n }\n }\n if (isComplete(buffer) === false) {\n setTimeout(function() {\n $input.trigger(\"incomplete\");\n }, 0);\n if (opts.clearIncomplete) {\n resetMaskSet();\n if (opts.clearMaskOnLostFocus) {\n buffer = [];\n } else {\n buffer = getBufferTemplate().slice();\n }\n }\n }\n writeBuffer(input, buffer, undefined, e);\n }\n if (undoValue !== getBuffer().join(\"\")) {\n undoValue = buffer.join(\"\");\n $input.trigger(\"change\");\n }\n }\n },\n mouseenterEvent: function(e) {\n var input = this;\n mouseEnter = true;\n if (document.activeElement !== input && opts.showMaskOnHover) {\n HandleNativePlaceholder(input, (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(\"\"));\n }\n },\n submitEvent: function(e) {\n if (undoValue !== getBuffer().join(\"\")) {\n $el.trigger(\"change\");\n }\n if (opts.clearMaskOnLostFocus && getLastValidPosition() === -1 && el.inputmask._valueGet && el.inputmask._valueGet() === getBufferTemplate().join(\"\")) {\n el.inputmask._valueSet(\"\");\n }\n if (opts.clearIncomplete && isComplete(getBuffer()) === false) {\n el.inputmask._valueSet(\"\");\n }\n if (opts.removeMaskOnSubmit) {\n el.inputmask._valueSet(el.inputmask.unmaskedvalue(), true);\n setTimeout(function() {\n writeBuffer(el, getBuffer());\n }, 0);\n }\n },\n resetEvent: function(e) {\n el.inputmask.refreshValue = true;\n setTimeout(function() {\n $el.trigger(\"setvalue\");\n }, 0);\n }\n };\n function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {\n var inputmask = this || input.inputmask, inputValue = nptvl.slice(), charCodes = \"\", initialNdx = -1, result = undefined;\n function isTemplateMatch(ndx, charCodes) {\n var charCodeNdx = getMaskTemplate(true, 0, false).slice(ndx, seekNext(ndx)).join(\"\").replace(/'/g, \"\").indexOf(charCodes);\n return charCodeNdx !== -1 && !isMask(ndx) && (getTest(ndx).match.nativeDef === charCodes.charAt(0) || getTest(ndx).match.fn === null && getTest(ndx).match.nativeDef === \"'\" + charCodes.charAt(0) || getTest(ndx).match.nativeDef === \" \" && (getTest(ndx + 1).match.nativeDef === charCodes.charAt(0) || getTest(ndx + 1).match.fn === null && getTest(ndx + 1).match.nativeDef === \"'\" + charCodes.charAt(0)));\n }\n resetMaskSet();\n if (!strict && opts.autoUnmask !== true) {\n var staticInput = getBufferTemplate().slice(0, seekNext(-1)).join(\"\"), matches = inputValue.join(\"\").match(new RegExp(\"^\" + Inputmask.escapeRegex(staticInput), \"g\"));\n if (matches && matches.length > 0) {\n inputValue.splice(0, matches.length * staticInput.length);\n initialNdx = seekNext(initialNdx);\n }\n } else {\n initialNdx = seekNext(initialNdx);\n }\n if (initialNdx === -1) {\n getMaskSet().p = seekNext(initialNdx);\n initialNdx = 0;\n } else getMaskSet().p = initialNdx;\n inputmask.caretPos = {\n begin: initialNdx\n };\n $.each(inputValue, function(ndx, charCode) {\n if (charCode !== undefined) {\n if (getMaskSet().validPositions[ndx] === undefined && inputValue[ndx] === getPlaceholder(ndx) && isMask(ndx, true) && isValid(ndx, inputValue[ndx], true, undefined, undefined, true) === false) {\n getMaskSet().p++;\n } else {\n var keypress = new $.Event(\"_checkval\");\n keypress.which = charCode.charCodeAt(0);\n charCodes += charCode;\n var lvp = getLastValidPosition(undefined, true);\n if (!isTemplateMatch(initialNdx, charCodes)) {\n result = EventHandlers.keypressEvent.call(input, keypress, true, false, strict, inputmask.caretPos.begin);\n if (result) {\n initialNdx = inputmask.caretPos.begin + 1;\n charCodes = \"\";\n }\n } else {\n result = EventHandlers.keypressEvent.call(input, keypress, true, false, strict, lvp + 1);\n }\n if (result) {\n writeBuffer(undefined, getBuffer(), result.forwardPosition, keypress, false);\n inputmask.caretPos = {\n begin: result.forwardPosition,\n end: result.forwardPosition\n };\n }\n }\n }\n });\n if (writeOut) writeBuffer(input, getBuffer(), result ? result.forwardPosition : undefined, initiatingEvent || new $.Event(\"checkval\"), initiatingEvent && initiatingEvent.type === \"input\");\n }\n function unmaskedvalue(input) {\n if (input) {\n if (input.inputmask === undefined) {\n return input.value;\n }\n if (input.inputmask && input.inputmask.refreshValue) {\n EventHandlers.setValueEvent.call(input);\n }\n }\n var umValue = [], vps = getMaskSet().validPositions;\n for (var pndx in vps) {\n if (vps[pndx].match && vps[pndx].match.fn != null) {\n umValue.push(vps[pndx].input);\n }\n }\n var unmaskedValue = umValue.length === 0 ? \"\" : (isRTL ? umValue.reverse() : umValue).join(\"\");\n if ($.isFunction(opts.onUnMask)) {\n var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(\"\");\n unmaskedValue = opts.onUnMask.call(inputmask, bufferValue, unmaskedValue, opts);\n }\n return unmaskedValue;\n }\n function caret(input, begin, end, notranslate) {\n function translatePosition(pos) {\n if (isRTL && typeof pos === \"number\" && (!opts.greedy || opts.placeholder !== \"\") && el) {\n pos = el.inputmask._valueGet().length - pos;\n }\n return pos;\n }\n var range;\n if (begin !== undefined) {\n if ($.isArray(begin)) {\n end = isRTL ? begin[0] : begin[1];\n begin = isRTL ? begin[1] : begin[0];\n }\n if (begin.begin !== undefined) {\n end = isRTL ? begin.begin : begin.end;\n begin = isRTL ? begin.end : begin.begin;\n }\n if (typeof begin === \"number\") {\n begin = notranslate ? begin : translatePosition(begin);\n end = notranslate ? end : translatePosition(end);\n end = typeof end == \"number\" ? end : begin;\n var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;\n input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0;\n input.inputmask.caretPos = {\n begin: begin,\n end: end\n };\n if (input === document.activeElement) {\n if (\"selectionStart\" in input) {\n input.selectionStart = begin;\n input.selectionEnd = end;\n } else if (window.getSelection) {\n range = document.createRange();\n if (input.firstChild === undefined || input.firstChild === null) {\n var textNode = document.createTextNode(\"\");\n input.appendChild(textNode);\n }\n range.setStart(input.firstChild, begin < input.inputmask._valueGet().length ? begin : input.inputmask._valueGet().length);\n range.setEnd(input.firstChild, end < input.inputmask._valueGet().length ? end : input.inputmask._valueGet().length);\n range.collapse(true);\n var sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n } else if (input.createTextRange) {\n range = input.createTextRange();\n range.collapse(true);\n range.moveEnd(\"character\", end);\n range.moveStart(\"character\", begin);\n range.select();\n }\n renderColorMask(input, {\n begin: begin,\n end: end\n });\n }\n }\n } else {\n if (\"selectionStart\" in input) {\n begin = input.selectionStart;\n end = input.selectionEnd;\n } else if (window.getSelection) {\n range = window.getSelection().getRangeAt(0);\n if (range.commonAncestorContainer.parentNode === input || range.commonAncestorContainer === input) {\n begin = range.startOffset;\n end = range.endOffset;\n }\n } else if (document.selection && document.selection.createRange) {\n range = document.selection.createRange();\n begin = 0 - range.duplicate().moveStart(\"character\", -input.inputmask._valueGet().length);\n end = begin + range.text.length;\n }\n return {\n begin: notranslate ? begin : translatePosition(begin),\n end: notranslate ? end : translatePosition(end)\n };\n }\n }\n function determineLastRequiredPosition(returnDefinition) {\n var buffer = getMaskTemplate(true, getLastValidPosition(), true, true), bl = buffer.length, pos, lvp = getLastValidPosition(), positions = {}, lvTest = getMaskSet().validPositions[lvp], ndxIntlzr = lvTest !== undefined ? lvTest.locator.slice() : undefined, testPos;\n for (pos = lvp + 1; pos < buffer.length; pos++) {\n testPos = getTestTemplate(pos, ndxIntlzr, pos - 1);\n ndxIntlzr = testPos.locator.slice();\n positions[pos] = $.extend(true, {}, testPos);\n }\n var lvTestAlt = lvTest && lvTest.alternation !== undefined ? lvTest.locator[lvTest.alternation] : undefined;\n for (pos = bl - 1; pos > lvp; pos--) {\n testPos = positions[pos];\n if ((testPos.match.optionality || testPos.match.optionalQuantifier && testPos.match.newBlockMarker || lvTestAlt && (lvTestAlt !== positions[pos].locator[lvTest.alternation] && testPos.match.fn != null || testPos.match.fn === null && testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(\",\"), lvTestAlt.toString().split(\",\")) && getTests(pos)[0].def !== \"\")) && buffer[pos] === getPlaceholder(pos, testPos.match)) {\n bl--;\n } else break;\n }\n return returnDefinition ? {\n l: bl,\n def: positions[bl] ? positions[bl].match : undefined\n } : bl;\n }\n function clearOptionalTail(buffer) {\n buffer.length = 0;\n var template = getMaskTemplate(true, 0, true, undefined, true), lmnt, validPos;\n while (lmnt = template.shift(), lmnt !== undefined) buffer.push(lmnt);\n return buffer;\n }\n function isComplete(buffer) {\n if ($.isFunction(opts.isComplete)) return opts.isComplete(buffer, opts);\n if (opts.repeat === \"*\") return undefined;\n var complete = false, lrp = determineLastRequiredPosition(true), aml = seekPrevious(lrp.l);\n if (lrp.def === undefined || lrp.def.newBlockMarker || lrp.def.optionality || lrp.def.optionalQuantifier) {\n complete = true;\n for (var i = 0; i <= aml; i++) {\n var test = getTestTemplate(i).match;\n if (test.fn !== null && getMaskSet().validPositions[i] === undefined && test.optionality !== true && test.optionalQuantifier !== true || test.fn === null && buffer[i] !== getPlaceholder(i, test)) {\n complete = false;\n break;\n }\n }\n }\n return complete;\n }\n function handleRemove(input, k, pos, strict, fromIsValid) {\n if (opts.numericInput || isRTL) {\n if (k === Inputmask.keyCode.BACKSPACE) {\n k = Inputmask.keyCode.DELETE;\n } else if (k === Inputmask.keyCode.DELETE) {\n k = Inputmask.keyCode.BACKSPACE;\n }\n if (isRTL) {\n var pend = pos.end;\n pos.end = pos.begin;\n pos.begin = pend;\n }\n }\n if (k === Inputmask.keyCode.BACKSPACE && pos.end - pos.begin < 1) {\n pos.begin = seekPrevious(pos.begin);\n if (getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator) {\n pos.begin--;\n }\n } else if (k === Inputmask.keyCode.DELETE && pos.begin === pos.end) {\n pos.end = isMask(pos.end, true) && (getMaskSet().validPositions[pos.end] && getMaskSet().validPositions[pos.end].input !== opts.radixPoint) ? pos.end + 1 : seekNext(pos.end) + 1;\n if (getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator) {\n pos.end++;\n }\n }\n revalidateMask(pos);\n if (strict !== true && opts.keepStatic !== false || opts.regex !== null) {\n var result = alternate(true);\n if (result) {\n var newPos = result.caret !== undefined ? result.caret : result.pos ? seekNext(result.pos.begin ? result.pos.begin : result.pos) : getLastValidPosition(-1, true);\n if (k !== Inputmask.keyCode.DELETE || pos.begin > newPos) {\n pos.begin == newPos;\n }\n }\n }\n var lvp = getLastValidPosition(pos.begin, true);\n if (lvp < pos.begin || pos.begin === -1) {\n getMaskSet().p = seekNext(lvp);\n } else if (strict !== true) {\n getMaskSet().p = pos.begin;\n if (fromIsValid !== true) {\n while (getMaskSet().p < lvp && getMaskSet().validPositions[getMaskSet().p] === undefined) {\n getMaskSet().p++;\n }\n }\n }\n }\n function initializeColorMask(input) {\n var computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null);\n function findCaretPos(clientx) {\n var e = document.createElement(\"span\"), caretPos;\n for (var style in computedStyle) {\n if (isNaN(style) && style.indexOf(\"font\") !== -1) {\n e.style[style] = computedStyle[style];\n }\n }\n e.style.textTransform = computedStyle.textTransform;\n e.style.letterSpacing = computedStyle.letterSpacing;\n e.style.position = \"absolute\";\n e.style.height = \"auto\";\n e.style.width = \"auto\";\n e.style.visibility = \"hidden\";\n e.style.whiteSpace = \"nowrap\";\n document.body.appendChild(e);\n var inputText = input.inputmask._valueGet(), previousWidth = 0, itl;\n for (caretPos = 0, itl = inputText.length; caretPos <= itl; caretPos++) {\n e.innerHTML += inputText.charAt(caretPos) || \"_\";\n if (e.offsetWidth >= clientx) {\n var offset1 = clientx - previousWidth;\n var offset2 = e.offsetWidth - clientx;\n e.innerHTML = inputText.charAt(caretPos);\n offset1 -= e.offsetWidth / 3;\n caretPos = offset1 < offset2 ? caretPos - 1 : caretPos;\n break;\n }\n previousWidth = e.offsetWidth;\n }\n document.body.removeChild(e);\n return caretPos;\n }\n var template = document.createElement(\"div\");\n template.style.width = computedStyle.width;\n template.style.textAlign = computedStyle.textAlign;\n colorMask = document.createElement(\"div\");\n input.inputmask.colorMask = colorMask;\n colorMask.className = \"im-colormask\";\n input.parentNode.insertBefore(colorMask, input);\n input.parentNode.removeChild(input);\n colorMask.appendChild(input);\n colorMask.appendChild(template);\n input.style.left = template.offsetLeft + \"px\";\n $(colorMask).on(\"mouseleave\", function(e) {\n return EventHandlers.mouseleaveEvent.call(input, [ e ]);\n });\n $(colorMask).on(\"mouseenter\", function(e) {\n return EventHandlers.mouseenterEvent.call(input, [ e ]);\n });\n $(colorMask).on(\"click\", function(e) {\n caret(input, findCaretPos(e.clientX));\n return EventHandlers.clickEvent.call(input, [ e ]);\n });\n }\n function renderColorMask(input, caretPos, clear) {\n var maskTemplate = [], isStatic = false, test, testPos, ndxIntlzr, pos = 0;\n function setEntry(entry) {\n if (entry === undefined) entry = \"\";\n if (!isStatic && (test.fn === null || testPos.input === undefined)) {\n isStatic = true;\n maskTemplate.push(\"<span class='im-static'>\" + entry);\n } else if (isStatic && (test.fn !== null && testPos.input !== undefined || test.def === \"\")) {\n isStatic = false;\n var mtl = maskTemplate.length;\n maskTemplate[mtl - 1] = maskTemplate[mtl - 1] + \"</span>\";\n maskTemplate.push(entry);\n } else maskTemplate.push(entry);\n }\n function setCaret() {\n if (document.activeElement === input) {\n maskTemplate.splice(caretPos.begin, 0, caretPos.begin === caretPos.end || caretPos.end > getMaskSet().maskLength ? '<mark class=\"im-caret\" style=\"border-right-width: 1px;border-right-style: solid;\">' : '<mark class=\"im-caret-select\">');\n maskTemplate.splice(caretPos.end + 1, 0, \"</mark>\");\n }\n }\n if (colorMask !== undefined) {\n var buffer = getBuffer();\n if (caretPos === undefined) {\n caretPos = caret(input);\n } else if (caretPos.begin === undefined) {\n caretPos = {\n begin: caretPos,\n end: caretPos\n };\n }\n if (clear !== true) {\n var lvp = getLastValidPosition();\n do {\n if (getMaskSet().validPositions[pos]) {\n testPos = getMaskSet().validPositions[pos];\n test = testPos.match;\n ndxIntlzr = testPos.locator.slice();\n setEntry(buffer[pos]);\n } else {\n testPos = getTestTemplate(pos, ndxIntlzr, pos - 1);\n test = testPos.match;\n ndxIntlzr = testPos.locator.slice();\n if (opts.jitMasking === false || pos < lvp || typeof opts.jitMasking === \"number\" && isFinite(opts.jitMasking) && opts.jitMasking > pos) {\n setEntry(getPlaceholder(pos, test));\n } else isStatic = false;\n }\n pos++;\n } while ((maxLength === undefined || pos < maxLength) && (test.fn !== null || test.def !== \"\") || lvp > pos || isStatic);\n if (isStatic) setEntry();\n setCaret();\n }\n var template = colorMask.getElementsByTagName(\"div\")[0];\n template.innerHTML = maskTemplate.join(\"\");\n input.inputmask.positionColorMask(input, template);\n }\n }\n function mask(elem) {\n function isElementTypeSupported(input, opts) {\n function patchValueProperty(npt) {\n var valueGet;\n var valueSet;\n function patchValhook(type) {\n if ($.valHooks && ($.valHooks[type] === undefined || $.valHooks[type].inputmaskpatch !== true)) {\n var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {\n return elem.value;\n };\n var valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) {\n elem.value = value;\n return elem;\n };\n $.valHooks[type] = {\n get: function(elem) {\n if (elem.inputmask) {\n if (elem.inputmask.opts.autoUnmask) {\n return elem.inputmask.unmaskedvalue();\n } else {\n var result = valhookGet(elem);\n return getLastValidPosition(undefined, undefined, elem.inputmask.maskset.validPositions) !== -1 || opts.nullable !== true ? result : \"\";\n }\n } else return valhookGet(elem);\n },\n set: function(elem, value) {\n var $elem = $(elem), result;\n result = valhookSet(elem, value);\n if (elem.inputmask) {\n $elem.trigger(\"setvalue\", [ value ]);\n }\n return result;\n },\n inputmaskpatch: true\n };\n }\n }\n function getter() {\n if (this.inputmask) {\n return this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : getLastValidPosition() !== -1 || opts.nullable !== true ? document.activeElement === this && opts.clearMaskOnLostFocus ? (isRTL ? clearOptionalTail(getBuffer().slice()).reverse() : clearOptionalTail(getBuffer().slice())).join(\"\") : valueGet.call(this) : \"\";\n } else return valueGet.call(this);\n }\n function setter(value) {\n valueSet.call(this, value);\n if (this.inputmask) {\n $(this).trigger(\"setvalue\", [ value ]);\n }\n }\n function installNativeValueSetFallback(npt) {\n EventRuler.on(npt, \"mouseenter\", function(event) {\n var $input = $(this), input = this, value = input.inputmask._valueGet();\n if (value !== getBuffer().join(\"\")) {\n $input.trigger(\"setvalue\");\n }\n });\n }\n if (!npt.inputmask.__valueGet) {\n if (opts.noValuePatching !== true) {\n if (Object.getOwnPropertyDescriptor) {\n if (typeof Object.getPrototypeOf !== \"function\") {\n Object.getPrototypeOf = typeof \"test\".__proto__ === \"object\" ? function(object) {\n return object.__proto__;\n } : function(object) {\n return object.constructor.prototype;\n };\n }\n var valueProperty = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(npt), \"value\") : undefined;\n if (valueProperty && valueProperty.get && valueProperty.set) {\n valueGet = valueProperty.get;\n valueSet = valueProperty.set;\n Object.defineProperty(npt, \"value\", {\n get: getter,\n set: setter,\n configurable: true\n });\n } else if (npt.tagName !== \"INPUT\") {\n valueGet = function() {\n return this.textContent;\n };\n valueSet = function(value) {\n this.textContent = value;\n };\n Object.defineProperty(npt, \"value\", {\n get: getter,\n set: setter,\n configurable: true\n });\n }\n } else if (document.__lookupGetter__ && npt.__lookupGetter__(\"value\")) {\n valueGet = npt.__lookupGetter__(\"value\");\n valueSet = npt.__lookupSetter__(\"value\");\n npt.__defineGetter__(\"value\", getter);\n npt.__defineSetter__(\"value\", setter);\n }\n npt.inputmask.__valueGet = valueGet;\n npt.inputmask.__valueSet = valueSet;\n }\n npt.inputmask._valueGet = function(overruleRTL) {\n return isRTL && overruleRTL !== true ? valueGet.call(this.el).split(\"\").reverse().join(\"\") : valueGet.call(this.el);\n };\n npt.inputmask._valueSet = function(value, overruleRTL) {\n valueSet.call(this.el, value === null || value === undefined ? \"\" : overruleRTL !== true && isRTL ? value.split(\"\").reverse().join(\"\") : value);\n };\n if (valueGet === undefined) {\n valueGet = function() {\n return this.value;\n };\n valueSet = function(value) {\n this.value = value;\n };\n patchValhook(npt.type);\n installNativeValueSetFallback(npt);\n }\n }\n }\n var elementType = input.getAttribute(\"type\");\n var isSupported = input.tagName === \"INPUT\" && $.inArray(elementType, opts.supportsInputType) !== -1 || input.isContentEditable || input.tagName === \"TEXTAREA\";\n if (!isSupported) {\n if (input.tagName === \"INPUT\") {\n var el = document.createElement(\"input\");\n el.setAttribute(\"type\", elementType);\n isSupported = el.type === \"text\";\n el = null;\n } else isSupported = \"partial\";\n }\n if (isSupported !== false) {\n patchValueProperty(input);\n } else input.inputmask = undefined;\n return isSupported;\n }\n EventRuler.off(elem);\n var isSupported = isElementTypeSupported(elem, opts);\n if (isSupported !== false) {\n el = elem;\n $el = $(el);\n originalPlaceholder = el.placeholder;\n maxLength = el !== undefined ? el.maxLength : undefined;\n if (maxLength === -1) maxLength = undefined;\n if (opts.colorMask === true) {\n initializeColorMask(el);\n }\n if (mobile) {\n if (\"inputMode\" in el) {\n el.inputmode = opts.inputmode;\n el.setAttribute(\"inputmode\", opts.inputmode);\n }\n if (opts.disablePredictiveText === true) {\n if (\"autocorrect\" in el) {\n el.autocorrect = false;\n } else {\n if (opts.colorMask !== true) {\n initializeColorMask(el);\n }\n el.type = \"password\";\n }\n }\n }\n if (isSupported === true) {\n el.setAttribute(\"im-insert\", opts.insertMode);\n EventRuler.on(el, \"submit\", EventHandlers.submitEvent);\n EventRuler.on(el, \"reset\", EventHandlers.resetEvent);\n EventRuler.on(el, \"blur\", EventHandlers.blurEvent);\n EventRuler.on(el, \"focus\", EventHandlers.focusEvent);\n if (opts.colorMask !== true) {\n EventRuler.on(el, \"click\", EventHandlers.clickEvent);\n EventRuler.on(el, \"mouseleave\", EventHandlers.mouseleaveEvent);\n EventRuler.on(el, \"mouseenter\", EventHandlers.mouseenterEvent);\n }\n EventRuler.on(el, \"paste\", EventHandlers.pasteEvent);\n EventRuler.on(el, \"cut\", EventHandlers.cutEvent);\n EventRuler.on(el, \"complete\", opts.oncomplete);\n EventRuler.on(el, \"incomplete\", opts.onincomplete);\n EventRuler.on(el, \"cleared\", opts.oncleared);\n if (!mobile && opts.inputEventOnly !== true) {\n EventRuler.on(el, \"keydown\", EventHandlers.keydownEvent);\n EventRuler.on(el, \"keypress\", EventHandlers.keypressEvent);\n } else {\n el.removeAttribute(\"maxLength\");\n }\n EventRuler.on(el, \"input\", EventHandlers.inputFallBackEvent);\n EventRuler.on(el, \"beforeinput\", EventHandlers.beforeInputEvent);\n }\n EventRuler.on(el, \"setvalue\", EventHandlers.setValueEvent);\n undoValue = getBufferTemplate().join(\"\");\n if (el.inputmask._valueGet(true) !== \"\" || opts.clearMaskOnLostFocus === false || document.activeElement === el) {\n var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, el.inputmask._valueGet(true), opts) || el.inputmask._valueGet(true) : el.inputmask._valueGet(true);\n if (initialValue !== \"\") checkVal(el, true, false, initialValue.split(\"\"));\n var buffer = getBuffer().slice();\n undoValue = buffer.join(\"\");\n if (isComplete(buffer) === false) {\n if (opts.clearIncomplete) {\n resetMaskSet();\n }\n }\n if (opts.clearMaskOnLostFocus && document.activeElement !== el) {\n if (getLastValidPosition() === -1) {\n buffer = [];\n } else {\n clearOptionalTail(buffer);\n }\n }\n if (opts.clearMaskOnLostFocus === false || opts.showMaskOnFocus && document.activeElement === el || el.inputmask._valueGet(true) !== \"\") writeBuffer(el, buffer);\n if (document.activeElement === el) {\n caret(el, seekNext(getLastValidPosition()));\n }\n }\n }\n }\n var valueBuffer;\n if (actionObj !== undefined) {\n switch (actionObj.action) {\n case \"isComplete\":\n el = actionObj.el;\n return isComplete(getBuffer());\n\n case \"unmaskedvalue\":\n if (el === undefined || actionObj.value !== undefined) {\n valueBuffer = actionObj.value;\n valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, valueBuffer, opts) || valueBuffer : valueBuffer).split(\"\");\n checkVal.call(this, undefined, false, false, valueBuffer);\n if ($.isFunction(opts.onBeforeWrite)) opts.onBeforeWrite.call(inputmask, undefined, getBuffer(), 0, opts);\n }\n return unmaskedvalue(el);\n\n case \"mask\":\n mask(el);\n break;\n\n case \"format\":\n valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, actionObj.value, opts) || actionObj.value : actionObj.value).split(\"\");\n checkVal.call(this, undefined, true, false, valueBuffer);\n if (actionObj.metadata) {\n return {\n value: isRTL ? getBuffer().slice().reverse().join(\"\") : getBuffer().join(\"\"),\n metadata: maskScope.call(this, {\n action: \"getmetadata\"\n }, maskset, opts)\n };\n }\n return isRTL ? getBuffer().slice().reverse().join(\"\") : getBuffer().join(\"\");\n\n case \"isValid\":\n if (actionObj.value) {\n valueBuffer = actionObj.value.split(\"\");\n checkVal.call(this, undefined, true, true, valueBuffer);\n } else {\n actionObj.value = getBuffer().join(\"\");\n }\n var buffer = getBuffer();\n var rl = determineLastRequiredPosition(), lmib = buffer.length - 1;\n for (;lmib > rl; lmib--) {\n if (isMask(lmib)) break;\n }\n buffer.splice(rl, lmib + 1 - rl);\n return isComplete(buffer) && actionObj.value === getBuffer().join(\"\");\n\n case \"getemptymask\":\n return getBufferTemplate().join(\"\");\n\n case \"remove\":\n if (el && el.inputmask) {\n $.data(el, \"_inputmask_opts\", null);\n $el = $(el);\n el.inputmask._valueSet(opts.autoUnmask ? unmaskedvalue(el) : el.inputmask._valueGet(true));\n EventRuler.off(el);\n if (el.inputmask.colorMask) {\n colorMask = el.inputmask.colorMask;\n colorMask.removeChild(el);\n colorMask.parentNode.insertBefore(el, colorMask);\n colorMask.parentNode.removeChild(colorMask);\n }\n var valueProperty;\n if (Object.getOwnPropertyDescriptor && Object.getPrototypeOf) {\n valueProperty = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el), \"value\");\n if (valueProperty) {\n if (el.inputmask.__valueGet) {\n Object.defineProperty(el, \"value\", {\n get: el.inputmask.__valueGet,\n set: el.inputmask.__valueSet,\n configurable: true\n });\n }\n }\n } else if (document.__lookupGetter__ && el.__lookupGetter__(\"value\")) {\n if (el.inputmask.__valueGet) {\n el.__defineGetter__(\"value\", el.inputmask.__valueGet);\n el.__defineSetter__(\"value\", el.inputmask.__valueSet);\n }\n }\n el.inputmask = undefined;\n }\n return el;\n break;\n\n case \"getmetadata\":\n if ($.isArray(maskset.metadata)) {\n var maskTarget = getMaskTemplate(true, 0, false).join(\"\");\n $.each(maskset.metadata, function(ndx, mtdt) {\n if (mtdt.mask === maskTarget) {\n maskTarget = mtdt;\n return false;\n }\n });\n return maskTarget;\n }\n return maskset.metadata;\n }\n }\n }\n return Inputmask;\n});\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js?");
1992
-
1993
- /***/ }),
1994
-
1995
- /***/ "./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.numeric.extensions.js":
1996
- /*!*********************************************************************************************************!*\
1997
- !*** ./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.numeric.extensions.js ***!
1998
- \*********************************************************************************************************/
1999
- /***/ (function(module, exports, __webpack_require__) {
2000
-
2001
- eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n* inputmask.numeric.extensions.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(/*! ./inputmask */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js\") ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(function(Inputmask) {\n var $ = Inputmask.dependencyLib;\n function autoEscape(txt, opts) {\n var escapedTxt = \"\";\n for (var i = 0; i < txt.length; i++) {\n if (Inputmask.prototype.definitions[txt.charAt(i)] || opts.definitions[txt.charAt(i)] || opts.optionalmarker.start === txt.charAt(i) || opts.optionalmarker.end === txt.charAt(i) || opts.quantifiermarker.start === txt.charAt(i) || opts.quantifiermarker.end === txt.charAt(i) || opts.groupmarker.start === txt.charAt(i) || opts.groupmarker.end === txt.charAt(i) || opts.alternatormarker === txt.charAt(i)) {\n escapedTxt += \"\\\\\" + txt.charAt(i);\n } else escapedTxt += txt.charAt(i);\n }\n return escapedTxt;\n }\n function alignDigits(buffer, digits, opts) {\n if (digits > 0) {\n var radixPosition = $.inArray(opts.radixPoint, buffer);\n if (radixPosition === -1) {\n buffer.push(opts.radixPoint);\n radixPosition = buffer.length - 1;\n }\n for (var i = 1; i <= digits; i++) {\n buffer[radixPosition + i] = buffer[radixPosition + i] || \"0\";\n }\n }\n return buffer;\n }\n Inputmask.extendAliases({\n numeric: {\n mask: function(opts) {\n if (opts.repeat !== 0 && isNaN(opts.integerDigits)) {\n opts.integerDigits = opts.repeat;\n }\n opts.repeat = 0;\n if (opts.groupSeparator === opts.radixPoint && opts.digits && opts.digits !== \"0\") {\n if (opts.radixPoint === \".\") {\n opts.groupSeparator = \",\";\n } else if (opts.radixPoint === \",\") {\n opts.groupSeparator = \".\";\n } else opts.groupSeparator = \"\";\n }\n if (opts.groupSeparator === \" \") {\n opts.skipOptionalPartCharacter = undefined;\n }\n opts.autoGroup = opts.autoGroup && opts.groupSeparator !== \"\";\n if (opts.autoGroup) {\n if (typeof opts.groupSize == \"string\" && isFinite(opts.groupSize)) opts.groupSize = parseInt(opts.groupSize);\n if (isFinite(opts.integerDigits)) {\n var seps = Math.floor(opts.integerDigits / opts.groupSize);\n var mod = opts.integerDigits % opts.groupSize;\n opts.integerDigits = parseInt(opts.integerDigits) + (mod === 0 ? seps - 1 : seps);\n if (opts.integerDigits < 1) {\n opts.integerDigits = \"*\";\n }\n }\n }\n if (opts.placeholder.length > 1) {\n opts.placeholder = opts.placeholder.charAt(0);\n }\n if (opts.positionCaretOnClick === \"radixFocus\" && (opts.placeholder === \"\" && opts.integerOptional === false)) {\n opts.positionCaretOnClick = \"lvp\";\n }\n opts.definitions[\";\"] = opts.definitions[\"~\"];\n opts.definitions[\";\"].definitionSymbol = \"~\";\n if (opts.numericInput === true) {\n opts.positionCaretOnClick = opts.positionCaretOnClick === \"radixFocus\" ? \"lvp\" : opts.positionCaretOnClick;\n opts.digitsOptional = false;\n if (isNaN(opts.digits)) opts.digits = 2;\n opts.decimalProtect = false;\n }\n var mask = \"[+]\";\n mask += autoEscape(opts.prefix, opts);\n if (opts.integerOptional === true) {\n mask += \"~{1,\" + opts.integerDigits + \"}\";\n } else mask += \"~{\" + opts.integerDigits + \"}\";\n if (opts.digits !== undefined) {\n var radixDef = opts.decimalProtect ? \":\" : opts.radixPoint;\n var dq = opts.digits.toString().split(\",\");\n if (isFinite(dq[0]) && dq[1] && isFinite(dq[1])) {\n mask += radixDef + \";{\" + opts.digits + \"}\";\n } else if (isNaN(opts.digits) || parseInt(opts.digits) > 0) {\n if (opts.digitsOptional) {\n mask += \"[\" + radixDef + \";{1,\" + opts.digits + \"}]\";\n } else mask += radixDef + \";{\" + opts.digits + \"}\";\n }\n }\n mask += autoEscape(opts.suffix, opts);\n mask += \"[-]\";\n opts.greedy = false;\n return mask;\n },\n placeholder: \"\",\n greedy: false,\n digits: \"*\",\n digitsOptional: true,\n enforceDigitsOnBlur: false,\n radixPoint: \".\",\n positionCaretOnClick: \"radixFocus\",\n groupSize: 3,\n groupSeparator: \"\",\n autoGroup: false,\n allowMinus: true,\n negationSymbol: {\n front: \"-\",\n back: \"\"\n },\n integerDigits: \"+\",\n integerOptional: true,\n prefix: \"\",\n suffix: \"\",\n rightAlign: true,\n decimalProtect: true,\n min: null,\n max: null,\n step: 1,\n insertMode: true,\n autoUnmask: false,\n unmaskAsNumber: false,\n inputType: \"text\",\n inputmode: \"numeric\",\n preValidation: function(buffer, pos, c, isSelection, opts, maskset) {\n if (c === \"-\" || c === opts.negationSymbol.front) {\n if (opts.allowMinus !== true) return false;\n opts.isNegative = opts.isNegative === undefined ? true : !opts.isNegative;\n if (buffer.join(\"\") === \"\") return true;\n return {\n caret: maskset.validPositions[pos] ? pos : undefined,\n dopost: true\n };\n }\n if (isSelection === false && c === opts.radixPoint && (opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0))) {\n var radixPos = $.inArray(opts.radixPoint, buffer);\n if (radixPos !== -1 && maskset.validPositions[radixPos] !== undefined) {\n if (opts.numericInput === true) {\n return pos === radixPos;\n }\n return {\n caret: radixPos + 1\n };\n }\n }\n return true;\n },\n postValidation: function(buffer, pos, currentResult, opts) {\n function buildPostMask(buffer, opts) {\n var postMask = \"\";\n postMask += \"(\" + opts.groupSeparator + \"*{\" + opts.groupSize + \"}){*}\";\n if (opts.radixPoint !== \"\") {\n var radixSplit = buffer.join(\"\").split(opts.radixPoint);\n if (radixSplit[1]) {\n postMask += opts.radixPoint + \"*{\" + radixSplit[1].match(/^\\d*\\??\\d*/)[0].length + \"}\";\n }\n }\n return postMask;\n }\n var suffix = opts.suffix.split(\"\"), prefix = opts.prefix.split(\"\");\n if (currentResult.pos === undefined && currentResult.caret !== undefined && currentResult.dopost !== true) return currentResult;\n var caretPos = currentResult.caret !== undefined ? currentResult.caret : currentResult.pos;\n var maskedValue = buffer.slice();\n if (opts.numericInput) {\n caretPos = maskedValue.length - caretPos - 1;\n maskedValue = maskedValue.reverse();\n }\n var charAtPos = maskedValue[caretPos];\n if (charAtPos === opts.groupSeparator) {\n caretPos += 1;\n charAtPos = maskedValue[caretPos];\n }\n if (caretPos === maskedValue.length - opts.suffix.length - 1 && charAtPos === opts.radixPoint) return currentResult;\n if (charAtPos !== undefined) {\n if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) {\n maskedValue[caretPos] = \"?\";\n if (opts.prefix.length > 0 && caretPos >= (opts.isNegative === false ? 1 : 0) && caretPos < opts.prefix.length - 1 + (opts.isNegative === false ? 1 : 0)) {\n prefix[caretPos - (opts.isNegative === false ? 1 : 0)] = \"?\";\n } else if (opts.suffix.length > 0 && caretPos >= maskedValue.length - opts.suffix.length - (opts.isNegative === false ? 1 : 0)) {\n suffix[caretPos - (maskedValue.length - opts.suffix.length - (opts.isNegative === false ? 1 : 0))] = \"?\";\n }\n }\n }\n prefix = prefix.join(\"\");\n suffix = suffix.join(\"\");\n var processValue = maskedValue.join(\"\").replace(prefix, \"\");\n processValue = processValue.replace(suffix, \"\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \"g\"), \"\");\n processValue = processValue.replace(new RegExp(\"[-\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \"]\", \"g\"), \"\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \"$\"), \"\");\n if (isNaN(opts.placeholder)) {\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), \"g\"), \"\");\n }\n if (processValue.length > 1 && processValue.indexOf(opts.radixPoint) !== 1) {\n if (charAtPos === \"0\") {\n processValue = processValue.replace(/^\\?/g, \"\");\n }\n processValue = processValue.replace(/^0/g, \"\");\n }\n if (processValue.charAt(0) === opts.radixPoint && opts.radixPoint !== \"\" && opts.numericInput !== true) {\n processValue = \"0\" + processValue;\n }\n if (processValue !== \"\") {\n processValue = processValue.split(\"\");\n if ((!opts.digitsOptional || opts.enforceDigitsOnBlur && currentResult.event === \"blur\") && isFinite(opts.digits)) {\n var radixPosition = $.inArray(opts.radixPoint, processValue);\n var rpb = $.inArray(opts.radixPoint, maskedValue);\n if (radixPosition === -1) {\n processValue.push(opts.radixPoint);\n radixPosition = processValue.length - 1;\n }\n for (var i = 1; i <= opts.digits; i++) {\n if ((!opts.digitsOptional || opts.enforceDigitsOnBlur && currentResult.event === \"blur\") && (processValue[radixPosition + i] === undefined || processValue[radixPosition + i] === opts.placeholder.charAt(0))) {\n processValue[radixPosition + i] = currentResult.placeholder || opts.placeholder.charAt(0);\n } else if (rpb !== -1 && maskedValue[rpb + i] !== undefined) {\n processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i];\n }\n }\n }\n if (opts.autoGroup === true && opts.groupSeparator !== \"\" && (charAtPos !== opts.radixPoint || currentResult.pos !== undefined || currentResult.dopost)) {\n var addRadix = processValue[processValue.length - 1] === opts.radixPoint && currentResult.c === opts.radixPoint;\n processValue = Inputmask(buildPostMask(processValue, opts), {\n numericInput: true,\n jitMasking: true,\n definitions: {\n \"*\": {\n validator: \"[0-9?]\",\n cardinality: 1\n }\n }\n }).format(processValue.join(\"\"));\n if (addRadix) processValue += opts.radixPoint;\n if (processValue.charAt(0) === opts.groupSeparator) {\n processValue.substr(1);\n }\n } else processValue = processValue.join(\"\");\n }\n if (opts.isNegative && currentResult.event === \"blur\") {\n opts.isNegative = processValue !== \"0\";\n }\n processValue = prefix + processValue;\n processValue += suffix;\n if (opts.isNegative) {\n processValue = opts.negationSymbol.front + processValue;\n processValue += opts.negationSymbol.back;\n }\n processValue = processValue.split(\"\");\n if (charAtPos !== undefined) {\n if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) {\n caretPos = $.inArray(\"?\", processValue);\n if (caretPos > -1) {\n processValue[caretPos] = charAtPos;\n } else caretPos = currentResult.caret || 0;\n } else if (charAtPos === opts.radixPoint || charAtPos === opts.negationSymbol.front || charAtPos === opts.negationSymbol.back) {\n var newCaretPos = $.inArray(charAtPos, processValue);\n if (newCaretPos !== -1) caretPos = newCaretPos;\n }\n }\n if (opts.numericInput) {\n caretPos = processValue.length - caretPos - 1;\n processValue = processValue.reverse();\n }\n var rslt = {\n caret: (charAtPos === undefined || currentResult.pos !== undefined) && caretPos !== undefined ? caretPos + (opts.numericInput ? -1 : 1) : caretPos,\n buffer: processValue,\n refreshFromBuffer: currentResult.dopost || buffer.join(\"\") !== processValue.join(\"\")\n };\n return rslt.refreshFromBuffer ? rslt : currentResult;\n },\n onBeforeWrite: function(e, buffer, caretPos, opts) {\n function parseMinMaxOptions(opts) {\n if (opts.parseMinMaxOptions === undefined) {\n if (opts.min !== null) {\n opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \"g\"), \"\");\n if (opts.radixPoint === \",\") opts.min = opts.min.replace(opts.radixPoint, \".\");\n opts.min = isFinite(opts.min) ? parseFloat(opts.min) : NaN;\n if (isNaN(opts.min)) opts.min = Number.MIN_VALUE;\n }\n if (opts.max !== null) {\n opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \"g\"), \"\");\n if (opts.radixPoint === \",\") opts.max = opts.max.replace(opts.radixPoint, \".\");\n opts.max = isFinite(opts.max) ? parseFloat(opts.max) : NaN;\n if (isNaN(opts.max)) opts.max = Number.MAX_VALUE;\n }\n opts.parseMinMaxOptions = \"done\";\n }\n }\n if (e) {\n switch (e.type) {\n case \"keydown\":\n return opts.postValidation(buffer, caretPos, {\n caret: caretPos,\n dopost: true\n }, opts);\n\n case \"blur\":\n case \"checkval\":\n var unmasked;\n parseMinMaxOptions(opts);\n if (opts.min !== null || opts.max !== null) {\n unmasked = opts.onUnMask(buffer.join(\"\"), undefined, $.extend({}, opts, {\n unmaskAsNumber: true\n }));\n if (opts.min !== null && unmasked < opts.min) {\n opts.isNegative = opts.min < 0;\n return opts.postValidation(opts.min.toString().replace(\".\", opts.radixPoint).split(\"\"), caretPos, {\n caret: caretPos,\n dopost: true,\n placeholder: \"0\"\n }, opts);\n } else if (opts.max !== null && unmasked > opts.max) {\n opts.isNegative = opts.max < 0;\n return opts.postValidation(opts.max.toString().replace(\".\", opts.radixPoint).split(\"\"), caretPos, {\n caret: caretPos,\n dopost: true,\n placeholder: \"0\"\n }, opts);\n }\n }\n return opts.postValidation(buffer, caretPos, {\n caret: caretPos,\n placeholder: \"0\",\n event: \"blur\"\n }, opts);\n\n case \"_checkval\":\n return {\n caret: caretPos\n };\n\n default:\n break;\n }\n }\n },\n regex: {\n integerPart: function(opts, emptyCheck) {\n return emptyCheck ? new RegExp(\"[\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \"+]?\") : new RegExp(\"[\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \"+]?\\\\d+\");\n },\n integerNPart: function(opts) {\n return new RegExp(\"[\\\\d\" + Inputmask.escapeRegex(opts.groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + \"]+\");\n }\n },\n definitions: {\n \"~\": {\n validator: function(chrs, maskset, pos, strict, opts, isSelection) {\n var isValid, l;\n if (chrs === \"k\" || chrs === \"m\") {\n isValid = {\n insert: [],\n c: 0\n };\n for (var i = 0, l = chrs === \"k\" ? 2 : 5; i < l; i++) {\n isValid.insert.push({\n pos: pos + i,\n c: 0\n });\n }\n isValid.pos = pos + l;\n return isValid;\n }\n isValid = strict ? new RegExp(\"[0-9\" + Inputmask.escapeRegex(opts.groupSeparator) + \"]\").test(chrs) : new RegExp(\"[0-9]\").test(chrs);\n if (isValid === true) {\n if (opts.numericInput !== true && maskset.validPositions[pos] !== undefined && maskset.validPositions[pos].match.def === \"~\" && !isSelection) {\n var processValue = maskset.buffer.join(\"\");\n processValue = processValue.replace(new RegExp(\"[-\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \"]\", \"g\"), \"\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \"$\"), \"\");\n var pvRadixSplit = processValue.split(opts.radixPoint);\n if (pvRadixSplit.length > 1) {\n pvRadixSplit[1] = pvRadixSplit[1].replace(/0/g, opts.placeholder.charAt(0));\n }\n if (pvRadixSplit[0] === \"0\") {\n pvRadixSplit[0] = pvRadixSplit[0].replace(/0/g, opts.placeholder.charAt(0));\n }\n processValue = pvRadixSplit[0] + opts.radixPoint + pvRadixSplit[1] || \"\";\n var bufferTemplate = maskset._buffer.join(\"\");\n if (processValue === opts.radixPoint) {\n processValue = bufferTemplate;\n }\n while (processValue.match(Inputmask.escapeRegex(bufferTemplate) + \"$\") === null) {\n bufferTemplate = bufferTemplate.slice(1);\n }\n processValue = processValue.replace(bufferTemplate, \"\");\n processValue = processValue.split(\"\");\n if (processValue[pos] === undefined) {\n isValid = {\n pos: pos,\n remove: pos\n };\n } else {\n isValid = {\n pos: pos\n };\n }\n }\n } else if (!strict && chrs === opts.radixPoint && maskset.validPositions[pos - 1] === undefined) {\n isValid = {\n insert: {\n pos: pos,\n c: 0\n },\n pos: pos + 1\n };\n }\n return isValid;\n },\n cardinality: 1\n },\n \"+\": {\n validator: function(chrs, maskset, pos, strict, opts) {\n return opts.allowMinus && (chrs === \"-\" || chrs === opts.negationSymbol.front);\n },\n cardinality: 1,\n placeholder: \"\"\n },\n \"-\": {\n validator: function(chrs, maskset, pos, strict, opts) {\n return opts.allowMinus && chrs === opts.negationSymbol.back;\n },\n cardinality: 1,\n placeholder: \"\"\n },\n \":\": {\n validator: function(chrs, maskset, pos, strict, opts) {\n var radix = \"[\" + Inputmask.escapeRegex(opts.radixPoint) + \"]\";\n var isValid = new RegExp(radix).test(chrs);\n if (isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint) {\n isValid = {\n caret: pos + 1\n };\n }\n return isValid;\n },\n cardinality: 1,\n placeholder: function(opts) {\n return opts.radixPoint;\n }\n }\n },\n onUnMask: function(maskedValue, unmaskedValue, opts) {\n if (unmaskedValue === \"\" && opts.nullable === true) {\n return unmaskedValue;\n }\n var processValue = maskedValue.replace(opts.prefix, \"\");\n processValue = processValue.replace(opts.suffix, \"\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \"g\"), \"\");\n if (opts.placeholder.charAt(0) !== \"\") {\n processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), \"g\"), \"0\");\n }\n if (opts.unmaskAsNumber) {\n if (opts.radixPoint !== \"\" && processValue.indexOf(opts.radixPoint) !== -1) processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), \".\");\n processValue = processValue.replace(new RegExp(\"^\" + Inputmask.escapeRegex(opts.negationSymbol.front)), \"-\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \"$\"), \"\");\n return Number(processValue);\n }\n return processValue;\n },\n isComplete: function(buffer, opts) {\n var maskedValue = (opts.numericInput ? buffer.slice().reverse() : buffer).join(\"\");\n maskedValue = maskedValue.replace(new RegExp(\"^\" + Inputmask.escapeRegex(opts.negationSymbol.front)), \"-\");\n maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \"$\"), \"\");\n maskedValue = maskedValue.replace(opts.prefix, \"\");\n maskedValue = maskedValue.replace(opts.suffix, \"\");\n maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator) + \"([0-9]{3})\", \"g\"), \"$1\");\n if (opts.radixPoint === \",\") maskedValue = maskedValue.replace(Inputmask.escapeRegex(opts.radixPoint), \".\");\n return isFinite(maskedValue);\n },\n onBeforeMask: function(initialValue, opts) {\n opts.isNegative = undefined;\n var radixPoint = opts.radixPoint || \",\";\n if ((typeof initialValue == \"number\" || opts.inputType === \"number\") && radixPoint !== \"\") {\n initialValue = initialValue.toString().replace(\".\", radixPoint);\n }\n var valueParts = initialValue.split(radixPoint), integerPart = valueParts[0].replace(/[^\\-0-9]/g, \"\"), decimalPart = valueParts.length > 1 ? valueParts[1].replace(/[^0-9]/g, \"\") : \"\";\n initialValue = integerPart + (decimalPart !== \"\" ? radixPoint + decimalPart : decimalPart);\n var digits = 0;\n if (radixPoint !== \"\") {\n digits = decimalPart.length;\n if (decimalPart !== \"\") {\n var digitsFactor = Math.pow(10, digits || 1);\n if (isFinite(opts.digits)) {\n digits = parseInt(opts.digits);\n digitsFactor = Math.pow(10, digits);\n }\n initialValue = initialValue.replace(Inputmask.escapeRegex(radixPoint), \".\");\n if (isFinite(initialValue)) initialValue = Math.round(parseFloat(initialValue) * digitsFactor) / digitsFactor;\n initialValue = initialValue.toString().replace(\".\", radixPoint);\n }\n }\n if (opts.digits === 0 && initialValue.indexOf(Inputmask.escapeRegex(radixPoint)) !== -1) {\n initialValue = initialValue.substring(0, initialValue.indexOf(Inputmask.escapeRegex(radixPoint)));\n }\n return alignDigits(initialValue.toString().split(\"\"), digits, opts).join(\"\");\n },\n onKeyDown: function(e, buffer, caretPos, opts) {\n var $input = $(this);\n if (e.ctrlKey) {\n switch (e.keyCode) {\n case Inputmask.keyCode.UP:\n $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step));\n $input.trigger(\"setvalue\");\n break;\n\n case Inputmask.keyCode.DOWN:\n $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step));\n $input.trigger(\"setvalue\");\n break;\n }\n }\n }\n },\n currency: {\n prefix: \"$ \",\n groupSeparator: \",\",\n alias: \"numeric\",\n placeholder: \"0\",\n autoGroup: true,\n digits: 2,\n digitsOptional: false,\n clearMaskOnLostFocus: false\n },\n decimal: {\n alias: \"numeric\"\n },\n integer: {\n alias: \"numeric\",\n digits: 0,\n radixPoint: \"\"\n },\n percentage: {\n alias: \"numeric\",\n digits: 2,\n digitsOptional: true,\n radixPoint: \".\",\n placeholder: \"0\",\n autoGroup: false,\n min: 0,\n max: 100,\n suffix: \" %\",\n allowMinus: false\n }\n });\n return Inputmask;\n});\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.numeric.extensions.js?");
2002
-
2003
- /***/ }),
2004
-
2005
- /***/ "./node_modules/@formio/core/node_modules/inputmask/index.js":
2006
- /*!*******************************************************************!*\
2007
- !*** ./node_modules/@formio/core/node_modules/inputmask/index.js ***!
2008
- \*******************************************************************/
2009
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
2010
-
2011
- eval("__webpack_require__(/*! ./dist/inputmask/inputmask.extensions */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.extensions.js\");\r\n__webpack_require__(/*! ./dist/inputmask/inputmask.date.extensions */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.date.extensions.js\");\r\n__webpack_require__(/*! ./dist/inputmask/inputmask.numeric.extensions */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.numeric.extensions.js\");\r\n\r\nmodule.exports = __webpack_require__(/*! ./dist/inputmask/inputmask.js */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js\");\r\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/index.js?");
2012
-
2013
- /***/ }),
2014
-
2015
1945
  /***/ "./node_modules/@formio/text-mask-addons/dist/textMaskAddons.js":
2016
1946
  /*!**********************************************************************!*\
2017
1947
  !*** ./node_modules/@formio/text-mask-addons/dist/textMaskAddons.js ***!
@@ -3430,16 +3360,6 @@ eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/
3430
3360
 
3431
3361
  /***/ }),
3432
3362
 
3433
- /***/ "./node_modules/lodash/_baseHas.js":
3434
- /*!*****************************************!*\
3435
- !*** ./node_modules/lodash/_baseHas.js ***!
3436
- \*****************************************/
3437
- /***/ (function(module) {
3438
-
3439
- eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nmodule.exports = baseHas;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/_baseHas.js?");
3440
-
3441
- /***/ }),
3442
-
3443
3363
  /***/ "./node_modules/lodash/_baseHasIn.js":
3444
3364
  /*!*******************************************!*\
3445
3365
  !*** ./node_modules/lodash/_baseHasIn.js ***!
@@ -4720,16 +4640,6 @@ eval("var baseGet = __webpack_require__(/*! ./_baseGet */ \"./node_modules/lodas
4720
4640
 
4721
4641
  /***/ }),
4722
4642
 
4723
- /***/ "./node_modules/lodash/has.js":
4724
- /*!************************************!*\
4725
- !*** ./node_modules/lodash/has.js ***!
4726
- \************************************/
4727
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
4728
-
4729
- eval("var baseHas = __webpack_require__(/*! ./_baseHas */ \"./node_modules/lodash/_baseHas.js\"),\n hasPath = __webpack_require__(/*! ./_hasPath */ \"./node_modules/lodash/_hasPath.js\");\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nmodule.exports = has;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/has.js?");
4730
-
4731
- /***/ }),
4732
-
4733
4643
  /***/ "./node_modules/lodash/hasIn.js":
4734
4644
  /*!**************************************!*\
4735
4645
  !*** ./node_modules/lodash/hasIn.js ***!
@@ -4800,16 +4710,6 @@ eval("/* module decorator */ module = __webpack_require__.nmd(module);\nvar root
4800
4710
 
4801
4711
  /***/ }),
4802
4712
 
4803
- /***/ "./node_modules/lodash/isEmpty.js":
4804
- /*!****************************************!*\
4805
- !*** ./node_modules/lodash/isEmpty.js ***!
4806
- \****************************************/
4807
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
4808
-
4809
- eval("var baseKeys = __webpack_require__(/*! ./_baseKeys */ \"./node_modules/lodash/_baseKeys.js\"),\n getTag = __webpack_require__(/*! ./_getTag */ \"./node_modules/lodash/_getTag.js\"),\n isArguments = __webpack_require__(/*! ./isArguments */ \"./node_modules/lodash/isArguments.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isArrayLike = __webpack_require__(/*! ./isArrayLike */ \"./node_modules/lodash/isArrayLike.js\"),\n isBuffer = __webpack_require__(/*! ./isBuffer */ \"./node_modules/lodash/isBuffer.js\"),\n isPrototype = __webpack_require__(/*! ./_isPrototype */ \"./node_modules/lodash/_isPrototype.js\"),\n isTypedArray = __webpack_require__(/*! ./isTypedArray */ \"./node_modules/lodash/isTypedArray.js\");\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = isEmpty;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/isEmpty.js?");
4810
-
4811
- /***/ }),
4812
-
4813
4713
  /***/ "./node_modules/lodash/isEqual.js":
4814
4714
  /*!****************************************!*\
4815
4715
  !*** ./node_modules/lodash/isEqual.js ***!
@@ -4850,16 +4750,6 @@ eval("var baseIsMap = __webpack_require__(/*! ./_baseIsMap */ \"./node_modules/l
4850
4750
 
4851
4751
  /***/ }),
4852
4752
 
4853
- /***/ "./node_modules/lodash/isNil.js":
4854
- /*!**************************************!*\
4855
- !*** ./node_modules/lodash/isNil.js ***!
4856
- \**************************************/
4857
- /***/ (function(module) {
4858
-
4859
- eval("/**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\nfunction isNil(value) {\n return value == null;\n}\n\nmodule.exports = isNil;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/isNil.js?");
4860
-
4861
- /***/ }),
4862
-
4863
4753
  /***/ "./node_modules/lodash/isObject.js":
4864
4754
  /*!*****************************************!*\
4865
4755
  !*** ./node_modules/lodash/isObject.js ***!
@@ -4900,16 +4790,6 @@ eval("var baseIsSet = __webpack_require__(/*! ./_baseIsSet */ \"./node_modules/l
4900
4790
 
4901
4791
  /***/ }),
4902
4792
 
4903
- /***/ "./node_modules/lodash/isString.js":
4904
- /*!*****************************************!*\
4905
- !*** ./node_modules/lodash/isString.js ***!
4906
- \*****************************************/
4907
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
4908
-
4909
- eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/isString.js?");
4910
-
4911
- /***/ }),
4912
-
4913
4793
  /***/ "./node_modules/lodash/isSymbol.js":
4914
4794
  /*!*****************************************!*\
4915
4795
  !*** ./node_modules/lodash/isSymbol.js ***!
@@ -5020,16 +4900,6 @@ eval("var baseProperty = __webpack_require__(/*! ./_baseProperty */ \"./node_mod
5020
4900
 
5021
4901
  /***/ }),
5022
4902
 
5023
- /***/ "./node_modules/lodash/set.js":
5024
- /*!************************************!*\
5025
- !*** ./node_modules/lodash/set.js ***!
5026
- \************************************/
5027
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
5028
-
5029
- eval("var baseSet = __webpack_require__(/*! ./_baseSet */ \"./node_modules/lodash/_baseSet.js\");\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/set.js?");
5030
-
5031
- /***/ }),
5032
-
5033
4903
  /***/ "./node_modules/lodash/stubArray.js":
5034
4904
  /*!******************************************!*\
5035
4905
  !*** ./node_modules/lodash/stubArray.js ***!
@@ -5100,16 +4970,6 @@ eval("var baseToString = __webpack_require__(/*! ./_baseToString */ \"./node_mod
5100
4970
 
5101
4971
  /***/ }),
5102
4972
 
5103
- /***/ "./node_modules/lodash/unset.js":
5104
- /*!**************************************!*\
5105
- !*** ./node_modules/lodash/unset.js ***!
5106
- \**************************************/
5107
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
5108
-
5109
- eval("var baseUnset = __webpack_require__(/*! ./_baseUnset */ \"./node_modules/lodash/_baseUnset.js\");\n\n/**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\nfunction unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n}\n\nmodule.exports = unset;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/unset.js?");
5110
-
5111
- /***/ }),
5112
-
5113
4973
  /***/ "./node_modules/moment-timezone/moment-timezone.js":
5114
4974
  /*!*********************************************************!*\
5115
4975
  !*** ./node_modules/moment-timezone/moment-timezone.js ***!
@@ -10962,7 +10822,7 @@ eval("\nvar parent = __webpack_require__(/*! ../../es/object/from-entries */ \".
10962
10822
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10963
10823
 
10964
10824
  "use strict";
10965
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.FormBuilder = exports.Form = exports.Formio = void 0;\nconst CDN_js_1 = __importDefault(__webpack_require__(/*! ./CDN.js */ \"./lib/cjs/CDN.js\"));\nclass Formio {\n static setLicense(license, norecurse = false) {\n _a.license = license;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setLicense(license);\n }\n }\n static setBaseUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setBaseUrl(url);\n }\n }\n static setApiUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setApiUrl(url);\n }\n }\n static setProjectUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setProjectUrl(url);\n }\n }\n static setAppUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setAppUrl(url);\n }\n }\n static setPathType(type, norecurse = false) {\n _a.pathType = type;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setPathType(type);\n }\n }\n static debug(...args) {\n if (_a.config.debug) {\n console.log(...args);\n }\n }\n static clearCache() {\n if (_a.FormioClass) {\n _a.FormioClass.clearCache();\n }\n }\n static global(prop, flag = '') {\n const globalValue = window[prop];\n if (flag && globalValue && !globalValue[flag]) {\n return null;\n }\n _a.debug(`Getting global ${prop}`, globalValue);\n return globalValue;\n }\n static use(module) {\n if (_a.FormioClass && _a.FormioClass.isRenderer) {\n _a.FormioClass.use(module);\n }\n else {\n _a.modules.push(module);\n }\n }\n static createElement(type, attrs, children) {\n const element = document.createElement(type);\n Object.keys(attrs).forEach(key => {\n element.setAttribute(key, attrs[key]);\n });\n (children || []).forEach(child => {\n element.appendChild(_a.createElement(child.tag, child.attrs, child.children));\n });\n return element;\n }\n static addScript(wrapper, src, name, flag = '') {\n return __awaiter(this, void 0, void 0, function* () {\n if (!src) {\n return Promise.resolve();\n }\n if (typeof src !== 'string' && src.length) {\n return Promise.all(src.map(ref => _a.addScript(wrapper, ref)));\n }\n if (name && _a.global(name, flag)) {\n _a.debug(`${name} already loaded.`);\n return Promise.resolve(_a.global(name));\n }\n _a.debug('Adding Script', src);\n try {\n wrapper.appendChild(_a.createElement('script', {\n src\n }));\n }\n catch (err) {\n _a.debug(err);\n return Promise.resolve();\n }\n if (!name) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n _a.debug(`Waiting to load ${name}`);\n const wait = setInterval(() => {\n if (_a.global(name, flag)) {\n clearInterval(wait);\n _a.debug(`${name} loaded.`);\n resolve(_a.global(name));\n }\n }, 100);\n });\n });\n }\n static addStyles(wrapper, href) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!href) {\n return;\n }\n if (typeof href !== 'string' && href.length) {\n href.forEach(ref => _a.addStyles(wrapper, ref));\n return;\n }\n _a.debug('Adding Styles', href);\n wrapper.appendChild(_a.createElement('link', {\n rel: 'stylesheet',\n href\n }));\n });\n }\n static submitDone(instance, submission) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.debug('Submision Complete', submission);\n const successMessage = (_a.config.success || '').toString();\n if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {\n instance.element.innerHTML = `<div class=\"alert-success\" role=\"alert\">${successMessage}</div>`;\n }\n let returnUrl = _a.config.redirect;\n // Allow form based configuration for return url.\n if (!returnUrl &&\n (instance._form &&\n instance._form.settings &&\n (instance._form.settings.returnUrl ||\n instance._form.settings.redirect))) {\n _a.debug('Return url found in form configuration');\n returnUrl = instance._form.settings.returnUrl || instance._form.settings.redirect;\n }\n if (returnUrl) {\n const formSrc = instance.formio ? instance.formio.formUrl : '';\n const hasQuery = !!returnUrl.match(/\\?/);\n const isOrigin = returnUrl.indexOf(location.origin) === 0;\n returnUrl += hasQuery ? '&' : '?';\n returnUrl += `sub=${submission._id}`;\n if (!isOrigin && formSrc) {\n returnUrl += `&form=${encodeURIComponent(formSrc)}`;\n }\n _a.debug('Return URL', returnUrl);\n window.location.href = returnUrl;\n if (isOrigin) {\n window.location.reload();\n }\n }\n });\n }\n // Return the full script if the builder is being used.\n static formioScript(script, builder) {\n builder = builder || _a.config.includeBuilder;\n if (_a.fullAdded || builder) {\n _a.fullAdded = true;\n return script.replace('formio.form', 'formio.full');\n }\n return script;\n }\n static addLibrary(wrapper, lib, name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!lib) {\n return;\n }\n if (lib.dependencies) {\n for (let i = 0; i < lib.dependencies.length; i++) {\n yield _a.addLibrary(wrapper, _a.cdn.libs[lib.dependencies[i]]);\n }\n }\n if (lib.css) {\n yield _a.addStyles(wrapper, lib.css);\n }\n if (lib.js) {\n const module = yield _a.addScript(wrapper, lib.js, lib.use ? name : false);\n if (lib.use) {\n _a.debug(`Using ${name}`);\n const options = lib.options || {};\n if (!options.license && _a.license) {\n options.license = _a.license;\n }\n _a.use((typeof lib.use === 'function' ? lib.use(module) : module), options);\n }\n }\n });\n }\n static addLoader(wrapper) {\n return __awaiter(this, void 0, void 0, function* () {\n wrapper.appendChild(_a.createElement('div', {\n 'class': 'formio-loader'\n }, [{\n tag: 'div',\n attrs: {\n class: 'loader-wrapper'\n },\n children: [{\n tag: 'div',\n attrs: {\n class: 'loader text-center'\n }\n }]\n }]));\n });\n }\n // eslint-disable-next-line max-statements\n static init(element, options = {}, builder = false) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.cdn = new CDN_js_1.default(_a.config.cdn, _a.config.cdnUrls || {});\n _a.config.libs = _a.config.libs || {\n uswds: {\n dependencies: ['fontawesome'],\n js: `${_a.cdn.uswds}/uswds.min.js`,\n css: `${_a.cdn.uswds}/uswds.min.css`,\n use: true\n },\n fontawesome: {\n css: `${_a.cdn['font-awesome']}/css/font-awesome.min.css`\n },\n bootstrap4: {\n dependencies: ['fontawesome'],\n css: `${_a.cdn.bootstrap4}/css/bootstrap.min.css`\n },\n bootstrap: {\n dependencies: ['bootstrap-icons'],\n css: `${_a.cdn.bootstrap}/css/bootstrap.min.css`\n },\n 'bootstrap-icons': {\n css: `${_a.cdn['bootstrap-icons']}/css/bootstrap-icons.css`\n }\n };\n const id = _a.config.id || `formio-${Math.random().toString(36).substring(7)}`;\n // Create a new wrapper and add the element inside of a new wrapper.\n let wrapper = _a.createElement('div', {\n 'id': `${id}-wrapper`\n });\n element.parentNode.insertBefore(wrapper, element);\n // If we include the libraries, then we will attempt to run this in shadow dom.\n const useShadowDom = _a.config.includeLibs && (typeof wrapper.attachShadow === 'function');\n if (useShadowDom) {\n wrapper = wrapper.attachShadow({\n mode: 'open'\n });\n options.shadowRoot = wrapper;\n }\n element.parentNode.removeChild(element);\n wrapper.appendChild(element);\n // If this is inside of shadow dom, then we need to add the styles and scripts to the shadow dom.\n const libWrapper = useShadowDom ? wrapper : document.body;\n // Load the renderer styles.\n yield _a.addStyles(libWrapper, _a.config.embedCSS || `${_a.cdn.js}/formio.embed.css`);\n // Add a loader.\n _a.addLoader(wrapper);\n const formioSrc = _a.config.full ? 'formio.full' : 'formio.form';\n const renderer = _a.config.debug ? formioSrc : `${formioSrc}.min`;\n _a.FormioClass = yield _a.addScript(libWrapper, _a.formioScript(_a.config.script || `${_a.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');\n _a.FormioClass.cdn = _a.cdn;\n _a.FormioClass.setBaseUrl(options.baseUrl || _a.baseUrl || _a.config.base);\n _a.FormioClass.setProjectUrl(options.projectUrl || _a.projectUrl || _a.config.project);\n _a.FormioClass.language = _a.language;\n _a.setLicense(_a.license || _a.config.license || false);\n _a.modules.forEach((module) => {\n _a.FormioClass.use(module);\n });\n if (_a.icons) {\n _a.FormioClass.icons = _a.icons;\n }\n if (_a.pathType) {\n _a.FormioClass.setPathType(_a.pathType);\n }\n // Add libraries if they wish to include the libs.\n if (_a.config.template && _a.config.includeLibs) {\n yield _a.addLibrary(libWrapper, _a.config.libs[_a.config.template], _a.config.template);\n }\n // Add the premium modules.\n if (_a.config.premium) {\n _a.config.modules.premium = _a.config.premium;\n }\n // Allow adding dynamic modules.\n if (_a.config.modules) {\n for (const name in _a.config.modules) {\n const lib = _a.config.modules[name];\n lib.use = lib.use || true;\n yield _a.addLibrary(libWrapper, lib, name);\n }\n }\n yield _a.addStyles(libWrapper, _a.formioScript(_a.config.style || `${_a.cdn.js}/${renderer}.css`, builder));\n if (_a.config.before) {\n yield _a.config.before(_a.FormioClass, element, _a.config);\n }\n _a.FormioClass.license = true;\n _a._formioReady(_a.FormioClass);\n return wrapper;\n });\n }\n // Called after an instance has been created.\n static afterCreate(instance, wrapper, readyEvent) {\n return __awaiter(this, void 0, void 0, function* () {\n const loader = wrapper.querySelector('.formio-loader');\n if (loader) {\n wrapper.removeChild(loader);\n }\n _a.FormioClass.events.emit(readyEvent, instance);\n if (_a.config.after) {\n _a.debug('Calling ready callback');\n _a.config.after(instance, _a.config);\n }\n return instance;\n });\n }\n // Create a new form.\n static createForm(element, form, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_a.FormioClass) {\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true }));\n }\n const wrapper = yield _a.init(element, options);\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true })).then((instance) => {\n // Set the default submission data.\n if (_a.config.submission) {\n _a.debug('Setting submission', _a.config.submission);\n instance.submission = _a.config.submission;\n }\n // Call the after create method.\n _a.afterCreate(instance, wrapper, 'formEmbedded');\n return instance;\n });\n });\n }\n // Create a form builder.\n static builder(element, form, options = {}) {\n var _b;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.builder) {\n return _a.FormioClass.builder(element, form, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.builder(element, form, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'builderEmbedded');\n return instance;\n });\n });\n }\n}\nexports.Formio = Formio;\n_a = Formio;\nFormio.FormioClass = null;\nFormio.config = {};\nFormio.modules = [];\nFormio.icons = '';\nFormio.license = '';\nFormio.formioReady = new Promise((ready, reject) => {\n _a._formioReady = ready;\n _a._formioReadyReject = reject;\n});\nFormio.version = '5.0.0-rc.51';\n// Create a report.\nFormio.Report = {\n create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {\n var _b;\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.Report) {\n return _a.FormioClass.Report.create(element, submission, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.Report.create(element, submission, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'reportEmbedded');\n return instance;\n });\n })\n};\nCDN_js_1.default.defaultCDN = Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nclass Form {\n constructor(element, form, options) {\n this.form = form;\n this.element = element;\n this.options = options || {};\n this.init();\n this.instance = {\n proxy: true,\n ready: this.ready,\n destroy: () => { }\n };\n }\n init() {\n if (this.instance && !this.instance.proxy) {\n this.instance.destroy();\n }\n this.element.innerHTML = '';\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.form = instance.form;\n return instance;\n });\n }\n create() {\n return Formio.createForm(this.element, this.form, this.options);\n }\n setForm(form) {\n this.form = form;\n if (this.instance) {\n this.instance.setForm(form);\n }\n }\n setDisplay(display) {\n if (this.instance.proxy) {\n return this.ready;\n }\n this.form.display = display;\n this.instance.destroy();\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.setForm(this.form);\n });\n return this.ready;\n }\n}\nexports.Form = Form;\nclass FormBuilder extends Form {\n create() {\n return Formio.builder(this.element, this.form, this.options);\n }\n}\nexports.FormBuilder = FormBuilder;\nFormio.Form = Form;\nFormio.FormBuilder = FormBuilder;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Embed.js?");
10825
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.FormBuilder = exports.Form = exports.Formio = void 0;\nconst CDN_js_1 = __importDefault(__webpack_require__(/*! ./CDN.js */ \"./lib/cjs/CDN.js\"));\nclass Formio {\n static setLicense(license, norecurse = false) {\n _a.license = license;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setLicense(license);\n }\n }\n static setBaseUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setBaseUrl(url);\n }\n }\n static setApiUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setApiUrl(url);\n }\n }\n static setProjectUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setProjectUrl(url);\n }\n }\n static setAppUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setAppUrl(url);\n }\n }\n static setPathType(type, norecurse = false) {\n _a.pathType = type;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setPathType(type);\n }\n }\n static debug(...args) {\n if (_a.config.debug) {\n console.log(...args);\n }\n }\n static clearCache() {\n if (_a.FormioClass) {\n _a.FormioClass.clearCache();\n }\n }\n static global(prop, flag = '') {\n const globalValue = window[prop];\n if (flag && globalValue && !globalValue[flag]) {\n return null;\n }\n _a.debug(`Getting global ${prop}`, globalValue);\n return globalValue;\n }\n static use(module) {\n if (_a.FormioClass && _a.FormioClass.isRenderer) {\n _a.FormioClass.use(module);\n }\n else {\n _a.modules.push(module);\n }\n }\n static createElement(type, attrs, children) {\n const element = document.createElement(type);\n Object.keys(attrs).forEach(key => {\n element.setAttribute(key, attrs[key]);\n });\n (children || []).forEach(child => {\n element.appendChild(_a.createElement(child.tag, child.attrs, child.children));\n });\n return element;\n }\n static addScript(wrapper, src, name, flag = '') {\n return __awaiter(this, void 0, void 0, function* () {\n if (!src) {\n return Promise.resolve();\n }\n if (typeof src !== 'string' && src.length) {\n return Promise.all(src.map(ref => _a.addScript(wrapper, ref)));\n }\n if (name && _a.global(name, flag)) {\n _a.debug(`${name} already loaded.`);\n return Promise.resolve(_a.global(name));\n }\n _a.debug('Adding Script', src);\n try {\n wrapper.appendChild(_a.createElement('script', {\n src\n }));\n }\n catch (err) {\n _a.debug(err);\n return Promise.resolve();\n }\n if (!name) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n _a.debug(`Waiting to load ${name}`);\n const wait = setInterval(() => {\n if (_a.global(name, flag)) {\n clearInterval(wait);\n _a.debug(`${name} loaded.`);\n resolve(_a.global(name));\n }\n }, 100);\n });\n });\n }\n static addStyles(wrapper, href) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!href) {\n return;\n }\n if (typeof href !== 'string' && href.length) {\n href.forEach(ref => _a.addStyles(wrapper, ref));\n return;\n }\n _a.debug('Adding Styles', href);\n wrapper.appendChild(_a.createElement('link', {\n rel: 'stylesheet',\n href\n }));\n });\n }\n static submitDone(instance, submission) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.debug('Submision Complete', submission);\n const successMessage = (_a.config.success || '').toString();\n if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {\n instance.element.innerHTML = `<div class=\"alert-success\" role=\"alert\">${successMessage}</div>`;\n }\n let returnUrl = _a.config.redirect;\n // Allow form based configuration for return url.\n if (!returnUrl &&\n (instance._form &&\n instance._form.settings &&\n (instance._form.settings.returnUrl ||\n instance._form.settings.redirect))) {\n _a.debug('Return url found in form configuration');\n returnUrl = instance._form.settings.returnUrl || instance._form.settings.redirect;\n }\n if (returnUrl) {\n const formSrc = instance.formio ? instance.formio.formUrl : '';\n const hasQuery = !!returnUrl.match(/\\?/);\n const isOrigin = returnUrl.indexOf(location.origin) === 0;\n returnUrl += hasQuery ? '&' : '?';\n returnUrl += `sub=${submission._id}`;\n if (!isOrigin && formSrc) {\n returnUrl += `&form=${encodeURIComponent(formSrc)}`;\n }\n _a.debug('Return URL', returnUrl);\n window.location.href = returnUrl;\n if (isOrigin) {\n window.location.reload();\n }\n }\n });\n }\n // Return the full script if the builder is being used.\n static formioScript(script, builder) {\n builder = builder || _a.config.includeBuilder;\n if (_a.fullAdded || builder) {\n _a.fullAdded = true;\n return script.replace('formio.form', 'formio.full');\n }\n return script;\n }\n static addLibrary(wrapper, lib, name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!lib) {\n return;\n }\n if (lib.dependencies) {\n for (let i = 0; i < lib.dependencies.length; i++) {\n yield _a.addLibrary(wrapper, _a.cdn.libs[lib.dependencies[i]]);\n }\n }\n if (lib.css) {\n yield _a.addStyles(wrapper, lib.css);\n }\n if (lib.js) {\n const module = yield _a.addScript(wrapper, lib.js, lib.use ? name : false);\n if (lib.use) {\n _a.debug(`Using ${name}`);\n const options = lib.options || {};\n if (!options.license && _a.license) {\n options.license = _a.license;\n }\n _a.use((typeof lib.use === 'function' ? lib.use(module) : module), options);\n }\n }\n });\n }\n static addLoader(wrapper) {\n return __awaiter(this, void 0, void 0, function* () {\n wrapper.appendChild(_a.createElement('div', {\n 'class': 'formio-loader'\n }, [{\n tag: 'div',\n attrs: {\n class: 'loader-wrapper'\n },\n children: [{\n tag: 'div',\n attrs: {\n class: 'loader text-center'\n }\n }]\n }]));\n });\n }\n // eslint-disable-next-line max-statements\n static init(element, options = {}, builder = false) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.cdn = new CDN_js_1.default(_a.config.cdn, _a.config.cdnUrls || {});\n _a.config.libs = _a.config.libs || {\n uswds: {\n dependencies: ['fontawesome'],\n js: `${_a.cdn.uswds}/uswds.min.js`,\n css: `${_a.cdn.uswds}/uswds.min.css`,\n use: true\n },\n fontawesome: {\n css: `${_a.cdn['font-awesome']}/css/font-awesome.min.css`\n },\n bootstrap4: {\n dependencies: ['fontawesome'],\n css: `${_a.cdn.bootstrap4}/css/bootstrap.min.css`\n },\n bootstrap: {\n dependencies: ['bootstrap-icons'],\n css: `${_a.cdn.bootstrap}/css/bootstrap.min.css`\n },\n 'bootstrap-icons': {\n css: `${_a.cdn['bootstrap-icons']}/css/bootstrap-icons.css`\n }\n };\n const id = _a.config.id || `formio-${Math.random().toString(36).substring(7)}`;\n // Create a new wrapper and add the element inside of a new wrapper.\n let wrapper = _a.createElement('div', {\n 'id': `${id}-wrapper`\n });\n element.parentNode.insertBefore(wrapper, element);\n // If we include the libraries, then we will attempt to run this in shadow dom.\n const useShadowDom = _a.config.includeLibs && (typeof wrapper.attachShadow === 'function');\n if (useShadowDom) {\n wrapper = wrapper.attachShadow({\n mode: 'open'\n });\n options.shadowRoot = wrapper;\n }\n element.parentNode.removeChild(element);\n wrapper.appendChild(element);\n // If this is inside of shadow dom, then we need to add the styles and scripts to the shadow dom.\n const libWrapper = useShadowDom ? wrapper : document.body;\n // Load the renderer styles.\n yield _a.addStyles(libWrapper, _a.config.embedCSS || `${_a.cdn.js}/formio.embed.css`);\n // Add a loader.\n _a.addLoader(wrapper);\n const formioSrc = _a.config.full ? 'formio.full' : 'formio.form';\n const renderer = _a.config.debug ? formioSrc : `${formioSrc}.min`;\n _a.FormioClass = yield _a.addScript(libWrapper, _a.formioScript(_a.config.script || `${_a.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');\n _a.FormioClass.cdn = _a.cdn;\n _a.FormioClass.setBaseUrl(options.baseUrl || _a.baseUrl || _a.config.base);\n _a.FormioClass.setProjectUrl(options.projectUrl || _a.projectUrl || _a.config.project);\n _a.FormioClass.language = _a.language;\n _a.setLicense(_a.license || _a.config.license || false);\n _a.modules.forEach((module) => {\n _a.FormioClass.use(module);\n });\n if (_a.icons) {\n _a.FormioClass.icons = _a.icons;\n }\n if (_a.pathType) {\n _a.FormioClass.setPathType(_a.pathType);\n }\n // Add libraries if they wish to include the libs.\n if (_a.config.template && _a.config.includeLibs) {\n yield _a.addLibrary(libWrapper, _a.config.libs[_a.config.template], _a.config.template);\n }\n // Add the premium modules.\n if (_a.config.premium) {\n _a.config.modules.premium = _a.config.premium;\n }\n // Allow adding dynamic modules.\n if (_a.config.modules) {\n for (const name in _a.config.modules) {\n const lib = _a.config.modules[name];\n lib.use = lib.use || true;\n yield _a.addLibrary(libWrapper, lib, name);\n }\n }\n yield _a.addStyles(libWrapper, _a.formioScript(_a.config.style || `${_a.cdn.js}/${renderer}.css`, builder));\n if (_a.config.before) {\n yield _a.config.before(_a.FormioClass, element, _a.config);\n }\n _a.FormioClass.license = true;\n _a._formioReady(_a.FormioClass);\n return wrapper;\n });\n }\n // Called after an instance has been created.\n static afterCreate(instance, wrapper, readyEvent) {\n return __awaiter(this, void 0, void 0, function* () {\n const loader = wrapper.querySelector('.formio-loader');\n if (loader) {\n wrapper.removeChild(loader);\n }\n _a.FormioClass.events.emit(readyEvent, instance);\n if (_a.config.after) {\n _a.debug('Calling ready callback');\n _a.config.after(instance, _a.config);\n }\n return instance;\n });\n }\n // Create a new form.\n static createForm(element, form, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_a.FormioClass) {\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true }));\n }\n const wrapper = yield _a.init(element, options);\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true })).then((instance) => {\n // Set the default submission data.\n if (_a.config.submission) {\n _a.debug('Setting submission', _a.config.submission);\n instance.submission = _a.config.submission;\n }\n // Call the after create method.\n _a.afterCreate(instance, wrapper, 'formEmbedded');\n return instance;\n });\n });\n }\n // Create a form builder.\n static builder(element, form, options = {}) {\n var _b;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.builder) {\n return _a.FormioClass.builder(element, form, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.builder(element, form, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'builderEmbedded');\n return instance;\n });\n });\n }\n}\nexports.Formio = Formio;\n_a = Formio;\nFormio.FormioClass = null;\nFormio.config = {};\nFormio.modules = [];\nFormio.icons = '';\nFormio.license = '';\nFormio.formioReady = new Promise((ready, reject) => {\n _a._formioReady = ready;\n _a._formioReadyReject = reject;\n});\nFormio.version = '5.0.0-rc.52';\n// Create a report.\nFormio.Report = {\n create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {\n var _b;\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.Report) {\n return _a.FormioClass.Report.create(element, submission, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.Report.create(element, submission, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'reportEmbedded');\n return instance;\n });\n })\n};\nCDN_js_1.default.defaultCDN = Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nclass Form {\n constructor(element, form, options) {\n this.form = form;\n this.element = element;\n this.options = options || {};\n this.init();\n this.instance = {\n proxy: true,\n ready: this.ready,\n destroy: () => { }\n };\n }\n init() {\n if (this.instance && !this.instance.proxy) {\n this.instance.destroy();\n }\n this.element.innerHTML = '';\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.form = instance.form;\n return instance;\n });\n }\n create() {\n return Formio.createForm(this.element, this.form, this.options);\n }\n setForm(form) {\n this.form = form;\n if (this.instance) {\n this.instance.setForm(form);\n }\n }\n setDisplay(display) {\n if (this.instance.proxy) {\n return this.ready;\n }\n this.form.display = display;\n this.instance.destroy();\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.setForm(this.form);\n });\n return this.ready;\n }\n}\nexports.Form = Form;\nclass FormBuilder extends Form {\n create() {\n return Formio.builder(this.element, this.form, this.options);\n }\n}\nexports.FormBuilder = FormBuilder;\nFormio.Form = Form;\nFormio.FormBuilder = FormBuilder;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Embed.js?");
10966
10826
 
10967
10827
  /***/ }),
10968
10828
 
@@ -10973,7 +10833,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
10973
10833
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10974
10834
 
10975
10835
  "use strict";
10976
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = void 0;\nconst sdk_1 = __webpack_require__(/*! @formio/core/sdk */ \"./node_modules/@formio/core/lib/sdk/index.js\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return sdk_1.Formio; } }));\nconst Embed_1 = __webpack_require__(/*! ./Embed */ \"./lib/cjs/Embed.js\");\nconst CDN_1 = __importDefault(__webpack_require__(/*! ./CDN */ \"./lib/cjs/CDN.js\"));\nconst providers_1 = __importDefault(__webpack_require__(/*! ./providers */ \"./lib/cjs/providers/index.js\"));\nsdk_1.Formio.cdn = new CDN_1.default();\nsdk_1.Formio.Providers = providers_1.default;\nsdk_1.Formio.version = '5.0.0-rc.51';\nCDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nconst isNil = (val) => val === null || val === undefined;\nsdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {\n const requestArgs = {\n provider: storage,\n method: 'upload',\n file: file,\n fileName: fileName,\n dir: dir\n };\n fileKey = fileKey || 'file';\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', storage);\n if (Provider) {\n const provider = new Provider(this);\n if (uploadStartCallback) {\n uploadStartCallback();\n }\n return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.downloadFile = function (file, options) {\n const requestArgs = {\n method: 'download',\n file: file\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.downloadFile(file, options);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.deleteFile = function (file, options) {\n const requestArgs = {\n method: 'delete',\n file: file\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.deleteFile(file, options);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\n// Esnure we proxy the following methods to the FormioEmbed class.\n['setBaseUrl', 'setApiUrl', 'setAppUrl', 'setProjectUrl', 'setPathType', 'setLicense'].forEach((fn) => {\n const baseFn = sdk_1.Formio[fn];\n sdk_1.Formio[fn] = function (arg) {\n const retVal = Embed_1.Formio[fn](arg, true);\n return baseFn ? baseFn.call(this, arg) : retVal;\n };\n});\n// For reverse compatability.\nsdk_1.Formio.Promise = Promise;\nsdk_1.Formio.formioReady = Embed_1.Formio.formioReady;\nsdk_1.Formio.config = Embed_1.Formio.config;\nsdk_1.Formio.builder = Embed_1.Formio.builder;\nsdk_1.Formio.Report = Embed_1.Formio.Report;\nsdk_1.Formio.Form = Embed_1.Formio.Form;\nsdk_1.Formio.FormBuilder = Embed_1.Formio.FormBuilder;\nsdk_1.Formio.use = Embed_1.Formio.use;\nsdk_1.Formio.createForm = Embed_1.Formio.createForm;\nsdk_1.Formio.submitDone = Embed_1.Formio.submitDone;\nsdk_1.Formio.addLibrary = Embed_1.Formio.addLibrary;\nsdk_1.Formio.addLoader = Embed_1.Formio.addLoader;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Formio.js?");
10836
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = void 0;\nconst sdk_1 = __webpack_require__(/*! @formio/core/sdk */ \"./node_modules/@formio/core/lib/sdk/index.js\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return sdk_1.Formio; } }));\nconst Embed_1 = __webpack_require__(/*! ./Embed */ \"./lib/cjs/Embed.js\");\nconst CDN_1 = __importDefault(__webpack_require__(/*! ./CDN */ \"./lib/cjs/CDN.js\"));\nconst providers_1 = __importDefault(__webpack_require__(/*! ./providers */ \"./lib/cjs/providers/index.js\"));\nsdk_1.Formio.cdn = new CDN_1.default();\nsdk_1.Formio.Providers = providers_1.default;\nsdk_1.Formio.version = '5.0.0-rc.52';\nCDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nconst isNil = (val) => val === null || val === undefined;\nsdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {\n const requestArgs = {\n provider: storage,\n method: 'upload',\n file: file,\n fileName: fileName,\n dir: dir\n };\n fileKey = fileKey || 'file';\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', storage);\n if (Provider) {\n const provider = new Provider(this);\n if (uploadStartCallback) {\n uploadStartCallback();\n }\n return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.downloadFile = function (file, options) {\n const requestArgs = {\n method: 'download',\n file: file\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.downloadFile(file, options);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.deleteFile = function (file, options) {\n const requestArgs = {\n method: 'delete',\n file: file\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.deleteFile(file, options);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\n// Esnure we proxy the following methods to the FormioEmbed class.\n['setBaseUrl', 'setApiUrl', 'setAppUrl', 'setProjectUrl', 'setPathType', 'setLicense'].forEach((fn) => {\n const baseFn = sdk_1.Formio[fn];\n sdk_1.Formio[fn] = function (arg) {\n const retVal = Embed_1.Formio[fn](arg, true);\n return baseFn ? baseFn.call(this, arg) : retVal;\n };\n});\n// For reverse compatability.\nsdk_1.Formio.Promise = Promise;\nsdk_1.Formio.formioReady = Embed_1.Formio.formioReady;\nsdk_1.Formio.config = Embed_1.Formio.config;\nsdk_1.Formio.builder = Embed_1.Formio.builder;\nsdk_1.Formio.Report = Embed_1.Formio.Report;\nsdk_1.Formio.Form = Embed_1.Formio.Form;\nsdk_1.Formio.FormBuilder = Embed_1.Formio.FormBuilder;\nsdk_1.Formio.use = Embed_1.Formio.use;\nsdk_1.Formio.createForm = Embed_1.Formio.createForm;\nsdk_1.Formio.submitDone = Embed_1.Formio.submitDone;\nsdk_1.Formio.addLibrary = Embed_1.Formio.addLibrary;\nsdk_1.Formio.addLoader = Embed_1.Formio.addLoader;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Formio.js?");
10977
10837
 
10978
10838
  /***/ }),
10979
10839