diff --git a/dist/formio.core.js b/dist/formio.core.js deleted file mode 100644 index b7594515..00000000 --- a/dist/formio.core.js +++ /dev/null @@ -1,972 +0,0 @@ -/* - * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). - * This devtool is neither made for production nor for readable output files. - * It uses "eval()" calls to create a separate source file in the browser devtools. - * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) - * or disable the default devtool with "devtool: false". - * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). - */ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["Formio"] = factory(); - else - root["Formio"] = factory(); -})(self, function() { -return /******/ (function() { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./node_modules/@formio/lodash/lib/array.js": -/*!**************************************************!*\ - !*** ./node_modules/@formio/lodash/lib/array.js ***! - \**************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.intersection = exports.map = exports.head = exports.last = exports.filter = exports.findEach = exports.matches = exports.findIndex = exports.find = exports.each = exports.dropRight = exports.drop = exports.difference = exports.concat = exports.compact = exports.chunk = void 0;\nvar lang_1 = __webpack_require__(/*! ./lang */ \"./node_modules/@formio/lodash/lib/lang.js\");\nvar object_1 = __webpack_require__(/*! ./object */ \"./node_modules/@formio/lodash/lib/object.js\");\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_chunk\nfunction chunk(input, size) {\n return input.reduce(function (arr, item, idx) {\n return idx % size === 0\n ? __spreadArray(__spreadArray([], arr), [[item]]) : __spreadArray(__spreadArray([], arr.slice(0, -1)), [__spreadArray(__spreadArray([], arr.slice(-1)[0]), [item])]);\n }, []);\n}\nexports.chunk = chunk;\n;\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_compact\nfunction compact(input) {\n return input.filter(Boolean);\n}\nexports.compact = compact;\n/**\n * @link https://lodash.com/docs/4.17.15#concat\n * @param input\n * @param args\n * @returns\n */\nfunction concat(input) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return input.concat.apply(input, args);\n}\nexports.concat = concat;\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_difference\nfunction difference() {\n var arrays = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n arrays[_i] = arguments[_i];\n }\n return arrays.reduce(function (a, b) {\n return a.filter(function (value) {\n return !b.includes(value);\n });\n });\n}\nexports.difference = difference;\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_drop\nfunction drop(arr, index) {\n if (index === void 0) { index = 1; }\n return (index > 0) ? arr.slice(index) : arr;\n}\nexports.drop = drop;\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_dropright\nfunction dropRight(arr, index) {\n if (index === void 0) { index = 1; }\n return (index > 0) ? arr.slice(0, -index) : arr;\n}\nexports.dropRight = dropRight;\n/**\n * Iterate through a collection or array.\n * @param collection\n * @param _each\n */\nfunction each(collection, _each) {\n var isArray = Array.isArray(collection);\n for (var i in collection) {\n if (collection.hasOwnProperty(i)) {\n if (_each(collection[i], isArray ? Number(i) : i) === true) {\n break;\n }\n ;\n }\n }\n}\nexports.each = each;\n/**\n * Perform a find operation.\n * @param arr\n * @param query\n */\nfunction find(arr, query, findIndex) {\n if (findIndex === void 0) { findIndex = false; }\n if (!arr) {\n return undefined;\n }\n if (Array.isArray(arr) && typeof query === 'function') {\n return findIndex ? arr.findIndex(query) : arr.find(query);\n }\n var found = undefined;\n var foundIndex = 0;\n findEach(arr, query, function (item, index) {\n found = item;\n foundIndex = index;\n return true;\n });\n return findIndex ? foundIndex : found;\n}\nexports.find = find;\n/**\n * Find an index.\n *\n * @param arr\n * @param query\n * @returns\n */\nfunction findIndex(arr, query) {\n return find(arr, query, true);\n}\nexports.findIndex = findIndex;\n/**\n * Returns a function to perform matches.\n * @param query\n * @returns\n */\nfunction matches(query) {\n var keys = [];\n var compare = {};\n if (typeof query === 'string') {\n keys = [query];\n compare[query] = true;\n }\n else {\n keys = Object.keys(query);\n compare = query;\n }\n return function (comp) {\n return lang_1.isEqual(object_1.pick(comp, keys), compare);\n };\n}\nexports.matches = matches;\n/**\n * Perform a find operation on each item in an array.\n * @param arr\n * @param query\n * @param fn\n */\nfunction findEach(arr, query, fn) {\n each(arr, function (item, index) {\n if (matches(query)(item)) {\n if (fn(item, index) === true) {\n return true;\n }\n }\n });\n}\nexports.findEach = findEach;\n/**\n * Perform a filter operation.\n * @param arr\n * @param fn\n */\nfunction filter(arr, fn) {\n if (!arr) {\n return [];\n }\n if (!fn) {\n fn = function (val) { return !!val; };\n }\n if (Array.isArray(arr) && typeof fn === 'function') {\n return arr.filter(fn);\n }\n var found = [];\n findEach(arr, fn, function (item, index) {\n found.push(item);\n if (Array.isArray(item)) {\n arr.splice(index, 1);\n }\n else {\n delete arr[index];\n }\n });\n return found;\n}\nexports.filter = filter;\n/**\n * Get the last item in an array.\n * @param arr\n */\nfunction last(arr) {\n return arr[arr.length - 1];\n}\nexports.last = last;\n/**\n * https://lodash.com/docs/4.17.15#head\n * @param arr\n * @returns\n */\nfunction head(arr) {\n return arr[0];\n}\nexports.head = head;\n/**\n * https://lodash.com/docs/4.17.15#map\n * @param arr\n * @param fn\n * @returns\n */\nfunction map(arr, fn) {\n return arr.map(fn);\n}\nexports.map = map;\n/**\n * Get the intersection of two objects.\n * @param a\n * @param b\n */\nfunction intersection(a, b) {\n return a.filter(function (value) { return b.includes(value); });\n}\nexports.intersection = intersection;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/array.js?"); - -/***/ }), - -/***/ "./node_modules/@formio/lodash/lib/function.js": -/*!*****************************************************!*\ - !*** ./node_modules/@formio/lodash/lib/function.js ***! - \*****************************************************/ -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.debounce = void 0;\n/**\n * Debounc the call of a function for a given amount of time.\n *\n * @param func\n * @param wait\n * @returns\n */\nfunction debounce(func, wait) {\n if (wait === void 0) { wait = 100; }\n var timeout;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (timeout) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(function () {\n timeout = null;\n func.apply(void 0, args);\n }, wait);\n };\n}\nexports.debounce = debounce;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/function.js?"); - -/***/ }), - -/***/ "./node_modules/@formio/lodash/lib/index.js": -/*!**************************************************!*\ - !*** ./node_modules/@formio/lodash/lib/index.js ***! - \**************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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 __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.chain = void 0;\nvar ArrayFunctions = __importStar(__webpack_require__(/*! ./array */ \"./node_modules/@formio/lodash/lib/array.js\"));\nvar Chainable = /** @class */ (function () {\n function Chainable(val) {\n this.chain = [];\n this.currentValue = [];\n this.currentValue = val;\n }\n Chainable.prototype.value = function () {\n return this.chain.reduce(function (current, func) {\n var _a;\n return (_a = ArrayFunctions)[func.method].apply(_a, __spreadArray([current], func.args));\n }, this.currentValue);\n };\n return Chainable;\n}());\nvar _loop_1 = function (method) {\n if (ArrayFunctions.hasOwnProperty(method)) {\n Chainable.prototype[method] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n this.chain.push({ method: method, args: args });\n return this;\n };\n }\n};\nfor (var method in ArrayFunctions) {\n _loop_1(method);\n}\n/**\n * Create a chainable array of methods.\n * @param val\n * @returns\n */\nfunction chain(val) {\n return new Chainable(val);\n}\nexports.chain = chain;\nexports.default = chain;\n__exportStar(__webpack_require__(/*! ./array */ \"./node_modules/@formio/lodash/lib/array.js\"), exports);\n__exportStar(__webpack_require__(/*! ./function */ \"./node_modules/@formio/lodash/lib/function.js\"), exports);\n__exportStar(__webpack_require__(/*! ./lang */ \"./node_modules/@formio/lodash/lib/lang.js\"), exports);\n__exportStar(__webpack_require__(/*! ./math */ \"./node_modules/@formio/lodash/lib/math.js\"), exports);\n__exportStar(__webpack_require__(/*! ./object */ \"./node_modules/@formio/lodash/lib/object.js\"), exports);\n__exportStar(__webpack_require__(/*! ./string */ \"./node_modules/@formio/lodash/lib/string.js\"), exports);\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/index.js?"); - -/***/ }), - -/***/ "./node_modules/@formio/lodash/lib/lang.js": -/*!*************************************************!*\ - !*** ./node_modules/@formio/lodash/lib/lang.js ***! - \*************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.isRegExp = exports.isBoolean = exports.isNumber = exports.isPlainObject = exports.isObject = exports.isObjectLike = exports.isArray = exports.isNull = exports.isNil = exports.isNaN = exports.isInteger = exports.isEmpty = exports.isString = exports.isEqual = exports.noop = void 0;\nvar array_1 = __webpack_require__(/*! ./array */ \"./node_modules/@formio/lodash/lib/array.js\");\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction getTag(value) {\n if (value == null) {\n return value === undefined ? '[object Undefined]' : '[object Null]';\n }\n return Object.prototype.toString.call(value);\n}\n/**\n * A no-operation function.\n */\nfunction noop() {\n return;\n}\nexports.noop = noop;\n;\n/**\n * Determines equality of a value or complex object.\n * @param a\n * @param b\n */\nfunction isEqual(a, b) {\n var equal = false;\n if (a === b) {\n return true;\n }\n if (a && b && (Array.isArray(a) || isObject(a))) {\n equal = true;\n array_1.each(a, function (val, key) {\n if ((Array.isArray(val) || isObject(val)) && !isEqual(b[key], val)) {\n equal = false;\n return true;\n }\n if (b[key] !== val) {\n equal = false;\n return true;\n }\n });\n }\n return equal;\n}\nexports.isEqual = isEqual;\nfunction isString(val) {\n return typeof val === 'string';\n}\nexports.isString = isString;\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_isempty\nfunction isEmpty(obj) {\n return [Object, Array].includes((obj || {}).constructor) && !Object.entries((obj || {})).length;\n}\nexports.isEmpty = isEmpty;\nfunction isInteger(val) {\n return Number.isInteger(val);\n}\nexports.isInteger = isInteger;\nfunction isNaN(val) {\n return Number.isNaN(val);\n}\nexports.isNaN = isNaN;\nfunction isNil(val) {\n return val == null;\n}\nexports.isNil = isNil;\nfunction isNull(val) {\n return val === null;\n}\nexports.isNull = isNull;\nfunction isArray(val) {\n return Array.isArray(val);\n}\nexports.isArray = isArray;\nfunction isObjectLike(val) {\n return typeof val === 'object' && (val !== null);\n}\nexports.isObjectLike = isObjectLike;\nfunction isObject(val) {\n var type = typeof val;\n return val != null && (type === 'object' || type === 'function');\n}\nexports.isObject = isObject;\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || getTag(value) != '[object Object]') {\n return false;\n }\n if (Object.getPrototypeOf(value) === null) {\n return true;\n }\n var proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n}\nexports.isPlainObject = isPlainObject;\nfunction isNumber(value) {\n return typeof value === 'number' || (isObjectLike(value) && getTag(value) == '[object Number]');\n}\nexports.isNumber = isNumber;\nfunction isBoolean(value) {\n return value === true || value === false || (isObjectLike(value) && getTag(value) == '[object Boolean]');\n}\nexports.isBoolean = isBoolean;\nfunction isRegExp(value) {\n return isObjectLike(value) && getTag(value) == '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/lang.js?"); - -/***/ }), - -/***/ "./node_modules/@formio/lodash/lib/math.js": -/*!*************************************************!*\ - !*** ./node_modules/@formio/lodash/lib/math.js ***! - \*************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.sumBy = exports.sum = exports.mod = exports.subtract = exports.round = exports.multiply = exports.minBy = exports.min = exports.meanBy = exports.mean = exports.maxBy = exports.max = exports.floor = exports.divide = exports.ceil = exports.add = void 0;\nvar lang_1 = __webpack_require__(/*! ./lang */ \"./node_modules/@formio/lodash/lib/lang.js\");\nvar object_1 = __webpack_require__(/*! ./object */ \"./node_modules/@formio/lodash/lib/object.js\");\nfunction mathOp(a, op, precision) {\n if (precision === void 0) { precision = 0; }\n if (!precision) {\n return op(a);\n }\n precision = Math.pow(10, precision);\n return op(a * precision) / precision;\n}\nfunction getBy(arr, fn, op) {\n var first = arr.shift();\n var fnString = lang_1.isString(fn);\n return arr.reduce(function (current, item) { return op(current, fnString ? object_1.get(item, fn) : fn(item)); }, first);\n}\n/**\n * @link https://lodash.com/docs/4.17.15#add\n * @param augend\n * @param addend\n * @returns\n */\nfunction add(augend, addend) {\n return augend + addend;\n}\nexports.add = add;\n/**\n * @link https://lodash.com/docs/4.17.15#ceil\n * @param num\n * @param precision\n * @returns\n */\nfunction ceil(num, precision) {\n if (precision === void 0) { precision = 0; }\n return mathOp(num, Math.ceil, precision);\n}\nexports.ceil = ceil;\n/**\n * https://lodash.com/docs/4.17.15#divide\n * @param dividend\n * @param divisor\n * @returns\n */\nfunction divide(dividend, divisor) {\n return dividend / divisor;\n}\nexports.divide = divide;\n/**\n * @link https://lodash.com/docs/4.17.15#floor\n * @param num\n * @param precision\n * @returns\n */\nfunction floor(num, precision) {\n if (precision === void 0) { precision = 0; }\n return mathOp(num, Math.floor, precision);\n}\nexports.floor = floor;\n/**\n * @link https://lodash.com/docs/4.17.15#max\n * @param arr\n * @returns\n */\nfunction max(arr) {\n return Math.max.apply(Math, arr);\n}\nexports.max = max;\n/**\n * @link https://lodash.com/docs/4.17.15#maxBy\n */\nfunction maxBy(arr, fn) {\n return getBy(arr, fn, Math.max);\n}\nexports.maxBy = maxBy;\n/**\n * @link https://lodash.com/docs/4.17.15#mean\n * @param arr\n * @returns\n */\nfunction mean(arr) {\n return sum(arr) / arr.length;\n}\nexports.mean = mean;\n/**\n * @link https://lodash.com/docs/4.17.15#meanBy\n * @param arr\n * @param fn\n * @returns\n */\nfunction meanBy(arr, fn) {\n return sumBy(arr, fn) / arr.length;\n}\nexports.meanBy = meanBy;\n/**\n * @link https://lodash.com/docs/4.17.15#min\n * @param arr\n * @returns\n */\nfunction min(arr) {\n return Math.min.apply(Math, arr);\n}\nexports.min = min;\n/**\n * @link https://lodash.com/docs/4.17.15#minBy\n * @param arr\n * @param fn\n * @returns\n */\nfunction minBy(arr, fn) {\n return getBy(arr, fn, Math.min);\n}\nexports.minBy = minBy;\n/**\n * @link https://lodash.com/docs/4.17.15#multiply\n * @param multiplier\n * @param multiplicand\n * @returns\n */\nfunction multiply(multiplier, multiplicand) {\n return multiplier * multiplicand;\n}\nexports.multiply = multiply;\n/**\n * @link https://lodash.com/docs/4.17.15#round\n * @param num\n * @param precision\n * @returns\n */\nfunction round(num, precision) {\n if (precision === void 0) { precision = 0; }\n return mathOp(num, Math.round, precision);\n}\nexports.round = round;\n/**\n * @link https://lodash.com/docs/4.17.15#subtract\n * @param a\n * @param b\n * @returns\n */\nfunction subtract(minuend, subtrahend) {\n return minuend - subtrahend;\n}\nexports.subtract = subtract;\n/**\n * Perform a modulus operation between two numbers.\n * @param a\n * @param b\n * @returns\n */\nfunction mod(a, b) {\n return a % b;\n}\nexports.mod = mod;\n/**\n * @link https://lodash.com/docs/4.17.15#sum\n * @param arr\n * @returns\n */\nfunction sum(arr) {\n return arr.reduce(add, 0);\n}\nexports.sum = sum;\n/**\n * @link https://lodash.com/docs/4.17.15#sumBy\n * @param arr\n * @param fn\n * @returns\n */\nfunction sumBy(arr, fn) {\n return getBy(arr, fn, function (a, b) { return (a + b); });\n}\nexports.sumBy = sumBy;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/math.js?"); - -/***/ }), - -/***/ "./node_modules/@formio/lodash/lib/object.js": -/*!***************************************************!*\ - !*** ./node_modules/@formio/lodash/lib/object.js ***! - \***************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.pick = exports.defaults = exports.cloneDeep = exports.fastCloneDeep = exports.merge = exports.set = exports.has = exports.propertyOf = exports.property = exports.get = exports.pathParts = exports.values = exports.keys = void 0;\nvar lang_1 = __webpack_require__(/*! ./lang */ \"./node_modules/@formio/lodash/lib/lang.js\");\nvar array_1 = __webpack_require__(/*! ./array */ \"./node_modules/@formio/lodash/lib/array.js\");\n/**\n * Get the keys of an Object.\n * @param obj\n */\nfunction keys(obj) {\n return Object.keys(obj);\n}\nexports.keys = keys;\n;\n/**\n * Return the values of an object or an array.\n * @param obj\n * @returns\n */\nfunction values(obj) {\n return lang_1.isArray(obj) ? obj : Object.values(obj);\n}\nexports.values = values;\n/**\n * Retrieve the path parts provided a path string.\n * @param path\n */\nfunction pathParts(path) {\n if (!path) {\n return [];\n }\n if (path[0] === '[') {\n path = path.replace(/^\\[([^\\]]+)\\]/, '$1');\n }\n return path.\n replace(/\\[/g, '.').\n replace(/\\]/g, '').\n split('.');\n}\nexports.pathParts = pathParts;\n/**\n * Get the value from an object or an array provided a path.\n *\n * @param obj\n * @param path\n * @param def\n */\nfunction get(obj, path, def) {\n var val = pathParts(path).reduce(function (o, k) { return (o || {})[k]; }, obj);\n return (typeof def !== 'undefined' &&\n typeof val === 'undefined') ? def : val;\n}\nexports.get = get;\nfunction property(path) {\n return function (obj) { return get(obj, path); };\n}\nexports.property = property;\nfunction propertyOf(obj) {\n return function (path) { return get(obj, path); };\n}\nexports.propertyOf = propertyOf;\n/**\n * Determine if a value is set.\n *\n * @param obj\n * @param path\n */\nfunction has(obj, path) {\n return get(obj, path, undefined) !== undefined;\n}\nexports.has = has;\n/**\n * Sets the value of an item within an array or object.\n * @param obj\n * @param path\n * @param value\n */\nfunction set(obj, path, value) {\n var parts = pathParts(path);\n parts.reduce(function (o, k, i) {\n if (!isNaN(Number(k))) {\n k = Number(k);\n }\n if ((Array.isArray(o) ? (k >= o.length) : !o.hasOwnProperty(k)) ||\n ((i < (parts.length - 1)) && !Array.isArray(o[k]) && !lang_1.isObject(o[k]))) {\n o[k] = !isNaN(Number(parts[i + 1])) ? [] : {};\n }\n if (i === (parts.length - 1)) {\n o[k] = value;\n }\n return o[k];\n }, obj);\n return obj;\n}\nexports.set = set;\n;\nfunction propertyIsOnObject(object, property) {\n try {\n return property in object;\n }\n catch (_) {\n return false;\n }\n}\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n && Object.propertyIsEnumerable.call(target, key)); // and also unsafe if they're nonenumerable.\n}\n/**\n * Merge a single object.\n *\n * @param target\n * @param source\n * @returns\n */\nfunction mergeObject(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n if (propertyIsUnsafe(target, key)) {\n return;\n }\n if (propertyIsOnObject(target, key)) {\n target[key] = merge(target[key], source[key]);\n }\n else {\n target[key] = cloneDeep(source[key]);\n }\n }\n }\n return target;\n}\n/**\n * Merge two arrays.\n * @param target\n * @param source\n */\nfunction mergeArray(target, source) {\n source.forEach(function (subSource, index) {\n target[index] = merge(target[index], subSource);\n });\n return target;\n}\n/**\n * Merges a complex data object.\n *\n * @param a\n * @param b\n * @param options\n */\nfunction merge() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var first = args.shift();\n return args.reduce(function (target, source, index) {\n if (!target || (target === source)) {\n return cloneDeep(source);\n }\n else if (lang_1.isArray(source)) {\n // If there is no target array, then make it one.\n if (!lang_1.isArray(target)) {\n args[index] = target = [];\n }\n return mergeArray(target, source);\n }\n else if (lang_1.isPlainObject(source)) {\n return mergeObject(target, source);\n }\n else {\n return cloneDeep(source);\n }\n }, first);\n}\nexports.merge = merge;\n/**\n * Performs a fast clone deep operation.\n *\n * @param obj\n */\nfunction fastCloneDeep(obj) {\n try {\n return JSON.parse(JSON.stringify(obj));\n }\n catch (err) {\n console.log(\"Clone Failed: \" + err.message);\n return null;\n }\n}\nexports.fastCloneDeep = fastCloneDeep;\n/**\n * Performs a recursive cloneDeep operation.\n * @param src\n * @returns\n */\nfunction cloneDeep(src) {\n if (Array.isArray(src)) { // for arrays\n return src.map(cloneDeep);\n }\n if (src === null || typeof src !== 'object') { // for primitives / functions / non-references/pointers\n return src;\n }\n return Object.fromEntries(Object.entries(src).map(function (_a) {\n var key = _a[0], val = _a[1];\n return ([key, cloneDeep(val)]);\n }));\n}\nexports.cloneDeep = cloneDeep;\n/**\n * Sets the defaults of an object.\n *\n * @param obj\n * @param defs\n */\nfunction defaults(obj, defs) {\n array_1.each(defs, function (value, key) {\n if (!obj.hasOwnProperty(key)) {\n obj[key] = value;\n }\n });\n return obj;\n}\nexports.defaults = defaults;\n/**\n * Pick an item in an object.\n * @param object\n * @param keys\n */\nfunction pick(object, keys) {\n return keys.reduce(function (obj, key) {\n if (object && object.hasOwnProperty(key)) {\n obj[key] = object[key];\n }\n return obj;\n }, {});\n}\nexports.pick = pick;\n;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/object.js?"); - -/***/ }), - -/***/ "./node_modules/@formio/lodash/lib/string.js": -/*!***************************************************!*\ - !*** ./node_modules/@formio/lodash/lib/string.js ***! - \***************************************************/ -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.trim = void 0;\n// From https://youmightnotneed.com/lodash/#trim\nfunction trim(str, c) {\n if (c === void 0) { c = '\\\\s'; }\n return str.replace(new RegExp(\"^([\" + c + \"]*)(.*?)([\" + c + \"]*)$\"), '$2');\n}\nexports.trim = trim;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/string.js?"); - -/***/ }), - -/***/ "./node_modules/dayjs/dayjs.min.js": -/*!*****************************************!*\ - !*** ./node_modules/dayjs/dayjs.min.js ***! - \*****************************************/ -/***/ (function(module) { - -eval("!function(t,e){ true?module.exports=e():0}(this,function(){\"use strict\";var t=\"millisecond\",e=\"second\",n=\"minute\",r=\"hour\",i=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",f=\"date\",h=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,c=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},$=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},l={s:$,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+$(r,2,\"0\")+\":\"+$(i,2,\"0\")},m:function t(e,n){if(e.date()=0&&(o[c]=parseInt(m,10))}var d=o[3],v=24===d?0:d,h=o[0]+\"-\"+o[1]+\"-\"+o[2]+\" \"+v+\":\"+o[4]+\":\"+o[5]+\":000\",l=+e;return(r.utc(h).valueOf()-(l-=l%1e3))/6e4},s=i.prototype;s.tz=function(t,e){void 0===t&&(t=o);var n=this.utcOffset(),i=this.toDate().toLocaleString(\"en-US\",{timeZone:t}),a=Math.round((this.toDate()-new Date(i))/1e3/60),f=r(i).$set(\"millisecond\",this.$ms).utcOffset(u-a,!0);if(e){var s=f.utcOffset();f=f.add(n-s,\"minute\")}return f.$x.$timezone=t,f},s.offsetName=function(t){var e=this.$x.$timezone||r.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find(function(t){return\"timezonename\"===t.type.toLowerCase()});return n&&n.value};var m=s.startOf;s.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return m.call(this,t,e);var n=r(this.format(\"YYYY-MM-DD HH:mm:ss:SSS\"));return m.call(n,t,e).tz(this.$x.$timezone,!0)},r.tz=function(t,e,n){var i=n&&e,u=n||e||o,a=f(+r(),u);if(\"string\"!=typeof t)return r(t).tz(u);var s=function(t,e,n){var i=t-60*e*1e3,r=f(i,n);if(e===r)return[i,e];var o=f(i-=60*(r-e)*1e3,n);return r===o?[i,r]:[t-60*Math.min(r,o)*1e3,Math.max(r,o)]}(r.utc(t,i).valueOf(),a,u),m=s[0],c=s[1],d=r(m).utcOffset(c);return d.$x.$timezone=u,d},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(t){o=t}}});\n\n\n//# sourceURL=webpack://Formio/./node_modules/dayjs/plugin/timezone.js?"); - -/***/ }), - -/***/ "./node_modules/dayjs/plugin/utc.js": -/*!******************************************!*\ - !*** ./node_modules/dayjs/plugin/utc.js ***! - \******************************************/ -/***/ (function(module) { - -eval("!function(t,i){ true?module.exports=i():0}(this,function(){\"use strict\";return function(t,i,e){var s=i.prototype;e.utc=function(t){return new i({date:t,utc:!0,args:arguments})},s.utc=function(t){var i=e(this.toDate(),{locale:this.$L,utc:!0});return t?i.add(this.utcOffset(),\"minute\"):i},s.local=function(){return e(this.toDate(),{locale:this.$L,utc:!1})};var f=s.parse;s.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),f.call(this,t)};var n=s.init;s.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else n.call(this)};var u=s.utcOffset;s.utcOffset=function(t,i){var e=this.$utils().u;if(e(t))return this.$u?0:e(this.$offset)?u.call(this):this.$offset;var s=Math.abs(t)<=16?60*t:t,f=this;if(i)return f.$offset=s,f.$u=0===t,f;if(0!==t){var n=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(f=this.local().add(s+n,\"minute\")).$offset=s,f.$x.$localOffset=n}else f=this.utc();return f};var o=s.format;s.format=function(t){var i=t||(this.$u?\"YYYY-MM-DDTHH:mm:ss[Z]\":\"\");return o.call(this,i)},s.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||(new Date).getTimezoneOffset());return this.$d.valueOf()-6e4*t},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var r=s.toDate;s.toDate=function(t){return\"s\"===t&&this.$offset?e(this.format(\"YYYY-MM-DD HH:mm:ss:SSS\")).toDate():r.call(this)};var a=s.diff;s.diff=function(t,i,s){if(t&&this.$u===t.$u)return a.call(this,t,i,s);var f=this.local(),n=e(t).local();return a.call(f,n,i,s)}}});\n\n\n//# sourceURL=webpack://Formio/./node_modules/dayjs/plugin/utc.js?"); - -/***/ }), - -/***/ "./node_modules/dompurify/dist/purify.js": -/*!***********************************************!*\ - !*** ./node_modules/dompurify/dist/purify.js ***! - \***********************************************/ -/***/ (function(module) { - -eval("/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */\n\n(function (global, factory) {\n true ? module.exports = factory() :\n 0;\n}(this, function () { 'use strict';\n\n function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n var hasOwnProperty = Object.hasOwnProperty,\n setPrototypeOf = Object.setPrototypeOf,\n isFrozen = Object.isFrozen,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n var freeze = Object.freeze,\n seal = Object.seal,\n create = Object.create; // eslint-disable-line import/no-mutable-exports\n\n var _ref = typeof Reflect !== 'undefined' && Reflect,\n apply = _ref.apply,\n construct = _ref.construct;\n\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n\n if (!construct) {\n construct = function construct(Func, args) {\n return new (Function.prototype.bind.apply(Func, [null].concat(_toConsumableArray(args))))();\n };\n }\n\n var arrayForEach = unapply(Array.prototype.forEach);\n var arrayPop = unapply(Array.prototype.pop);\n var arrayPush = unapply(Array.prototype.push);\n\n var stringToLowerCase = unapply(String.prototype.toLowerCase);\n var stringMatch = unapply(String.prototype.match);\n var stringReplace = unapply(String.prototype.replace);\n var stringIndexOf = unapply(String.prototype.indexOf);\n var stringTrim = unapply(String.prototype.trim);\n\n var regExpTest = unapply(RegExp.prototype.test);\n\n var typeErrorCreate = unconstruct(TypeError);\n\n function unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return apply(func, thisArg, args);\n };\n }\n\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return construct(func, args);\n };\n }\n\n /* Add properties to a lookup table */\n function addToSet(set, array) {\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n var l = array.length;\n while (l--) {\n var element = array[l];\n if (typeof element === 'string') {\n var lcElement = stringToLowerCase(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n }\n\n /* Shallow clone an object */\n function clone(object) {\n var newObject = create(null);\n\n var property = void 0;\n for (property in object) {\n if (apply(hasOwnProperty, object, [property])) {\n newObject[property] = object[property];\n }\n }\n\n return newObject;\n }\n\n /* IE10 doesn't support __lookupGetter__ so lets'\n * simulate it. It also automatically checks\n * if the prop is function or getter and behaves\n * accordingly. */\n function lookupGetter(object, prop) {\n while (object !== null) {\n var desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n\n object = getPrototypeOf(object);\n }\n\n function fallbackValue(element) {\n console.warn('fallback value for', element);\n return null;\n }\n\n return fallbackValue;\n }\n\n var html = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n // SVG\n var svg = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n\n var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n var svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'fedropshadow', 'feimage', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n\n var mathMl = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover']);\n\n // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n var mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n\n var text = freeze(['#text']);\n\n var html$1 = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns']);\n\n var svg$1 = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n\n var mathMl$1 = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n\n var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n // eslint-disable-next-line unicorn/better-regex\n var MUSTACHE_EXPR = seal(/\\{\\{[\\s\\S]*|[\\s\\S]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n var ERB_EXPR = seal(/<%[\\s\\S]*|[\\s\\S]*%>/gm);\n var DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n var ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n var IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n var ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n\n var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n function _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n var getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n };\n\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {Document} document The document object (to determine policy name suffix)\n * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported).\n */\n var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {\n if ((typeof trustedTypes === 'undefined' ? 'undefined' : _typeof(trustedTypes)) !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n var suffix = null;\n var ATTR_NAME = 'data-tt-policy-suffix';\n if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {\n suffix = document.currentScript.getAttribute(ATTR_NAME);\n }\n\n var policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML: function createHTML(html$$1) {\n return html$$1;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n\n function createDOMPurify() {\n var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n\n var DOMPurify = function DOMPurify(root) {\n return createDOMPurify(root);\n };\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '2.2.7';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n\n return DOMPurify;\n }\n\n var originalDocument = window.document;\n\n var document = window.document;\n var DocumentFragment = window.DocumentFragment,\n HTMLTemplateElement = window.HTMLTemplateElement,\n Node = window.Node,\n Element = window.Element,\n NodeFilter = window.NodeFilter,\n _window$NamedNodeMap = window.NamedNodeMap,\n NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,\n Text = window.Text,\n Comment = window.Comment,\n DOMParser = window.DOMParser,\n trustedTypes = window.trustedTypes;\n\n\n var ElementPrototype = Element.prototype;\n\n var cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n var getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n var getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n var template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);\n var emptyHTML = trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML('') : '';\n\n var _document = document,\n implementation = _document.implementation,\n createNodeIterator = _document.createNodeIterator,\n getElementsByTagName = _document.getElementsByTagName,\n createDocumentFragment = _document.createDocumentFragment;\n var importNode = originalDocument.importNode;\n\n\n var documentMode = {};\n try {\n documentMode = clone(document).documentMode ? document.documentMode : {};\n } catch (_) {}\n\n var hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined' && documentMode !== 9;\n\n var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR,\n ERB_EXPR$$1 = ERB_EXPR,\n DATA_ATTR$$1 = DATA_ATTR,\n ARIA_ATTR$$1 = ARIA_ATTR,\n IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE$$1 = ATTR_WHITESPACE;\n var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n\n var ALLOWED_TAGS = null;\n var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(html), _toConsumableArray$1(svg), _toConsumableArray$1(svgFilters), _toConsumableArray$1(mathMl), _toConsumableArray$1(text)));\n\n /* Allowed attribute names */\n var ALLOWED_ATTR = null;\n var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray$1(html$1), _toConsumableArray$1(svg$1), _toConsumableArray$1(mathMl$1), _toConsumableArray$1(xml)));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n var FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n var FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n var ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n var ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n var ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n var SAFE_FOR_TEMPLATES = false;\n\n /* Decide if document with ... should be returned */\n var WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n var SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n var FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n var RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n var RETURN_DOM_FRAGMENT = false;\n\n /* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM\n * `Node` is imported into the current `Document`. If this flag is not enabled the\n * `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by\n * DOMPurify.\n *\n * This defaults to `true` starting DOMPurify 2.2.0. Note that setting it to `false`\n * might cause XSS from attacks hidden in closed shadowroots in case the browser\n * supports Declarative Shadow: DOM https://web.dev/declarative-shadow-dom/\n */\n var RETURN_DOM_IMPORT = true;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n var RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks? */\n var SANITIZE_DOM = true;\n\n /* Keep element content when removing element? */\n var KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n var IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n var USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n var FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n\n /* Tags that are safe for data: URIs */\n var DATA_URI_TAGS = null;\n var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n var URI_SAFE_ATTRIBUTES = null;\n var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'summary', 'title', 'value', 'style', 'xmlns']);\n\n /* Keep a reference to config to pass to hooks */\n var CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n var formElement = document.createElement('form');\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n var _parseConfig = function _parseConfig(cfg) {\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || (typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n\n /* Set configuration parameters */\n ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;\n URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS;\n FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};\n FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};\n USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT !== false; // Default true\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1;\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(text)));\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html);\n addToSet(ALLOWED_ATTR, html$1);\n }\n\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg);\n addToSet(ALLOWED_ATTR, svg$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl);\n addToSet(ALLOWED_ATTR, mathMl$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);\n }\n\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);\n }\n\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n\n var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n var ALL_SVG_TAGS = addToSet({}, svg);\n addToSet(ALL_SVG_TAGS, svgFilters);\n addToSet(ALL_SVG_TAGS, svgDisallowed);\n\n var ALL_MATHML_TAGS = addToSet({}, mathMl);\n addToSet(ALL_MATHML_TAGS, mathMlDisallowed);\n\n var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n\n /**\n *\n *\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n var _checkValidNamespace = function _checkValidNamespace(element) {\n var parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: HTML_NAMESPACE,\n tagName: 'template'\n };\n }\n\n var tagName = stringToLowerCase(element.tagName);\n var parentTagName = stringToLowerCase(parent.tagName);\n\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erronously deleted from\n // HTML namespace.\n var commonSvgAndHTMLElements = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (commonSvgAndHTMLElements[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG or MathML). Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n var _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, { element: node });\n try {\n node.parentNode.removeChild(node);\n } catch (_) {\n try {\n node.outerHTML = emptyHTML;\n } catch (_) {\n node.remove();\n }\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n var _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n var _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n var doc = void 0;\n var leadingWhitespace = void 0;\n\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n var matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n\n var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /* Use the DOMParser API by default, fallback later if needs be */\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, 'text/html');\n } catch (_) {}\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createHTMLDocument('');\n var _doc = doc,\n body = _doc.body;\n\n body.parentNode.removeChild(body.parentNode.firstElementChild);\n body.outerHTML = dirtyPayload;\n }\n\n if (dirty && leadingWhitespace) {\n doc.body.insertBefore(document.createTextNode(leadingWhitespace), doc.body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n };\n\n /**\n * _createIterator\n *\n * @param {Document} root document/fragment to create iterator for\n * @return {Iterator} iterator instance\n */\n var _createIterator = function _createIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, function () {\n return NodeFilter.FILTER_ACCEPT;\n }, false);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n var _isClobbered = function _isClobbered(elm) {\n if (elm instanceof Text || elm instanceof Comment) {\n return false;\n }\n\n if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function') {\n return true;\n }\n\n return false;\n };\n\n /**\n * _isNode\n *\n * @param {Node} obj object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n var _isNode = function _isNode(object) {\n return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? object instanceof Node : object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n var _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n\n arrayForEach(hooks[entryPoint], function (hook) {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n var _sanitizeElements = function _sanitizeElements(currentNode) {\n var content = void 0;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check if tagname contains Unicode */\n if (stringMatch(currentNode.nodeName, /[\\u0080-\\uFFFF]/)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n var tagName = stringToLowerCase(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName: tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (!_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n var parentNode = getParentNode(currentNode);\n var childNodes = getChildNodes(currentNode);\n\n if (childNodes && parentNode) {\n var childCount = childNodes.length;\n\n for (var i = childCount - 1; i >= 0; --i) {\n parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));\n }\n }\n }\n\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n if ((tagName === 'noscript' || tagName === 'noembed') && regExpTest(/<\\/no(script|embed)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n content = stringReplace(content, MUSTACHE_EXPR$$1, ' ');\n content = stringReplace(content, ERB_EXPR$$1, ' ');\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$$1, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n return false;\n\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if (!value) ; else {\n return false;\n }\n\n return true;\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n var attr = void 0;\n var value = void 0;\n var lcName = void 0;\n var l = void 0;\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n\n var attributes = currentNode.attributes;\n\n /* Check if we have attributes; if not we might have a text node */\n\n if (!attributes) {\n return;\n }\n\n var hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n attr = attributes[l];\n var _attr = attr,\n name = _attr.name,\n namespaceURI = _attr.namespaceURI;\n\n value = stringTrim(attr.value);\n lcName = stringToLowerCase(name);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n value = stringReplace(value, MUSTACHE_EXPR$$1, ' ');\n value = stringReplace(value, ERB_EXPR$$1, ' ');\n }\n\n /* Is `value` valid for this attribute? */\n var lcTag = currentNode.nodeName.toLowerCase();\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n\n arrayPop(DOMPurify.removed);\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n var shadowNode = void 0;\n var shadowIterator = _createIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} configuration object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty, cfg) {\n var body = void 0;\n var importedNode = void 0;\n var currentNode = void 0;\n var oldNode = void 0;\n var returnNode = void 0;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n if (!dirty) {\n dirty = '';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n // eslint-disable-next-line no-negated-condition\n if (typeof dirty.toString !== 'function') {\n throw typeErrorCreate('toString is not a function');\n } else {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n }\n }\n\n /* Check we can run. Otherwise fall back or ignore */\n if (!DOMPurify.isSupported) {\n if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {\n if (typeof dirty === 'string') {\n return window.toStaticHTML(dirty);\n }\n\n if (_isNode(dirty)) {\n return window.toStaticHTML(dirty.outerHTML);\n }\n }\n\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n\n if (IN_PLACE) ; else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : emptyHTML;\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n var nodeIterator = _createIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Fix IE's strange behavior with manipulated textNodes #89 */\n if (currentNode.nodeType === 3 && currentNode === oldNode) {\n continue;\n }\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n\n oldNode = currentNode;\n }\n\n oldNode = null;\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (RETURN_DOM_IMPORT) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$$1, ' ');\n serializedHTML = stringReplace(serializedHTML, ERB_EXPR$$1, ' ');\n }\n\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function (cfg) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {string} tag Tag name of containing element.\n * @param {string} attr Attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n\n var lcTag = stringToLowerCase(tag);\n var lcName = stringToLowerCase(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n *\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n\n return DOMPurify;\n }\n\n var purify = createDOMPurify();\n\n return purify;\n\n}));\n//# sourceMappingURL=purify.js.map\n\n\n//# sourceURL=webpack://Formio/./node_modules/dompurify/dist/purify.js?"); - -/***/ }), - -/***/ "./node_modules/eventemitter3/index.js": -/*!*********************************************!*\ - !*** ./node_modules/eventemitter3/index.js ***! - \*********************************************/ -/***/ (function(module) { - -"use strict"; -eval("\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif (true) {\n module.exports = EventEmitter;\n}\n\n\n//# sourceURL=webpack://Formio/./node_modules/eventemitter3/index.js?"); - -/***/ }), - -/***/ "./node_modules/fetch-ponyfill/build/fetch-browser.js": -/*!************************************************************!*\ - !*** ./node_modules/fetch-ponyfill/build/fetch-browser.js ***! - \************************************************************/ -/***/ (function(module, exports, __webpack_require__) { - -eval("var __WEBPACK_AMD_DEFINE_RESULT__;(function (global) {\n 'use strict';\n\n function fetchPonyfill(options) {\n var Promise = options && options.Promise || global.Promise;\n var XMLHttpRequest = options && options.XMLHttpRequest || global.XMLHttpRequest;\n\n return (function () {\n var globalThis = Object.create(global, {\n fetch: {\n value: undefined,\n writable: true\n }\n });\n\n (function (global, factory) {\n true ? factory(exports) :\n 0;\n }(this, (function (exports) { 'use strict';\n\n var global =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n (typeof global !== 'undefined' && global);\n\n var support = {\n searchParams: 'URLSearchParams' in global,\n iterable: 'Symbol' in global && 'iterator' in Symbol,\n blob:\n 'FileReader' in global &&\n 'Blob' in global &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in global,\n arrayBuffer: 'ArrayBuffer' in global\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n this.bodyUsed = this.bodyUsed;\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this);\n if (isConsumed) {\n return isConsumed\n }\n if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/;\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/;\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();\n }\n }\n }\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : '';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = global.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n setTimeout(function() {\n resolve(new Response(body, options));\n }, 0);\n };\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'));\n }, 0);\n };\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'));\n }, 0);\n };\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n }, 0);\n };\n\n function fixUrl(url) {\n try {\n return url === '' && global.location.href ? global.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob';\n } else if (\n support.arrayBuffer &&\n request.headers.get('Content-Type') &&\n request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1\n ) {\n xhr.responseType = 'arraybuffer';\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]));\n });\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!global.fetch) {\n global.fetch = fetch;\n global.Headers = Headers;\n global.Request = Request;\n global.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n })));\n\n\n return {\n fetch: globalThis.fetch,\n Headers: globalThis.Headers,\n Request: globalThis.Request,\n Response: globalThis.Response,\n DOMException: globalThis.DOMException\n };\n }());\n }\n\n if (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return fetchPonyfill;\n }).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : this));\n\n\n\n//# sourceURL=webpack://Formio/./node_modules/fetch-ponyfill/build/fetch-browser.js?"); - -/***/ }), - -/***/ "./node_modules/json-logic-js/logic.js": -/*!*********************************************!*\ - !*** ./node_modules/json-logic-js/logic.js ***! - \*********************************************/ -/***/ (function(module, exports, __webpack_require__) { - -eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* globals define,module */\n/*\nUsing a Universal Module Loader that should be browser, require, and AMD friendly\nhttp://ricostacruz.com/cheatsheets/umdjs.html\n*/\n;(function(root, factory) {\n if (true) {\n !(__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__.call(exports, __webpack_require__, exports, module)) :\n\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function() {\n \"use strict\";\n /* globals console:false */\n\n if ( ! Array.isArray) {\n Array.isArray = function(arg) {\n return Object.prototype.toString.call(arg) === \"[object Array]\";\n };\n }\n\n /**\n * Return an array that contains no duplicates (original not modified)\n * @param {array} array Original reference array\n * @return {array} New array with no duplicates\n */\n function arrayUnique(array) {\n var a = [];\n for (var i=0, l=array.length; i\": function(a, b) {\n return a > b;\n },\n \">=\": function(a, b) {\n return a >= b;\n },\n \"<\": function(a, b, c) {\n return (c === undefined) ? a < b : (a < b) && (b < c);\n },\n \"<=\": function(a, b, c) {\n return (c === undefined) ? a <= b : (a <= b) && (b <= c);\n },\n \"!!\": function(a) {\n return jsonLogic.truthy(a);\n },\n \"!\": function(a) {\n return !jsonLogic.truthy(a);\n },\n \"%\": function(a, b) {\n return a % b;\n },\n \"log\": function(a) {\n console.log(a); return a;\n },\n \"in\": function(a, b) {\n if (!b || typeof b.indexOf === \"undefined\") return false;\n return (b.indexOf(a) !== -1);\n },\n \"cat\": function() {\n return Array.prototype.join.call(arguments, \"\");\n },\n \"substr\": function(source, start, end) {\n if (end < 0) {\n // JavaScript doesn't support negative end, this emulates PHP behavior\n var temp = String(source).substr(start);\n return temp.substr(0, temp.length + end);\n }\n return String(source).substr(start, end);\n },\n \"+\": function() {\n return Array.prototype.reduce.call(arguments, function(a, b) {\n return parseFloat(a, 10) + parseFloat(b, 10);\n }, 0);\n },\n \"*\": function() {\n return Array.prototype.reduce.call(arguments, function(a, b) {\n return parseFloat(a, 10) * parseFloat(b, 10);\n });\n },\n \"-\": function(a, b) {\n if (b === undefined) {\n return -a;\n } else {\n return a - b;\n }\n },\n \"/\": function(a, b) {\n return a / b;\n },\n \"min\": function() {\n return Math.min.apply(this, arguments);\n },\n \"max\": function() {\n return Math.max.apply(this, arguments);\n },\n \"merge\": function() {\n return Array.prototype.reduce.call(arguments, function(a, b) {\n return a.concat(b);\n }, []);\n },\n \"var\": function(a, b) {\n var not_found = (b === undefined) ? null : b;\n var data = this;\n if (typeof a === \"undefined\" || a===\"\" || a===null) {\n return data;\n }\n var sub_props = String(a).split(\".\");\n for (var i = 0; i < sub_props.length; i++) {\n if (data === null || data === undefined) {\n return not_found;\n }\n // Descending into data\n data = data[sub_props[i]];\n if (data === undefined) {\n return not_found;\n }\n }\n return data;\n },\n \"missing\": function() {\n /*\n Missing can receive many keys as many arguments, like {\"missing:[1,2]}\n Missing can also receive *one* argument that is an array of keys,\n which typically happens if it's actually acting on the output of another command\n (like 'if' or 'merge')\n */\n\n var missing = [];\n var keys = Array.isArray(arguments[0]) ? arguments[0] : arguments;\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = jsonLogic.apply({\"var\": key}, this);\n if (value === null || value === \"\") {\n missing.push(key);\n }\n }\n\n return missing;\n },\n \"missing_some\": function(need_count, options) {\n // missing_some takes two arguments, how many (minimum) items must be present, and an array of keys (just like 'missing') to check for presence.\n var are_missing = jsonLogic.apply({\"missing\": options}, this);\n\n if (options.length - are_missing.length >= need_count) {\n return [];\n } else {\n return are_missing;\n }\n },\n };\n\n jsonLogic.is_logic = function(logic) {\n return (\n typeof logic === \"object\" && // An object\n logic !== null && // but not null\n ! Array.isArray(logic) && // and not an array\n Object.keys(logic).length === 1 // with exactly one key\n );\n };\n\n /*\n This helper will defer to the JsonLogic spec as a tie-breaker when different language interpreters define different behavior for the truthiness of primitives. E.g., PHP considers empty arrays to be falsy, but Javascript considers them to be truthy. JsonLogic, as an ecosystem, needs one consistent answer.\n\n Spec and rationale here: http://jsonlogic.com/truthy\n */\n jsonLogic.truthy = function(value) {\n if (Array.isArray(value) && value.length === 0) {\n return false;\n }\n return !! value;\n };\n\n\n jsonLogic.get_operator = function(logic) {\n return Object.keys(logic)[0];\n };\n\n jsonLogic.get_values = function(logic) {\n return logic[jsonLogic.get_operator(logic)];\n };\n\n jsonLogic.apply = function(logic, data) {\n // Does this array contain logic? Only one way to find out.\n if (Array.isArray(logic)) {\n return logic.map(function(l) {\n return jsonLogic.apply(l, data);\n });\n }\n // You've recursed to a primitive, stop!\n if ( ! jsonLogic.is_logic(logic) ) {\n return logic;\n }\n\n var op = jsonLogic.get_operator(logic);\n var values = logic[op];\n var i;\n var current;\n var scopedLogic;\n var scopedData;\n var filtered;\n var initial;\n\n // easy syntax for unary operators, like {\"var\" : \"x\"} instead of strict {\"var\" : [\"x\"]}\n if ( ! Array.isArray(values)) {\n values = [values];\n }\n\n // 'if', 'and', and 'or' violate the normal rule of depth-first calculating consequents, let each manage recursion as needed.\n if (op === \"if\" || op == \"?:\") {\n /* 'if' should be called with a odd number of parameters, 3 or greater\n This works on the pattern:\n if( 0 ){ 1 }else{ 2 };\n if( 0 ){ 1 }else if( 2 ){ 3 }else{ 4 };\n if( 0 ){ 1 }else if( 2 ){ 3 }else if( 4 ){ 5 }else{ 6 };\n\n The implementation is:\n For pairs of values (0,1 then 2,3 then 4,5 etc)\n If the first evaluates truthy, evaluate and return the second\n If the first evaluates falsy, jump to the next pair (e.g, 0,1 to 2,3)\n given one parameter, evaluate and return it. (it's an Else and all the If/ElseIf were false)\n given 0 parameters, return NULL (not great practice, but there was no Else)\n */\n for (i = 0; i < values.length - 1; i += 2) {\n if ( jsonLogic.truthy( jsonLogic.apply(values[i], data) ) ) {\n return jsonLogic.apply(values[i+1], data);\n }\n }\n if (values.length === i+1) {\n return jsonLogic.apply(values[i], data);\n }\n return null;\n } else if (op === \"and\") { // Return first falsy, or last\n for (i=0; i < values.length; i+=1) {\n current = jsonLogic.apply(values[i], data);\n if ( ! jsonLogic.truthy(current)) {\n return current;\n }\n }\n return current; // Last\n } else if (op === \"or\") {// Return first truthy, or last\n for (i=0; i < values.length; i+=1) {\n current = jsonLogic.apply(values[i], data);\n if ( jsonLogic.truthy(current) ) {\n return current;\n }\n }\n return current; // Last\n } else if (op === \"filter\") {\n scopedData = jsonLogic.apply(values[0], data);\n scopedLogic = values[1];\n\n if ( ! Array.isArray(scopedData)) {\n return [];\n }\n // Return only the elements from the array in the first argument,\n // that return truthy when passed to the logic in the second argument.\n // For parity with JavaScript, reindex the returned array\n return scopedData.filter(function(datum) {\n return jsonLogic.truthy( jsonLogic.apply(scopedLogic, datum));\n });\n } else if (op === \"map\") {\n scopedData = jsonLogic.apply(values[0], data);\n scopedLogic = values[1];\n\n if ( ! Array.isArray(scopedData)) {\n return [];\n }\n\n return scopedData.map(function(datum) {\n return jsonLogic.apply(scopedLogic, datum);\n });\n } else if (op === \"reduce\") {\n scopedData = jsonLogic.apply(values[0], data);\n scopedLogic = values[1];\n initial = typeof values[2] !== \"undefined\" ? values[2] : null;\n\n if ( ! Array.isArray(scopedData)) {\n return initial;\n }\n\n return scopedData.reduce(\n function(accumulator, current) {\n return jsonLogic.apply(\n scopedLogic,\n {current: current, accumulator: accumulator}\n );\n },\n initial\n );\n } else if (op === \"all\") {\n scopedData = jsonLogic.apply(values[0], data);\n scopedLogic = values[1];\n // All of an empty set is false. Note, some and none have correct fallback after the for loop\n if ( ! scopedData.length) {\n return false;\n }\n for (i=0; i < scopedData.length; i+=1) {\n if ( ! jsonLogic.truthy( jsonLogic.apply(scopedLogic, scopedData[i]) )) {\n return false; // First falsy, short circuit\n }\n }\n return true; // All were truthy\n } else if (op === \"none\") {\n filtered = jsonLogic.apply({filter: values}, data);\n return filtered.length === 0;\n } else if (op === \"some\") {\n filtered = jsonLogic.apply({filter: values}, data);\n return filtered.length > 0;\n }\n\n // Everyone else gets immediate depth-first recursion\n values = values.map(function(val) {\n return jsonLogic.apply(val, data);\n });\n\n\n // The operation is called with \"data\" bound to its \"this\" and \"values\" passed as arguments.\n // Structured commands like % or > can name formal arguments while flexible commands (like missing or merge) can operate on the pseudo-array arguments\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments\n if (operations.hasOwnProperty(op) && typeof operations[op] === \"function\") {\n return operations[op].apply(data, values);\n } else if (op.indexOf(\".\") > 0) { // Contains a dot, and not in the 0th position\n var sub_ops = String(op).split(\".\");\n var operation = operations;\n for (i = 0; i < sub_ops.length; i++) {\n\n if (!operation.hasOwnProperty(sub_ops[i])) {\n throw new Error(\"Unrecognized operation \" + op +\n \" (failed at \" + sub_ops.slice(0, i+1).join(\".\") + \")\");\n }\n // Descending into operations\n operation = operation[sub_ops[i]];\n }\n\n return operation.apply(data, values);\n }\n\n throw new Error(\"Unrecognized operation \" + op );\n };\n\n jsonLogic.uses_data = function(logic) {\n var collection = [];\n\n if (jsonLogic.is_logic(logic)) {\n var op = jsonLogic.get_operator(logic);\n var values = logic[op];\n\n if ( ! Array.isArray(values)) {\n values = [values];\n }\n\n if (op === \"var\") {\n // This doesn't cover the case where the arg to var is itself a rule.\n collection.push(values[0]);\n } else {\n // Recursion!\n values.map(function(val) {\n collection.push.apply(collection, jsonLogic.uses_data(val) );\n });\n }\n }\n\n return arrayUnique(collection);\n };\n\n jsonLogic.add_operation = function(name, code) {\n operations[name] = code;\n };\n\n jsonLogic.rm_operation = function(name) {\n delete operations[name];\n };\n\n jsonLogic.rule_like = function(rule, pattern) {\n // console.log(\"Is \". JSON.stringify(rule) . \" like \" . JSON.stringify(pattern) . \"?\");\n if (pattern === rule) {\n return true;\n } // TODO : Deep object equivalency?\n if (pattern === \"@\") {\n return true;\n } // Wildcard!\n if (pattern === \"number\") {\n return (typeof rule === \"number\");\n }\n if (pattern === \"string\") {\n return (typeof rule === \"string\");\n }\n if (pattern === \"array\") {\n // !logic test might be superfluous in JavaScript\n return Array.isArray(rule) && ! jsonLogic.is_logic(rule);\n }\n\n if (jsonLogic.is_logic(pattern)) {\n if (jsonLogic.is_logic(rule)) {\n var pattern_op = jsonLogic.get_operator(pattern);\n var rule_op = jsonLogic.get_operator(rule);\n\n if (pattern_op === \"@\" || pattern_op === rule_op) {\n // echo \"\\nOperators match, go deeper\\n\";\n return jsonLogic.rule_like(\n jsonLogic.get_values(rule, false),\n jsonLogic.get_values(pattern, false)\n );\n }\n }\n return false; // pattern is logic, rule isn't, can't be eq\n }\n\n if (Array.isArray(pattern)) {\n if (Array.isArray(rule)) {\n if (pattern.length !== rule.length) {\n return false;\n }\n /*\n Note, array order MATTERS, because we're using this array test logic to consider arguments, where order can matter. (e.g., + is commutative, but '-' or 'if' or 'var' are NOT)\n */\n for (var i = 0; i < pattern.length; i += 1) {\n // If any fail, we fail\n if ( ! jsonLogic.rule_like(rule[i], pattern[i])) {\n return false;\n }\n }\n return true; // If they *all* passed, we pass\n } else {\n return false; // Pattern is array, rule isn't\n }\n }\n\n // Not logic, not array, not a === match for rule.\n return false;\n };\n\n return jsonLogic;\n}));\n\n\n//# sourceURL=webpack://Formio/./node_modules/json-logic-js/logic.js?"); - -/***/ }), - -/***/ "./src/base/Components.ts": -/*!********************************!*\ - !*** ./src/base/Components.ts ***! - \********************************/ -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; -eval("\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.render = exports.Components = void 0;\n/**\n * Manages all of the components within the Form.io renderer.\n */\nvar Components = /** @class */ (function () {\n function Components() {\n }\n /**\n * Gets a specific component type.\n *\n * @param type\n * @param from\n * @returns\n */\n Components.component = function (type, from) {\n if (from === void 0) { from = 'components'; }\n if (Components[from][type]) {\n return Components[from][type];\n }\n else {\n return Components[from].component;\n }\n };\n /**\n * Create a new component.\n *\n * ```ts\n * const htmlComp = Components.createComponent({\n * type: 'html',\n * tag: 'p',\n * content: 'This is a test.'\n * })\n * ```\n *\n * @param comp The component JSON you wish to create.\n * @param options The options to pass to this component.\n * @param data The data you wish to provide to this component.\n */\n Components.create = function (comp, options, data) {\n return new (Components.component(comp.type))(comp, options, data);\n };\n /**\n * Adds a base decorator type component.\n *\n * @param baseComponent\n * @param type\n */\n Components.addDecorator = function (decorator, type) {\n Components.decorators[type] = decorator;\n };\n /**\n * Adds a new component to the renderer. Can either be a component class or a component JSON\n * to be imported.\n *\n * @param component\n */\n Components.addComponent = function (component, type) {\n if (!component) {\n return;\n }\n if (typeof component !== 'function') {\n return Components.importComponent(component);\n }\n Components.components[type] = component;\n return component;\n };\n /**\n * Imports a new component based on the JSON decorator of that component.\n * @param component\n */\n Components.importComponent = function (props) {\n if (props === void 0) { props = {}; }\n var Decorator = Components.component(props.extends, 'decorators');\n var ExtendedComponent = /** @class */ (function () {\n function ExtendedComponent() {\n }\n ExtendedComponent = __decorate([\n Decorator(props)\n ], ExtendedComponent);\n return ExtendedComponent;\n }());\n Components.addComponent(ExtendedComponent, props.type);\n };\n /**\n * Sets the components used within this renderer.\n * @param components\n */\n Components.setComponents = function (components) {\n Object.assign(Components.components, components);\n };\n /**\n * An array of Components available to be rendered.\n */\n Components.components = {};\n Components.decorators = {};\n return Components;\n}());\nexports.Components = Components;\n/**\n * Render a component attached to an html component.\n *\n * @param element\n * @param component\n * @param options\n * @param data\n */\nfunction render(element, component, options, data) {\n if (options === void 0) { options = {}; }\n if (data === void 0) { data = {}; }\n return Components.create(component, options, data).attach(element);\n}\nexports.render = render;\n\n\n//# sourceURL=webpack://Formio/./src/base/Components.ts?"); - -/***/ }), - -/***/ "./src/base/Template.ts": -/*!******************************!*\ - !*** ./src/base/Template.ts ***! - \******************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Template = void 0;\nvar _ = __importStar(__webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\"));\n/**\n * Manages all the available templates which can be rendered.\n */\nvar Template = /** @class */ (function () {\n function Template() {\n }\n /**\n * Adds a collection of template frameworks to the renderer.\n * @param templates\n */\n Template.addTemplates = function (templates) {\n var framework = Template.framework;\n Template.templates = _.merge(Template.templates, templates);\n Template.framework = framework;\n };\n /**\n * Adds some templates to the existing template.\n * @param name\n * @param template\n */\n Template.addTemplate = function (name, template) {\n Template.templates[name] = _.merge(Template.current, template);\n };\n /**\n * Extend an existing template.\n * @param name\n * @param template\n */\n Template.extendTemplate = function (name, template) {\n Template.templates[name] = _.merge(Template.templates[name], template);\n };\n /**\n * Sets a template.\n * @param name\n * @param template\n */\n Template.setTemplate = function (name, template) {\n Template.addTemplate(name, template);\n };\n Object.defineProperty(Template, \"current\", {\n /**\n * Get the current template.\n */\n get: function () {\n return Template._current;\n },\n /**\n * Set the current template.\n */\n set: function (templates) {\n var defaultTemplates = Template.current;\n Template._current = _.merge(defaultTemplates, templates);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Template, \"framework\", {\n /**\n * Gets the current framework.\n */\n get: function () {\n return Template._framework;\n },\n /**\n * Sets the current framework.\n */\n set: function (framework) {\n if (Template.templates.hasOwnProperty(framework)) {\n Template._framework = framework;\n Template._current = Template.templates[framework];\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Render a partial within the current template.\n * @param name\n * @param ctx\n * @param mode\n * @returns\n */\n Template.render = function (name, ctx, mode, defaultTemplate) {\n if (mode === void 0) { mode = 'html'; }\n if (defaultTemplate === void 0) { defaultTemplate = null; }\n if (typeof name === 'function') {\n return name(ctx);\n }\n if (this.current[name] && this.current[name][mode]) {\n return this.current[name][mode](ctx);\n }\n if (defaultTemplate) {\n return defaultTemplate(ctx);\n }\n return 'Unknown template';\n };\n Template.templates = [];\n Template._current = {};\n Template._framework = 'bootstrap';\n return Template;\n}());\nexports.Template = Template;\n\n\n//# sourceURL=webpack://Formio/./src/base/Template.ts?"); - -/***/ }), - -/***/ "./src/base/array/ArrayComponent.ts": -/*!******************************************!*\ - !*** ./src/base/array/ArrayComponent.ts ***! - \******************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ArrayComponent = void 0;\nvar Components_1 = __webpack_require__(/*! ../Components */ \"./src/base/Components.ts\");\nvar model_1 = __webpack_require__(/*! @formio/model */ \"./src/model/index.ts\");\nvar NestedComponent_1 = __webpack_require__(/*! ../nested/NestedComponent */ \"./src/base/nested/NestedComponent.ts\");\n/**\n * An array data type component. This provides a nested component that creates \"rows\" of data\n * where each row creates new instances of the JSON components and sets the data context for\n * each row according to the row it is within.\n *\n * For example, if you have the following JSON schema.\n *\n * ```\n * {\n * type: 'array',\n * key: 'customers',\n * components: [\n * {\n * type: 'datavalue',\n * key: 'firstName'\n * },\n * {\n * type: 'datavalue',\n * key: 'lastName'\n * }\n * ]\n * }\n * ```\n *\n * You can now create multiple rows using the following data.\n *\n * ```\n * {\n * customers: [\n * {firstName: 'Joe', lastName: 'Smith'},\n * {firstName: 'Sally', lastName: 'Thompson'},\n * {firstName: 'Sue', lastName: 'Warner'}\n * ]\n * }\n * ```\n */\nfunction ArrayComponent(props) {\n if (props === void 0) { props = {}; }\n if (!props.type) {\n props.type = 'array';\n }\n if (!props.model) {\n props.model = model_1.NestedArrayModel;\n }\n return function (BaseClass) {\n return /** @class */ (function (_super) {\n __extends(ExtendedArrayComponent, _super);\n function ExtendedArrayComponent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return ExtendedArrayComponent;\n }(NestedComponent_1.NestedComponent(props)(BaseClass)));\n };\n}\nexports.ArrayComponent = ArrayComponent;\nComponents_1.Components.addDecorator(ArrayComponent, 'array');\nComponents_1.Components.addComponent(ArrayComponent()(), 'array');\n\n\n//# sourceURL=webpack://Formio/./src/base/array/ArrayComponent.ts?"); - -/***/ }), - -/***/ "./src/base/component/Component.ts": -/*!*****************************************!*\ - !*** ./src/base/component/Component.ts ***! - \*****************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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 __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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Component = void 0;\nvar Components_1 = __webpack_require__(/*! ../Components */ \"./src/base/Components.ts\");\nvar Template_1 = __webpack_require__(/*! ../Template */ \"./src/base/Template.ts\");\nvar Evaluator_1 = __webpack_require__(/*! @formio/utils/Evaluator */ \"./src/utils/Evaluator.ts\");\nvar dom = __importStar(__webpack_require__(/*! @formio/utils/dom */ \"./src/utils/dom.ts\"));\nvar sanitize_1 = __webpack_require__(/*! @formio/utils/sanitize */ \"./src/utils/sanitize.ts\");\nvar model_1 = __webpack_require__(/*! @formio/model */ \"./src/model/index.ts\");\nvar object_1 = __webpack_require__(/*! @formio/lodash/lib/object */ \"./node_modules/@formio/lodash/lib/object.js\");\nfunction Component(props) {\n if (props === void 0) { props = {}; }\n props = object_1.merge({\n type: 'component',\n template: false,\n schema: {\n persistent: true,\n protected: false,\n }\n }, props);\n props.schema.type = props.type;\n var ModelClass = props.model || model_1.Model;\n return function (BaseClass) {\n return /** @class */ (function (_super) {\n __extends(ExtendedComponent, _super);\n function ExtendedComponent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * Boolean to let us know if this component is attached to the DOM or not.\n */\n _this.attached = false;\n /**\n * The DOM element references used for component logic.\n */\n _this.refs = {};\n /**\n * The template to render for this component.\n */\n _this.template = props.template;\n /**\n * An array of attached listeners.\n */\n _this.attachedListeners = [];\n return _this;\n }\n Object.defineProperty(ExtendedComponent.prototype, \"defaultOptions\", {\n get: function () {\n return {\n language: 'en',\n namespace: 'formio'\n };\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ExtendedComponent.prototype, \"defaultTemplate\", {\n get: function () {\n return function (ctx) { return \"\" + ctx.t('Unknown Component') + \"\"; };\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Interpolate a template string.\n * @param template - The template string to interpolate.\n * @param context - The context variables to pass to the interpolation.\n */\n ExtendedComponent.prototype.interpolate = function (template, context) {\n return Evaluator_1.Evaluator.interpolate(template, context);\n };\n /**\n * The rendering context.\n * @param context - The existing contexts from parent classes.\n */\n ExtendedComponent.prototype.renderContext = function (context) {\n if (context === void 0) { context = {}; }\n if (_super.prototype.renderContext) {\n return _super.prototype.renderContext.call(this, context);\n }\n return context;\n };\n /**\n * Performs an evaluation using the evaluation context of this component.\n *\n * @param func\n * @param args\n * @param ret\n * @param tokenize\n * @return {*}\n */\n ExtendedComponent.prototype.evaluate = function (func, args, ret, tokenize) {\n if (args === void 0) { args = {}; }\n if (ret === void 0) { ret = ''; }\n if (tokenize === void 0) { tokenize = false; }\n return Evaluator_1.Evaluator.evaluate(func, this.evalContext(args), ret, tokenize);\n };\n /**\n * Renders this component as an HTML string.\n */\n ExtendedComponent.prototype.render = function (context) {\n if (context === void 0) { context = {}; }\n if (_super.prototype.render) {\n return _super.prototype.render.call(this, context);\n }\n return this.renderTemplate((this.template || this.component.type), this.renderContext(context));\n };\n /**\n * Returns the template references.\n */\n ExtendedComponent.prototype.getRefs = function () {\n if (_super.prototype.getRefs) {\n return _super.prototype.getRefs.call(this);\n }\n return {};\n };\n /**\n * Loads the elemement references.\n * @param element\n */\n ExtendedComponent.prototype.loadRefs = function (element) {\n var refs = this.getRefs();\n for (var ref in refs) {\n if (refs[ref] === 'single') {\n this.refs[ref] = element.querySelector(\"[ref=\\\"\" + ref + \"\\\"]\");\n }\n else {\n this.refs[ref] = element.querySelectorAll(\"[ref=\\\"\" + ref + \"\\\"]\");\n }\n }\n };\n /**\n * Renders the component and then attaches this component to the HTMLElement.\n * @param element\n */\n ExtendedComponent.prototype.attach = function (element) {\n return __awaiter(this, void 0, void 0, function () {\n var parent, index;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (this.element && !element) {\n element = this.element;\n }\n if (!element) {\n return [2 /*return*/, this];\n }\n parent = element.parentNode;\n if (!parent) {\n return [2 /*return*/, this];\n }\n index = Array.prototype.indexOf.call(parent.children, element);\n element.outerHTML = String(this.sanitize(this.render()));\n element = parent.children[index];\n this.element = element;\n this.loadRefs(this.element);\n if (!_super.prototype.attach) return [3 /*break*/, 2];\n return [4 /*yield*/, _super.prototype.attach.call(this, element)];\n case 1:\n _a.sent();\n _a.label = 2;\n case 2:\n this.attached = true;\n return [2 /*return*/, this];\n }\n });\n });\n };\n /**\n * Redraw this component.\n * @returns\n */\n ExtendedComponent.prototype.redraw = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (this.element) {\n this.clear();\n return [2 /*return*/, this.attach()];\n }\n return [2 /*return*/];\n });\n });\n };\n /**\n * Sanitize an html string.\n *\n * @param string\n * @returns {*}\n */\n ExtendedComponent.prototype.sanitize = function (dirty) {\n return sanitize_1.sanitize(dirty, this.options);\n };\n Object.defineProperty(ExtendedComponent.prototype, \"translations\", {\n /**\n * Get all available translations.\n */\n get: function () {\n if (this.options.language &&\n this.options.i18n &&\n this.options.i18n[this.options.language]) {\n return this.options.i18n[this.options.language];\n }\n return {};\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Tranlation method to translate a string being rendered.\n * @param str\n */\n ExtendedComponent.prototype.t = function (str) {\n if (this.translations[str]) {\n return this.translations[str];\n }\n return str;\n };\n /**\n * The evaluation context for interpolations.\n * @param extend\n */\n ExtendedComponent.prototype.evalContext = function (extend) {\n var _this = this;\n if (extend === void 0) { extend = {}; }\n return Object.assign({\n instance: this,\n component: this.component,\n options: this.options,\n data: this.data,\n value: function () { return _this.dataValue; },\n t: function (str) { return _this.t(str); }\n }, extend);\n };\n /**\n * Render a template with provided context.\n * @param name\n * @param ctx\n */\n ExtendedComponent.prototype.renderTemplate = function (name, ctx) {\n if (ctx === void 0) { ctx = {}; }\n return Template_1.Template.render(name, this.evalContext(ctx), 'html', this.defaultTemplate);\n };\n /**\n * Determines if the value of this component is redacted from the user as if it is coming from the server, but is protected.\n *\n * @return {boolean|*}\n */\n ExtendedComponent.prototype.isValueRedacted = function () {\n return (this.component.protected ||\n !this.component.persistent ||\n (this.component.persistent === 'client-only'));\n };\n /**\n * Sets the data value and updates the view representation.\n * @param value\n */\n ExtendedComponent.prototype.setValue = function (value) {\n var changed = false;\n if (_super.prototype.setValue) {\n changed = _super.prototype.setValue.call(this, value);\n }\n return this.updateValue(value) || changed;\n };\n /**\n * Returns the main HTML Element for this component.\n */\n ExtendedComponent.prototype.getElement = function () {\n return this.element;\n };\n /**\n * Remove all event handlers.\n */\n ExtendedComponent.prototype.detach = function () {\n this.refs = {};\n this.attached = false;\n this.removeAttachedListeners();\n if (_super.prototype.detach) {\n _super.prototype.detach.call(this);\n }\n };\n /**\n * Clear an element.\n */\n ExtendedComponent.prototype.clear = function () {\n this.detach();\n dom.empty(this.getElement());\n if (_super.prototype.clear) {\n _super.prototype.clear.call(this);\n }\n };\n /**\n * Appends an element to this component.\n * @param element\n */\n ExtendedComponent.prototype.append = function (element) {\n dom.appendTo(element, this.element);\n };\n /**\n * Prepends an element to this component.\n * @param element\n */\n ExtendedComponent.prototype.prepend = function (element) {\n dom.prependTo(element, this.element);\n };\n /**\n * Removes an element from this component.\n * @param element\n */\n ExtendedComponent.prototype.removeChild = function (element) {\n dom.removeChildFrom(element, this.element);\n };\n /**\n * Wrapper method to add an event listener to an HTML element.\n *\n * @param obj\n * The DOM element to add the event to.\n * @param type\n * The event name to add.\n * @param func\n * The callback function to be executed when the listener is triggered.\n * @param persistent\n * If this listener should persist beyond \"destroy\" commands.\n */\n ExtendedComponent.prototype.addEventListener = function (obj, type, func) {\n if (!obj) {\n return;\n }\n if ('addEventListener' in obj) {\n obj.addEventListener(type, func, false);\n }\n else if ('attachEvent' in obj) {\n obj.attachEvent(\"on\" + type, func);\n }\n this.attachedListeners.push({ obj: obj, type: type, func: func });\n return this;\n };\n /**\n * Remove all the attached listeners.\n */\n ExtendedComponent.prototype.removeAttachedListeners = function () {\n var _this = this;\n this.attachedListeners.forEach(function (item) { return _this.removeEventListener(item.obj, item.type, item.func); });\n };\n /**\n * Remove an event listener from the object.\n *\n * @param obj\n * @param type\n */\n ExtendedComponent.prototype.removeEventListener = function (obj, type, func) {\n if (obj) {\n obj.removeEventListener(type, func);\n }\n return this;\n };\n return ExtendedComponent;\n }(ModelClass(props)(BaseClass)));\n };\n}\nexports.Component = Component;\n// Add the default component.\nComponents_1.Components.addDecorator(Component, 'component');\nComponents_1.Components.addComponent(Component()(), 'component');\n\n\n//# sourceURL=webpack://Formio/./src/base/component/Component.ts?"); - -/***/ }), - -/***/ "./src/base/data/DataComponent.ts": -/*!****************************************!*\ - !*** ./src/base/data/DataComponent.ts ***! - \****************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.DataComponent = void 0;\nvar Components_1 = __webpack_require__(/*! ../Components */ \"./src/base/Components.ts\");\nvar model_1 = __webpack_require__(/*! @formio/model */ \"./src/model/index.ts\");\nvar NestedComponent_1 = __webpack_require__(/*! ../nested/NestedComponent */ \"./src/base/nested/NestedComponent.ts\");\n/**\n * A DataComponent is one that establishes a new data context for all of its\n * children at the specified \"key\" of this comopnent. For example, if this data\n * component has a key of \"employee\", and then some components within the data\n * component of \"firstName\" and \"lastName\", the data structure provided by this\n * component would resemble the following.\n *\n * {\n * \"employee\": {\n * \"firstName\": \"Bob\",\n * \"lastName\": \"Smith\"\n * }\n * }\n */\nfunction DataComponent(props) {\n if (props === void 0) { props = {}; }\n if (!props.type) {\n props.type = 'data';\n }\n if (!props.model) {\n props.model = model_1.NestedDataModel;\n }\n return function (BaseClass) {\n return /** @class */ (function (_super) {\n __extends(ExtendedDataComponent, _super);\n function ExtendedDataComponent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return ExtendedDataComponent;\n }(NestedComponent_1.NestedComponent(props)(BaseClass)));\n };\n}\nexports.DataComponent = DataComponent;\nComponents_1.Components.addDecorator(DataComponent, 'data');\nComponents_1.Components.addComponent(DataComponent()(), 'data');\n\n\n//# sourceURL=webpack://Formio/./src/base/data/DataComponent.ts?"); - -/***/ }), - -/***/ "./src/base/index.ts": -/*!***************************!*\ - !*** ./src/base/index.ts ***! - \***************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Template = exports.ArrayComponent = exports.DataComponent = exports.NestedComponent = exports.Component = exports.render = exports.Components = void 0;\nvar Components_1 = __webpack_require__(/*! ./Components */ \"./src/base/Components.ts\");\nObject.defineProperty(exports, \"Components\", ({ enumerable: true, get: function () { return Components_1.Components; } }));\nObject.defineProperty(exports, \"render\", ({ enumerable: true, get: function () { return Components_1.render; } }));\nvar Component_1 = __webpack_require__(/*! ./component/Component */ \"./src/base/component/Component.ts\");\nObject.defineProperty(exports, \"Component\", ({ enumerable: true, get: function () { return Component_1.Component; } }));\nvar NestedComponent_1 = __webpack_require__(/*! ./nested/NestedComponent */ \"./src/base/nested/NestedComponent.ts\");\nObject.defineProperty(exports, \"NestedComponent\", ({ enumerable: true, get: function () { return NestedComponent_1.NestedComponent; } }));\nvar DataComponent_1 = __webpack_require__(/*! ./data/DataComponent */ \"./src/base/data/DataComponent.ts\");\nObject.defineProperty(exports, \"DataComponent\", ({ enumerable: true, get: function () { return DataComponent_1.DataComponent; } }));\nvar ArrayComponent_1 = __webpack_require__(/*! ./array/ArrayComponent */ \"./src/base/array/ArrayComponent.ts\");\nObject.defineProperty(exports, \"ArrayComponent\", ({ enumerable: true, get: function () { return ArrayComponent_1.ArrayComponent; } }));\nvar Template_1 = __webpack_require__(/*! ./Template */ \"./src/base/Template.ts\");\nObject.defineProperty(exports, \"Template\", ({ enumerable: true, get: function () { return Template_1.Template; } }));\n__exportStar(__webpack_require__(/*! @formio/model */ \"./src/model/index.ts\"), exports);\n\n\n//# sourceURL=webpack://Formio/./src/base/index.ts?"); - -/***/ }), - -/***/ "./src/base/nested/NestedComponent.ts": -/*!********************************************!*\ - !*** ./src/base/nested/NestedComponent.ts ***! - \********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.NestedComponent = void 0;\nvar Components_1 = __webpack_require__(/*! ../Components */ \"./src/base/Components.ts\");\nvar Component_1 = __webpack_require__(/*! ../component/Component */ \"./src/base/component/Component.ts\");\nvar model_1 = __webpack_require__(/*! @formio/model */ \"./src/model/index.ts\");\nfunction NestedComponent(props) {\n if (props === void 0) { props = {}; }\n if (!props.type) {\n props.type = 'nested';\n }\n if (!props.model) {\n props.model = model_1.NestedModel;\n }\n if (!props.factory) {\n props.factory = Components_1.Components;\n }\n return function (BaseClass) {\n return /** @class */ (function (_super) {\n __extends(ExtendedNestedComponent, _super);\n function ExtendedNestedComponent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(ExtendedNestedComponent.prototype, \"defaultTemplate\", {\n get: function () {\n return function (ctx) { return \"
\" + ctx.instance.renderComponents() + \"
\"; };\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Attach a html element to this nestd component.\n * @param element\n */\n ExtendedNestedComponent.prototype.attach = function (element) {\n return __awaiter(this, void 0, void 0, function () {\n var promises_1, children;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, _super.prototype.attach.call(this, element)];\n case 1:\n _a.sent();\n if (!this.element) return [3 /*break*/, 3];\n promises_1 = [];\n children = this.element.querySelectorAll(\"[data-within=\\\"\" + this.id + \"\\\"]\");\n Array.prototype.slice.call(children).forEach(function (child, index) {\n promises_1.push(_this.components[index].attach(child));\n });\n return [4 /*yield*/, Promise.all(promises_1)];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3: return [2 /*return*/, this];\n }\n });\n });\n };\n /**\n * Detach components.\n */\n ExtendedNestedComponent.prototype.detach = function () {\n _super.prototype.detach.call(this);\n this.eachComponent(function (comp) { return comp.detach(); });\n };\n ExtendedNestedComponent.prototype.renderComponents = function () {\n var _this = this;\n return this.components.reduce(function (tpl, comp) {\n return tpl + comp.render().replace(/(<[^\\>]+)/, \"$1 data-within=\\\"\" + _this.id + \"\\\"\");\n }, '');\n };\n return ExtendedNestedComponent;\n }(Component_1.Component(props)(BaseClass)));\n };\n}\nexports.NestedComponent = NestedComponent;\nComponents_1.Components.addDecorator(NestedComponent, 'nested');\nComponents_1.Components.addComponent(NestedComponent()(), 'nested');\n\n\n//# sourceURL=webpack://Formio/./src/base/nested/NestedComponent.ts?"); - -/***/ }), - -/***/ "./src/components/datatable/datatable.ts": -/*!***********************************************!*\ - !*** ./src/components/datatable/datatable.ts ***! - \***********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.DataTableComponent = exports.DataTable = void 0;\nvar base_1 = __webpack_require__(/*! @formio/base */ \"./src/base/index.ts\");\n/**\n * A base class for a data table.\n */\nvar DataTable = /** @class */ (function () {\n function DataTable(component, options, data) {\n this.component = component;\n this.options = options;\n this.data = data;\n }\n DataTable.prototype.renderClasses = function () {\n var classes = '';\n if (this.component.bordered) {\n classes += ' table-bordered';\n }\n if (this.component.striped) {\n classes += ' table-striped';\n }\n if (this.component.hover) {\n classes += ' table-hover';\n }\n if (this.component.condensed) {\n classes += ' table-condensed';\n }\n return classes;\n };\n DataTable.prototype.renderContext = function (extend) {\n if (extend === void 0) { extend = {}; }\n return Object.assign({\n classes: this.renderClasses()\n }, extend);\n };\n return DataTable;\n}());\nexports.DataTable = DataTable;\nvar DataTableComponent = /** @class */ (function (_super) {\n __extends(DataTableComponent, _super);\n function DataTableComponent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DataTableComponent = __decorate([\n base_1.ArrayComponent({\n type: 'datatable',\n schema: {\n bordered: true,\n striped: false,\n hover: true,\n condensed: true\n },\n template: 'datatable',\n })\n ], DataTableComponent);\n return DataTableComponent;\n}(DataTable));\nexports.DataTableComponent = DataTableComponent;\n\n\n//# sourceURL=webpack://Formio/./src/components/datatable/datatable.ts?"); - -/***/ }), - -/***/ "./src/components/datavalue/datavalue.ts": -/*!***********************************************!*\ - !*** ./src/components/datavalue/datavalue.ts ***! - \***********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.DataValueComponent = void 0;\nvar base_1 = __webpack_require__(/*! @formio/base */ \"./src/base/index.ts\");\nvar html_1 = __webpack_require__(/*! ../html/html */ \"./src/components/html/html.ts\");\nvar DataValueComponent = /** @class */ (function (_super) {\n __extends(DataValueComponent, _super);\n function DataValueComponent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DataValueComponent = __decorate([\n base_1.Component({\n type: 'datavalue',\n schema: {\n tag: 'span',\n attrs: [],\n className: ''\n },\n template: function (ctx) {\n return \"<\" + ctx.tag + \" ref=\\\"val\\\"\" + ctx.attrs + \">\" + ctx.value() + \"\";\n }\n })\n ], DataValueComponent);\n return DataValueComponent;\n}(html_1.HTML));\nexports.DataValueComponent = DataValueComponent;\n\n\n//# sourceURL=webpack://Formio/./src/components/datavalue/datavalue.ts?"); - -/***/ }), - -/***/ "./src/components/html/html.ts": -/*!*************************************!*\ - !*** ./src/components/html/html.ts ***! - \*************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.HTMLComponent = exports.HTML = exports.HTMLProperties = void 0;\nvar base_1 = __webpack_require__(/*! @formio/base */ \"./src/base/index.ts\");\nexports.HTMLProperties = {\n type: 'html',\n schema: {\n tag: 'span',\n content: '',\n attrs: [],\n className: ''\n },\n template: function (ctx) {\n return \"<\" + ctx.tag + \" ref=\\\"\" + ctx.ref + \"\\\"\" + ctx.attrs + \">\" + ctx.t(ctx.content) + \"\";\n }\n};\n/**\n * Base class for HTML based components.\n */\nvar HTML = /** @class */ (function () {\n function HTML(component, options, data) {\n this.component = component;\n this.options = options;\n this.data = data;\n }\n HTML.prototype.getAttributes = function () {\n var hasClass = false;\n var attrs = '';\n for (var i in this.component.attrs) {\n if (this.component.attrs.hasOwnProperty(i)) {\n var attrValue = this.component.attrs[i];\n var isString = Number.isNaN(parseInt(i));\n var attr = isString ? i : attrValue.attr;\n var value = isString ? attrValue : attrValue.value;\n if (attr === 'class' && this.component.className) {\n hasClass = true;\n attr += \" \" + this.component.className;\n }\n attrs += \" \" + attr + \"=\\\"\" + this.interpolate(value, this.evalContext()) + \"\\\"\";\n }\n }\n if (!hasClass && this.component.className) {\n attrs += \" class=\\\"\" + this.interpolate(this.component.className, this.evalContext()) + \"\\\"\";\n }\n return attrs;\n };\n HTML.prototype.renderContext = function (extend) {\n if (extend === void 0) { extend = {}; }\n return Object.assign({\n tag: this.component.tag,\n ref: this.component.type,\n content: this.component.content ? this.interpolate(this.component.content, this.evalContext()) : '',\n attrs: this.getAttributes()\n }, extend);\n };\n return HTML;\n}());\nexports.HTML = HTML;\nvar HTMLComponent = /** @class */ (function (_super) {\n __extends(HTMLComponent, _super);\n function HTMLComponent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n HTMLComponent = __decorate([\n base_1.Component(exports.HTMLProperties)\n ], HTMLComponent);\n return HTMLComponent;\n}(HTML));\nexports.HTMLComponent = HTMLComponent;\n\n\n//# sourceURL=webpack://Formio/./src/components/html/html.ts?"); - -/***/ }), - -/***/ "./src/components/htmlcontainer/htmlcontainer.ts": -/*!*******************************************************!*\ - !*** ./src/components/htmlcontainer/htmlcontainer.ts ***! - \*******************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.HTMLContainerComponent = exports.HTMLContainer = void 0;\nvar base_1 = __webpack_require__(/*! @formio/base */ \"./src/base/index.ts\");\nvar html_1 = __webpack_require__(/*! ../html/html */ \"./src/components/html/html.ts\");\n/**\n * Base HTMLContainer component.\n */\nvar HTMLContainer = /** @class */ (function (_super) {\n __extends(HTMLContainer, _super);\n function HTMLContainer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n HTMLContainer.prototype.renderContext = function (extend) {\n if (extend === void 0) { extend = {}; }\n return _super.prototype.renderContext.call(this, Object.assign({\n content: this.renderComponents()\n }, extend));\n };\n return HTMLContainer;\n}(html_1.HTML));\nexports.HTMLContainer = HTMLContainer;\nvar HTMLContainerComponent = /** @class */ (function (_super) {\n __extends(HTMLContainerComponent, _super);\n function HTMLContainerComponent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n HTMLContainerComponent = __decorate([\n base_1.NestedComponent({\n type: 'htmlcontainer',\n schema: html_1.HTMLProperties.schema,\n template: html_1.HTMLProperties.template\n })\n ], HTMLContainerComponent);\n return HTMLContainerComponent;\n}(HTMLContainer));\nexports.HTMLContainerComponent = HTMLContainerComponent;\n\n\n//# sourceURL=webpack://Formio/./src/components/htmlcontainer/htmlcontainer.ts?"); - -/***/ }), - -/***/ "./src/components/index.ts": -/*!*********************************!*\ - !*** ./src/components/index.ts ***! - \*********************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.InputComponent = exports.Input = exports.DataValueComponent = exports.DataTableComponent = exports.DataTable = exports.HTMLContainerComponent = exports.HTMLContainer = exports.HTMLComponent = exports.HTML = void 0;\nvar templates_1 = __importDefault(__webpack_require__(/*! ./templates */ \"./src/components/templates/index.ts\"));\nvar html_1 = __webpack_require__(/*! ./html/html */ \"./src/components/html/html.ts\");\nvar htmlcontainer_1 = __webpack_require__(/*! ./htmlcontainer/htmlcontainer */ \"./src/components/htmlcontainer/htmlcontainer.ts\");\nvar datatable_1 = __webpack_require__(/*! ./datatable/datatable */ \"./src/components/datatable/datatable.ts\");\nvar datavalue_1 = __webpack_require__(/*! ./datavalue/datavalue */ \"./src/components/datavalue/datavalue.ts\");\nvar input_1 = __webpack_require__(/*! ./input/input */ \"./src/components/input/input.ts\");\nvar html_2 = __webpack_require__(/*! ./html/html */ \"./src/components/html/html.ts\");\nObject.defineProperty(exports, \"HTML\", ({ enumerable: true, get: function () { return html_2.HTML; } }));\nObject.defineProperty(exports, \"HTMLComponent\", ({ enumerable: true, get: function () { return html_2.HTMLComponent; } }));\nvar htmlcontainer_2 = __webpack_require__(/*! ./htmlcontainer/htmlcontainer */ \"./src/components/htmlcontainer/htmlcontainer.ts\");\nObject.defineProperty(exports, \"HTMLContainer\", ({ enumerable: true, get: function () { return htmlcontainer_2.HTMLContainer; } }));\nObject.defineProperty(exports, \"HTMLContainerComponent\", ({ enumerable: true, get: function () { return htmlcontainer_2.HTMLContainerComponent; } }));\nvar datatable_2 = __webpack_require__(/*! ./datatable/datatable */ \"./src/components/datatable/datatable.ts\");\nObject.defineProperty(exports, \"DataTable\", ({ enumerable: true, get: function () { return datatable_2.DataTable; } }));\nObject.defineProperty(exports, \"DataTableComponent\", ({ enumerable: true, get: function () { return datatable_2.DataTableComponent; } }));\nvar datavalue_2 = __webpack_require__(/*! ./datavalue/datavalue */ \"./src/components/datavalue/datavalue.ts\");\nObject.defineProperty(exports, \"DataValueComponent\", ({ enumerable: true, get: function () { return datavalue_2.DataValueComponent; } }));\nvar input_2 = __webpack_require__(/*! ./input/input */ \"./src/components/input/input.ts\");\nObject.defineProperty(exports, \"Input\", ({ enumerable: true, get: function () { return input_2.Input; } }));\nObject.defineProperty(exports, \"InputComponent\", ({ enumerable: true, get: function () { return input_2.InputComponent; } }));\nexports.default = {\n components: {\n html: html_1.HTMLComponent,\n htmlcontainer: htmlcontainer_1.HTMLContainerComponent,\n datatable: datatable_1.DataTableComponent,\n datavalue: datavalue_1.DataValueComponent,\n input: input_1.InputComponent\n },\n templates: templates_1.default\n};\n\n\n//# sourceURL=webpack://Formio/./src/components/index.ts?"); - -/***/ }), - -/***/ "./src/components/input/input.ts": -/*!***************************************!*\ - !*** ./src/components/input/input.ts ***! - \***************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.InputComponent = exports.Input = void 0;\nvar base_1 = __webpack_require__(/*! @formio/base */ \"./src/base/index.ts\");\nvar html_1 = __webpack_require__(/*! ../html/html */ \"./src/components/html/html.ts\");\n/**\n * Base Input component for extending purposes.\n */\nvar Input = /** @class */ (function (_super) {\n __extends(Input, _super);\n function Input() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Input.prototype.getAttributes = function () {\n var attributes = _super.prototype.getAttributes.call(this);\n var inputName = (this.component.type + \"-\" + this.component.key).toLowerCase().replace(/[^a-z0-9\\-]+/g, '_');\n return \" type=\\\"\" + this.component.inputType + \"\\\" id=\\\"\" + inputName + \"\\\" name=\\\"\" + inputName + \"\\\"\" + attributes;\n };\n Input.prototype.onInput = function () {\n this.updateValue(this.element.value);\n };\n Input.prototype.attach = function (element) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n this.addEventListener(this.element, this.component.changeEvent, this.onInput.bind(this));\n return [2 /*return*/, this];\n });\n });\n };\n Input.prototype.detach = function () {\n this.removeEventListener(this.element, this.component.changeEvent, this.onInput.bind(this));\n };\n Input.prototype.setValue = function (value) {\n if (this.element) {\n this.element.value = value;\n }\n };\n return Input;\n}(html_1.HTML));\nexports.Input = Input;\nvar InputComponent = /** @class */ (function (_super) {\n __extends(InputComponent, _super);\n function InputComponent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n InputComponent = __decorate([\n base_1.Component({\n type: 'input',\n template: html_1.HTMLProperties.template,\n schema: __assign(__assign({}, html_1.HTMLProperties.schema), {\n tag: 'input',\n ref: 'input',\n changeEvent: 'input',\n inputType: 'text'\n })\n })\n ], InputComponent);\n return InputComponent;\n}(Input));\nexports.InputComponent = InputComponent;\n\n\n//# sourceURL=webpack://Formio/./src/components/input/input.ts?"); - -/***/ }), - -/***/ "./src/components/templates/bootstrap/datatable/index.ts": -/*!***************************************************************!*\ - !*** ./src/components/templates/bootstrap/datatable/index.ts ***! - \***************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.html = void 0;\nvar html_ejs_js_1 = __importDefault(__webpack_require__(/*! ./html.ejs.js */ \"./src/components/templates/bootstrap/datatable/html.ejs.js\"));\nexports.html = html_ejs_js_1.default;\n\n\n//# sourceURL=webpack://Formio/./src/components/templates/bootstrap/datatable/index.ts?"); - -/***/ }), - -/***/ "./src/components/templates/bootstrap/index.ts": -/*!*****************************************************!*\ - !*** ./src/components/templates/bootstrap/index.ts ***! - \*****************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.datatable = void 0;\nexports.datatable = __importStar(__webpack_require__(/*! ./datatable */ \"./src/components/templates/bootstrap/datatable/index.ts\"));\n\n\n//# sourceURL=webpack://Formio/./src/components/templates/bootstrap/index.ts?"); - -/***/ }), - -/***/ "./src/components/templates/index.ts": -/*!*******************************************!*\ - !*** ./src/components/templates/index.ts ***! - \*******************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar bootstrap = __importStar(__webpack_require__(/*! ./bootstrap */ \"./src/components/templates/bootstrap/index.ts\"));\nexports.default = { bootstrap: bootstrap };\n\n\n//# sourceURL=webpack://Formio/./src/components/templates/index.ts?"); - -/***/ }), - -/***/ "./src/index.ts": -/*!**********************!*\ - !*** ./src/index.ts ***! - \**********************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = exports.use = exports.useModule = exports.usePlugin = void 0;\nvar sdk_1 = __webpack_require__(/*! @formio/sdk */ \"./src/sdk/index.ts\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return sdk_1.Formio; } }));\nvar validator_1 = __webpack_require__(/*! @formio/validator */ \"./src/validator/index.ts\");\nvar utils_1 = __webpack_require__(/*! @formio/utils */ \"./src/utils/index.ts\");\nvar base_1 = __webpack_require__(/*! @formio/base */ \"./src/base/index.ts\");\nsdk_1.Formio.render = base_1.render;\nsdk_1.Formio.Components = base_1.Components;\nsdk_1.Formio.Validator = sdk_1.Formio.Rules = validator_1.Validator;\nsdk_1.Formio.Evaluator = utils_1.Evaluator;\nsdk_1.Formio.Utils = utils_1.Utils;\nsdk_1.Formio.Templates = base_1.Template;\nvar lodash_1 = __webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\");\n/**\n * Register a specific plugin.\n *\n * @param key\n * @param plugin\n * @returns\n */\nfunction usePlugin(key, plugin) {\n switch (key) {\n case 'options':\n if (!sdk_1.Formio.options) {\n return;\n }\n sdk_1.Formio.options = lodash_1.merge(sdk_1.Formio.options, plugin);\n break;\n case 'templates':\n if (!sdk_1.Formio.Templates) {\n return;\n }\n var current = sdk_1.Formio.Templates.framework || 'bootstrap';\n for (var _i = 0, _a = Object.keys(plugin); _i < _a.length; _i++) {\n var framework = _a[_i];\n sdk_1.Formio.Templates.extendTemplate(framework, plugin[framework]);\n }\n if (plugin[current]) {\n sdk_1.Formio.Templates.current = plugin[current];\n }\n break;\n case 'components':\n if (!sdk_1.Formio.Components) {\n return;\n }\n sdk_1.Formio.Components.setComponents(plugin);\n break;\n case 'framework':\n if (!sdk_1.Formio.Templates) {\n return;\n }\n sdk_1.Formio.Templates.framework = plugin;\n break;\n case 'fetch':\n for (var _b = 0, _c = Object.keys(plugin); _b < _c.length; _b++) {\n var name_1 = _c[_b];\n sdk_1.Formio.registerPlugin(plugin[name_1], name_1);\n }\n break;\n case 'rules':\n if (!sdk_1.Formio.Rules) {\n return;\n }\n sdk_1.Formio.Rules.addRules(plugin);\n break;\n case 'evaluator':\n if (!sdk_1.Formio.Evaluator) {\n return;\n }\n sdk_1.Formio.Evaluator.registerEvaluator(plugin);\n break;\n default:\n console.log('Unknown plugin option', key);\n }\n}\nexports.usePlugin = usePlugin;\n;\n/**\n * Register a new module.\n *\n * @param module\n * @returns\n */\nfunction useModule(module) {\n // Sanity check.\n if (typeof module !== 'object') {\n return;\n }\n for (var _i = 0, _a = Object.keys(module); _i < _a.length; _i++) {\n var key = _a[_i];\n usePlugin(key, module[key]);\n }\n}\nexports.useModule = useModule;\n;\n/**\n* Allows passing in plugins as multiple arguments or an array of plugins.\n*\n* Formio.plugins(plugin1, plugin2, etc);\n* Formio.plugins([plugin1, plugin2, etc]);\n*/\nfunction use() {\n var mods = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n mods[_i] = arguments[_i];\n }\n mods.forEach(function (mod) {\n if (Array.isArray(mod)) {\n mod.forEach(function (p) { return useModule(p); });\n }\n else {\n useModule(mod);\n }\n });\n}\nexports.use = use;\n;\nsdk_1.Formio.useModule = useModule;\nsdk_1.Formio.usePlugin = usePlugin;\nsdk_1.Formio.use = use;\nvar components_1 = __importDefault(__webpack_require__(/*! @formio/components */ \"./src/components/index.ts\"));\nsdk_1.Formio.use(components_1.default);\nvar modules_1 = __importDefault(__webpack_require__(/*! @formio/modules */ \"./src/modules/index.ts\"));\nsdk_1.Formio.use(modules_1.default);\n__exportStar(__webpack_require__(/*! @formio/modules */ \"./src/modules/index.ts\"), exports);\n__exportStar(__webpack_require__(/*! @formio/model */ \"./src/model/index.ts\"), exports);\n__exportStar(__webpack_require__(/*! @formio/base */ \"./src/base/index.ts\"), exports);\n__exportStar(__webpack_require__(/*! @formio/components */ \"./src/components/index.ts\"), exports);\n\n\n//# sourceURL=webpack://Formio/./src/index.ts?"); - -/***/ }), - -/***/ "./src/model/EventEmitter.ts": -/*!***********************************!*\ - !*** ./src/model/EventEmitter.ts ***! - \***********************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.EventEmitterBase = exports.EventEmitter = void 0;\nvar eventemitter3_1 = __importDefault(__webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\"));\nexports.EventEmitterBase = eventemitter3_1.default;\nfunction EventEmitter(BaseClass) {\n if (!BaseClass) {\n BaseClass = /** @class */ (function () {\n function _BaseClass() {\n }\n return _BaseClass;\n }());\n }\n return /** @class */ (function (_super) {\n __extends(EventEmitter, _super);\n function EventEmitter() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * The parent entity.\n */\n _this.parent = null;\n /**\n * The events to fire for this model.\n */\n _this.events = new eventemitter3_1.default();\n return _this;\n }\n /**\n * Bubble an event up to the parent.\n *\n * @param event\n * @param args\n * @returns\n */\n EventEmitter.prototype.bubble = function (event) {\n var _a;\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (this.parent) {\n return (_a = this.parent).bubble.apply(_a, __spreadArray([event], args));\n }\n return this.emit.apply(this, __spreadArray([event], args));\n };\n /**\n * Emit an event on this component.\n * @param event\n * @param args\n * @returns\n */\n EventEmitter.prototype.emit = function (event) {\n var _a;\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return (_a = this.events).emit.apply(_a, __spreadArray([event], args));\n };\n /**\n * Register an event subscriber.\n * @param event\n * @param fn\n * @param args\n * @returns\n */\n EventEmitter.prototype.on = function (event, fn) {\n var _a;\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n return (_a = this.events).on.apply(_a, __spreadArray([event, fn], args));\n };\n /**\n * Register an event subscriber that will only be called once.\n * @param event\n * @param fn\n * @param args\n * @returns\n */\n EventEmitter.prototype.once = function (event, fn) {\n var _a;\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n return (_a = this.events).once.apply(_a, __spreadArray([event, fn], args));\n };\n /**\n * Turn off the event registrations.\n * @param event\n * @param args\n * @returns\n */\n EventEmitter.prototype.off = function (event) {\n var _a;\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return (_a = this.events).off.apply(_a, __spreadArray([event], args));\n };\n return EventEmitter;\n }(BaseClass));\n}\nexports.EventEmitter = EventEmitter;\n\n\n//# sourceURL=webpack://Formio/./src/model/EventEmitter.ts?"); - -/***/ }), - -/***/ "./src/model/Model.ts": -/*!****************************!*\ - !*** ./src/model/Model.ts ***! - \****************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Model = void 0;\nvar _ = __importStar(__webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\"));\nvar EventEmitter_1 = __webpack_require__(/*! ./EventEmitter */ \"./src/model/EventEmitter.ts\");\nfunction Model(props) {\n if (props === void 0) { props = {}; }\n if (!props.schema) {\n props.schema = {};\n }\n if (!props.schema.key) {\n props.schema.key = '';\n }\n return function (BaseClass) {\n return /** @class */ (function (_super) {\n __extends(BaseModel, _super);\n /**\n * @constructor\n * @param component\n * @param options\n * @param data\n */\n function BaseModel(component, options, data) {\n if (component === void 0) { component = {}; }\n if (options === void 0) { options = {}; }\n if (data === void 0) { data = {}; }\n var _this = _super.call(this, component, options, data) || this;\n _this.component = component;\n _this.options = options;\n _this.data = data;\n /**\n * The root entity.\n */\n _this.root = null;\n _this.id = \"e\" + Math.random().toString(36).substring(7);\n _this.component = _.merge({}, _this.defaultSchema, _this.component);\n _this.options = __assign(__assign({}, _this.defaultOptions), _this.options);\n if (!_this.options.noInit) {\n _this.init();\n }\n return _this;\n }\n /**\n * The default JSON schema\n * @param extend\n */\n BaseModel.schema = function () {\n return props.schema;\n };\n Object.defineProperty(BaseModel.prototype, \"defaultOptions\", {\n get: function () {\n return {};\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseModel.prototype, \"defaultSchema\", {\n get: function () {\n return BaseModel.schema();\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Initializes the entity.\n */\n BaseModel.prototype.init = function () {\n this.hook('init');\n };\n Object.defineProperty(BaseModel.prototype, \"emptyValue\", {\n /**\n * The empty value for this component.\n *\n * @return {null}\n */\n get: function () {\n return null;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Checks to see if this components value is empty.\n *\n * @param value\n * @returns\n */\n BaseModel.prototype.isEmpty = function (value) {\n if (value === void 0) { value = this.dataValue; }\n var isEmptyArray = (_.isArray(value) && value.length === 1) ? _.isEqual(value[0], this.emptyValue) : false;\n return value == null || value.length === 0 || _.isEqual(value, this.emptyValue) || isEmptyArray;\n };\n Object.defineProperty(BaseModel.prototype, \"dataValue\", {\n /**\n * Returns the data value for this component.\n */\n get: function () {\n return _.get(this.data, this.component.key);\n },\n /**\n * Sets the datavalue for this component.\n */\n set: function (value) {\n if (this.component.key) {\n _.set(this.data, this.component.key, value);\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Determine if this component has changed values.\n *\n * @param value - The value to compare against the current value.\n */\n BaseModel.prototype.hasChanged = function (value) {\n return String(value) !== String(this.dataValue);\n };\n /**\n * Updates the data model value\n * @param value The value to update within this component.\n * @return boolean true if the value has changed.\n */\n BaseModel.prototype.updateValue = function (value) {\n var changed = this.hasChanged(value);\n this.dataValue = value;\n if (changed) {\n // Bubble a change event.\n this.bubble('change', value);\n }\n return changed;\n };\n /**\n * Get the model value.\n * @returns\n */\n BaseModel.prototype.getValue = function () {\n return this.dataValue;\n };\n /**\n * Allow for options to hook into the functionality of this entity.\n * @return {*}\n */\n BaseModel.prototype.hook = function (name) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (this.options &&\n this.options.hooks &&\n this.options.hooks[name]) {\n return this.options.hooks[name].apply(this, args);\n }\n else {\n // If this is an async hook instead of a sync.\n var fn = (typeof args[args.length - 1] === 'function') ? args[args.length - 1] : null;\n if (fn) {\n return fn(null, args[1]);\n }\n else {\n return args[1];\n }\n }\n };\n return BaseModel;\n }(EventEmitter_1.EventEmitter(BaseClass)));\n };\n}\nexports.Model = Model;\n\n\n//# sourceURL=webpack://Formio/./src/model/Model.ts?"); - -/***/ }), - -/***/ "./src/model/NestedArrayModel.ts": -/*!***************************************!*\ - !*** ./src/model/NestedArrayModel.ts ***! - \***************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.NestedArrayModel = void 0;\nvar _ = __importStar(__webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\"));\nvar NestedDataModel_1 = __webpack_require__(/*! ./NestedDataModel */ \"./src/model/NestedDataModel.ts\");\nfunction NestedArrayModel(props) {\n if (props === void 0) { props = {}; }\n return function (BaseClass) {\n return /** @class */ (function (_super) {\n __extends(BaseNestedArrayModel, _super);\n function BaseNestedArrayModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(BaseNestedArrayModel.prototype, \"defaultValue\", {\n get: function () {\n return [];\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Returns a row of componments at the provided index.\n * @param index The index of the row to return\n */\n BaseNestedArrayModel.prototype.row = function (index) {\n return (index < this.rows.length) ? this.rows[index] : [];\n };\n /**\n * Removes a row and detatches all components within that row.\n *\n * @param index The index of the row to remove.\n */\n BaseNestedArrayModel.prototype.removeRow = function (index) {\n var _this = this;\n this.row(index).forEach(function (comp) { return _this.removeComponent(comp); });\n this.dataValue.splice(index, 1);\n this.rows.splice(index, 1);\n };\n /**\n * Adds a new row of components.\n *\n * @param data The data context to pass to this row of components.\n */\n BaseNestedArrayModel.prototype.addRow = function (data, index) {\n if (data === void 0) { data = {}; }\n if (index === void 0) { index = 0; }\n var rowData = data;\n this.dataValue[index] = rowData;\n this.createRowComponents(rowData, index);\n };\n /**\n * Sets the data for a specific row of components.\n * @param rowData The data to set\n * @param index The index of the rows to set the data within.\n */\n BaseNestedArrayModel.prototype.setRowData = function (rowData, index) {\n this.dataValue[index] = rowData;\n this.row(index).forEach(function (comp) { return (comp.data = rowData); });\n };\n /**\n * Determines if the data within a row has changed.\n *\n * @param rowData\n * @param index\n */\n BaseNestedArrayModel.prototype.rowChanged = function (rowData, index) {\n var changed = false;\n this.row(index).forEach(function (comp) {\n var hasChanged = comp.hasChanged(_.get(rowData, comp.component.key));\n changed = hasChanged || changed;\n if (hasChanged) {\n comp.bubble('change', comp);\n }\n });\n return changed;\n };\n /**\n * Creates all components for each row.\n * @param data\n * @returns\n */\n BaseNestedArrayModel.prototype.createComponents = function (data) {\n var _this = this;\n this.rows = [];\n var added = [];\n this.eachRowValue(data, function (row, index) {\n added = added.concat(_this.createRowComponents(row, index));\n });\n return added;\n };\n /**\n * Creates a new row of components.\n *\n * @param data The data context to pass along to this row of components.\n */\n BaseNestedArrayModel.prototype.createRowComponents = function (data, index) {\n if (index === void 0) { index = 0; }\n var comps = _super.prototype.createComponents.call(this, data);\n this.rows[index] = comps;\n return comps;\n };\n BaseNestedArrayModel.prototype.getIndexes = function (value) {\n if (_super.prototype.getIndexes) {\n return _super.prototype.getIndexes.call(this, value);\n }\n return {\n min: 0,\n max: (value.length - 1)\n };\n };\n BaseNestedArrayModel.prototype.eachRowValue = function (value, fn) {\n if (!value || !value.length) {\n return;\n }\n var indexes = this.getIndexes(value);\n for (var i = indexes.min; i <= indexes.max; i++) {\n fn(value[i], i);\n }\n };\n Object.defineProperty(BaseNestedArrayModel.prototype, \"emptyValue\", {\n /**\n * The empty value for this component.\n *\n * @return {array}\n */\n get: function () {\n return [];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseNestedArrayModel.prototype, \"dataValue\", {\n /**\n * Returns the dataValue for this component.\n */\n get: function () {\n return _.get(this.data, this.component.key);\n },\n /**\n * Set the datavalue of an array component.\n *\n * @param value The value to set this component to.\n */\n set: function (value) {\n var _this = this;\n // Only set the value if it is an array.\n if (Array.isArray(value)) {\n // Get the current data value.\n var dataValue_1 = this.dataValue;\n this.eachRowValue(value, function (row, index) {\n if (index >= dataValue_1.length) {\n _this.addRow(row, index);\n }\n _this.setRowData(row, index);\n });\n // Remove superfluous rows.\n if (dataValue_1.length > value.length) {\n for (var i = value.length; i < dataValue_1.length; i++) {\n this.removeRow(i);\n }\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Determine if this array component has changed.\n *\n * @param value\n */\n BaseNestedArrayModel.prototype.hasChanged = function (value) {\n var _this = this;\n var dataValue = this.dataValue;\n // If the length changes, then this compnent has changed.\n if (value.length !== dataValue.length) {\n this.emit('changed', this);\n return true;\n }\n var changed = false;\n this.eachRowValue(value, function (rowData, index) {\n changed = _this.rowChanged(rowData, index) || changed;\n });\n return changed;\n };\n /**\n * Sets the value of an array component.\n *\n * @param value\n */\n BaseNestedArrayModel.prototype.setValue = function (value) {\n var changed = false;\n this.eachComponentValue(value, function (comp, val) {\n changed = comp.setValue(val) || changed;\n });\n return changed;\n };\n return BaseNestedArrayModel;\n }(NestedDataModel_1.NestedDataModel(props)(BaseClass)));\n };\n}\nexports.NestedArrayModel = NestedArrayModel;\n;\n\n\n//# sourceURL=webpack://Formio/./src/model/NestedArrayModel.ts?"); - -/***/ }), - -/***/ "./src/model/NestedDataModel.ts": -/*!**************************************!*\ - !*** ./src/model/NestedDataModel.ts ***! - \**************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.NestedDataModel = void 0;\nvar _ = __importStar(__webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\"));\nvar NestedModel_1 = __webpack_require__(/*! ./NestedModel */ \"./src/model/NestedModel.ts\");\nfunction NestedDataModel(props) {\n if (props === void 0) { props = {}; }\n return function (BaseClass) {\n return /** @class */ (function (_super) {\n __extends(BaseNestedDataModel, _super);\n function BaseNestedDataModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(BaseNestedDataModel.prototype, \"emptyValue\", {\n get: function () {\n return {};\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseNestedDataModel.prototype, \"defaultValue\", {\n get: function () {\n return {};\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Get the component data.\n */\n BaseNestedDataModel.prototype.componentData = function () {\n var compData = _.get(this.data, this.component.key, this.defaultValue);\n if (!Object.keys(compData).length) {\n _.set(this.data, this.component.key, compData);\n }\n return compData;\n };\n Object.defineProperty(BaseNestedDataModel.prototype, \"dataValue\", {\n get: function () {\n return _.get(this.data, this.component.key);\n },\n set: function (value) {\n this.eachComponentValue(value, function (comp, val) { return (comp.dataValue = val); });\n },\n enumerable: false,\n configurable: true\n });\n return BaseNestedDataModel;\n }(NestedModel_1.NestedModel(props)(BaseClass)));\n };\n}\nexports.NestedDataModel = NestedDataModel;\n;\n\n\n//# sourceURL=webpack://Formio/./src/model/NestedDataModel.ts?"); - -/***/ }), - -/***/ "./src/model/NestedModel.ts": -/*!**********************************!*\ - !*** ./src/model/NestedModel.ts ***! - \**********************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.NestedModel = void 0;\nvar _ = __importStar(__webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\"));\nvar Model_1 = __webpack_require__(/*! ./Model */ \"./src/model/Model.ts\");\nfunction NestedModel(props) {\n if (props === void 0) { props = {}; }\n if (!props.schema) {\n props.schema = {};\n }\n if (!props.schema.components) {\n props.schema.components = [];\n }\n return function (BaseClass) {\n return /** @class */ (function (_super) {\n __extends(BaseNestedModel, _super);\n function BaseNestedModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Initialize the nested entity by creating the children.\n */\n BaseNestedModel.prototype.init = function () {\n _super.prototype.init.call(this);\n this.components = [];\n this.createComponents(this.componentData());\n };\n /**\n * Get the component data.\n * @returns\n */\n BaseNestedModel.prototype.componentData = function () {\n return this.data;\n };\n /**\n * Creates a new component entity.\n * @param component\n * @param options\n * @param data\n * @returns\n */\n BaseNestedModel.prototype.createComponent = function (component, options, data) {\n if (!props.factory) {\n console.log('Cannot create components. No \"factory\" provided.');\n return null;\n }\n var comp = props.factory.create(component, __assign({ noInit: true }, options), data);\n comp.parent = this;\n comp.root = this.root || this;\n comp.init();\n return comp;\n };\n /**\n * Creates the components.\n * @param data\n * @returns\n */\n BaseNestedModel.prototype.createComponents = function (data) {\n var _this = this;\n var added = [];\n (this.component.components || []).forEach(function (comp) {\n var newComp = _this.createComponent(comp, _this.options, data);\n if (newComp) {\n _this.components.push(newComp);\n added.push(newComp);\n }\n });\n return added;\n };\n /**\n * Removes a child comopnent.\n * @param component\n */\n BaseNestedModel.prototype.removeComponent = function (component) {\n var _this = this;\n (this.components || []).forEach(function (comp, index) {\n if (comp === component) {\n if (comp.detach) {\n comp.detach();\n }\n _this.components.splice(index, 1);\n }\n });\n };\n Object.defineProperty(BaseNestedModel.prototype, \"defaultValue\", {\n /**\n * Get the default value for this nested entity.\n */\n get: function () {\n return {};\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseNestedModel.prototype, \"emptyValue\", {\n /**\n * The empty value for this component.\n *\n * @return {null}\n */\n get: function () {\n return {};\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseNestedModel.prototype, \"dataValue\", {\n /**\n * Get the datavalue of this component.\n */\n get: function () {\n return this.data;\n },\n /**\n * Set the data value for this nested entity.\n */\n set: function (value) {\n this.eachComponentValue(value, function (comp, val) { return (comp.dataValue = val); });\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Perform an iteration over each component within this container component.\n *\n * @param {function} fn - Called for each component\n */\n BaseNestedModel.prototype.eachComponent = function (fn) {\n _.each(this.components, function (component, index) {\n if (fn(component, index) === false) {\n return false;\n }\n });\n };\n /**\n * Iterate through each component value.\n *\n * @param value The context data value.\n * @param fn Callback to be called with the component and the value for that component.\n */\n BaseNestedModel.prototype.eachComponentValue = function (value, fn) {\n if (Object.keys(value).length) {\n this.eachComponent(function (comp) {\n fn(comp, _.get(value, comp.component.key));\n });\n }\n };\n /**\n * Sets the value for a data component.\n *\n * @param value\n */\n BaseNestedModel.prototype.setValue = function (value) {\n var changed = false;\n this.eachComponentValue(value, function (comp, val) {\n changed = comp.setValue(val) || changed;\n });\n return changed;\n };\n return BaseNestedModel;\n }(Model_1.Model(props)(BaseClass)));\n };\n}\nexports.NestedModel = NestedModel;\n;\n\n\n//# sourceURL=webpack://Formio/./src/model/NestedModel.ts?"); - -/***/ }), - -/***/ "./src/model/index.ts": -/*!****************************!*\ - !*** ./src/model/index.ts ***! - \****************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.NestedArrayModel = exports.NestedDataModel = exports.NestedModel = exports.Model = exports.EventEmitter = void 0;\nvar EventEmitter_1 = __webpack_require__(/*! ./EventEmitter */ \"./src/model/EventEmitter.ts\");\nObject.defineProperty(exports, \"EventEmitter\", ({ enumerable: true, get: function () { return EventEmitter_1.EventEmitter; } }));\nvar Model_1 = __webpack_require__(/*! ./Model */ \"./src/model/Model.ts\");\nObject.defineProperty(exports, \"Model\", ({ enumerable: true, get: function () { return Model_1.Model; } }));\nvar NestedModel_1 = __webpack_require__(/*! ./NestedModel */ \"./src/model/NestedModel.ts\");\nObject.defineProperty(exports, \"NestedModel\", ({ enumerable: true, get: function () { return NestedModel_1.NestedModel; } }));\nvar NestedDataModel_1 = __webpack_require__(/*! ./NestedDataModel */ \"./src/model/NestedDataModel.ts\");\nObject.defineProperty(exports, \"NestedDataModel\", ({ enumerable: true, get: function () { return NestedDataModel_1.NestedDataModel; } }));\nvar NestedArrayModel_1 = __webpack_require__(/*! ./NestedArrayModel */ \"./src/model/NestedArrayModel.ts\");\nObject.defineProperty(exports, \"NestedArrayModel\", ({ enumerable: true, get: function () { return NestedArrayModel_1.NestedArrayModel; } }));\n\n\n//# sourceURL=webpack://Formio/./src/model/index.ts?"); - -/***/ }), - -/***/ "./src/modules/index.ts": -/*!******************************!*\ - !*** ./src/modules/index.ts ***! - \******************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar jsonlogic_1 = __importDefault(__webpack_require__(/*! ./jsonlogic */ \"./src/modules/jsonlogic/index.ts\"));\nexports.default = [\n jsonlogic_1.default\n];\n\n\n//# sourceURL=webpack://Formio/./src/modules/index.ts?"); - -/***/ }), - -/***/ "./src/modules/jsonlogic/index.ts": -/*!****************************************!*\ - !*** ./src/modules/jsonlogic/index.ts ***! - \****************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\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.JSONLogicEvaluator = void 0;\nvar utils_1 = __webpack_require__(/*! @formio/utils */ \"./src/utils/index.ts\");\nvar rules_1 = __importDefault(__webpack_require__(/*! ./rules */ \"./src/modules/jsonlogic/rules/index.ts\"));\nvar jsonLogic_1 = __webpack_require__(/*! ./jsonLogic */ \"./src/modules/jsonlogic/jsonLogic.ts\");\nvar JSONLogicEvaluator = /** @class */ (function (_super) {\n __extends(JSONLogicEvaluator, _super);\n function JSONLogicEvaluator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n JSONLogicEvaluator.evaluate = function (func, args, ret, tokenize, context) {\n if (args === void 0) { args = {}; }\n if (ret === void 0) { ret = ''; }\n if (tokenize === void 0) { tokenize = false; }\n if (context === void 0) { context = {}; }\n var returnVal = null;\n if (typeof func === 'object') {\n try {\n returnVal = jsonLogic_1.jsonLogic.apply(func, args);\n }\n catch (err) {\n returnVal = null;\n console.warn(\"An error occured within JSON Logic\", err);\n }\n }\n else {\n returnVal = utils_1.BaseEvaluator.evaluate(func, args, ret, tokenize, context);\n }\n return returnVal;\n };\n return JSONLogicEvaluator;\n}(utils_1.BaseEvaluator));\nexports.JSONLogicEvaluator = JSONLogicEvaluator;\nexports.default = {\n evaluator: JSONLogicEvaluator,\n rules: rules_1.default,\n jsonLogic: jsonLogic_1.jsonLogic\n};\n\n\n//# sourceURL=webpack://Formio/./src/modules/jsonlogic/index.ts?"); - -/***/ }), - -/***/ "./src/modules/jsonlogic/jsonLogic.ts": -/*!********************************************!*\ - !*** ./src/modules/jsonlogic/jsonLogic.ts ***! - \********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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;\nvar jsonLogic = __webpack_require__(/*! json-logic-js */ \"./node_modules/json-logic-js/logic.js\");\nexports.jsonLogic = jsonLogic;\nvar _ = __importStar(__webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\"));\nvar dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nvar operators_1 = __webpack_require__(/*! ./operators/operators */ \"./src/modules/jsonlogic/operators/operators.js\");\n// Configure JsonLogic\noperators_1.lodashOperators.forEach(function (name) {\n if (_[name]) {\n jsonLogic.add_operation(\"_\" + name, _[name]);\n }\n});\n// Retrieve Any Date\njsonLogic.add_operation('getDate', function (date) {\n return dayjs_1.default(date).toISOString();\n});\n// Set Relative Minimum Date\njsonLogic.add_operation('relativeMinDate', function (relativeMinDate) {\n return dayjs_1.default().subtract(relativeMinDate, 'days').toISOString();\n});\n// Set Relative Maximum Date\njsonLogic.add_operation('relativeMaxDate', function (relativeMaxDate) {\n return dayjs_1.default().add(relativeMaxDate, 'days').toISOString();\n});\n\n\n//# sourceURL=webpack://Formio/./src/modules/jsonlogic/jsonLogic.ts?"); - -/***/ }), - -/***/ "./src/modules/jsonlogic/rules/JSON.ts": -/*!*********************************************!*\ - !*** ./src/modules/jsonlogic/rules/JSON.ts ***! - \*********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.JSONRule = void 0;\nvar validator_1 = __webpack_require__(/*! @formio/validator */ \"./src/validator/index.ts\");\nvar JSONRule = /** @class */ (function (_super) {\n __extends(JSONRule, _super);\n function JSONRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{error}}';\n return _this;\n }\n JSONRule.prototype.check = function (value, data, row, index) {\n if (value === void 0) { value = this.component.dataValue; }\n if (data === void 0) { data = {}; }\n if (row === void 0) { row = {}; }\n if (index === void 0) { index = 0; }\n return __awaiter(this, void 0, void 0, function () {\n var json, valid;\n return __generator(this, function (_a) {\n json = this.settings.json;\n if (!json) {\n return [2 /*return*/, true];\n }\n valid = this.component.evaluate(json, {\n data: data,\n row: row,\n rowIndex: index,\n input: value\n });\n if (valid === null) {\n return [2 /*return*/, true];\n }\n return [2 /*return*/, valid];\n });\n });\n };\n return JSONRule;\n}(validator_1.Rule));\nexports.JSONRule = JSONRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/modules/jsonlogic/rules/JSON.ts?"); - -/***/ }), - -/***/ "./src/modules/jsonlogic/rules/index.ts": -/*!**********************************************!*\ - !*** ./src/modules/jsonlogic/rules/index.ts ***! - \**********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar JSON_1 = __webpack_require__(/*! ./JSON */ \"./src/modules/jsonlogic/rules/JSON.ts\");\nexports.default = {\n json: JSON_1.JSONRule\n};\n\n\n//# sourceURL=webpack://Formio/./src/modules/jsonlogic/rules/index.ts?"); - -/***/ }), - -/***/ "./src/sdk/Formio.ts": -/*!***************************!*\ - !*** ./src/sdk/Formio.ts ***! - \***************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -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 = exports.FormioPathType = void 0;\nvar fetch_ponyfill_1 = __importDefault(__webpack_require__(/*! fetch-ponyfill */ \"./node_modules/fetch-ponyfill/build/fetch-browser.js\"));\nvar lodash_1 = __webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\");\nvar formUtil_1 = __webpack_require__(/*! @formio/utils/formUtil */ \"./src/utils/formUtil.ts\");\nvar eventemitter3_1 = __importDefault(__webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\"));\nvar _a = fetch_ponyfill_1.default(), fetch = _a.fetch, Headers = _a.Headers;\nvar Plugins_1 = __importDefault(__webpack_require__(/*! ./Plugins */ \"./src/sdk/Plugins.ts\"));\n/**\n * The different path types for a project.\n */\nvar FormioPathType;\n(function (FormioPathType) {\n FormioPathType[\"Subdirectories\"] = \"Subdirectories\";\n FormioPathType[\"Subdomains\"] = \"Subdomains\";\n})(FormioPathType = exports.FormioPathType || (exports.FormioPathType = {}));\n/**\n * The Formio interface class. This is a minimalistic API library that allows you to work with the Form.io API's within JavaScript.\n *\n * ## Usage\n * Creating an instance of Formio is simple, and takes only a path (URL String). The path can be different, depending on the desired output.\n * The Formio instance can also access higher level operations, depending on how granular of a path you start with.\n *\n * ```ts\n * var formio = new Formio(, [options]);\n * ```\n *\n * Where **endpoint** is any valid API endpoint within Form.io. These URL's can provide a number of different methods depending on the granularity of the endpoint. This allows you to use the same interface but have access to different methods depending on how granular the endpoint url is.\n * **options** is defined within the {link Formio.constructor} documentation.\n *\n * Here is an example of how this library can be used to load a form JSON from the Form.io API's\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadForm().then((form) => {\n * console.log(form);\n * });\n * ```\n */\nvar Formio = /** @class */ (function () {\n /* eslint-disable max-statements */\n /**\n * @constructor\n * @param {string} path - A project, form, and submission API Url.\n * @param {FormioOptions} options - Available options to configure the Javascript API.\n */\n function Formio(path, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n this.path = path;\n this.options = options;\n /**\n * The base API url of the Form.io Platform. Example: https://api.form.io\n */\n this.base = '';\n /**\n * The Projects Endpoint derived from the provided source.\n *\n * @example https://api.form.io/project\n */\n this.projectsUrl = '';\n /**\n * A specific project endpoint derived from the provided source.\n *\n * @example https://examples.form.io\n */\n this.projectUrl = '';\n /**\n * The Project ID found within the provided source.\n */\n this.projectId = '';\n /**\n * A specific Role URL provided the source.\n *\n * @example https://examples.form.io/role/2342343234234234\n */\n this.roleUrl = '';\n /**\n * The roles endpoint derived from the provided source.\n *\n * @example https://examples.form.io/role\n */\n this.rolesUrl = '';\n /**\n * The roleID derieved from the provided source.\n */\n this.roleId = '';\n /**\n * A specific form url derived from the provided source.\n *\n * @example https://examples.form.io/example\n */\n this.formUrl = '';\n /**\n * The forms url derived from the provided source.\n *\n * @example https://example.form.io/form\n */\n this.formsUrl = '';\n /**\n * The Form ID derived from the provided source.\n */\n this.formId = '';\n /**\n * The submissions URL derived from the provided source.\n *\n * @example https://examples.form.io/example/submission\n */\n this.submissionsUrl = '';\n /**\n * A specific submissions URL derived from a provided source.\n *\n * @example https://examples.form.io/example/submission/223423423423\n */\n this.submissionUrl = '';\n /**\n * The submission ID provided a submission url.\n */\n this.submissionId = '';\n /**\n * The actions url provided a form url as the source.\n *\n * @example https://examples.form.io/example/action\n */\n this.actionsUrl = '';\n /**\n * The Action ID derived from a provided Action url.\n */\n this.actionId = '';\n /**\n * A specific action api endoint.\n */\n this.actionUrl = '';\n this.vsUrl = '';\n this.vId = '';\n this.vUrl = '';\n /**\n * The query string derived from the provided src url.\n */\n this.query = '';\n /**\n * If this is a non-project url, such is the case for Open Source API.\n */\n this.noProject = false;\n // Ensure we have an instance of Formio.\n if (!(this instanceof Formio)) {\n return new Formio(path);\n }\n if (options.hasOwnProperty('base') && options.base) {\n this.base = options.base;\n }\n else if (Formio.baseUrl) {\n this.base = Formio.baseUrl;\n }\n else if (window && window.location) {\n this.base = window.location.href.match(/http[s]?:\\/\\/api./)[0];\n }\n if (!path) {\n // Allow user to create new projects if this was instantiated without\n // a url\n this.projectUrl = Formio.projectUrl || this.base + \"/project\";\n this.projectsUrl = this.base + \"/project\";\n this.projectId = '';\n this.query = '';\n return;\n }\n if (options.hasOwnProperty('project') && options.project) {\n this.projectUrl = options.project;\n }\n var project = this.projectUrl || Formio.projectUrl;\n var projectRegEx = /(^|\\/)(project)($|\\/[^/]+)/;\n var isProjectUrl = (path.search(projectRegEx) !== -1);\n // The baseURL is the same as the projectUrl, and does not contain \"/project/MONGO_ID\" in\n // its domain. This is almost certainly against the Open Source server.\n if (project && this.base === project && !isProjectUrl) {\n this.noProject = true;\n this.projectUrl = this.base;\n }\n // Normalize to an absolute path.\n if ((path.indexOf('http') !== 0) && (path.indexOf('//') !== 0)) {\n path = this.base + path;\n }\n var hostparts = this.getUrlParts(path);\n var hostName = '';\n var parts = [];\n if (hostparts) {\n hostName = hostparts[1] + hostparts[2];\n path = hostparts.length > 3 ? hostparts[3] : '';\n var queryparts = path.split('?');\n if (queryparts.length > 1) {\n path = queryparts[0];\n this.query = \"?\" + queryparts[1];\n }\n }\n // Register a specific path.\n var registerPath = function (name, base) {\n _this[name + \"sUrl\"] = base + \"/\" + name;\n var regex = new RegExp(\"/\" + name + \"/([^/]+)\");\n if (path && path.search(regex) !== -1) {\n parts = path.match(regex);\n _this[name + \"Url\"] = parts ? (base + parts[0]) : '';\n _this[name + \"Id\"] = (parts.length > 1) ? parts[1] : '';\n base += parts[0];\n }\n return base;\n };\n // Register an array of items.\n var registerItems = function (items, base, staticBase) {\n for (var i in items) {\n if (items.hasOwnProperty(i)) {\n var item = items[i];\n if (Array.isArray(item)) {\n registerItems(item, base, true);\n }\n else {\n var newBase = registerPath(item, base);\n base = staticBase ? base : newBase;\n }\n }\n }\n };\n if (!this.projectUrl || (this.projectUrl === this.base)) {\n // If a project uses Subdirectories path type, we need to specify a projectUrl\n if (!this.projectUrl && !isProjectUrl && Formio.pathType === 'Subdirectories') {\n var regex = \"^\" + hostName.replace(/\\//g, '\\\\/') + \".[^/]+\";\n var match = project.match(new RegExp(regex));\n this.projectUrl = match ? match[0] : hostName;\n }\n else {\n this.projectUrl = hostName;\n }\n }\n // Check if we have a specified path type.\n var isNotSubdomainType = false;\n if (Formio.pathType) {\n isNotSubdomainType = Formio.pathType !== 'Subdomains';\n }\n if (!this.noProject) {\n // Determine the projectUrl and projectId\n if (isProjectUrl) {\n // Get project id as project/:projectId.\n registerItems(['project'], hostName);\n path = path.replace(projectRegEx, '');\n }\n else if (hostName === this.base) {\n // Get project id as first part of path (subdirectory).\n if (hostparts && hostparts.length > 3 && path.split('/').length > 1) {\n var pathParts = path.split('/');\n pathParts.shift(); // Throw away the first /.\n var projectId = pathParts.shift();\n if (projectId) {\n this.projectId = projectId;\n path = \"/\" + pathParts.join('/');\n this.projectUrl = hostName + \"/\" + this.projectId;\n }\n }\n }\n else {\n // Get project id from subdomain.\n if (hostparts && hostparts.length > 2 && (hostparts[2].split('.').length > 2 || hostName.includes('localhost')) && !isNotSubdomainType) {\n this.projectUrl = hostName;\n this.projectId = hostparts[2].split('.')[0];\n }\n }\n this.projectsUrl = this.projectsUrl || this.base + \"/project\";\n }\n // Configure Role urls and role ids.\n registerItems(['role'], this.projectUrl);\n // Configure Form urls and form ids.\n if (/(^|\\/)(form)($|\\/)/.test(path)) {\n registerItems(['form', ['submission', 'action', 'v']], this.projectUrl);\n }\n else {\n var subRegEx = new RegExp('/(submission|action|v)($|/.*)');\n var subs = path.match(subRegEx);\n if ((subs && (subs.length > 1))) {\n this.pathType = subs[1];\n }\n path = path.replace(subRegEx, '');\n path = path.replace(/\\/$/, '');\n this.formsUrl = this.projectUrl + \"/form\";\n this.formUrl = path ? this.projectUrl + path : '';\n this.formId = path.replace(/^\\/+|\\/+$/g, '');\n var items = ['submission', 'action', 'v'];\n for (var i in items) {\n if (items.hasOwnProperty(i)) {\n var item = items[i];\n this[item + \"sUrl\"] = this.projectUrl + path + \"/\" + item;\n if ((this.pathType === item) && subs && (subs.length > 2) && subs[2]) {\n this[item + \"Id\"] = subs[2].replace(/^\\/+|\\/+$/g, '');\n this[item + \"Url\"] = this.projectUrl + path + subs[0];\n }\n }\n }\n }\n // Set the app url if it is not set.\n if (!Formio.projectUrlSet) {\n Formio.projectUrl = this.projectUrl;\n }\n }\n /* eslint-enable max-statements */\n /**\n * Deletes a remote resource of any provided type.\n *\n * @param {string} type - The type of resource to delete. \"submission\", \"form\", etc.\n * @param {object} options - The options passed to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.delete = function (type, opts) {\n var _id = type + \"Id\";\n var _url = type + \"Url\";\n if (!this[_id]) {\n return Promise.reject('Nothing to delete');\n }\n Formio.cache = {};\n return this.makeRequest(type, this[_url], 'delete', null, opts);\n };\n /**\n * Returns the index (array of records) for any provided type.\n *\n * @param {string} type - The type of resource to fetch the index of. \"submission\", \"form\", etc.\n * @param {object} query - A query object to pass to the request.\n * @param {object} query.params - A map (key-value pairs) of URL query parameters to add to the url.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.index = function (type, query, opts) {\n var _url = type + \"Url\";\n query = query || '';\n if (query && lodash_1.isObject(query)) {\n query = \"?\" + Formio.serialize(query.params);\n }\n return this.makeRequest(type, this[_url] + query, 'get', null, opts);\n };\n /**\n * Save a document record using \"upsert\". If the document does not exist, it will be created, if the _id is provided,\n * it will be updated.\n *\n * @param {string} type - The type of resource to fetch the index of. \"submission\", \"form\", etc.\n * @param {object} data - The resource data object.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.save = function (type, data, opts) {\n var _id = type + \"Id\";\n var _url = type + \"Url\";\n var method = (this[_id] || data._id) ? 'put' : 'post';\n var reqUrl = this[_id] ? this[_url] : this[type + \"sUrl\"];\n if (!this[_id] && data._id && (method === 'put') && !reqUrl.includes(data._id)) {\n reqUrl += \"/\" + data._id;\n }\n Formio.cache = {};\n return this.makeRequest(type, reqUrl + this.query, method, data, opts);\n };\n /**\n * @summary Load (GET) a document record.\n *\n * @param {string} type - The type of resource to fetch the index of. \"submission\", \"form\", etc.\n * @param {object} query - A query object to pass to the request.\n * @param {object} query.params - A map (key-value pairs) of URL query parameters to add to the url.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.load = function (type, query, opts) {\n var _id = type + \"Id\";\n var _url = type + \"Url\";\n if (query && lodash_1.isObject(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = this.query ? (this.query + \"&\" + query) : (\"?\" + query);\n }\n else {\n query = this.query;\n }\n if (!this[_id]) {\n return Promise.reject(\"Missing \" + _id);\n }\n return this.makeRequest(type, this[_url] + query, 'get', null, opts);\n };\n /**\n * @summary Call {@link Formio.makeRequest} for this Formio instance.\n *\n * @param {string} type - The request resource type. \"submission\", \"form\", etc.\n * @param {string} url - The URL to request.\n * @param {string} method - The request method. GET, PUT, POST, DELETE, or PATCH\n * @param {object} data - The data to pass to the request (for PUT, POST, and PATCH methods)\n * @param {object} options - An object of options to pass to the request method.\n * @param {boolean} options.ignoreCache - To ignore internal caching of the request.\n * @param {object} options.headers - An object of headers to pass along to the request.\n * @param {boolean} options.noToken - If set to true, this will not include the Form.io x-jwt-token along with the request.\n * @param {string} options.namespace - The Form.io namespace to prepend to all LocalStorage variables such as formioToken.\n * @param {boolean} options.getHeaders - Set this if you wish to include the response headers with the return of this method.\n * @return {Promise}\n */\n Formio.prototype.makeRequest = function (type, url, method, data, opts) {\n return Formio.makeRequest(this, type, url, method, data, opts);\n };\n /**\n * @summary Loads a project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.loadProject().then((project) => {\n * console.log(project);\n * });\n * ```\n *\n * @param {object} query - Query parameters to pass to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.loadProject = function (query, opts) {\n return this.load('project', query, opts);\n };\n /**\n * Saves or Updates a project.\n *\n * ### Create a new project\n * ```ts\n * const formio = new Formio();\n * formio.saveProject({\n * title: 'My Project',\n * path: 'myproject',\n * name: 'myproject'\n * });\n * ```\n *\n * ### Update an existing project\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.loadProject().then((project) => {\n * project.title = 'Title changed';\n * formio.saveProject(project).then(() => {\n * console.log('Done saving project!');\n * });\n * });\n * ```\n *\n * @param {object} data - The project JSON to create or update.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.saveProject = function (data, opts) {\n return this.save('project', data, opts);\n };\n /**\n * Deletes a project\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.deleteProject();\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.deleteProject = function (opts) {\n return this.delete('project', opts);\n };\n /**\n * Loads a list of all projects.\n *\n * ```ts\n * Formio.loadProjects().then((projects) => {\n * console.log(projects);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {*}\n */\n Formio.loadProjects = function (query, opts) {\n query = query || '';\n if (lodash_1.isObject(query)) {\n query = \"?\" + Formio.serialize(query.params);\n }\n return Formio.makeStaticRequest(Formio.baseUrl + \"/project\" + query, 'GET', null, opts);\n };\n /**\n * Loads a role within a project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/role/234234234234');\n * formio.loadRole().then((role) => {\n * console.log(role);\n * });\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.loadRole = function (opts) {\n return this.load('role', null, opts);\n };\n /**\n * Create a new or Update an existing role within a project.\n *\n * ### Create new Role example\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.saveRole({\n * title: 'Employee',\n * description: 'A person who belongs to a company.'\n * }).then((role) => {\n * console.log(role);\n * });\n * ```\n *\n * ### Update existing role example\n * ```ts\n * const formio = new Formio('https://examples.form.io/role/234234234234234');\n * formio.loadRole().then((role) => {\n * role.title = 'Manager';\n * formio.saveRole(role).then(() => {\n * console.log('DONE');\n * });\n * });\n * ```\n *\n * @param {object} role - The Role JSON to create or update.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.saveRole = function (data, opts) {\n return this.save('role', data, opts);\n };\n /**\n * Deletes a role within a project.\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.deleteRole = function (opts) {\n return this.delete('role', opts);\n };\n /**\n * Load all roles within a project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.loadRoles().then((roles) => {\n * console.log(roles);\n * });\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.loadRoles = function (opts) {\n return this.index('roles', null, opts);\n };\n /**\n * Loads a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadForm().then((form) => {\n * console.log(form);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.loadForm = function (query, opts) {\n var _this = this;\n return this.load('form', query, opts)\n .then(function (currentForm) {\n // Check to see if there isn't a number in vId.\n if (!currentForm.revisions || isNaN(parseInt(_this.vId))) {\n return currentForm;\n }\n // If a submission already exists but form is marked to load current version of form.\n if (currentForm.revisions === 'current' && _this.submissionId) {\n return currentForm;\n }\n // If they specified a revision form, load the revised form components.\n if (query && lodash_1.isObject(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = _this.query ? (_this.query + \"&\" + query) : (\"?\" + query);\n }\n else {\n query = _this.query;\n }\n return _this.makeRequest('form', _this.vUrl + query, 'get', null, opts)\n .then(function (revisionForm) {\n currentForm._vid = revisionForm._vid;\n currentForm.components = revisionForm.components;\n currentForm.settings = revisionForm.settings;\n // Using object.assign so we don't cross polinate multiple form loads.\n return Object.assign({}, currentForm);\n })\n // If we couldn't load the revision, just return the original form.\n .catch(function () { return Object.assign({}, currentForm); });\n });\n };\n /**\n * Create or Update a specific form.\n *\n * ### Create form example\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.saveForm({\n * title: 'Employee',\n * type: 'resource',\n * path: 'employee',\n * name: 'employee',\n * components: [\n * {\n * type: 'textfield',\n * key: 'firstName',\n * label: 'First Name'\n * },\n * {\n * type: 'textfield',\n * key: 'lastName',\n * label: 'Last Name'\n * }\n * ]\n * });\n * ```\n *\n * ### Update a form example\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadForm().then((form) => {\n * form.title = 'Changed Title';\n * formio.saveForm(form).then(() => {\n * console.log('DONE!!!');\n * });\n * });\n * ```\n *\n * @param {object} data - The Form JSON to create or update.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.saveForm = function (data, opts) {\n return this.save('form', data, opts);\n };\n /**\n * Deletes a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.deleteForm().then(() => {\n * console.log('Deleted!');\n * });\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.deleteForm = function (opts) {\n return this.delete('form', opts);\n };\n /**\n * Loads all forms within a project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.loadForms().then((forms) => {\n * console.log(forms);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.loadForms = function (query, opts) {\n return this.index('forms', query, opts);\n };\n /**\n * Loads a specific submissionn.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/submission/23423423423423423');\n * formio.loadSubmission().then((submission) => {\n * console.log(submission);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.loadSubmission = function (query, opts) {\n var _this = this;\n return this.load('submission', query, opts)\n .then(function (submission) {\n _this.vId = submission._fvid;\n _this.vUrl = _this.formUrl + \"/v/\" + _this.vId;\n return submission;\n });\n };\n /**\n * Creates a new or Updates an existing submission.\n *\n * ### Create a new submission\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.saveSubmission({\n * data: {\n * firstName: 'Joe',\n * lastName: 'Smith'\n * }\n * }).then((submission) => {\n * // This will now be the complete submission object saved on the server.\n * console.log(submission);\n * });\n * ```\n *\n * ### Update an existing submission\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/submission/23423423423423423');\n * formio.loadSubmission().then((submission) => {\n * submission.data.lastName = 'Thompson';\n * formio.saveSubmission(submission).then(() => {\n * console.log('DONE');\n * });\n * });\n * ```\n *\n * @param {object} data - The submission JSON object.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.saveSubmission = function (data, opts) {\n if (!isNaN(parseInt(this.vId))) {\n data._fvid = this.vId;\n }\n return this.save('submission', data, opts);\n };\n /**\n * Deletes a submission.\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.deleteSubmission = function (opts) {\n return this.delete('submission', opts);\n };\n /**\n * Loads all submissions within a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadSubmissions({\n * params: {\n * limit: 25,\n * 'data.lastName__regex': 'smith'\n * }\n * }).then((submissions) => {\n * // Should print out 25 submissions where the last name contains \"smith\".\n * console.log(submissions);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.loadSubmissions = function (query, opts) {\n return this.index('submissions', query, opts);\n };\n /**\n * Loads a form action.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/action/234234234234');\n * formio.loadAction().then((action) => {\n * console.log(action);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.loadAction = function (query, opts) {\n return this.load('action', query, opts);\n };\n /**\n * Create a new or update an existing action.\n *\n * ### Create a new action for a form.\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.saveAction({\n * data: {\n * name: 'webhook',\n * title: 'Webhook Action',\n * method: ['create', 'update', 'delete'],\n * handler: ['after'],\n * condition: {},\n * settings: {\n * url: 'https://example.com',\n * headers: [{}],\n * block: false,\n * forwardHeaders: false\n * }\n * }\n * }).then((action) => {\n * console.log(action);\n * });\n * ```\n *\n * ### Update an action\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/action/234234234234');\n * formio.loadAction().then((action) => {\n * action.title = 'Updated title';\n * formio.saveAction(action).then(() => {\n * console.log('Done!');\n * });\n * });\n * ```\n *\n * @param {object} data - The action JSON\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.saveAction = function (data, opts) {\n return this.save('action', data, opts);\n };\n /**\n * Delete an action\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/action/234234234234');\n * formio.deleteAction().then(() => {\n * console.log('Action was deleted.');\n * });\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.deleteAction = function (opts) {\n return this.delete('action', opts);\n };\n /**\n * Loads all actions within a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadActions().then((actions) => {\n * console.log(actions);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.loadActions = function (query, opts) {\n return this.index('actions', query, opts);\n };\n /**\n * Returns a list of available actions\n *\n * @return {Promise}\n */\n Formio.prototype.availableActions = function () {\n return this.makeRequest('availableActions', this.formUrl + \"/actions\");\n };\n /**\n * Returns the action information for a specific action, such as \"save\".\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/actions/save');\n * formio.actionInfo().then((info) => {\n * console.log(info);\n * });\n * ```\n *\n * @param {string} name - The name of the action you would like to get information for. i.e. \"save\", \"webhook\", etc.\n * @return {Promise}\n */\n Formio.prototype.actionInfo = function (name) {\n return this.makeRequest('actionInfo', this.formUrl + \"/actions/\" + name);\n };\n /**\n * Determine if a string ID is a valid MongoID.\n *\n * @param {string} id - The id that should be tested if it is avalid id.\n * @return {boolean} - true if it is a valid MongoId, false otherwise.\n */\n Formio.prototype.isObjectId = function (id) {\n var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');\n return checkForHexRegExp.test(id);\n };\n /**\n * Get the project ID of project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.getProjectId().then((projectId) => {\n * console.log(projectId);\n * };\n * ```\n *\n * @return {Promise}\n */\n Formio.prototype.getProjectId = function () {\n if (!this.projectId) {\n return Promise.resolve('');\n }\n if (this.isObjectId(this.projectId)) {\n return Promise.resolve(this.projectId);\n }\n else {\n return this.loadProject().then(function (project) {\n return project._id;\n });\n }\n };\n /**\n * Get the ID of a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.getFormId().then((formId) => {\n * console.log(formId);\n * });\n * ```\n *\n * @return {Promise}\n */\n Formio.prototype.getFormId = function () {\n if (!this.formId) {\n return Promise.resolve('');\n }\n if (this.isObjectId(this.formId)) {\n return Promise.resolve(this.formId);\n }\n else {\n return this.loadForm().then(function (form) {\n return form._id;\n });\n }\n };\n /**\n * Instance method for {@link Formio.currentUser}\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise}\n */\n Formio.prototype.currentUser = function (options) {\n return Formio.currentUser(this, options);\n };\n /**\n * Instance method for {@link Formio.accessInfo}\n *\n * @return {Promise}\n */\n Formio.prototype.accessInfo = function () {\n return Formio.accessInfo(this);\n };\n /**\n * Returns the JWT token for this instance.\n *\n * @param {object} options - The following options are provided.\n * @param {string} options.namespace - The localStorage namespace to use when retrieving tokens from storage.\n * @return {string} - The JWT token for this user.\n */\n Formio.prototype.getToken = function (options) {\n return Formio.getToken(Object.assign({ formio: this }, this.options, options));\n };\n /**\n * Sets the JWT token for this instance.\n *\n * @param {string} token - The JWT token to set.\n * @param {object} options - The following options are provided.\n * @param {string} options.namespace - The localStorage namespace to use when retrieving tokens from storage.\n * @return {string} - The JWT token that was set.\n */\n Formio.prototype.setToken = function (token, options) {\n return Formio.setToken(token, Object.assign({ formio: this }, this.options, options));\n };\n /**\n * Returns a temporary authentication token for single purpose token generation.\n *\n * @param {number|string} expire - The amount of seconds to wait before this temp token expires.\n * @param {string} allowed - The allowed path string inn the format GET:/path\n * @param {object} options - The options passed to {@link Formio#getToken}\n */\n Formio.prototype.getTempToken = function (expire, allowed, options) {\n var token = Formio.getToken(options);\n if (!token) {\n return Promise.reject('You must be authenticated to generate a temporary auth token.');\n }\n var authUrl = Formio.authUrl || this.projectUrl;\n return this.makeRequest('tempToken', authUrl + \"/token\", 'GET', null, {\n ignoreCache: true,\n header: new Headers({\n 'x-expire': expire,\n 'x-allow': allowed\n })\n });\n };\n /**\n * Get a PDF download url for a submission, which will generate a new PDF of the submission. This method will first\n * fetch a temporary download token, and then append this to the download url for this form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/submission/324234234234234');\n * formio.getDownloadUrl().then((url) => {\n * console.log(url);\n * });\n * ```\n *\n * @param {object} [form] - The form JSON to fetch a download url for.\n * @return {Promise} - The download url.\n */\n Formio.prototype.getDownloadUrl = function (form) {\n var _this = this;\n if (!this.submissionId) {\n return Promise.resolve('');\n }\n if (!form) {\n // Make sure to load the form first.\n return this.loadForm().then(function (_form) {\n if (!_form) {\n return '';\n }\n return _this.getDownloadUrl(_form);\n });\n }\n var apiUrl = \"/project/\" + form.project;\n apiUrl += \"/form/\" + form._id;\n apiUrl += \"/submission/\" + this.submissionId;\n apiUrl += '/download';\n var download = this.base + apiUrl;\n return new Promise(function (resolve, reject) {\n _this.getTempToken(3600, \"GET:\" + apiUrl).then(function (tempToken) {\n download += \"?token=\" + tempToken.key;\n resolve(download);\n }, function () {\n resolve(download);\n }).catch(reject);\n });\n };\n /**\n * Returns the user permissions to a form and submission.\n *\n * @param user - The user or current user if undefined. For anonymous, use \"null\"\n * @param form - The form or current form if undefined. For no form check, use \"null\"\n * @param submission - The submisison or \"index\" if undefined.\n *\n * @return {{create: boolean, read: boolean, edit: boolean, delete: boolean}}\n */\n Formio.prototype.userPermissions = function (user, form, submission) {\n return Promise.all([\n (form !== undefined) ? Promise.resolve(form) : this.loadForm(),\n (user !== undefined) ? Promise.resolve(user) : this.currentUser(),\n (submission !== undefined || !this.submissionId) ? Promise.resolve(submission) : this.loadSubmission(),\n this.accessInfo()\n ]).then(function (results) {\n var form = results.shift();\n var user = results.shift() || { _id: false, roles: [] };\n var submission = results.shift();\n var access = results.shift();\n var permMap = {\n create: 'create',\n read: 'read',\n update: 'edit',\n delete: 'delete'\n };\n var perms = {\n user: user,\n form: form,\n access: access,\n create: false,\n read: false,\n edit: false,\n delete: false\n };\n for (var roleName in access.roles) {\n if (access.roles.hasOwnProperty(roleName)) {\n var role = access.roles[roleName];\n if (role.default && (user._id === false)) {\n // User is anonymous. Add the anonymous role.\n user.roles.push(role._id);\n }\n else if (role.admin && user.roles.indexOf(role._id) !== -1) {\n perms.create = true;\n perms.read = true;\n perms.delete = true;\n perms.edit = true;\n return perms;\n }\n }\n }\n if (form && form.submissionAccess) {\n for (var i = 0; i < form.submissionAccess.length; i++) {\n var permission = form.submissionAccess[i];\n var _a = permission.type.split('_'), perm = _a[0], scope = _a[1];\n if (['create', 'read', 'update', 'delete'].includes(perm)) {\n if (lodash_1.intersection(permission.roles, user.roles).length) {\n perms[permMap[perm]] = (scope === 'all') || (!submission || (user._id === submission.owner));\n }\n }\n }\n }\n // check for Group Permissions\n if (submission) {\n // we would anyway need to loop through components for create permission, so we'll do that for all of them\n formUtil_1.eachComponent(form.components, function (component, path) {\n if (component && component.defaultPermission) {\n var value = lodash_1.get(submission.data, path);\n // make it work for single-select Group and multi-select Group\n var groups = Array.isArray(value) ? value : [value];\n groups.forEach(function (group) {\n if (group && group._id && // group id is present\n user.roles.indexOf(group._id) > -1 // user has group id in his roles\n ) {\n if (component.defaultPermission === 'read') {\n perms[permMap.read] = true;\n }\n if (component.defaultPermission === 'create') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n }\n if (component.defaultPermission === 'write') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n perms[permMap.update] = true;\n }\n if (component.defaultPermission === 'admin') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n perms[permMap.update] = true;\n perms[permMap.delete] = true;\n }\n }\n });\n }\n });\n }\n return perms;\n });\n };\n /**\n * `Determine if the current user can submit a form.\n * @return {*}\n */\n Formio.prototype.canSubmit = function () {\n var _this = this;\n return this.userPermissions().then(function (perms) {\n // If there is user and they cannot create, then check anonymous user permissions.\n if (!perms.create && Formio.getUser()) {\n return _this.userPermissions(null).then(function (anonPerms) {\n if (anonPerms.create) {\n Formio.setUser(null);\n return true;\n }\n return false;\n });\n }\n return perms.create;\n });\n };\n Formio.prototype.getUrlParts = function (url) {\n return Formio.getUrlParts(url, this);\n };\n Formio.getUrlParts = function (url, formio) {\n var base = (formio && formio.base) ? formio.base : Formio.baseUrl;\n var regex = '^(http[s]?:\\\\/\\\\/)';\n if (base && url.indexOf(base) === 0) {\n regex += \"(\" + base.replace(/^http[s]?:\\/\\//, '') + \")\";\n }\n else {\n regex += '([^/]+)';\n }\n regex += '($|\\\\/.*)';\n return url.match(new RegExp(regex));\n };\n Formio.serialize = function (obj, _interpolate) {\n var str = [];\n var interpolate = function (item) {\n return _interpolate ? _interpolate(item) : item;\n };\n for (var p in obj) {\n if (obj.hasOwnProperty(p)) {\n str.push(encodeURIComponent(p) + \"=\" + encodeURIComponent(interpolate(obj[p])));\n }\n }\n return str.join('&');\n };\n Formio.getRequestArgs = function (formio, type, url, method, data, opts) {\n method = (method || 'GET').toUpperCase();\n if (!opts || !lodash_1.isObject(opts)) {\n opts = {};\n }\n var requestArgs = {\n url: url,\n method: method,\n data: data || null,\n opts: opts\n };\n if (type) {\n requestArgs.type = type;\n }\n if (formio) {\n requestArgs.formio = formio;\n }\n return requestArgs;\n };\n Formio.makeStaticRequest = function (url, method, data, opts) {\n var requestArgs = Formio.getRequestArgs(null, '', url, method, data, opts);\n var request = Plugins_1.default.pluginWait('preRequest', requestArgs)\n .then(function () { return Plugins_1.default.pluginGet('staticRequest', requestArgs)\n .then(function (result) {\n if (lodash_1.isNil(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n }); });\n return Plugins_1.default.pluginAlter('wrapStaticRequestPromise', request, requestArgs);\n };\n /**\n * Make an API request and wrap that request with the Form.io Request plugin system. This is very similar to the\n * {Formio.request} method with a difference being that it will pass the request through the Form.io request plugin.\n *\n * @param {Formio} formio - An instance of the Formio class.\n * @param {string} type - The request resource type. \"submission\", \"form\", etc.\n * @param {string} url - The URL to request.\n * @param {string} method - The request method. GET, PUT, POST, DELETE, or PATCH\n * @param {object} data - The data to pass to the request (for PUT, POST, and PATCH methods)\n * @param {object} options - An object of options to pass to the request method.\n * @param {boolean} options.ignoreCache - To ignore internal caching of the request.\n * @param {object} options.headers - An object of headers to pass along to the request.\n * @param {boolean} options.noToken - If set to true, this will not include the Form.io x-jwt-token along with the request.\n * @param {string} options.namespace - The Form.io namespace to prepend to all LocalStorage variables such as formioToken.\n * @param {boolean} options.getHeaders - Set this if you wish to include the response headers with the return of this method.\n * @return {Promise}\n */\n Formio.makeRequest = function (formio, type, url, method, data, opts) {\n if (!formio) {\n return Formio.makeStaticRequest(url, method, data, opts);\n }\n var requestArgs = Formio.getRequestArgs(formio, type, url, method, data, opts);\n requestArgs.opts = requestArgs.opts || {};\n requestArgs.opts.formio = formio;\n //for Formio requests default Accept and Content-type headers\n if (!requestArgs.opts.headers) {\n requestArgs.opts.headers = {};\n }\n requestArgs.opts.headers = lodash_1.defaults(requestArgs.opts.headers, {\n 'Accept': 'application/json',\n 'Content-type': 'application/json'\n });\n var request = Plugins_1.default.pluginWait('preRequest', requestArgs)\n .then(function () { return Plugins_1.default.pluginGet('request', requestArgs)\n .then(function (result) {\n if (lodash_1.isNil(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n }); });\n return Plugins_1.default.pluginAlter('wrapRequestPromise', request, requestArgs);\n };\n /**\n * Execute an API request to any external system. This is a wrapper around the Web fetch method.\n *\n * ```ts\n * Formio.request('https://examples.form.io').then((form) => {\n * console.log(form);\n * });\n * ```\n *\n * @param {string} url - The URL to request.\n * @param {string} method - The request method. GET, PUT, POST, DELETE, or PATCH\n * @param {object} data - The data to pass to the request (for PUT, POST, and PATCH methods)\n * @param {Headers} header - An object of headers to pass to the request.\n * @param {object} options - An object of options to pass to the request method.\n * @param {boolean} options.ignoreCache - To ignore internal caching of the request.\n * @param {object} options.headers - An object of headers to pass along to the request.\n * @param {boolean} options.noToken - If set to true, this will not include the Form.io x-jwt-token along with the request.\n * @param {string} options.namespace - The Form.io namespace to prepend to all LocalStorage variables such as formioToken.\n * @param {boolean} options.getHeaders - Set this if you wish to include the response headers with the return of this method.\n * @return {Promise|*}\n */\n Formio.request = function (url, method, data, header, opts) {\n if (!url) {\n return Promise.reject('No url provided');\n }\n method = (method || 'GET').toUpperCase();\n // For reverse compatibility, if they provided the ignoreCache parameter,\n // then change it back to the options format where that is a parameter.\n if (lodash_1.isBoolean(opts)) {\n opts = { ignoreCache: opts };\n }\n if (!opts || !lodash_1.isObject(opts)) {\n opts = {};\n }\n // Generate a cachekey.\n var cacheKey = btoa(encodeURI(url));\n // Get the cached promise to save multiple loads.\n if (!opts.ignoreCache && method === 'GET' && Formio.cache.hasOwnProperty(cacheKey)) {\n return Promise.resolve(Formio.cloneResponse(Formio.cache[cacheKey]));\n }\n // Set up and fetch request\n var headers = header || new Headers(opts.headers || {\n 'Accept': 'application/json',\n 'Content-type': 'application/json'\n });\n var token = Formio.getToken(opts);\n if (token && !opts.noToken) {\n headers.append('x-jwt-token', token);\n }\n // The fetch-ponyfill can't handle a proper Headers class anymore. Change it back to an object.\n var headerObj = {};\n headers.forEach(function (value, name) {\n headerObj[name] = value;\n });\n var options = {\n method: method,\n headers: headerObj,\n mode: 'cors'\n };\n if (data) {\n options.body = JSON.stringify(data);\n }\n // Allow plugins to alter the options.\n options = Plugins_1.default.pluginAlter('requestOptions', options, url);\n if (options.namespace || Formio.namespace) {\n opts.namespace = options.namespace || Formio.namespace;\n }\n var requestToken = options.headers['x-jwt-token'];\n var result = Plugins_1.default.pluginAlter('wrapFetchRequestPromise', Formio.fetch(url, options), { url: url, method: method, data: data, opts: opts }).then(function (response) {\n // Allow plugins to respond.\n response = Plugins_1.default.pluginAlter('requestResponse', response, Formio, data);\n if (!response.ok) {\n if (response.status === 440) {\n Formio.setToken(null, opts);\n Formio.events.emit('formio.sessionExpired', response.body);\n }\n else if (response.status === 401) {\n Formio.events.emit('formio.unauthorized', response.body);\n }\n else if (response.status === 416) {\n Formio.events.emit('formio.rangeIsNotSatisfiable', response.body);\n }\n // Parse and return the error as a rejected promise to reject this promise\n return (response.headers.get('content-type').includes('application/json')\n ? response.json()\n : response.text())\n .then(function (error) {\n return Promise.reject(error);\n });\n }\n // Handle fetch results\n var token = response.headers.get('x-jwt-token');\n // In some strange cases, the fetch library will return an x-jwt-token without sending\n // one to the server. This has even been debugged on the server to verify that no token\n // was introduced with the request, but the response contains a token. This is an Invalid\n // case where we do not send an x-jwt-token and get one in return for any GET request.\n var tokenIntroduced = false;\n if ((method === 'GET') &&\n !requestToken &&\n token &&\n !opts.external &&\n !url.includes('token=') &&\n !url.includes('x-jwt-token=')) {\n console.warn('Token was introduced in request.');\n tokenIntroduced = true;\n }\n if (response.status >= 200 &&\n response.status < 300 &&\n token &&\n token !== '' &&\n !tokenIntroduced) {\n Formio.setToken(token, opts);\n }\n // 204 is no content. Don't try to .json() it.\n if (response.status === 204) {\n return {};\n }\n var getResult = response.headers.get('content-type').includes('application/json')\n ? response.json()\n : response.text();\n return getResult.then(function (result) {\n // Add some content-range metadata to the result here\n var range = response.headers.get('content-range');\n if (range && lodash_1.isObject(result)) {\n range = range.split('/');\n if (range[0] !== '*') {\n var skipLimit = range[0].split('-');\n result.skip = Number(skipLimit[0]);\n result.limit = skipLimit[1] - skipLimit[0] + 1;\n }\n result.serverCount = range[1] === '*' ? range[1] : Number(range[1]);\n }\n if (!opts.getHeaders) {\n return result;\n }\n var headers = {};\n response.headers.forEach(function (item, key) {\n headers[key] = item;\n });\n // Return the result with the headers.\n return {\n result: result,\n headers: headers,\n };\n });\n })\n .then(function (result) {\n if (opts.getHeaders) {\n return result;\n }\n // Cache the response.\n if (method === 'GET') {\n Formio.cache[cacheKey] = result;\n }\n return Formio.cloneResponse(result);\n })\n .catch(function (err) {\n if (err === 'Bad Token') {\n Formio.setToken(null, opts);\n Formio.events.emit('formio.badToken', err);\n }\n if (err.message) {\n err.message = \"Could not connect to API server (\" + err.message + \")\";\n err.networkError = true;\n }\n if (method === 'GET') {\n delete Formio.cache[cacheKey];\n }\n return Promise.reject(err);\n });\n return result;\n };\n Object.defineProperty(Formio, \"token\", {\n // Needed to maintain reverse compatability...\n get: function () {\n return Formio.tokens.formioToken || '';\n },\n // Needed to maintain reverse compatability...\n set: function (token) {\n Formio.tokens.formioToken = token || '';\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Sets the JWT in storage to be used within an application.\n *\n * @param {string} token - The JWT token to set.\n * @param {object} options - Options as follows\n * @param {string} options.namespace - The namespace to save the token within. i.e. \"formio\"\n * @param {Formio} options.formio - The Formio instance.\n * @return {Promise|void}\n */\n Formio.setToken = function (token, opts) {\n if (token === void 0) { token = ''; }\n if (opts === void 0) { opts = {}; }\n token = token || '';\n opts = (typeof opts === 'string') ? { namespace: opts } : opts || {};\n var tokenName = (opts.namespace || Formio.namespace || 'formio') + \"Token\";\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n if (!token) {\n if (!opts.fromUser) {\n opts.fromToken = true;\n Formio.setUser(null, opts);\n }\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n localStorage.removeItem(tokenName);\n }\n catch (err) {\n console.log(\"Error removing token: \" + err.message);\n }\n Formio.tokens[tokenName] = token;\n return Promise.resolve(null);\n }\n if (Formio.tokens[tokenName] !== token) {\n Formio.tokens[tokenName] = token;\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n localStorage.setItem(tokenName, token);\n }\n catch (err) {\n console.log(\"Error setting token: \" + err.message);\n }\n }\n // Return or updates the current user\n return Formio.currentUser(opts.formio, opts);\n };\n /**\n * Returns the token set within the application for the user.\n *\n * @param {object} options - The options as follows.\n * @param {string} options.namespace - The namespace of the token you wish to fetch.\n * @param {boolean} options.decode - If you would like the token returned as decoded JSON.\n * @return {*}\n */\n Formio.getToken = function (options) {\n options = (typeof options === 'string') ? { namespace: options } : options || {};\n var tokenName = (options.namespace || Formio.namespace || 'formio') + \"Token\";\n var decodedTokenName = options.decode ? tokenName + \"Decoded\" : tokenName;\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n if (Formio.tokens[decodedTokenName]) {\n return Formio.tokens[decodedTokenName];\n }\n try {\n Formio.tokens[tokenName] = localStorage.getItem(tokenName) || '';\n return Formio.tokens[tokenName];\n }\n catch (e) {\n console.log(\"Error retrieving token: \" + e.message);\n return '';\n }\n };\n /**\n * Sets the current user within the application cache.\n *\n * @param {object} user - JSON object of the user you wish to set.\n * @param {object} options - Options as follows\n * @param {string} options.namespace - The namespace of the tokens\n */\n Formio.setUser = function (user, opts) {\n if (opts === void 0) { opts = {}; }\n var userName = (opts.namespace || Formio.namespace || 'formio') + \"User\";\n if (!user) {\n if (!opts.fromToken) {\n opts.fromUser = true;\n Formio.setToken(null, opts);\n }\n // Emit an event on the cleared user.\n Formio.events.emit('formio.user', null);\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n return localStorage.removeItem(userName);\n }\n catch (err) {\n console.log(\"Error removing token: \" + err.message);\n return;\n }\n }\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n localStorage.setItem(userName, JSON.stringify(user));\n }\n catch (err) {\n console.log(\"Error setting token: \" + err.message);\n }\n // Emit an event on the authenticated user.\n Formio.events.emit('formio.user', user);\n };\n /**\n * Returns the user JSON.\n *\n * @param {object} options - Options as follows\n * @param {string} namespace - The namespace of the tokens stored within this application.\n * @return {object} - The user object.\n */\n Formio.getUser = function (options) {\n options = options || {};\n var userName = (options.namespace || Formio.namespace || 'formio') + \"User\";\n try {\n return JSON.parse((localStorage.getItem(userName) || null));\n }\n catch (e) {\n console.log(\"Error getting user: \" + e.message);\n return {};\n }\n };\n /**\n * Sets the BaseURL for the application.\n *\n * @description Every application developed using the JavaScript SDK must set both the {@link Formio.setBaseUrl} and\n * {@link Formio.setProjectUrl} methods. These two functions ensure that every URL passed into the constructor of this\n * class can determine the \"project\" context for which the application is running.\n *\n * Any Open Source server applications will set both the {@link Formio.setBaseUrl} and {@link Formio.setProjectUrl}\n * values will be the same value.\n *\n * ```ts\n * Formio.setBaseUrl('https://yourwebsite.com/forms');\n * Formio.setProjectUrl('https://yourwebsite.com/forms/project');\n *\n * // Now the Formio constructor will know what is the \"project\" and what is the form alias name. Without setBaseUrl\n * // and setProjectUrl, this would throw an error.\n *\n * const formio = new Formio('https://yourwebsite.com/forms/project/user');\n * formio.loadForm().then((form) => {\n * console.log(form);\n * });\n * ```\n *\n * @param {string} url - The URL of the Base API url.\n */\n Formio.setBaseUrl = function (url) {\n Formio.baseUrl = url;\n if (!Formio.projectUrlSet) {\n Formio.projectUrl = url;\n }\n };\n /**\n * Returns the current base url described at {@link Formio.setBaseUrl}\n *\n * @return {string} - The base url of the application.\n */\n Formio.getBaseUrl = function () {\n return Formio.baseUrl;\n };\n Formio.setApiUrl = function (url) {\n return Formio.setBaseUrl(url);\n };\n Formio.getApiUrl = function () {\n return Formio.getBaseUrl();\n };\n Formio.setAppUrl = function (url) {\n console.warn('Formio.setAppUrl() is deprecated. Use Formio.setProjectUrl instead.');\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n };\n /**\n * Sets the Project Url for the application. This is an important method that needs to be set for all applications. It\n * is documented @ {@link Formio.setBaseUrl}.\n *\n * @param {string} url - The project api url.\n */\n Formio.setProjectUrl = function (url) {\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n };\n /**\n * The Auth URL can be set to customize the authentication requests made from an application. By default, this is\n * just the same value as {@link Formio.projectUrl}\n *\n * @param {string} url - The authentication url\n */\n Formio.setAuthUrl = function (url) {\n Formio.authUrl = url;\n };\n Formio.getAppUrl = function () {\n console.warn('Formio.getAppUrl() is deprecated. Use Formio.getProjectUrl instead.');\n return Formio.projectUrl;\n };\n /**\n * Returns the Project url described at {@link Formio.setProjectUrl}\n *\n * @return {string|string} - The Project Url.\n */\n Formio.getProjectUrl = function () {\n return Formio.projectUrl;\n };\n /**\n * Clears the runtime internal API cache.\n *\n * @description By default, the Formio class will cache all API requests in memory so that any subsequent requests\n * using GET method will return the cached results as long as the API URl is the same as what was cached previously.\n * This cache can be cleared using this method as follows.\n *\n * ```ts\n * Formio.clearCache();\n * ```\n *\n * Or, if you just wish to clear a single request, then the {@link Formio.request#options.ignoreCache} option can be\n * provided when making an API request as follows.\n *\n * ```ts\n * Formio.loadForm({}, {\n * ignoreCache: true\n * }).then((form) => {\n * console.log(form);\n * });\n * ```\n *\n * Both of the following will ensure that a new request is made to the API server and that the results will not be\n * from the cached result.\n */\n Formio.clearCache = function () {\n Formio.cache = {};\n };\n /**\n * Return the access information about a Project, such as the Role ID's for that project, and if the server is\n * configured to do so, the Form and Resource access configurations that the authenticated user has access to.\n *\n * @description This is useful for an application to determine the UI for a specific user to identify which forms they have\n * access to submit or read.\n *\n * @param {Formio} formio - The Formio instance.\n * @return {Promise}\n */\n Formio.accessInfo = function (formio) {\n var projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'accessInfo', projectUrl + \"/access\");\n };\n /**\n * Returns an array of roles for the project, which includes the ID's and names of those roles.\n *\n * @param {Formio} formio - The Formio instance.\n * @return {Promise}\n */\n Formio.projectRoles = function (formio) {\n var projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'projectRoles', projectUrl + \"/role\");\n };\n /**\n * Return the currentUser object. This will fetch the user from the server and respond with the Submission JSON\n * of that user object.\n *\n * @param {Formio} formio - The Formio instance\n * @param {object} options - The options passed to {@link Formio.getUser}\n * @return {Promise|*}\n */\n Formio.currentUser = function (formio, options) {\n if (options === void 0) { options = {}; }\n var authUrl = Formio.authUrl;\n if (!authUrl) {\n authUrl = formio ? formio.projectUrl : (Formio.projectUrl || Formio.baseUrl);\n }\n authUrl += '/current';\n var user = Formio.getUser(options);\n if (user) {\n return Plugins_1.default.pluginAlter('wrapStaticRequestPromise', Promise.resolve(user), {\n url: authUrl,\n method: 'GET',\n options: options\n });\n }\n var token = Formio.getToken(options);\n if ((!options || !options.external) && !token) {\n return Plugins_1.default.pluginAlter('wrapStaticRequestPromise', Promise.resolve(null), {\n url: authUrl,\n method: 'GET',\n options: options\n });\n }\n return Formio.makeRequest(formio, 'currentUser', authUrl, 'GET', null, options)\n .then(function (response) {\n Formio.setUser(response, options);\n return response;\n });\n };\n /**\n * Performs a logout of the Form.io application. This will reset all cache, as well as make a request to the logout\n * endpoint of the Form.io api platform.\n *\n * @param {Formio} formio - A Formio instance.\n * @param {object} options - Options passed to both {@link Formio.setToken} as well as {@link Formio.setUser}\n * @return {Promise}\n */\n Formio.logout = function (formio, options) {\n if (options === void 0) { options = {}; }\n options.formio = formio;\n var projectUrl = Formio.authUrl ? Formio.authUrl : (formio ? formio.projectUrl : Formio.baseUrl);\n return Formio.makeRequest(formio, 'logout', projectUrl + \"/logout\")\n .then(function (result) {\n Formio.setToken(null, options);\n Formio.setUser(null, options);\n Formio.clearCache();\n return result;\n })\n .catch(function (err) {\n Formio.setToken(null, options);\n Formio.setUser(null, options);\n Formio.clearCache();\n throw err;\n });\n };\n /**\n * Returns the query passed to a page in JSON object format.\n *\n * @description For example, lets say you visit your application using\n * the url as follows.\n *\n * ```\n * https://yourapplication.com/?token=23423423423&username=Joe\n * ```\n *\n * The following code will provide your application with the following.\n *\n * ```ts\n * const query Formio.pageQuery();\n * console.log(query.token); // Will print 23423423423\n * console.log(query.username); // Will print Joe\n * ```\n *\n * @return {{}} - A JSON object representation of the query that was passed to the URL of an application.\n */\n Formio.pageQuery = function () {\n var pageQuery = {};\n pageQuery.paths = [];\n var hashes = location.hash.substr(1).replace(/\\?/g, '&').split('&');\n var parts = [];\n location.search.substr(1).split('&').forEach(function (item) {\n parts = item.split('=');\n if (parts.length > 1) {\n pageQuery[parts[0]] = parts[1] && decodeURIComponent(parts[1]);\n }\n });\n hashes.forEach(function (item) {\n parts = item.split('=');\n if (parts.length > 1) {\n pageQuery[parts[0]] = parts[1] && decodeURIComponent(parts[1]);\n }\n else if (item.indexOf('/') === 0) {\n pageQuery.paths = item.substr(1).split('/');\n }\n });\n return pageQuery;\n };\n /**\n * Much like {@link Formio.currentUser}, but instead automatically injects the Bearer tokens into the headers to\n * perform a Token swap of the OAuth token which will then return the JWT token for that user.\n *\n * @param {Formio} formio - The Formio instance\n * @param {string} token - An OAuth Bearer token to use for a token swap between the OAuth provider and Form.io\n * @return {Promise|*}\n */\n Formio.oAuthCurrentUser = function (formio, token) {\n return Formio.currentUser(formio, {\n external: true,\n headers: {\n Authorization: \"Bearer \" + token\n }\n });\n };\n /**\n * Perform a SAML initialization.\n *\n * @description Typically, you would use the {@link Formio.ssoInit} method to perform this function\n * since this method is an alias for the following.\n *\n * ```ts\n * Formio.samlInit();\n * Formio.ssoInit('saml'); // This is the exact same thing as calling Formio.samlInit\n * ```\n *\n * This method will return false if the process is just starting. The code below is a typical block of code that is\n * used to automatically trigger the SAML authentication process within your application using a Button component.\n *\n * ```ts\n * if (Formio.pageQuery().saml) {\n * const sso = Formio.samlInit();\n * if (sso) {\n * sso.then((user) => {\n * // The SSO user is now loaded!\n * console.log(user);\n * });\n * }\n * }\n * ```\n *\n * You can then place the following code withiin the \"Custom\" action of a Button component on your form.\n *\n * ```ts\n * Formio.samlInit();\n * ```\n *\n * Now when you click on this button, it will start the handshake process with SAML, and once it returns, will pass\n * a \"saml\" query parameter back to your application which will execute the code to load the current user from SAML.\n *\n * @param {object} options - Options to pass to the SAML initialization process.\n * @param {string} options.relay - The URL that will be used as the authentication \"relay\" that occurs during a SAML handshake process.\n * @return {boolean|Promise|void}\n */\n Formio.samlInit = function (options) {\n if (options === void 0) { options = {}; }\n var query = Formio.pageQuery();\n if (query.saml) {\n Formio.setUser(null);\n var retVal = Formio.setToken(query.saml);\n var uri = window.location.toString();\n uri = uri.substring(0, uri.indexOf('?'));\n if (window.location.hash) {\n uri += window.location.hash;\n }\n window.history.replaceState({}, document.title, uri);\n return retVal;\n }\n // Set the relay if not provided.\n if (!options.relay) {\n options.relay = window.location.href;\n }\n // go to the saml sso endpoint for this project.\n var authUrl = Formio.authUrl || Formio.projectUrl;\n window.location.href = authUrl + \"/saml/sso?relay=\" + encodeURI(options.relay);\n return false;\n };\n /**\n * Perform an Okta Authentication process using the {@link https://developer.okta.com/code/javascript/okta_auth_sdk|Okta SDK}.\n *\n * @description This method does require that you first include the Okta JavaScript SDK within your application as follows.\n *\n * First you need to include the Okta Authentication script.\n *\n * ```html\n * \n * ```\n *\n * Then you can call this method as follows.\n *\n * ```ts\n * Formio.oktaInit();\n * ```\n *\n * @param {object} options - Options that are passed directly to the {@link https://github.com/okta/okta-auth-js#configuration-reference|Okta SDK constructor}\n * @param {constructor} options.OktaAuth - If the OktaAuth constructor is not provided global to the application, it can be provided to this method using this property.\n * @param {Formio} options.formio - The Formio instance.\n * @param {Array} options.scopes - Scopes that are passed to the {@link https://github.com/okta/okta-auth-js#tokengetwithredirectoptions|getWithRedirect} method from the Okta SDK.\n * @return {Promise}\n */\n Formio.oktaInit = function (options) {\n if (options === void 0) { options = {}; }\n if (typeof OktaAuth !== undefined) {\n options.OktaAuth = OktaAuth;\n }\n if (typeof options.OktaAuth === undefined) {\n var errorMessage = 'Cannot find OktaAuth. Please include the Okta JavaScript SDK within your application. See https://developer.okta.com/code/javascript/okta_auth_sdk for an example.';\n console.warn(errorMessage);\n return Promise.reject(errorMessage);\n }\n return new Promise(function (resolve, reject) {\n var Okta = options.OktaAuth;\n delete options.OktaAuth;\n var authClient = new Okta(options);\n authClient.tokenManager.get('accessToken')\n .then(function (accessToken) {\n if (accessToken) {\n resolve(Formio.oAuthCurrentUser(options.formio, accessToken.accessToken));\n }\n else if (location.hash) {\n authClient.token.parseFromUrl()\n .then(function (token) {\n authClient.tokenManager.add('accessToken', token);\n resolve(Formio.oAuthCurrentUser(options.formio, token.accessToken));\n })\n .catch(function (err) {\n console.warn(err);\n reject(err);\n });\n }\n else {\n authClient.token.getWithRedirect({\n responseType: 'token',\n scopes: options.scopes\n });\n resolve(false);\n }\n })\n .catch(function (error) {\n reject(error);\n });\n });\n };\n /**\n * A common static method to trigger any SSO processes. This method is really just an alias for other static methods.\n *\n * @param {('saml'|'okta')} type - The type of SSO to trigger. 'saml' is an alias for {@link Formio.samlInit}, and 'okta' is an alias for {@link Formio.oktaInit}.\n * @param {object} options - Options to pass to the specific sso methods\n * @return {*|Promise|boolean|void}\n */\n Formio.ssoInit = function (type, options) {\n if (options === void 0) { options = {}; }\n switch (type) {\n case 'saml':\n return Formio.samlInit(options);\n case 'okta':\n return Formio.oktaInit(options);\n default:\n console.warn('Unknown SSO type');\n return Promise.reject('Unknown SSO type');\n }\n };\n /**\n * Lazy load a remote library dependency.\n *\n * @description This is useful for components that wish to lazy load a required library\n * by adding that library to the section of the HTML webpage, and then provide a promise that will resolve\n * when the library becomes available for use.\n *\n * @example Load Google Maps API.\n * ```ts\n * Formio.requireLibrary('googleMaps', 'google.maps.Map', 'https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap', true).then(() => {\n * // Once the promise resolves, the following can now be used within your application.\n * const map = new google.maps.Map(document.getElementById(\"map\"), {...});\n * });\n * ```\n *\n * @param {string} name - The internal name to give to the library you are loading. This is useful for caching the library for later use.\n * @param {string} property - The name of the global property that will be added to the global namespace once the library has been loaded. This is used to check to see if the property exists before resolving the promise that the library is ready for use.\n * @param {string} src - The URL of the library to lazy load.\n * @param {boolean} polling - Determines if polling should be used to determine if they library is ready to use. If set to false, then it will rely on a global callback called ${name}Callback where \"name\" is the first property passed to this method. When this is called, that will indicate when the library is ready. In most cases, you will want to pass true to this parameter to initiate a polling method to check for the library availability in the global context.\n * @return {Promise} - A promise that will resolve when the plugin is ready to be used.\n */\n Formio.requireLibrary = function (name, property, src, polling) {\n if (polling === void 0) { polling = false; }\n if (!Formio.libraries.hasOwnProperty(name)) {\n Formio.libraries[name] = {};\n Formio.libraries[name].ready = new Promise(function (resolve, reject) {\n Formio.libraries[name].resolve = resolve;\n Formio.libraries[name].reject = reject;\n });\n var callbackName = name + \"Callback\";\n if (!polling && !window[callbackName]) {\n window[callbackName] = function () { return Formio.libraries[name].resolve(); };\n }\n // See if the plugin already exists.\n var plugin = lodash_1.get(window, property);\n if (plugin) {\n Formio.libraries[name].resolve(plugin);\n }\n else {\n src = Array.isArray(src) ? src : [src];\n src.forEach(function (lib) {\n var attrs = {};\n var elementType = '';\n if (typeof lib === 'string') {\n lib = {\n type: 'script',\n src: lib,\n };\n }\n switch (lib.type) {\n case 'script':\n elementType = 'script';\n attrs = {\n src: lib.src,\n type: 'text/javascript',\n defer: true,\n async: true,\n referrerpolicy: 'origin',\n };\n break;\n case 'styles':\n elementType = 'link';\n attrs = {\n href: lib.src,\n rel: 'stylesheet',\n };\n break;\n }\n // Add the script to the top of the page.\n var element = document.createElement(elementType);\n if (element.setAttribute) {\n for (var attr in attrs) {\n element.setAttribute(attr, attrs[attr]);\n }\n }\n var head = document.head;\n if (head) {\n head.appendChild(element);\n }\n });\n // if no callback is provided, then check periodically for the script.\n if (polling) {\n var interval_1 = setInterval(function () {\n var plugin = lodash_1.get(window, property);\n if (plugin) {\n clearInterval(interval_1);\n Formio.libraries[name].resolve(plugin);\n }\n }, 200);\n }\n }\n }\n return Formio.libraries[name].ready;\n };\n /**\n * Determines if a lazy loaded library is ready to be used.\n *\n * @description Example: Let's assume that the example provided at {@link Formio.requireLibrary} was used elsewhere in your application.\n * You could now use the following within a separate place that will also resolve once the library is ready to be used.\n *\n * ```js\n * Formio.libraryReady('googleMaps').then(() => {\n * // Once the promise resolves, the following can now be used within your application.\n * const map = new google.maps.Map(document.getElementById(\"map\"), {...});\n * });\n * ```\n *\n * @param {string} name - The name of the library to check.\n * @return {Promise} - A promise that will resolve when the library is ready to be used.\n */\n Formio.libraryReady = function (name) {\n if (Formio.libraries.hasOwnProperty(name) &&\n Formio.libraries[name].ready) {\n return Formio.libraries[name].ready;\n }\n return Promise.reject(name + \" library was not required.\");\n };\n /**\n * Clones the response from the API so that it cannot be mutated.\n *\n * @param response\n */\n Formio.cloneResponse = function (response) {\n var copy = lodash_1.fastCloneDeep(response);\n if (Array.isArray(response)) {\n copy.skip = response.skip;\n copy.limit = response.limit;\n copy.serverCount = response.serverCount;\n }\n return copy;\n };\n /**\n * Sets the project path type.\n *\n * @param type\n */\n Formio.setPathType = function (type) {\n if (typeof type === 'string') {\n Formio.pathType = type;\n }\n };\n /**\n * Gets the project path type.\n */\n Formio.getPathType = function () {\n return Formio.pathType;\n };\n /**\n * The base API url of the Form.io Platform. Example: https://api.form.io\n */\n Formio.baseUrl = 'https://api.form.io';\n /**\n * The project API url of the Form.io Project. Example: https://examples.form.io\n */\n Formio.projectUrl = '';\n /**\n * The project url to use for Authentication.\n */\n Formio.authUrl = '';\n /**\n * Set to true if the project url has been established with ```Formio.setProjectUrl()```\n */\n Formio.projectUrlSet = false;\n /**\n * The Form.io API Cache. This ensures that requests to the same API endpoint are cached.\n */\n Formio.cache = {};\n /**\n * The namespace used to save the Form.io Token's and variables within an application.\n */\n Formio.namespace = '';\n /**\n * Handles events fired within this SDK library.\n */\n Formio.events = new eventemitter3_1.default();\n /**\n * Stores all of the libraries lazy loaded with ```Formio.requireLibrary``` method.\n */\n Formio.libraries = {};\n /**\n * A direct interface to the Form.io fetch polyfill.\n */\n Formio.fetch = fetch;\n /**\n * A direct interface to the Form.io fetch Headers polyfill.\n */\n Formio.Headers = Headers;\n /**\n * All of the auth tokens for this session.\n */\n Formio.tokens = {};\n /**\n * The version of this library.\n */\n Formio.version = '---VERSION---';\n // Add Plugin methods.\n Formio.plugins = Plugins_1.default.plugins;\n Formio.deregisterPlugin = Plugins_1.default.deregisterPlugin;\n Formio.registerPlugin = Plugins_1.default.registerPlugin;\n Formio.getPlugin = Plugins_1.default.getPlugin;\n Formio.pluginWait = Plugins_1.default.pluginWait;\n Formio.pluginGet = Plugins_1.default.pluginGet;\n Formio.pluginAlter = Plugins_1.default.pluginAlter;\n return Formio;\n}());\nexports.Formio = Formio;\n// Adds Formio to the Plugins Interface.\nPlugins_1.default.Formio = Formio;\n\n\n//# sourceURL=webpack://Formio/./src/sdk/Formio.ts?"); - -/***/ }), - -/***/ "./src/sdk/Plugins.ts": -/*!****************************!*\ - !*** ./src/sdk/Plugins.ts ***! - \****************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar lodash_1 = __webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\");\n/**\n * The Form.io Plugins allow external systems to \"hook\" into the default behaviors of the JavaScript SDK.\n */\nvar Plugins = /** @class */ (function () {\n function Plugins() {\n }\n /**\n * Returns the plugin identity.\n *\n * @param value\n */\n Plugins.identity = function (value) {\n return value;\n };\n /**\n * De-registers a plugin.\n * @param plugin The plugin you wish to deregister.\n */\n Plugins.deregisterPlugin = function (plugin) {\n var beforeLength = Plugins.plugins.length;\n Plugins.plugins = Plugins.plugins.filter(function (p) {\n if (p !== plugin && p.__name !== plugin) {\n return true;\n }\n (p.deregister || lodash_1.noop).call(plugin, Plugins.Formio);\n return false;\n });\n return beforeLength !== Plugins.plugins.length;\n };\n /**\n * Registers a new plugin.\n *\n * @param plugin The Plugin object.\n * @param name The name of the plugin you wish to register.\n */\n Plugins.registerPlugin = function (plugin, name) {\n Plugins.plugins.push(plugin);\n Plugins.plugins.sort(function (a, b) { return (b.priority || 0) - (a.priority || 0); });\n plugin.__name = name;\n (plugin.init || lodash_1.noop).call(plugin, Plugins.Formio);\n };\n /**\n * Returns a plugin provided the name of the plugin.\n * @param name The name of the plugin you would like to get.\n */\n Plugins.getPlugin = function (name) {\n for (var _i = 0, _a = Plugins.plugins; _i < _a.length; _i++) {\n var plugin = _a[_i];\n if (plugin.__name === name) {\n return plugin;\n }\n }\n return null;\n };\n /**\n * Wait for a plugin function to complete.\n * @param pluginFn - A function within the plugin.\n * @param args\n */\n Plugins.pluginWait = function (pluginFn) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return Promise.all(Plugins.plugins.map(function (plugin) {\n var _a;\n return (_a = (plugin[pluginFn] || lodash_1.noop)).call.apply(_a, __spreadArray([plugin], args));\n }));\n };\n /**\n * Gets a value from a Plugin\n * @param pluginFn\n * @param args\n */\n Plugins.pluginGet = function (pluginFn) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var callPlugin = function (index) {\n var _a;\n var plugin = Plugins.plugins[index];\n if (!plugin) {\n return Promise.resolve(null);\n }\n return Promise.resolve((_a = (plugin[pluginFn] || lodash_1.noop)).call.apply(_a, __spreadArray([plugin], args)))\n .then(function (result) {\n if (!lodash_1.isNil(result)) {\n return result;\n }\n return callPlugin(index + 1);\n });\n };\n return callPlugin(0);\n };\n /**\n * Allows a Plugin to alter the behavior of the JavaScript library.\n *\n * @param pluginFn\n * @param value\n * @param args\n */\n Plugins.pluginAlter = function (pluginFn, value) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n return Plugins.plugins.reduce(function (value, plugin) {\n return (plugin[pluginFn] || Plugins.identity).apply(void 0, __spreadArray([value], args));\n }, value);\n };\n /**\n * An array of Form.io Plugins.\n */\n Plugins.plugins = [];\n return Plugins;\n}());\nexports.default = Plugins;\n\n\n//# sourceURL=webpack://Formio/./src/sdk/Plugins.ts?"); - -/***/ }), - -/***/ "./src/sdk/index.ts": -/*!**************************!*\ - !*** ./src/sdk/index.ts ***! - \**************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = void 0;\nvar Formio_1 = __webpack_require__(/*! ./Formio */ \"./src/sdk/Formio.ts\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return Formio_1.Formio; } }));\n\n\n//# sourceURL=webpack://Formio/./src/sdk/index.ts?"); - -/***/ }), - -/***/ "./src/utils/Evaluator.ts": -/*!********************************!*\ - !*** ./src/utils/Evaluator.ts ***! - \********************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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 __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Evaluator = exports.BaseEvaluator = void 0;\nvar _ = __importStar(__webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\"));\n// BaseEvaluator is for extending.\nvar BaseEvaluator = /** @class */ (function () {\n function BaseEvaluator() {\n }\n BaseEvaluator.evaluator = function (func) {\n var params = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n params[_i - 1] = arguments[_i];\n }\n if (Evaluator.noeval) {\n console.warn('No evaluations allowed for this renderer.');\n return _.noop;\n }\n if (typeof func === 'function') {\n return func;\n }\n if (typeof params[0] === 'object') {\n params = _.keys(params[0]);\n }\n return new (Function.bind.apply(Function, __spreadArray(__spreadArray([void 0], params), [func])))();\n };\n ;\n BaseEvaluator.interpolateString = function (rawTemplate, data) {\n return rawTemplate.replace(/({{\\s*(.*?)\\s*}})/g, function (match, $1, $2) {\n // If this is a function call and we allow evals.\n if ($2.indexOf('(') !== -1) {\n return $2.replace(/([^\\(]+)\\(([^\\)]+)\\s*\\);?/, function (evalMatch, funcName, args) {\n funcName = _.trim(funcName);\n var func = _.get(data, funcName);\n if (func) {\n if (args) {\n args = args.split(',').map(function (arg) {\n arg = _.trim(arg);\n if ((arg.indexOf('\"') === 0) || (arg.indexOf(\"'\") === 0)) {\n return arg.substring(1, arg.length - 1);\n }\n return _.get(data, arg);\n });\n }\n return Evaluator.evaluate(func, args, '', false, data);\n }\n return '';\n });\n }\n else {\n return _.get(data, $2);\n }\n });\n };\n BaseEvaluator.interpolate = function (rawTemplate, data) {\n if (typeof rawTemplate === 'function') {\n try {\n return rawTemplate(data);\n }\n catch (err) {\n console.warn('Error interpolating template', err, data);\n return err.message;\n }\n }\n return Evaluator.interpolateString(String(rawTemplate), data);\n };\n ;\n /**\n * Evaluate a method.\n *\n * @param func\n * @param args\n * @return {*}\n */\n BaseEvaluator.evaluate = function (func, args, ret, interpolate, context) {\n if (args === void 0) { args = {}; }\n if (ret === void 0) { ret = ''; }\n if (interpolate === void 0) { interpolate = false; }\n if (context === void 0) { context = {}; }\n var returnVal = null;\n var component = args.component ? args.component : { key: 'unknown' };\n if (!args.form && args.instance) {\n args.form = _.get(args.instance, 'root._form', {});\n }\n var componentKey = component.key;\n if (typeof func === 'string') {\n if (ret) {\n func += \";return \" + ret;\n }\n if (interpolate) {\n func = BaseEvaluator.interpolate(func, args);\n }\n try {\n func = Evaluator.evaluator(func, args, context);\n args = _.values(args);\n }\n catch (err) {\n console.warn(\"An error occured within the custom function for \" + componentKey, err);\n returnVal = null;\n func = false;\n }\n }\n if (typeof func === 'function') {\n try {\n returnVal = Evaluator.execute(func, args, context);\n }\n catch (err) {\n returnVal = null;\n console.warn(\"An error occured within custom function for \" + componentKey, err);\n }\n }\n else if (func) {\n console.warn(\"Unknown function type for \" + componentKey);\n }\n return returnVal;\n };\n /**\n * Execute a function.\n *\n * @param func\n * @param args\n * @returns\n */\n BaseEvaluator.execute = function (func, args, context) {\n if (context === void 0) { context = {}; }\n if (Evaluator.noeval) {\n console.warn('No evaluations allowed for this renderer.');\n return _.noop;\n }\n return Array.isArray(args) ? func.apply(context, args) : func.call(context, args);\n };\n ;\n BaseEvaluator.templateSettings = {\n interpolate: /{{([\\s\\S]+?)}}/g,\n };\n BaseEvaluator.noeval = false;\n return BaseEvaluator;\n}());\nexports.BaseEvaluator = BaseEvaluator;\n// The extendable evaluator\nvar Evaluator = /** @class */ (function (_super) {\n __extends(Evaluator, _super);\n function Evaluator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Allow external modules the ability to extend the Evaluator.\n * @param evaluator\n */\n Evaluator.registerEvaluator = function (evaluator) {\n Object.keys(evaluator).forEach(function (key) {\n Evaluator[key] = evaluator[key];\n });\n };\n return Evaluator;\n}(BaseEvaluator));\nexports.Evaluator = Evaluator;\n\n\n//# sourceURL=webpack://Formio/./src/utils/Evaluator.ts?"); - -/***/ }), - -/***/ "./src/utils/date.ts": -/*!***************************!*\ - !*** ./src/utils/date.ts ***! - \***************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.dayjs = exports.getDateSetting = exports.formatDate = exports.momentDate = exports.convertFormatToMoment = exports.currentTimezone = void 0;\nvar dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nexports.dayjs = dayjs_1.default;\nvar timezone_1 = __importDefault(__webpack_require__(/*! dayjs/plugin/timezone */ \"./node_modules/dayjs/plugin/timezone.js\"));\nvar utc_1 = __importDefault(__webpack_require__(/*! dayjs/plugin/utc */ \"./node_modules/dayjs/plugin/utc.js\"));\nvar lodash_1 = __webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\");\nvar Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"./src/utils/Evaluator.ts\");\ndayjs_1.default.extend(utc_1.default);\ndayjs_1.default.extend(timezone_1.default);\n/**\n * Get the current timezone string.\n *\n * @return {string}\n */\nfunction currentTimezone() {\n return dayjs_1.default.tz.guess();\n}\nexports.currentTimezone = currentTimezone;\n/**\n * Convert the format from the angular-datepicker module to moment format.\n * @param format\n * @return {string}\n */\nfunction convertFormatToMoment(format) {\n return format\n // Year conversion.\n .replace(/y/g, 'Y')\n // Day in month.\n .replace(/d/g, 'D')\n // Day in week.\n .replace(/E/g, 'd')\n // AM/PM marker\n .replace(/a/g, 'A')\n // Unix Timestamp\n .replace(/U/g, 'X');\n}\nexports.convertFormatToMoment = convertFormatToMoment;\n/**\n * Get the moment date object for translating dates with timezones.\n *\n * @param value\n * @param format\n * @param timezone\n * @return {*}\n */\nfunction momentDate(value, format, timezone) {\n var momentDate = dayjs_1.default(value);\n if (timezone === 'UTC') {\n return dayjs_1.default.utc();\n }\n if (timezone !== currentTimezone() || (format && format.match(/\\s(z$|z\\s)/))) {\n return momentDate.tz(timezone);\n }\n return momentDate;\n}\nexports.momentDate = momentDate;\n/**\n * Format a date provided a value, format, and timezone object.\n *\n * @param value\n * @param format\n * @param timezone\n * @return {string}\n */\nfunction formatDate(value, format, timezone) {\n var momentDate = dayjs_1.default(value);\n if (timezone === 'UTC') {\n return dayjs_1.default.utc().format(convertFormatToMoment(format)) + \" UTC\";\n }\n if (timezone) {\n return momentDate.tz(timezone).format(convertFormatToMoment(format) + \" z\");\n }\n return momentDate.format(convertFormatToMoment(format));\n}\nexports.formatDate = formatDate;\n/**\n * Return a translated date setting.\n *\n * @param date\n * @return {(null|Date)}\n */\nfunction getDateSetting(date) {\n if (lodash_1.isNil(date) || lodash_1.isNaN(date) || date === '') {\n return null;\n }\n if (date instanceof Date) {\n return date;\n }\n else if (typeof date.toDate === 'function') {\n return date.isValid() ? date.toDate() : null;\n }\n var dateSetting = ((typeof date !== 'string') || (date.indexOf('moment(') === -1)) ? dayjs_1.default(date) : null;\n if (dateSetting && dateSetting.isValid()) {\n return dateSetting.toDate();\n }\n dateSetting = null;\n try {\n var value = Evaluator_1.Evaluator.evaluator(\"return \" + date + \";\", 'moment')(dayjs_1.default);\n if (typeof value === 'string') {\n dateSetting = dayjs_1.default(value);\n }\n else if (typeof value.toDate === 'function') {\n dateSetting = dayjs_1.default(value.toDate().toUTCString());\n }\n else if (value instanceof Date) {\n dateSetting = dayjs_1.default(value);\n }\n }\n catch (e) {\n return null;\n }\n if (!dateSetting) {\n return null;\n }\n // Ensure this is a date.\n if (!dateSetting.isValid()) {\n return null;\n }\n return dateSetting.toDate();\n}\nexports.getDateSetting = getDateSetting;\n\n\n//# sourceURL=webpack://Formio/./src/utils/date.ts?"); - -/***/ }), - -/***/ "./src/utils/dom.ts": -/*!**************************!*\ - !*** ./src/utils/dom.ts ***! - \**************************/ -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.empty = exports.removeChildFrom = exports.prependTo = exports.appendTo = void 0;\n/**\n * Append an HTML DOM element to a container.\n *\n * @param element\n * @param container\n */\nfunction appendTo(element, container) {\n if (container && element) {\n container === null || container === void 0 ? void 0 : container.appendChild(element);\n }\n}\nexports.appendTo = appendTo;\n/**\n * Prepend an HTML DOM element to a container.\n *\n * @param {HTMLElement} element - The DOM element to prepend.\n * @param {HTMLElement} container - The DOM element that is the container of the element getting prepended.\n */\nfunction prependTo(element, container) {\n if (container && element) {\n if (container.firstChild) {\n try {\n container.insertBefore(element, container.firstChild);\n }\n catch (err) {\n console.warn(err);\n container.appendChild(element);\n }\n }\n else {\n container.appendChild(element);\n }\n }\n}\nexports.prependTo = prependTo;\n/**\n * Removes an HTML DOM element from its bounding container.\n *\n * @param {HTMLElement} element - The element to remove.\n * @param {HTMLElement} container - The DOM element that is the container of the element to remove.\n */\nfunction removeChildFrom(element, container) {\n if (container && element && container.contains(element)) {\n try {\n container.removeChild(element);\n }\n catch (err) {\n console.warn(err);\n }\n }\n}\nexports.removeChildFrom = removeChildFrom;\n/**\n * Empty's an HTML DOM element.\n *\n * @param {HTMLElement} element - The element you wish to empty.\n */\nfunction empty(element) {\n if (element) {\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n }\n}\nexports.empty = empty;\n\n\n//# sourceURL=webpack://Formio/./src/utils/dom.ts?"); - -/***/ }), - -/***/ "./src/utils/formUtil.ts": -/*!*******************************!*\ - !*** ./src/utils/formUtil.ts ***! - \*******************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.uniqueName = exports.guid = exports.eachComponent = void 0;\nvar Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"./src/utils/Evaluator.ts\");\nvar lodash_1 = __webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\");\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(function (component) {\n if (!component) {\n return;\n }\n var hasColumns = component.columns && Array.isArray(component.columns);\n var hasRows = component.rows && Array.isArray(component.rows);\n var hasComps = component.components && Array.isArray(component.components);\n var noRecurse = false;\n var newPath = component.key ? (path ? (path + \".\" + component.key) : component.key) : '';\n // Keep track of parent references.\n if (parent) {\n // Ensure we don't create infinite JSON structures.\n component.parent = __assign({}, parent);\n delete component.parent.components;\n delete component.parent.componentMap;\n delete component.parent.columns;\n delete component.parent.rows;\n }\n // there's no need to add other layout components here because we expect that those would either have columns, rows or components\n var layoutTypes = ['htmlelement', 'content'];\n var isLayoutComponent = hasColumns || hasRows || hasComps || layoutTypes.indexOf(component.type) > -1;\n if (includeAll || component.tree || !isLayoutComponent) {\n noRecurse = fn(component, newPath, components);\n }\n var subPath = function () {\n if (component.key &&\n !['panel', 'table', 'well', 'columns', 'fieldset', 'tabs', 'form'].includes(component.type) &&\n (['datagrid', 'container', 'editgrid', 'address', 'dynamicWizard'].includes(component.type) ||\n component.tree)) {\n return newPath;\n }\n else if (component.key &&\n component.type === 'form') {\n return newPath + \".data\";\n }\n return path;\n };\n if (!noRecurse) {\n if (hasColumns) {\n component.columns.forEach(function (column) {\n return eachComponent(column.components, fn, includeAll, subPath(), parent ? component : null);\n });\n }\n else if (hasRows) {\n component.rows.forEach(function (row) {\n if (Array.isArray(row)) {\n row.forEach(function (column) {\n return eachComponent(column.components, fn, includeAll, subPath(), parent ? component : null);\n });\n }\n });\n }\n else if (hasComps) {\n eachComponent(component.components, fn, includeAll, subPath(), parent ? component : null);\n }\n }\n });\n}\nexports.eachComponent = eachComponent;\nfunction guid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0;\n var v = c === 'x'\n ? r\n : (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 var parts = name.split('.');\n var fileName = parts.slice(0, parts.length - 1).join('.');\n var extension = parts.length > 1\n ? \".\" + lodash_1.last(parts)\n : '';\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: fileName,\n guid: guid()\n });\n //only letters, numbers, dots, dashes, underscores and spaces are allowed. Anything else will be replaced with dash\n var uniqueName = (\"\" + Evaluator_1.Evaluator.interpolate(template, evalContext) + extension).replace(/[^0-9a-zA-Z.\\-_ ]/g, '-');\n return uniqueName;\n}\nexports.uniqueName = uniqueName;\n\n\n//# sourceURL=webpack://Formio/./src/utils/formUtil.ts?"); - -/***/ }), - -/***/ "./src/utils/index.ts": -/*!****************************!*\ - !*** ./src/utils/index.ts ***! - \****************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\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 __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.dom = exports.override = exports.sanitize = exports.BaseEvaluator = exports.Evaluator = exports.Utils = void 0;\nexports.Utils = __importStar(__webpack_require__(/*! ./formUtil */ \"./src/utils/formUtil.ts\"));\nvar Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"./src/utils/Evaluator.ts\");\nObject.defineProperty(exports, \"Evaluator\", ({ enumerable: true, get: function () { return Evaluator_1.Evaluator; } }));\nObject.defineProperty(exports, \"BaseEvaluator\", ({ enumerable: true, get: function () { return Evaluator_1.BaseEvaluator; } }));\nvar sanitize_1 = __webpack_require__(/*! ./sanitize */ \"./src/utils/sanitize.ts\");\nObject.defineProperty(exports, \"sanitize\", ({ enumerable: true, get: function () { return sanitize_1.sanitize; } }));\nvar override_1 = __webpack_require__(/*! ./override */ \"./src/utils/override.ts\");\nObject.defineProperty(exports, \"override\", ({ enumerable: true, get: function () { return override_1.override; } }));\nexports.dom = __importStar(__webpack_require__(/*! ./dom */ \"./src/utils/dom.ts\"));\n__exportStar(__webpack_require__(/*! ./utils */ \"./src/utils/utils.ts\"), exports);\n__exportStar(__webpack_require__(/*! ./date */ \"./src/utils/date.ts\"), exports);\n__exportStar(__webpack_require__(/*! ./mask */ \"./src/utils/mask.ts\"), exports);\n\n\n//# sourceURL=webpack://Formio/./src/utils/index.ts?"); - -/***/ }), - -/***/ "./src/utils/mask.ts": -/*!***************************!*\ - !*** ./src/utils/mask.ts ***! - \***************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.matchInputMask = exports.getInputMask = void 0;\nvar lodash_1 = __webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\");\n/**\n * Returns an input mask that is compatible with the input mask library.\n * @param {string} mask - The Form.io input mask.\n * @param {string} placeholderChar - Char which is used as a placeholder.\n * @returns {Array} - The input mask for the mask library.\n */\nfunction getInputMask(mask, placeholderChar) {\n if (mask instanceof Array) {\n return mask;\n }\n var maskArray = [];\n maskArray.numeric = true;\n for (var i = 0; i < mask.length; i++) {\n switch (mask[i]) {\n case '9':\n maskArray.push(/\\d/);\n break;\n case 'A':\n maskArray.numeric = false;\n maskArray.push(/[a-zA-Z]/);\n break;\n case 'a':\n maskArray.numeric = false;\n maskArray.push(/[a-z]/);\n break;\n case '*':\n maskArray.numeric = false;\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.numeric = false;\n maskArray.push(' ');\n break;\n default:\n maskArray.numeric = false;\n maskArray.push(mask[i]);\n break;\n }\n }\n return maskArray;\n}\nexports.getInputMask = getInputMask;\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 (var i = 0; i < inputMask.length; i++) {\n var char = value[i];\n var charPart = inputMask[i];\n if (!(lodash_1.isRegExp(charPart) && charPart.test(char) || charPart === char)) {\n return false;\n }\n }\n return true;\n}\nexports.matchInputMask = matchInputMask;\n\n\n//# sourceURL=webpack://Formio/./src/utils/mask.ts?"); - -/***/ }), - -/***/ "./src/utils/override.ts": -/*!*******************************!*\ - !*** ./src/utils/override.ts ***! - \*******************************/ -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.override = void 0;\n/**\n * Simple class to allow for overriding base classes.\n * @param classObj\n * @param extenders\n */\nfunction override(classObj, extenders) {\n for (var key in extenders) {\n if (extenders.hasOwnProperty(key)) {\n var extender = extenders[key];\n if (typeof extender === 'function') {\n classObj.prototype[key] = extender;\n }\n else {\n var prop = Object.getOwnPropertyDescriptor(classObj.prototype, key);\n for (var attr in extender) {\n if (extender.hasOwnProperty(attr)) {\n prop[attr] = extender[attr](prop[attr]);\n }\n }\n Object.defineProperty(classObj.prototype, key, prop);\n }\n }\n }\n}\nexports.override = override;\n\n\n//# sourceURL=webpack://Formio/./src/utils/override.ts?"); - -/***/ }), - -/***/ "./src/utils/sanitize.ts": -/*!*******************************!*\ - !*** ./src/utils/sanitize.ts ***! - \*******************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.sanitize = void 0;\nvar dompurify_1 = __importDefault(__webpack_require__(/*! dompurify */ \"./node_modules/dompurify/dist/purify.js\"));\nvar DOMPurify = null;\nvar getDOMPurify = function () {\n if (DOMPurify) {\n return DOMPurify;\n }\n if (window) {\n DOMPurify = dompurify_1.default(window);\n return DOMPurify;\n }\n return null;\n};\n/**\n * Sanitize an html string.\n *\n * @param string\n * @returns {*}\n */\nfunction sanitize(string, options) {\n var dompurify = getDOMPurify();\n if (!dompurify) {\n console.log('DOMPurify unable to sanitize the contents.');\n return string;\n }\n // Dompurify configuration\n var sanitizeOptions = {\n ADD_ATTR: ['ref', 'target', 'within'],\n USE_PROFILES: { html: true }\n };\n // Add attrs\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addAttr) && options.sanitizeConfig.addAttr.length > 0) {\n options.sanitizeConfig.addAttr.forEach(function (attr) {\n sanitizeOptions.ADD_ATTR.push(attr);\n });\n }\n // Add tags\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addTags) && options.sanitizeConfig.addTags.length > 0) {\n sanitizeOptions.ADD_TAGS = options.sanitizeConfig.addTags;\n }\n // Allow tags\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.allowedTags) && options.sanitizeConfig.allowedTags.length > 0) {\n sanitizeOptions.ALLOWED_TAGS = options.sanitizeConfig.allowedTags;\n }\n // Allow attributes\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.allowedAttrs) && options.sanitizeConfig.allowedAttrs.length > 0) {\n sanitizeOptions.ALLOWED_ATTR = options.sanitizeConfig.allowedAttrs;\n }\n // Allowd URI Regex\n if (options.sanitizeConfig && options.sanitizeConfig.allowedUriRegex) {\n sanitizeOptions.ALLOWED_URI_REGEXP = options.sanitizeConfig.allowedUriRegex;\n }\n // Allow to extend the existing array of elements that are safe for URI-like values\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addUriSafeAttr) && options.sanitizeConfig.addUriSafeAttr.length > 0) {\n sanitizeOptions.ADD_URI_SAFE_ATTR = options.sanitizeConfig.addUriSafeAttr;\n }\n return dompurify.sanitize(string, sanitizeOptions);\n}\nexports.sanitize = sanitize;\n\n\n//# sourceURL=webpack://Formio/./src/utils/sanitize.ts?"); - -/***/ }), - -/***/ "./src/utils/utils.ts": -/*!****************************!*\ - !*** ./src/utils/utils.ts ***! - \****************************/ -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.escapeRegExCharacters = void 0;\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\n//# sourceURL=webpack://Formio/./src/utils/utils.ts?"); - -/***/ }), - -/***/ "./src/validator/index.ts": -/*!********************************!*\ - !*** ./src/validator/index.ts ***! - \********************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Rule = exports.Rules = exports.Validator = void 0;\nvar rules_1 = __importDefault(__webpack_require__(/*! ./rules */ \"./src/validator/rules/index.ts\"));\nexports.Rules = rules_1.default;\nvar Validator = /** @class */ (function () {\n function Validator() {\n }\n Validator.addRules = function (rules) {\n Validator.rules = __assign(__assign({}, Validator.rules), rules);\n };\n Validator.rules = rules_1.default;\n return Validator;\n}());\nexports.Validator = Validator;\n;\nvar Rule_1 = __webpack_require__(/*! ./rules/Rule */ \"./src/validator/rules/Rule.ts\");\nObject.defineProperty(exports, \"Rule\", ({ enumerable: true, get: function () { return Rule_1.Rule; } }));\n\n\n//# sourceURL=webpack://Formio/./src/validator/index.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Custom.ts": -/*!***************************************!*\ - !*** ./src/validator/rules/Custom.ts ***! - \***************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.CustomRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar CustomRule = /** @class */ (function (_super) {\n __extends(CustomRule, _super);\n function CustomRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{error}}';\n return _this;\n }\n CustomRule.prototype.check = function (value, data, row, index) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var custom, valid;\n return __generator(this, function (_a) {\n custom = this.settings.custom;\n if (!custom) {\n return [2 /*return*/, true];\n }\n valid = this.component.evaluate(custom, {\n valid: true,\n data: data,\n row: row,\n rowIndex: index,\n input: value,\n }, 'valid', true);\n if (valid === null) {\n return [2 /*return*/, true];\n }\n return [2 /*return*/, valid];\n });\n });\n };\n return CustomRule;\n}(Rule_1.Rule));\nexports.CustomRule = CustomRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Custom.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Date.ts": -/*!*************************************!*\ - !*** ./src/validator/rules/Date.ts ***! - \*************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.DateRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar DateRule = /** @class */ (function (_super) {\n __extends(DateRule, _super);\n function DateRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} is not a valid date.';\n return _this;\n }\n DateRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (!value || value instanceof Date) {\n return [2 /*return*/, true];\n }\n if (typeof value === 'string') {\n if (value.toLowerCase() === 'invalid date') {\n return [2 /*return*/, false];\n }\n value = new Date(value);\n }\n return [2 /*return*/, value.toString() !== 'Invalid Date'];\n });\n });\n };\n return DateRule;\n}(Rule_1.Rule));\nexports.DateRule = DateRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Date.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Day.ts": -/*!************************************!*\ - !*** ./src/validator/rules/Day.ts ***! - \************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.DayRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar DayRule = /** @class */ (function (_super) {\n __extends(DayRule, _super);\n function DayRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} is not a valid day.';\n return _this;\n }\n DayRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n function isLeapYear(year) {\n // Year is leap if it is evenly divisible by 400 or evenly divisible by 4 and not evenly divisible by 100.\n return !(year % 400) || (!!(year % 100) && !(year % 4));\n }\n function getDaysInMonthCount(month, year) {\n switch (month) {\n case 1: // January\n case 3: // March\n case 5: // May\n case 7: // July\n case 8: // August\n case 10: // October\n case 12: // December\n return 31;\n case 4: // April\n case 6: // June\n case 9: // September\n case 11: // November\n return 30;\n case 2: // February\n return isLeapYear(year) ? 29 : 28;\n default:\n return 31;\n }\n }\n var _a, DAY, MONTH, YEAR, values, day, month, year, maxDay;\n return __generator(this, function (_b) {\n if (!value) {\n return [2 /*return*/, true];\n }\n if (typeof value !== 'string') {\n return [2 /*return*/, false];\n }\n _a = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2], DAY = _a[0], MONTH = _a[1], YEAR = _a[2];\n values = value.split('/').map(function (x) { return parseInt(x, 10); }), day = values[DAY], month = values[MONTH], year = values[YEAR], maxDay = getDaysInMonthCount(month, year);\n if (isNaN(day) || day < 0 || day > maxDay) {\n return [2 /*return*/, false];\n }\n if (isNaN(month) || month < 0 || month > 12) {\n return [2 /*return*/, false];\n }\n if (isNaN(year) || year < 0 || year > 9999) {\n return [2 /*return*/, false];\n }\n return [2 /*return*/, true];\n });\n });\n };\n return DayRule;\n}(Rule_1.Rule));\nexports.DayRule = DayRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Day.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Email.ts": -/*!**************************************!*\ - !*** ./src/validator/rules/Email.ts ***! - \**************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.EmailRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar EmailRule = /** @class */ (function (_super) {\n __extends(EmailRule, _super);\n function EmailRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} must be a valid email.';\n return _this;\n }\n EmailRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var re;\n return __generator(this, function (_a) {\n if (!value) {\n return [2 /*return*/, true];\n }\n re = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n /* eslint-enable max-len */\n // Allow emails to be valid if the component is pristine and no value is provided.\n return [2 /*return*/, re.test(value)];\n });\n });\n };\n return EmailRule;\n}(Rule_1.Rule));\nexports.EmailRule = EmailRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Email.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Mask.ts": -/*!*************************************!*\ - !*** ./src/validator/rules/Mask.ts ***! - \*************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MaskRule = void 0;\nvar utils_1 = __webpack_require__(/*! @formio/utils */ \"./src/utils/index.ts\");\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar MaskRule = /** @class */ (function (_super) {\n __extends(MaskRule, _super);\n function MaskRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} does not match the mask.';\n return _this;\n }\n MaskRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var inputMask, maskName, formioInputMask;\n return __generator(this, function (_a) {\n if (this.component.isMultipleMasksField) {\n maskName = value ? value.maskName : undefined;\n formioInputMask = this.component.getMaskByName(maskName);\n if (formioInputMask) {\n inputMask = utils_1.getInputMask(formioInputMask);\n }\n value = value ? value.value : value;\n }\n else {\n inputMask = utils_1.getInputMask(this.settings.mask);\n }\n if (value && inputMask) {\n return [2 /*return*/, utils_1.matchInputMask(value, inputMask)];\n }\n return [2 /*return*/, true];\n });\n });\n };\n return MaskRule;\n}(Rule_1.Rule));\nexports.MaskRule = MaskRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Mask.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Max.ts": -/*!************************************!*\ - !*** ./src/validator/rules/Max.ts ***! - \************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MaxRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar MaxRule = /** @class */ (function (_super) {\n __extends(MaxRule, _super);\n function MaxRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} cannot be greater than {{settings.limit}}.';\n return _this;\n }\n MaxRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var max, parsedValue;\n return __generator(this, function (_a) {\n max = parseFloat(this.settings.limit);\n parsedValue = parseFloat(value);\n if (Number.isNaN(max) || Number.isNaN(parsedValue)) {\n return [2 /*return*/, true];\n }\n return [2 /*return*/, parsedValue <= max];\n });\n });\n };\n return MaxRule;\n}(Rule_1.Rule));\nexports.MaxRule = MaxRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Max.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/MaxDate.ts": -/*!****************************************!*\ - !*** ./src/validator/rules/MaxDate.ts ***! - \****************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\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.MaxDateRule = void 0;\nvar utils_1 = __webpack_require__(/*! @formio/utils */ \"./src/utils/index.ts\");\nvar lodash_1 = __webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\");\nvar dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar MaxDateRule = /** @class */ (function (_super) {\n __extends(MaxDateRule, _super);\n function MaxDateRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} should not contain date after {{settings.dateLimit}}';\n return _this;\n }\n MaxDateRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var date, maxDate;\n return __generator(this, function (_a) {\n if (!value) {\n return [2 /*return*/, true];\n }\n // If they are the exact same string or object, then return true.\n if (value === this.settings.dateLimit) {\n return [2 /*return*/, true];\n }\n date = dayjs_1.default(value);\n maxDate = utils_1.getDateSetting(this.settings.dateLimit);\n if (lodash_1.isNull(maxDate)) {\n return [2 /*return*/, true];\n }\n else {\n maxDate.setHours(0, 0, 0, 0);\n }\n return [2 /*return*/, date.isBefore(maxDate) || date.isSame(maxDate)];\n });\n });\n };\n return MaxDateRule;\n}(Rule_1.Rule));\nexports.MaxDateRule = MaxDateRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/MaxDate.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/MaxLength.ts": -/*!******************************************!*\ - !*** ./src/validator/rules/MaxLength.ts ***! - \******************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MaxLengthRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar MaxLengthRule = /** @class */ (function (_super) {\n __extends(MaxLengthRule, _super);\n function MaxLengthRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} must have no more than {{- settings.length}} characters.';\n return _this;\n }\n MaxLengthRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var maxLength;\n return __generator(this, function (_a) {\n maxLength = parseInt(this.settings.length, 10);\n if (!value || !maxLength || !value.hasOwnProperty('length')) {\n return [2 /*return*/, true];\n }\n return [2 /*return*/, (value.length <= maxLength)];\n });\n });\n };\n return MaxLengthRule;\n}(Rule_1.Rule));\nexports.MaxLengthRule = MaxLengthRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/MaxLength.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/MaxWords.ts": -/*!*****************************************!*\ - !*** ./src/validator/rules/MaxWords.ts ***! - \*****************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MaxWordsRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar MaxWordsRule = /** @class */ (function (_super) {\n __extends(MaxWordsRule, _super);\n function MaxWordsRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} must have no more than {{- settings.length}} words.';\n return _this;\n }\n MaxWordsRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var maxWords;\n return __generator(this, function (_a) {\n maxWords = parseInt(this.settings.length, 10);\n if (!maxWords || (typeof value !== 'string')) {\n return [2 /*return*/, true];\n }\n return [2 /*return*/, (value.trim().split(/\\s+/).length <= maxWords)];\n });\n });\n };\n return MaxWordsRule;\n}(Rule_1.Rule));\nexports.MaxWordsRule = MaxWordsRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/MaxWords.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/MaxYear.ts": -/*!****************************************!*\ - !*** ./src/validator/rules/MaxYear.ts ***! - \****************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MaxYearRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar MaxYearRule = /** @class */ (function (_super) {\n __extends(MaxYearRule, _super);\n function MaxYearRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} should not contain year greater than {{maxYear}}';\n return _this;\n }\n MaxYearRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var maxYear, year;\n return __generator(this, function (_a) {\n maxYear = this.settings;\n year = /\\d{4}$/.exec(value);\n year = year ? year[0] : null;\n if (!(+maxYear) || !(+year)) {\n return [2 /*return*/, true];\n }\n return [2 /*return*/, +year <= +maxYear];\n });\n });\n };\n return MaxYearRule;\n}(Rule_1.Rule));\nexports.MaxYearRule = MaxYearRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/MaxYear.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Min.ts": -/*!************************************!*\ - !*** ./src/validator/rules/Min.ts ***! - \************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MinRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar lodash_1 = __webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\");\nvar MinRule = /** @class */ (function (_super) {\n __extends(MinRule, _super);\n function MinRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} cannot be less than {{settings.limit}}.';\n return _this;\n }\n MinRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var min, parsedValue;\n return __generator(this, function (_a) {\n min = parseFloat(this.settings.limit);\n parsedValue = parseFloat(value);\n if (lodash_1.isNaN(min) || lodash_1.isNaN(parsedValue)) {\n return [2 /*return*/, true];\n }\n return [2 /*return*/, parsedValue >= min];\n });\n });\n };\n return MinRule;\n}(Rule_1.Rule));\nexports.MinRule = MinRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Min.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/MinDate.ts": -/*!****************************************!*\ - !*** ./src/validator/rules/MinDate.ts ***! - \****************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\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.MinDateRule = void 0;\nvar utils_1 = __webpack_require__(/*! @formio/utils */ \"./src/utils/index.ts\");\nvar lodash_1 = __webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\");\nvar dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar MinDateRule = /** @class */ (function (_super) {\n __extends(MinDateRule, _super);\n function MinDateRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} should not contain date before {{settings.dateLimit}}';\n return _this;\n }\n MinDateRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var date, minDate;\n return __generator(this, function (_a) {\n if (!value) {\n return [2 /*return*/, true];\n }\n date = dayjs_1.default(value);\n minDate = utils_1.getDateSetting(this.settings.dateLimit);\n if (lodash_1.isNull(minDate)) {\n return [2 /*return*/, true];\n }\n else {\n minDate.setHours(0, 0, 0, 0);\n }\n return [2 /*return*/, date.isAfter(minDate) || date.isSame(minDate)];\n });\n });\n };\n return MinDateRule;\n}(Rule_1.Rule));\nexports.MinDateRule = MinDateRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/MinDate.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/MinLength.ts": -/*!******************************************!*\ - !*** ./src/validator/rules/MinLength.ts ***! - \******************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MinLengthRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar MinLengthRule = /** @class */ (function (_super) {\n __extends(MinLengthRule, _super);\n function MinLengthRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} must have no more than {{- settings.length}} characters.';\n return _this;\n }\n MinLengthRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var minLength;\n return __generator(this, function (_a) {\n minLength = parseInt(this.settings.length, 10);\n if (!minLength || !value || !value.hasOwnProperty('length') || this.component.isEmpty(value)) {\n return [2 /*return*/, true];\n }\n return [2 /*return*/, (value.length >= minLength)];\n });\n });\n };\n return MinLengthRule;\n}(Rule_1.Rule));\nexports.MinLengthRule = MinLengthRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/MinLength.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/MinWords.ts": -/*!*****************************************!*\ - !*** ./src/validator/rules/MinWords.ts ***! - \*****************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MinWordsRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar MinWordsRule = /** @class */ (function (_super) {\n __extends(MinWordsRule, _super);\n function MinWordsRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} must have at least {{- settings.length}} words.';\n return _this;\n }\n MinWordsRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var minWords;\n return __generator(this, function (_a) {\n minWords = parseInt(this.settings.length, 10);\n if (!minWords || !value || (typeof value !== 'string')) {\n return [2 /*return*/, true];\n }\n return [2 /*return*/, (value.trim().split(/\\s+/).length >= minWords)];\n });\n });\n };\n return MinWordsRule;\n}(Rule_1.Rule));\nexports.MinWordsRule = MinWordsRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/MinWords.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/MinYear.ts": -/*!****************************************!*\ - !*** ./src/validator/rules/MinYear.ts ***! - \****************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.MinYearRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar MinYearRule = /** @class */ (function (_super) {\n __extends(MinYearRule, _super);\n function MinYearRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} should not contain year less than {{minYear}}';\n return _this;\n }\n MinYearRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var minYear, year;\n return __generator(this, function (_a) {\n minYear = this.settings;\n year = /\\d{4}$/.exec(value);\n year = year ? year[0] : null;\n if (!year || !(+minYear) || !(+year)) {\n return [2 /*return*/, true];\n }\n return [2 /*return*/, +year >= +minYear];\n });\n });\n };\n return MinYearRule;\n}(Rule_1.Rule));\nexports.MinYearRule = MinYearRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/MinYear.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Pattern.ts": -/*!****************************************!*\ - !*** ./src/validator/rules/Pattern.ts ***! - \****************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.PatternRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar PatternRule = /** @class */ (function (_super) {\n __extends(PatternRule, _super);\n function PatternRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} does not match the pattern {{settings.pattern}}';\n return _this;\n }\n PatternRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var pattern;\n return __generator(this, function (_a) {\n pattern = this.settings.pattern;\n if (!pattern) {\n return [2 /*return*/, true];\n }\n return [2 /*return*/, (new RegExp(\"^\" + pattern + \"$\")).test(value)];\n });\n });\n };\n return PatternRule;\n}(Rule_1.Rule));\nexports.PatternRule = PatternRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Pattern.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Required.ts": -/*!*****************************************!*\ - !*** ./src/validator/rules/Required.ts ***! - \*****************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RequiredRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar RequiredRule = /** @class */ (function (_super) {\n __extends(RequiredRule, _super);\n function RequiredRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} is required';\n return _this;\n }\n RequiredRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (!this.settings.required || this.component.isValueRedacted()) {\n return [2 /*return*/, true];\n }\n return [2 /*return*/, !this.component.isEmpty(value)];\n });\n });\n };\n return RequiredRule;\n}(Rule_1.Rule));\nexports.RequiredRule = RequiredRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Required.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Rule.ts": -/*!*************************************!*\ - !*** ./src/validator/rules/Rule.ts ***! - \*************************************/ -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; -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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Rule = void 0;\nvar Rule = /** @class */ (function () {\n function Rule(component, settings, config) {\n this.component = component;\n this.settings = settings;\n this.config = config;\n }\n Rule.prototype.check = function (value, data, row) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, false];\n });\n });\n };\n return Rule;\n}());\nexports.Rule = Rule;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Rule.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Select.ts": -/*!***************************************!*\ - !*** ./src/validator/rules/Select.ts ***! - \***************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\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.SelectRule = void 0;\nvar utils_1 = __webpack_require__(/*! @formio/utils */ \"./src/utils/index.ts\");\nvar lodash_1 = __webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\");\nvar fetch_ponyfill_1 = __importDefault(__webpack_require__(/*! fetch-ponyfill */ \"./node_modules/fetch-ponyfill/build/fetch-browser.js\"));\nvar _a = fetch_ponyfill_1.default(), fetch = _a.fetch, Headers = _a.Headers, Request = _a.Request;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar SelectRule = /** @class */ (function (_super) {\n __extends(SelectRule, _super);\n function SelectRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} contains an invalid selection';\n return _this;\n }\n SelectRule.prototype.check = function (value, data, row, async) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var schema, requestOptions, query, resp, results;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // Skip if value is empty\n if (!value || lodash_1.isEmpty(value)) {\n return [2 /*return*/, true];\n }\n // Skip if we're not async-capable\n if (!async) {\n return [2 /*return*/, true];\n }\n schema = this.component.component;\n requestOptions = {\n url: this.settings.url,\n method: 'GET',\n qs: {},\n json: true,\n headers: {}\n };\n // If the url is a boolean value\n if (lodash_1.isBoolean(requestOptions.url)) {\n requestOptions.url = !!requestOptions.url;\n if (!requestOptions.url ||\n schema.dataSrc !== 'url' ||\n !schema.data.url ||\n !schema.searchField) {\n return [2 /*return*/, true];\n }\n // Get the validation url\n requestOptions.url = schema.data.url;\n // Add the search field\n requestOptions.qs[schema.searchField] = value;\n // Add the filters\n if (schema.filter) {\n requestOptions.url += (!requestOptions.url.includes('?') ? '?' : '&') + schema.filter;\n }\n // If they only wish to return certain fields.\n if (schema.selectFields) {\n requestOptions.qs.select = schema.selectFields;\n }\n }\n if (!requestOptions.url) {\n return [2 /*return*/, true];\n }\n // Make sure to interpolate.\n requestOptions.url = utils_1.Evaluator.interpolate(requestOptions.url, { data: this.component.data });\n query = [];\n lodash_1.each(requestOptions.qs, function (val, key) {\n query.push(encodeURIComponent(key) + \"=\" + encodeURIComponent(val));\n });\n requestOptions.url += (requestOptions.url.includes('?') ? '&' : '?') + query.join('&');\n // Set custom headers.\n if (schema.data && schema.data.headers) {\n lodash_1.each(schema.data.headers, function (header) {\n if (header.key) {\n requestOptions.headers[header.key] = header.value;\n }\n });\n }\n // Set form.io authentication.\n if (schema.authenticate && this.config.token) {\n requestOptions.headers['x-jwt-token'] = this.config.token;\n }\n return [4 /*yield*/, fetch(new Request(requestOptions.url, {\n headers: new Headers(requestOptions.headers)\n }))];\n case 1:\n resp = _a.sent();\n return [4 /*yield*/, resp.json()];\n case 2:\n results = _a.sent();\n return [2 /*return*/, results && results.length];\n }\n });\n });\n };\n return SelectRule;\n}(Rule_1.Rule));\nexports.SelectRule = SelectRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Select.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Time.ts": -/*!*************************************!*\ - !*** ./src/validator/rules/Time.ts ***! - \*************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\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.TimeRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nvar TimeRule = /** @class */ (function (_super) {\n __extends(TimeRule, _super);\n function TimeRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} must contain valid time';\n return _this;\n }\n TimeRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (this.component.isEmpty(value))\n return [2 /*return*/, true];\n return [2 /*return*/, dayjs_1.default(value, this.component.component.format).isValid()];\n });\n });\n };\n return TimeRule;\n}(Rule_1.Rule));\nexports.TimeRule = TimeRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Time.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Unique.ts": -/*!***************************************!*\ - !*** ./src/validator/rules/Unique.ts ***! - \***************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.UniqueRule = void 0;\nvar utils_1 = __webpack_require__(/*! @formio/utils */ \"./src/utils/index.ts\");\nvar lodash_1 = __webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\");\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar UniqueRule = /** @class */ (function (_super) {\n __extends(UniqueRule, _super);\n function UniqueRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} must be unique';\n return _this;\n }\n UniqueRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var form, submission, path, query, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // Skip if value is empty object or falsy\n if (!value || lodash_1.isObjectLike(value) && lodash_1.isEmpty(value)) {\n return [2 /*return*/, true];\n }\n // Skip if we don't have a database connection\n if (!this.config.db) {\n return [2 /*return*/, true];\n }\n form = this.config.form;\n submission = this.config.submission;\n path = \"data.\" + this.component.path;\n query = { form: form._id };\n if (lodash_1.isString(value)) {\n query[path] = {\n $regex: new RegExp(\"^\" + utils_1.escapeRegExCharacters(value) + \"$\"),\n $options: 'i'\n };\n }\n else if (lodash_1.isPlainObject(value) &&\n value.address &&\n value.address['address_components'] &&\n value.address['place_id']) {\n query[path + \".address.place_id\"] = {\n $regex: new RegExp(\"^\" + utils_1.escapeRegExCharacters(value.address['place_id']) + \"$\"),\n $options: 'i'\n };\n }\n // Compare the contents of arrays vs the order.\n else if (lodash_1.isArray(value)) {\n query[path] = { $all: value };\n }\n else if (lodash_1.isObject(value) || lodash_1.isNumber(value)) {\n query[path] = { $eq: value };\n }\n // Only search for non-deleted items\n query.deleted = { $eq: null };\n return [4 /*yield*/, this.config.db.findOne(query)];\n case 1:\n result = _a.sent();\n return [2 /*return*/, submission._id && (result._id.toString() === submission._id)];\n }\n });\n });\n };\n return UniqueRule;\n}(Rule_1.Rule));\nexports.UniqueRule = UniqueRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Unique.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/Url.ts": -/*!************************************!*\ - !*** ./src/validator/rules/Url.ts ***! - \************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\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 __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.UrlRule = void 0;\nvar Rule_1 = __webpack_require__(/*! ./Rule */ \"./src/validator/rules/Rule.ts\");\nvar UrlRule = /** @class */ (function (_super) {\n __extends(UrlRule, _super);\n function UrlRule() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.defaultMessage = '{{field}} must be a valid url.';\n return _this;\n }\n UrlRule.prototype.check = function (value) {\n if (value === void 0) { value = this.component.dataValue; }\n return __awaiter(this, void 0, void 0, function () {\n var re, emailRe;\n return __generator(this, function (_a) {\n re = /^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#]\\S*)?$/i;\n emailRe = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n /* eslint-enable max-len */\n // Allow urls to be valid if the component is pristine and no value is provided.\n return [2 /*return*/, !value || (re.test(value) && !emailRe.test(value))];\n });\n });\n };\n return UrlRule;\n}(Rule_1.Rule));\nexports.UrlRule = UrlRule;\n;\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/Url.ts?"); - -/***/ }), - -/***/ "./src/validator/rules/index.ts": -/*!**************************************!*\ - !*** ./src/validator/rules/index.ts ***! - \**************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar Custom_1 = __webpack_require__(/*! ./Custom */ \"./src/validator/rules/Custom.ts\");\nvar Date_1 = __webpack_require__(/*! ./Date */ \"./src/validator/rules/Date.ts\");\nvar Day_1 = __webpack_require__(/*! ./Day */ \"./src/validator/rules/Day.ts\");\nvar Email_1 = __webpack_require__(/*! ./Email */ \"./src/validator/rules/Email.ts\");\nvar Mask_1 = __webpack_require__(/*! ./Mask */ \"./src/validator/rules/Mask.ts\");\nvar Max_1 = __webpack_require__(/*! ./Max */ \"./src/validator/rules/Max.ts\");\nvar MaxDate_1 = __webpack_require__(/*! ./MaxDate */ \"./src/validator/rules/MaxDate.ts\");\nvar MaxLength_1 = __webpack_require__(/*! ./MaxLength */ \"./src/validator/rules/MaxLength.ts\");\nvar MaxWords_1 = __webpack_require__(/*! ./MaxWords */ \"./src/validator/rules/MaxWords.ts\");\nvar Min_1 = __webpack_require__(/*! ./Min */ \"./src/validator/rules/Min.ts\");\nvar MinDate_1 = __webpack_require__(/*! ./MinDate */ \"./src/validator/rules/MinDate.ts\");\nvar MinLength_1 = __webpack_require__(/*! ./MinLength */ \"./src/validator/rules/MinLength.ts\");\nvar MinWords_1 = __webpack_require__(/*! ./MinWords */ \"./src/validator/rules/MinWords.ts\");\nvar Pattern_1 = __webpack_require__(/*! ./Pattern */ \"./src/validator/rules/Pattern.ts\");\nvar Required_1 = __webpack_require__(/*! ./Required */ \"./src/validator/rules/Required.ts\");\nvar Select_1 = __webpack_require__(/*! ./Select */ \"./src/validator/rules/Select.ts\");\nvar Unique_1 = __webpack_require__(/*! ./Unique */ \"./src/validator/rules/Unique.ts\");\nvar Url_1 = __webpack_require__(/*! ./Url */ \"./src/validator/rules/Url.ts\");\nvar MinYear_1 = __webpack_require__(/*! ./MinYear */ \"./src/validator/rules/MinYear.ts\");\nvar MaxYear_1 = __webpack_require__(/*! ./MaxYear */ \"./src/validator/rules/MaxYear.ts\");\nvar Time_1 = __webpack_require__(/*! ./Time */ \"./src/validator/rules/Time.ts\");\nexports.default = {\n custom: Custom_1.CustomRule,\n date: Date_1.DateRule,\n day: Day_1.DayRule,\n email: Email_1.EmailRule,\n mask: Mask_1.MaskRule,\n max: Max_1.MaxRule,\n maxDate: MaxDate_1.MaxDateRule,\n maxLength: MaxLength_1.MaxLengthRule,\n maxWords: MaxWords_1.MaxWordsRule,\n min: Min_1.MinRule,\n minDate: MinDate_1.MinDateRule,\n minLength: MinLength_1.MinLengthRule,\n minWords: MinWords_1.MinWordsRule,\n pattern: Pattern_1.PatternRule,\n required: Required_1.RequiredRule,\n select: Select_1.SelectRule,\n unique: Unique_1.UniqueRule,\n url: Url_1.UrlRule,\n minYear: MinYear_1.MinYearRule,\n maxYear: MaxYear_1.MaxYearRule,\n time: Time_1.TimeRule,\n};\n\n\n//# sourceURL=webpack://Formio/./src/validator/rules/index.ts?"); - -/***/ }), - -/***/ "./src/components/templates/bootstrap/datatable/html.ejs.js": -/*!******************************************************************!*\ - !*** ./src/components/templates/bootstrap/datatable/html.ejs.js ***! - \******************************************************************/ -/***/ (function(__unused_webpack_module, exports) { - -eval("Object.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default=function(ctx) {\nvar __t, __p = '', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n__p += '\\n \\n \\n ';\n ctx.component.components.forEach(function(comp) { ;\n__p += '\\n \\n ';\n }); ;\n__p += '\\n \\n \\n \\n ';\n ctx.instance.rows.forEach(function(row) { ;\n__p += '\\n \\n ';\n row.forEach(function(rowComp) { ;\n__p += '\\n \\n ';\n }); ;\n__p += '\\n \\n ';\n }); ;\n__p += '\\n \\n
' +\n((__t = ( comp.label || comp.key )) == null ? '' : __t) +\n'
' +\n((__t = ( rowComp.dataValue )) == null ? '' : __t) +\n'
';\nreturn __p\n}\n\n//# sourceURL=webpack://Formio/./src/components/templates/bootstrap/datatable/html.ejs.js?"); - -/***/ }), - -/***/ "./src/modules/jsonlogic/operators/operators.js": -/*!******************************************************!*\ - !*** ./src/modules/jsonlogic/operators/operators.js ***! - \******************************************************/ -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"lodashOperators\": function() { return /* binding */ lodashOperators; }\n/* harmony export */ });\n// Use only immutable useful functions from Lodash.\n// Visit https://lodash.com/docs for more info.\nconst 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/./src/modules/jsonlogic/operators/operators.js?"); - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ !function() { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = function(exports, definition) { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/global */ -/******/ !function() { -/******/ __webpack_require__.g = (function() { -/******/ if (typeof globalThis === 'object') return globalThis; -/******/ try { -/******/ return this || new Function('return this')(); -/******/ } catch (e) { -/******/ if (typeof window === 'object') return window; -/******/ } -/******/ })(); -/******/ }(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ !function() { -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -/******/ }(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ !function() { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ }(); -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module is referenced by other modules so it can't be inlined -/******/ var __webpack_exports__ = __webpack_require__("./src/index.ts"); -/******/ -/******/ return __webpack_exports__; -/******/ })() -; -}); \ No newline at end of file diff --git a/docs/classes/base_components.components.html b/docs/classes/base_components.components.html index fae6c824..606625e4 100644 --- a/docs/classes/base_components.components.html +++ b/docs/classes/base_components.components.html @@ -139,7 +139,7 @@

Static components

components: any = {}
@@ -154,7 +154,7 @@

Static decorators

decorators: any = {}
@@ -171,7 +171,7 @@

Static addComponent

  • @@ -205,7 +205,7 @@

    Static addDecorator

  • @@ -238,7 +238,7 @@

    Static component

  • @@ -269,7 +269,7 @@

    Static create

  • @@ -318,7 +318,7 @@

    Static importComponent

  • @@ -346,7 +346,7 @@

    Static setComponents

  • diff --git a/docs/classes/base_template.template.html b/docs/classes/base_template.template.html index 32950d60..9991bf33 100644 --- a/docs/classes/base_template.template.html +++ b/docs/classes/base_template.template.html @@ -146,7 +146,7 @@

    Static _current

    _current: any = {}
    @@ -156,7 +156,7 @@

    Static _framework

    _framework: string = 'bootstrap'
    @@ -166,7 +166,7 @@

    Static templates

    templates: any = []
    @@ -184,7 +184,7 @@

    Static current

  • @@ -197,7 +197,7 @@

    Returns any
    @@ -226,7 +226,7 @@

    Static framework

  • @@ -239,7 +239,7 @@

    Returns string
    @@ -270,7 +270,7 @@

    Static addTemplate

  • @@ -303,7 +303,7 @@

    Static addTemplates

  • @@ -333,7 +333,7 @@

    Static extendTemplate

  • @@ -366,7 +366,7 @@

    Static render

  • @@ -403,7 +403,7 @@

    Static setTemplate

  • diff --git a/docs/classes/components_datatable_datatable.datatable.html b/docs/classes/components_datatable_datatable.datatable.html index 9fa10658..f6c941ef 100644 --- a/docs/classes/components_datatable_datatable.datatable.html +++ b/docs/classes/components_datatable_datatable.datatable.html @@ -137,7 +137,7 @@

    constructor

  • Parameters

    @@ -193,7 +193,7 @@

    renderClasses

  • Returns string

    @@ -210,7 +210,7 @@

    renderContext

  • Parameters

    diff --git a/docs/classes/components_datatable_datatable.datatablecomponent.html b/docs/classes/components_datatable_datatable.datatablecomponent.html index 32492bb5..7f83d1b7 100644 --- a/docs/classes/components_datatable_datatable.datatablecomponent.html +++ b/docs/classes/components_datatable_datatable.datatablecomponent.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -182,7 +182,7 @@

    renderClasses

    Returns string

    @@ -200,7 +200,7 @@

    renderContext

    Parameters

    diff --git a/docs/classes/components_datavalue_datavalue.datavaluecomponent.html b/docs/classes/components_datavalue_datavalue.datavaluecomponent.html index 83c7238a..9ad191e9 100644 --- a/docs/classes/components_datavalue_datavalue.datavaluecomponent.html +++ b/docs/classes/components_datavalue_datavalue.datavaluecomponent.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -182,7 +182,7 @@

    getAttributes

    Returns string

    @@ -200,7 +200,7 @@

    renderContext

    Parameters

    diff --git a/docs/classes/components_html_html.html.html b/docs/classes/components_html_html.html.html index 838b846f..d1071d4d 100644 --- a/docs/classes/components_html_html.html.html +++ b/docs/classes/components_html_html.html.html @@ -146,7 +146,7 @@

    constructor

  • Parameters

    @@ -202,7 +202,7 @@

    getAttributes

  • Returns string

    @@ -219,7 +219,7 @@

    renderContext

  • Parameters

    diff --git a/docs/classes/components_html_html.htmlcomponent.html b/docs/classes/components_html_html.htmlcomponent.html index 405dd041..8d74da54 100644 --- a/docs/classes/components_html_html.htmlcomponent.html +++ b/docs/classes/components_html_html.htmlcomponent.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -182,7 +182,7 @@

    getAttributes

    Returns string

    @@ -200,7 +200,7 @@

    renderContext

    Parameters

    diff --git a/docs/classes/components_htmlcontainer_htmlcontainer.htmlcontainer.html b/docs/classes/components_htmlcontainer_htmlcontainer.htmlcontainer.html index 99a3a058..88a6a25b 100644 --- a/docs/classes/components_htmlcontainer_htmlcontainer.htmlcontainer.html +++ b/docs/classes/components_htmlcontainer_htmlcontainer.htmlcontainer.html @@ -134,7 +134,7 @@

    constructor

    Parameters

    @@ -194,7 +194,7 @@

    getAttributes

    Returns string

    @@ -212,7 +212,7 @@

    renderContext

    Parameters

    diff --git a/docs/classes/components_htmlcontainer_htmlcontainer.htmlcontainercomponent.html b/docs/classes/components_htmlcontainer_htmlcontainer.htmlcontainercomponent.html index 9ed637d0..cd9853c3 100644 --- a/docs/classes/components_htmlcontainer_htmlcontainer.htmlcontainercomponent.html +++ b/docs/classes/components_htmlcontainer_htmlcontainer.htmlcontainercomponent.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -182,7 +182,7 @@

    getAttributes

    Returns string

    @@ -200,7 +200,7 @@

    renderContext

    Parameters

    diff --git a/docs/classes/components_input_input.input.html b/docs/classes/components_input_input.input.html index 46a9cef8..266e4448 100644 --- a/docs/classes/components_input_input.input.html +++ b/docs/classes/components_input_input.input.html @@ -139,7 +139,7 @@

    constructor

    Parameters

    @@ -183,7 +183,7 @@

    element

    element: any
    @@ -208,7 +208,7 @@

    attach

  • Parameters

    @@ -231,7 +231,7 @@

    detach

  • Returns void

    @@ -249,7 +249,7 @@

    getAttributes

    Returns string

    @@ -266,7 +266,7 @@

    onInput

  • Returns void

    @@ -284,7 +284,7 @@

    renderContext

    Parameters

    @@ -307,7 +307,7 @@

    setValue

  • Parameters

    diff --git a/docs/classes/components_input_input.inputcomponent.html b/docs/classes/components_input_input.inputcomponent.html index cae6aab0..edf4fdff 100644 --- a/docs/classes/components_input_input.inputcomponent.html +++ b/docs/classes/components_input_input.inputcomponent.html @@ -127,7 +127,7 @@

    constructor

    Parameters

    @@ -172,7 +172,7 @@

    element

    @@ -198,7 +198,7 @@

    attach

    Parameters

    @@ -222,7 +222,7 @@

    detach

    Returns void

    @@ -240,7 +240,7 @@

    getAttributes

    Returns string

    @@ -258,7 +258,7 @@

    onInput

    Returns void

    @@ -276,7 +276,7 @@

    renderContext

    Parameters

    @@ -300,7 +300,7 @@

    setValue

    Parameters

    diff --git a/docs/classes/modules_jsonlogic.jsonlogicevaluator.html b/docs/classes/modules_jsonlogic.jsonlogicevaluator.html index b14aa7e3..577a0b79 100644 --- a/docs/classes/modules_jsonlogic.jsonlogicevaluator.html +++ b/docs/classes/modules_jsonlogic.jsonlogicevaluator.html @@ -137,7 +137,7 @@

    Static noeval

    @@ -155,7 +155,7 @@

    Static evaluate

    Parameters

    @@ -191,7 +191,7 @@

    Static evaluator

    Parameters

    @@ -218,7 +218,7 @@

    Static execute

    @@ -253,7 +253,7 @@

    Static interpolate

    Parameters

    @@ -280,7 +280,7 @@

    Static interpolateString

    Inherited from BaseEvaluator.interpolateString

    Parameters

    diff --git a/docs/classes/sdk_formio.formio.html b/docs/classes/sdk_formio.formio.html index dfc23b0d..863dbadf 100644 --- a/docs/classes/sdk_formio.formio.html +++ b/docs/classes/sdk_formio.formio.html @@ -256,7 +256,7 @@

    constructor

  • Parameters

    @@ -287,7 +287,7 @@

    actionId

    actionId: string = ''
    @@ -302,7 +302,7 @@

    actionUrl

    actionUrl: string = ''
    @@ -317,7 +317,7 @@

    actionsUrl

    actionsUrl: string = ''
    @@ -337,7 +337,7 @@

    base

    base: string = ''
    @@ -352,7 +352,7 @@

    formId

    formId: string = ''
    @@ -367,7 +367,7 @@

    formUrl

    formUrl: string = ''
    @@ -387,7 +387,7 @@

    formsUrl

    formsUrl: string = ''
    @@ -407,7 +407,7 @@

    noProject

    noProject: boolean = false
    @@ -436,7 +436,7 @@

    Optional pathType

    pathType: FormioPathType
    @@ -451,7 +451,7 @@

    projectId

    projectId: string = ''
    @@ -466,7 +466,7 @@

    projectUrl

    projectUrl: string = ''
    @@ -486,7 +486,7 @@

    projectsUrl

    projectsUrl: string = ''
    @@ -506,7 +506,7 @@

    query

    query: string = ''
    @@ -521,7 +521,7 @@

    roleId

    roleId: string = ''
    @@ -536,7 +536,7 @@

    roleUrl

    roleUrl: string = ''
    @@ -556,7 +556,7 @@

    rolesUrl

    rolesUrl: string = ''
    @@ -576,7 +576,7 @@

    submissionId

    submissionId: string = ''
    @@ -591,7 +591,7 @@

    submissionUrl

    submissionUrl: string = ''
    @@ -611,7 +611,7 @@

    submissionsUrl

    submissionsUrl: string = ''
    @@ -631,7 +631,7 @@

    vId

    vId: string = ''
    @@ -641,7 +641,7 @@

    vUrl

    vUrl: string = ''
    @@ -651,7 +651,7 @@

    vsUrl

    vsUrl: string = ''
    @@ -661,7 +661,7 @@

    Static Headers

    Headers: any = ...
    @@ -676,7 +676,7 @@

    Static authUrl

    authUrl: string = ''
    @@ -691,7 +691,7 @@

    Static baseUrl

    baseUrl: string = 'https://api.form.io'
    @@ -706,7 +706,7 @@

    Static cache

    cache: any = {}
    @@ -721,7 +721,7 @@

    Static deregisterPlugin

    deregisterPlugin: (plugin: string | Plugin) => boolean = ...
    @@ -760,7 +760,7 @@

    Static events

    events: EventEmitterBase<string | symbol, any> = ...
    @@ -775,7 +775,7 @@

    Static fetch

    fetch: any = ...
    @@ -790,7 +790,7 @@

    Static getPlugin

    getPlugin: (name: string) => null | Plugin = ...
    @@ -829,7 +829,7 @@

    Static libraries

    libraries: any = {}
    @@ -844,7 +844,7 @@

    Static namespace

    namespace: string = ''
    @@ -859,7 +859,7 @@

    Static pathType: FormioPathType

    @@ -874,7 +874,7 @@

    Static pluginAlter

    pluginAlter: (pluginFn: any, value: any, ...args: any[]) => any = ...
    @@ -918,7 +918,7 @@

    Static pluginGet

    pluginGet: (pluginFn: any, ...args: any[]) => any = ...
    @@ -959,7 +959,7 @@

    Static pluginWait

    pluginWait: (pluginFn: any, ...args: any[]) => Promise<any[]> = ...
    @@ -1003,7 +1003,7 @@

    Static plugins

    plugins: Plugin[] = ...
    @@ -1013,7 +1013,7 @@

    Static projectUrl

    projectUrl: string = ''
    @@ -1028,7 +1028,7 @@

    Static projectUrlSetprojectUrlSet: boolean = false

    @@ -1043,7 +1043,7 @@

    Static registerPlugin

    registerPlugin: (plugin: Plugin, name: string) => void = ...
    @@ -1088,7 +1088,7 @@

    Static tokens

    tokens: any = {}
    @@ -1103,7 +1103,7 @@

    Static version

    version: string = '---VERSION---'
    @@ -1126,7 +1126,7 @@

    Static token

  • Returns any

    @@ -1134,7 +1134,7 @@

    Returns any

    Parameters

    @@ -1160,7 +1160,7 @@

    accessInfo

  • @@ -1182,7 +1182,7 @@

    actionInfo

  • @@ -1218,7 +1218,7 @@

    availableActions

  • @@ -1240,7 +1240,7 @@

    canSubmit

  • @@ -1262,7 +1262,7 @@

    currentUser

  • @@ -1293,7 +1293,7 @@

    delete

  • @@ -1327,7 +1327,7 @@

    deleteAction

  • @@ -1360,7 +1360,7 @@

    deleteForm

  • @@ -1393,7 +1393,7 @@

    deleteProject

  • @@ -1424,7 +1424,7 @@

    deleteRole

  • @@ -1452,7 +1452,7 @@

    deleteSubmission

  • @@ -1480,7 +1480,7 @@

    getDownloadUrl

  • @@ -1517,7 +1517,7 @@

    getFormId

  • @@ -1544,7 +1544,7 @@

    getProjectId

  • @@ -1571,7 +1571,7 @@

    getTempToken

  • @@ -1614,7 +1614,7 @@

    getToken

  • @@ -1648,7 +1648,7 @@

    getUrlParts

  • Parameters

    @@ -1671,7 +1671,7 @@

    index

  • @@ -1711,7 +1711,7 @@

    isObjectId

  • @@ -1745,7 +1745,7 @@

    load

  • @@ -1787,7 +1787,7 @@

    loadAction

  • @@ -1826,7 +1826,7 @@

    loadActions

  • @@ -1865,7 +1865,7 @@

    loadForm

  • @@ -1904,7 +1904,7 @@

    loadForms

  • @@ -1943,7 +1943,7 @@

    loadProject

  • @@ -1984,7 +1984,7 @@

    loadRole

  • @@ -2017,7 +2017,7 @@

    loadRoles

  • @@ -2050,7 +2050,7 @@

    loadSubmission

  • @@ -2089,7 +2089,7 @@

    loadSubmissions

  • @@ -2134,7 +2134,7 @@

    makeRequest

  • @@ -2188,7 +2188,7 @@

    save

  • @@ -2229,7 +2229,7 @@

    saveAction

  • @@ -2296,7 +2296,7 @@

    saveForm

  • @@ -2364,7 +2364,7 @@

    saveProject

  • @@ -2419,7 +2419,7 @@

    saveRole

  • @@ -2472,7 +2472,7 @@

    saveSubmission

  • @@ -2531,7 +2531,7 @@

    setToken

  • @@ -2571,7 +2571,7 @@

    userPermissions

  • @@ -2614,7 +2614,7 @@

    Static accessInfo

  • @@ -2652,7 +2652,7 @@

    Static clearCache

  • @@ -2693,7 +2693,7 @@

    Static cloneResponse

  • @@ -2723,7 +2723,7 @@

    Static currentUser

  • @@ -2761,7 +2761,7 @@

    Static getApiUrl

  • Returns string

    @@ -2778,7 +2778,7 @@

    Static getAppUrl

  • Returns string

    @@ -2795,7 +2795,7 @@

    Static getBaseUrl

  • @@ -2820,7 +2820,7 @@

    Static getPathType

    @@ -2842,7 +2842,7 @@

    Static getProjectUrl
    @@ -2867,7 +2867,7 @@

    Static getRequestArgs<
  • Parameters

    @@ -2905,7 +2905,7 @@

    Static getToken

  • @@ -2936,7 +2936,7 @@

    Static getUrlParts

    Parameters

    @@ -2962,7 +2962,7 @@

    Static getUser

  • @@ -2996,7 +2996,7 @@

    Static libraryReady

  • @@ -3041,7 +3041,7 @@

    Static loadProjects

  • @@ -3079,7 +3079,7 @@

    Static logout

  • @@ -3117,7 +3117,7 @@

    Static makeRequest

  • @@ -3176,7 +3176,7 @@

    Static makeStaticReque
  • Parameters

    @@ -3208,7 +3208,7 @@

    Static oAuthCurrent
    @@ -3246,7 +3246,7 @@

    Static oktaInit

  • @@ -3288,7 +3288,7 @@

    Static pageQuery

  • @@ -3326,7 +3326,7 @@

    Static projectRoles

  • @@ -3357,7 +3357,7 @@

    Static request

  • @@ -3413,7 +3413,7 @@

    Static requireLibrary

  • @@ -3480,7 +3480,7 @@

    Static samlInit

  • @@ -3537,7 +3537,7 @@

    Static serialize

  • Parameters

    @@ -3563,7 +3563,7 @@

    Static setApiUrl

  • Parameters

    @@ -3586,7 +3586,7 @@

    Static setAppUrl

  • Parameters

    @@ -3609,7 +3609,7 @@

    Static setAuthUrl

  • @@ -3641,7 +3641,7 @@

    Static setBaseUrl

  • @@ -3692,7 +3692,7 @@

    Static setPathType

    @@ -3722,7 +3722,7 @@

    Static setProjectUrl
    @@ -3754,7 +3754,7 @@

    Static setToken

  • @@ -3788,7 +3788,7 @@

    Static setUser

  • @@ -3822,7 +3822,7 @@

    Static ssoInit

  • diff --git a/docs/classes/sdk_plugins.default.html b/docs/classes/sdk_plugins.default.html index 73ded5ed..b4173ba9 100644 --- a/docs/classes/sdk_plugins.default.html +++ b/docs/classes/sdk_plugins.default.html @@ -140,7 +140,7 @@

    Static Formio

    Formio: any
    @@ -155,7 +155,7 @@

    Static plugins

    plugins: Plugin[] = []
    @@ -177,7 +177,7 @@

    Static deregisterPlugin

    @@ -208,7 +208,7 @@

    Static getPlugin

  • @@ -239,7 +239,7 @@

    Static identity

  • @@ -269,7 +269,7 @@

    Static pluginAlter

  • @@ -305,7 +305,7 @@

    Static pluginGet

  • @@ -338,7 +338,7 @@

    Static pluginWait

  • @@ -374,7 +374,7 @@

    Static registerPlugin

  • diff --git a/docs/classes/utils_evaluator.baseevaluator.html b/docs/classes/utils_evaluator.baseevaluator.html index 4fab00c0..232aa18f 100644 --- a/docs/classes/utils_evaluator.baseevaluator.html +++ b/docs/classes/utils_evaluator.baseevaluator.html @@ -139,7 +139,7 @@

    Static noeval

    noeval: boolean = false
    @@ -149,7 +149,7 @@

    Static templateSettings: { interpolate: RegExp } = ...

    @@ -174,7 +174,7 @@

    Static evaluate

  • @@ -214,7 +214,7 @@

    Static evaluator

  • Parameters

    @@ -240,7 +240,7 @@

    Static execute

  • @@ -274,7 +274,7 @@

    Static interpolate

  • Parameters

    @@ -300,7 +300,7 @@

    Static interpolateString

    Parameters

    diff --git a/docs/classes/utils_evaluator.evaluator.html b/docs/classes/utils_evaluator.evaluator.html index 4b75db2c..dd78f5a5 100644 --- a/docs/classes/utils_evaluator.evaluator.html +++ b/docs/classes/utils_evaluator.evaluator.html @@ -138,7 +138,7 @@

    Static noeval

    @@ -156,7 +156,7 @@

    Static evaluate

    @@ -197,7 +197,7 @@

    Static evaluator

    Parameters

    @@ -224,7 +224,7 @@

    Static execute

    @@ -259,7 +259,7 @@

    Static interpolate

    Parameters

    @@ -286,7 +286,7 @@

    Static interpolateString

    Inherited from BaseEvaluator.interpolateString

    Parameters

    @@ -312,7 +312,7 @@

    Static registerEvaluator
    diff --git a/docs/classes/validator.validator-1.html b/docs/classes/validator.validator-1.html index d41a312c..2a852654 100644 --- a/docs/classes/validator.validator-1.html +++ b/docs/classes/validator.validator-1.html @@ -126,7 +126,7 @@

    Static rules

    rules: any = ...
    @@ -143,7 +143,7 @@

    Static addRules

  • Parameters

    diff --git a/docs/classes/validator_rules_custom.customrule.html b/docs/classes/validator_rules_custom.customrule.html index 6b1191bb..1ca86495 100644 --- a/docs/classes/validator_rules_custom.customrule.html +++ b/docs/classes/validator_rules_custom.customrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{error}}'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_date.daterule.html b/docs/classes/validator_rules_date.daterule.html index da0388f2..5c1418cb 100644 --- a/docs/classes/validator_rules_date.daterule.html +++ b/docs/classes/validator_rules_date.daterule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} is not a valid date.'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_day.dayrule.html b/docs/classes/validator_rules_day.dayrule.html index 4c9cdd9d..ad424dfb 100644 --- a/docs/classes/validator_rules_day.dayrule.html +++ b/docs/classes/validator_rules_day.dayrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} is not a valid day.'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_email.emailrule.html b/docs/classes/validator_rules_email.emailrule.html index 2f86f9b9..3ddd8d06 100644 --- a/docs/classes/validator_rules_email.emailrule.html +++ b/docs/classes/validator_rules_email.emailrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} must be a valid email.'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_mask.maskrule.html b/docs/classes/validator_rules_mask.maskrule.html index 62ec5753..0d95e8ef 100644 --- a/docs/classes/validator_rules_mask.maskrule.html +++ b/docs/classes/validator_rules_mask.maskrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} does not match the mask.'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_max.maxrule.html b/docs/classes/validator_rules_max.maxrule.html index 9eb1eb1b..be9db272 100644 --- a/docs/classes/validator_rules_max.maxrule.html +++ b/docs/classes/validator_rules_max.maxrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} cannot be greater than {{settings.limit}}.'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_maxdate.maxdaterule.html b/docs/classes/validator_rules_maxdate.maxdaterule.html index 28eee7cb..8b9ce39f 100644 --- a/docs/classes/validator_rules_maxdate.maxdaterule.html +++ b/docs/classes/validator_rules_maxdate.maxdaterule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} should not contain date after {{settings.dateLimit}}'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_maxlength.maxlengthrule.html b/docs/classes/validator_rules_maxlength.maxlengthrule.html index 17992ef2..359dcde1 100644 --- a/docs/classes/validator_rules_maxlength.maxlengthrule.html +++ b/docs/classes/validator_rules_maxlength.maxlengthrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} must have no more than {{- settings.length}} characters.'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_maxwords.maxwordsrule.html b/docs/classes/validator_rules_maxwords.maxwordsrule.html index a3c14b8e..e146ddaa 100644 --- a/docs/classes/validator_rules_maxwords.maxwordsrule.html +++ b/docs/classes/validator_rules_maxwords.maxwordsrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} must have no more than {{- settings.length}} words.'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_maxyear.maxyearrule.html b/docs/classes/validator_rules_maxyear.maxyearrule.html index 91fc99d3..725d013c 100644 --- a/docs/classes/validator_rules_maxyear.maxyearrule.html +++ b/docs/classes/validator_rules_maxyear.maxyearrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} should not contain year greater than {{maxYear}}'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_min.minrule.html b/docs/classes/validator_rules_min.minrule.html index 75bd451c..33a173bf 100644 --- a/docs/classes/validator_rules_min.minrule.html +++ b/docs/classes/validator_rules_min.minrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} cannot be less than {{settings.limit}}.'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_mindate.mindaterule.html b/docs/classes/validator_rules_mindate.mindaterule.html index e12197f2..b4e46a43 100644 --- a/docs/classes/validator_rules_mindate.mindaterule.html +++ b/docs/classes/validator_rules_mindate.mindaterule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} should not contain date before {{settings.dateLimit}}'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_minlength.minlengthrule.html b/docs/classes/validator_rules_minlength.minlengthrule.html index 6f090944..1b4c8d5a 100644 --- a/docs/classes/validator_rules_minlength.minlengthrule.html +++ b/docs/classes/validator_rules_minlength.minlengthrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} must have no more than {{- settings.length}} characters.'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_minwords.minwordsrule.html b/docs/classes/validator_rules_minwords.minwordsrule.html index 628e86ce..d6be28df 100644 --- a/docs/classes/validator_rules_minwords.minwordsrule.html +++ b/docs/classes/validator_rules_minwords.minwordsrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} must have at least {{- settings.length}} words.'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_minyear.minyearrule.html b/docs/classes/validator_rules_minyear.minyearrule.html index 08b92822..b0e17478 100644 --- a/docs/classes/validator_rules_minyear.minyearrule.html +++ b/docs/classes/validator_rules_minyear.minyearrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} should not contain year less than {{minYear}}'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_pattern.patternrule.html b/docs/classes/validator_rules_pattern.patternrule.html index 0430c572..4f51fe5c 100644 --- a/docs/classes/validator_rules_pattern.patternrule.html +++ b/docs/classes/validator_rules_pattern.patternrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} does not match the pattern {{settings.pattern}}'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_required.requiredrule.html b/docs/classes/validator_rules_required.requiredrule.html index 2b246854..ca4953e6 100644 --- a/docs/classes/validator_rules_required.requiredrule.html +++ b/docs/classes/validator_rules_required.requiredrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} is required'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_rule.rule.html b/docs/classes/validator_rules_rule.rule.html index 52f327c0..eae6bb7c 100644 --- a/docs/classes/validator_rules_rule.rule.html +++ b/docs/classes/validator_rules_rule.rule.html @@ -180,7 +180,7 @@

    constructor

  • Parameters

    @@ -236,7 +236,7 @@

    check

  • Parameters

    diff --git a/docs/classes/validator_rules_select.selectrule.html b/docs/classes/validator_rules_select.selectrule.html index f4acac0e..fa0f929a 100644 --- a/docs/classes/validator_rules_select.selectrule.html +++ b/docs/classes/validator_rules_select.selectrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} contains an invalid selection'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_time.timerule.html b/docs/classes/validator_rules_time.timerule.html index dbe4756d..ad2ec023 100644 --- a/docs/classes/validator_rules_time.timerule.html +++ b/docs/classes/validator_rules_time.timerule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} must contain valid time'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_unique.uniquerule.html b/docs/classes/validator_rules_unique.uniquerule.html index ab0d42c2..e3ff0b72 100644 --- a/docs/classes/validator_rules_unique.uniquerule.html +++ b/docs/classes/validator_rules_unique.uniquerule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} must be unique'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/classes/validator_rules_url.urlrule.html b/docs/classes/validator_rules_url.urlrule.html index b76cb6d0..a9b4a8f9 100644 --- a/docs/classes/validator_rules_url.urlrule.html +++ b/docs/classes/validator_rules_url.urlrule.html @@ -122,7 +122,7 @@

    constructor

    Parameters

    @@ -166,7 +166,7 @@

    defaultMessage

    defaultMessage: string = '{{field}} must be a valid url.'
    @@ -192,7 +192,7 @@

    check

    Parameters

    diff --git a/docs/enums/sdk_formio.formiopathtype.html b/docs/enums/sdk_formio.formiopathtype.html index 3df4fe35..9ef74231 100644 --- a/docs/enums/sdk_formio.formiopathtype.html +++ b/docs/enums/sdk_formio.formiopathtype.html @@ -97,7 +97,7 @@

    Subdirectories

    Subdirectories: = "Subdirectories"
    @@ -107,7 +107,7 @@

    Subdomains

    Subdomains: = "Subdomains"
    diff --git a/docs/interfaces/base_component_component.componentinterface.html b/docs/interfaces/base_component_component.componentinterface.html index 2f28ad96..43e428af 100644 --- a/docs/interfaces/base_component_component.componentinterface.html +++ b/docs/interfaces/base_component_component.componentinterface.html @@ -101,7 +101,7 @@

    constructor

  • Parameters

    diff --git a/docs/interfaces/base_component_component.componentoptions.html b/docs/interfaces/base_component_component.componentoptions.html index b127fd73..bfc612e3 100644 --- a/docs/interfaces/base_component_component.componentoptions.html +++ b/docs/interfaces/base_component_component.componentoptions.html @@ -109,7 +109,7 @@

    Optional hooks

    hooks: any
    @@ -119,7 +119,7 @@

    Optional i18n

    i18n: any
    @@ -129,7 +129,7 @@

    Optional language

    language: string
    @@ -139,7 +139,7 @@

    Optional namespace

    namespace: string
    @@ -149,7 +149,7 @@

    Optional noInit

    noInit: boolean
    @@ -159,7 +159,7 @@

    Optional template

    template: string
    diff --git a/docs/interfaces/base_component_component.componentschema.html b/docs/interfaces/base_component_component.componentschema.html index 6353cb75..761b9984 100644 --- a/docs/interfaces/base_component_component.componentschema.html +++ b/docs/interfaces/base_component_component.componentschema.html @@ -111,7 +111,7 @@

    key

    key: string
    @@ -121,7 +121,7 @@

    Optional label

    label: string
    @@ -131,7 +131,7 @@

    type

    type: string
    diff --git a/docs/interfaces/base_nested_nestedcomponent.nestedcomponentschema.html b/docs/interfaces/base_nested_nestedcomponent.nestedcomponentschema.html index e22d00b5..be16b0d0 100644 --- a/docs/interfaces/base_nested_nestedcomponent.nestedcomponentschema.html +++ b/docs/interfaces/base_nested_nestedcomponent.nestedcomponentschema.html @@ -105,7 +105,7 @@

    components

    components: any[]
    @@ -116,7 +116,7 @@

    key

    @@ -127,7 +127,7 @@

    Optional label

    @@ -138,7 +138,7 @@

    type

    diff --git a/docs/interfaces/model_eventemitter.modelinterface.html b/docs/interfaces/model_eventemitter.modelinterface.html index 12b5da18..8cbd0e0b 100644 --- a/docs/interfaces/model_eventemitter.modelinterface.html +++ b/docs/interfaces/model_eventemitter.modelinterface.html @@ -109,7 +109,7 @@

    constructor

  • Parameters

    @@ -137,7 +137,7 @@

    Optional component

    component: any
    @@ -147,7 +147,7 @@

    Optional data

    data: any
    @@ -157,7 +157,7 @@

    Optional options

    options: any
    diff --git a/docs/interfaces/model_model.modeldecoratorinterface.html b/docs/interfaces/model_model.modeldecoratorinterface.html index 4aceaea8..0ae66383 100644 --- a/docs/interfaces/model_model.modeldecoratorinterface.html +++ b/docs/interfaces/model_model.modeldecoratorinterface.html @@ -85,7 +85,7 @@

    Callable

  • Parameters

    diff --git a/docs/interfaces/sdk_formio.formiooptions.html b/docs/interfaces/sdk_formio.formiooptions.html index 13d1543c..5835f0c8 100644 --- a/docs/interfaces/sdk_formio.formiooptions.html +++ b/docs/interfaces/sdk_formio.formiooptions.html @@ -105,7 +105,7 @@

    Optional base

    base: string
    @@ -120,7 +120,7 @@

    Optional project

    project: string
    diff --git a/docs/interfaces/sdk_plugins.plugin.html b/docs/interfaces/sdk_plugins.plugin.html index 302f9751..c3986759 100644 --- a/docs/interfaces/sdk_plugins.plugin.html +++ b/docs/interfaces/sdk_plugins.plugin.html @@ -107,7 +107,7 @@

    __name

    __name: string
    @@ -122,7 +122,7 @@

    deregister

    @@ -137,7 +137,7 @@

    init

    @@ -152,7 +152,7 @@

    priority

    priority: number
    diff --git a/docs/interfaces/sdk_plugins.pluginderegisterfunction.html b/docs/interfaces/sdk_plugins.pluginderegisterfunction.html index 8629aa11..f4fd1551 100644 --- a/docs/interfaces/sdk_plugins.pluginderegisterfunction.html +++ b/docs/interfaces/sdk_plugins.pluginderegisterfunction.html @@ -92,7 +92,7 @@

    Callable

  • diff --git a/docs/interfaces/sdk_plugins.plugininitfunction.html b/docs/interfaces/sdk_plugins.plugininitfunction.html index 341f2e95..1e069527 100644 --- a/docs/interfaces/sdk_plugins.plugininitfunction.html +++ b/docs/interfaces/sdk_plugins.plugininitfunction.html @@ -92,7 +92,7 @@

    Callable

  • diff --git a/docs/modules/base_array_arraycomponent.html b/docs/modules/base_array_arraycomponent.html index 9f0d4283..6d43dc51 100644 --- a/docs/modules/base_array_arraycomponent.html +++ b/docs/modules/base_array_arraycomponent.html @@ -90,7 +90,7 @@

    ArrayComponent

  • diff --git a/docs/modules/base_component_component.html b/docs/modules/base_component_component.html index e29a1460..fb50da57 100644 --- a/docs/modules/base_component_component.html +++ b/docs/modules/base_component_component.html @@ -98,7 +98,7 @@

    Component

  • Parameters

    diff --git a/docs/modules/base_components.html b/docs/modules/base_components.html index d9b06f10..4d4ac997 100644 --- a/docs/modules/base_components.html +++ b/docs/modules/base_components.html @@ -96,7 +96,7 @@

    render

  • diff --git a/docs/modules/base_data_datacomponent.html b/docs/modules/base_data_datacomponent.html index a920cbf0..f87d781c 100644 --- a/docs/modules/base_data_datacomponent.html +++ b/docs/modules/base_data_datacomponent.html @@ -90,7 +90,7 @@

    DataComponent

  • diff --git a/docs/modules/base_nested_nestedcomponent.html b/docs/modules/base_nested_nestedcomponent.html index 931dc211..e443cd99 100644 --- a/docs/modules/base_nested_nestedcomponent.html +++ b/docs/modules/base_nested_nestedcomponent.html @@ -96,7 +96,7 @@

    NestedComponent

  • Parameters

    diff --git a/docs/modules/components_html_html.html b/docs/modules/components_html_html.html index 8b34730e..e96fe306 100644 --- a/docs/modules/components_html_html.html +++ b/docs/modules/components_html_html.html @@ -93,7 +93,7 @@

    Const HTMLProperties

    HTMLProperties: { schema: { attrs: never[]; className: string; content: string; tag: string }; template: (ctx: any) => string; type: string } = ...
    diff --git a/docs/modules/core.html b/docs/modules/core.html index 9d4fadf5..db9c8473 100644 --- a/docs/modules/core.html +++ b/docs/modules/core.html @@ -106,7 +106,7 @@

    use

  • @@ -136,7 +136,7 @@

    useModule

  • @@ -164,7 +164,7 @@

    usePlugin

  • diff --git a/docs/modules/ejs.html b/docs/modules/ejs.html index a13d45af..39b84c29 100644 --- a/docs/modules/ejs.html +++ b/docs/modules/ejs.html @@ -86,7 +86,7 @@

    Const default

    default: string
    diff --git a/docs/modules/model_eventemitter.html b/docs/modules/model_eventemitter.html index 0ac74aed..4953cb70 100644 --- a/docs/modules/model_eventemitter.html +++ b/docs/modules/model_eventemitter.html @@ -108,7 +108,7 @@

    EventEmitter

  • Parameters

    diff --git a/docs/modules/model_model.html b/docs/modules/model_model.html index 0db80abd..491f745c 100644 --- a/docs/modules/model_model.html +++ b/docs/modules/model_model.html @@ -110,7 +110,7 @@

    Model

  • Parameters

    diff --git a/docs/modules/model_nestedarraymodel.html b/docs/modules/model_nestedarraymodel.html index 881be939..ed4b40e8 100644 --- a/docs/modules/model_nestedarraymodel.html +++ b/docs/modules/model_nestedarraymodel.html @@ -90,7 +90,7 @@

    NestedArrayModel

  • Parameters

    diff --git a/docs/modules/model_nesteddatamodel.html b/docs/modules/model_nesteddatamodel.html index 1ea5c9cf..f90a0ba0 100644 --- a/docs/modules/model_nesteddatamodel.html +++ b/docs/modules/model_nesteddatamodel.html @@ -90,7 +90,7 @@

    NestedDataModel

  • Parameters

    diff --git a/docs/modules/model_nestedmodel.html b/docs/modules/model_nestedmodel.html index 55569eed..d846c725 100644 --- a/docs/modules/model_nestedmodel.html +++ b/docs/modules/model_nestedmodel.html @@ -90,7 +90,7 @@

    NestedModel

  • Parameters

    diff --git a/docs/modules/modules_jsonlogic_jsonlogic.html b/docs/modules/modules_jsonlogic_jsonlogic.html index 4cf3c9fe..0d8a6327 100644 --- a/docs/modules/modules_jsonlogic_jsonlogic.html +++ b/docs/modules/modules_jsonlogic_jsonlogic.html @@ -86,7 +86,7 @@

    Const jsonLogic

    jsonLogic: any = ...
    diff --git a/docs/modules/utils_date.html b/docs/modules/utils_date.html index 71e95e27..885f3513 100644 --- a/docs/modules/utils_date.html +++ b/docs/modules/utils_date.html @@ -108,7 +108,7 @@

    convertFormatToMoment

  • @@ -136,7 +136,7 @@

    currentTimezone

  • @@ -158,7 +158,7 @@

    formatDate

  • @@ -192,7 +192,7 @@

    getDateSetting

  • @@ -220,7 +220,7 @@

    momentDate

  • diff --git a/docs/modules/utils_dom.html b/docs/modules/utils_dom.html index e5aeac89..bc1e1c26 100644 --- a/docs/modules/utils_dom.html +++ b/docs/modules/utils_dom.html @@ -93,7 +93,7 @@

    appendTo

  • @@ -126,7 +126,7 @@

    empty

  • @@ -157,7 +157,7 @@

    prependTo

  • @@ -194,7 +194,7 @@

    removeChildFrom

  • diff --git a/docs/modules/utils_formutil.html b/docs/modules/utils_formutil.html index 03f2a40a..af85103c 100644 --- a/docs/modules/utils_formutil.html +++ b/docs/modules/utils_formutil.html @@ -92,7 +92,7 @@

    eachComponent

  • @@ -147,7 +147,7 @@

    guid

  • Returns string

    @@ -164,7 +164,7 @@

    uniqueName

  • diff --git a/docs/modules/utils_mask.html b/docs/modules/utils_mask.html index aad255d1..2ee97436 100644 --- a/docs/modules/utils_mask.html +++ b/docs/modules/utils_mask.html @@ -91,7 +91,7 @@

    getInputMask

  • @@ -131,7 +131,7 @@

    matchInputMask

  • Parameters

    diff --git a/docs/modules/utils_override.html b/docs/modules/utils_override.html index 2fd70e45..c0cd654d 100644 --- a/docs/modules/utils_override.html +++ b/docs/modules/utils_override.html @@ -90,7 +90,7 @@

    override

  • diff --git a/docs/modules/utils_sanitize.html b/docs/modules/utils_sanitize.html index 8667cec5..406219f9 100644 --- a/docs/modules/utils_sanitize.html +++ b/docs/modules/utils_sanitize.html @@ -90,7 +90,7 @@

    sanitize

  • diff --git a/docs/modules/utils_unwind.html b/docs/modules/utils_unwind.html index d9c584fc..d4628cca 100644 --- a/docs/modules/utils_unwind.html +++ b/docs/modules/utils_unwind.html @@ -93,7 +93,7 @@

    mergeArray

  • Parameters

    @@ -119,7 +119,7 @@

    mergeObject

  • Parameters

    @@ -145,7 +145,7 @@

    rewind

  • Parameters

    @@ -175,7 +175,7 @@

    unwind

  • Parameters

    diff --git a/docs/modules/utils_utils.html b/docs/modules/utils_utils.html index 1f57155b..c6b9c5c5 100644 --- a/docs/modules/utils_utils.html +++ b/docs/modules/utils_utils.html @@ -90,7 +90,7 @@

    escapeRegExCharacters

  • diff --git a/package.json b/package.json index 1e6a295f..16a79fdd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@formio/core", - "version": "0.2.1", + "version": "0.2.2", "description": "The core Form.io renderering framework.", "main": "lib/index.js", "scripts": { @@ -8,7 +8,8 @@ "docs": "./node_modules/typedoc/bin/typedoc --exclude '*.spec.ts' src/*.ts src/**/*.ts src/**/**/*.ts", "build:dev": "webpack --config config/webpack.config.js", "build:prod": "webpack --config config/webpack.prod.js", - "build": "gulp templates && npm run docs && npm run build:dev && npm run build:prod", + "clean": "rm -rf lib && rm -rf dist && rm -rf docs", + "build": "npm run clean && gulp templates && npm run docs && npm run build:dev && npm run build:prod", "prepublish": "npm run build && npm run test" }, "repository": { @@ -29,6 +30,7 @@ }, "files": [ "dist", + "lib", "src" ], "homepage": "https://github.com/formio/core#readme",