@formio/js 5.3.1-refb-rc.0 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/formio.embed.js +1 -1
  2. package/dist/formio.embed.min.js +1 -1
  3. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  4. package/dist/formio.form.js +24 -24
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +1 -1
  7. package/dist/formio.full.js +24 -24
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +1 -1
  10. package/dist/formio.js +4 -4
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.min.js.LICENSE.txt +1 -1
  13. package/dist/formio.utils.js +4 -4
  14. package/dist/formio.utils.min.js +1 -1
  15. package/dist/formio.utils.min.js.LICENSE.txt +1 -1
  16. package/lib/cjs/Embed.js +1 -1
  17. package/lib/cjs/Formio.js +1 -1
  18. package/lib/cjs/PDF.js +9 -1
  19. package/lib/cjs/Webform.js +1 -1
  20. package/lib/cjs/components/_classes/component/Component.d.ts +1 -0
  21. package/lib/cjs/components/_classes/component/Component.js +14 -1
  22. package/lib/cjs/components/_classes/input/Input.js +17 -2
  23. package/lib/cjs/components/address/Address.js +2 -1
  24. package/lib/cjs/components/datagrid/DataGrid.js +12 -1
  25. package/lib/cjs/components/fieldset/Fieldset.d.ts +1 -0
  26. package/lib/cjs/components/fieldset/Fieldset.js +7 -0
  27. package/lib/cjs/components/select/Select.js +13 -8
  28. package/lib/cjs/components/tags/Tags.js +2 -1
  29. package/lib/cjs/package.json +1 -1
  30. package/lib/cjs/utils/conditionOperators/IsEqualTo.d.ts +1 -3
  31. package/lib/cjs/utils/conditionOperators/IsEqualTo.js +6 -12
  32. package/lib/cjs/utils/conditionOperators/index.d.ts +2 -1
  33. package/lib/cjs/utils/index.d.ts +2 -1
  34. package/lib/cjs/utils/utils.d.ts +9 -0
  35. package/lib/cjs/utils/utils.js +132 -2
  36. package/lib/cjs/widgets/CalendarWidget.js +2 -1
  37. package/lib/mjs/Embed.js +1 -1
  38. package/lib/mjs/Formio.js +1 -1
  39. package/lib/mjs/PDF.js +9 -1
  40. package/lib/mjs/Webform.js +1 -1
  41. package/lib/mjs/components/_classes/component/Component.d.ts +1 -0
  42. package/lib/mjs/components/_classes/component/Component.js +12 -1
  43. package/lib/mjs/components/_classes/input/Input.js +16 -3
  44. package/lib/mjs/components/address/Address.js +1 -1
  45. package/lib/mjs/components/datagrid/DataGrid.js +11 -1
  46. package/lib/mjs/components/fieldset/Fieldset.d.ts +1 -0
  47. package/lib/mjs/components/fieldset/Fieldset.js +7 -0
  48. package/lib/mjs/components/select/Select.js +11 -8
  49. package/lib/mjs/components/tags/Tags.js +1 -1
  50. package/lib/mjs/package.json +1 -1
  51. package/lib/mjs/utils/conditionOperators/IsEqualTo.d.ts +1 -3
  52. package/lib/mjs/utils/conditionOperators/IsEqualTo.js +6 -11
  53. package/lib/mjs/utils/conditionOperators/index.d.ts +2 -1
  54. package/lib/mjs/utils/index.d.ts +2 -1
  55. package/lib/mjs/utils/utils.d.ts +9 -0
  56. package/lib/mjs/utils/utils.js +130 -1
  57. package/lib/mjs/widgets/CalendarWidget.js +1 -1
  58. package/package.json +3 -3
@@ -29,7 +29,7 @@
29
29
 
30
30
  /*! choices.js v11.1.0 | © 2025 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
31
31
 
32
- /*! formiojs v5.3.0 | https://unpkg.com/formiojs@5.3.0/LICENSE.txt */
32
+ /*! formiojs v5.3.1 | https://unpkg.com/formiojs@5.3.1/LICENSE.txt */
33
33
 
34
34
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
35
35
 
package/dist/formio.js CHANGED
@@ -2015,7 +2015,7 @@ eval("{\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argumen
2015
2015
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2016
2016
 
2017
2017
  "use strict";
2018
- eval("{\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.dereferenceProcessInfo = exports.dereferenceProcess = void 0;\nconst error_1 = __webpack_require__(/*! ../../error */ \"../core/lib/error/index.js\");\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"../core/lib/utils/index.js\");\nconst isDereferenceableDataTableComponent = (component) => {\n var _a, _b, _c;\n return (component &&\n component.type === 'datatable' &&\n ((_a = component.fetch) === null || _a === void 0 ? void 0 : _a.enableFetch) === true &&\n ((_b = component.fetch) === null || _b === void 0 ? void 0 : _b.dataSrc) === 'resource' &&\n typeof ((_c = component.fetch) === null || _c === void 0 ? void 0 : _c.resource) === 'string');\n};\n/**\n * This function is used to dereference reference IDs contained in the form.\n * It is currently only compatible with Data Table components.\n * @todo Add support for other components (if applicable) and for submission data dereferencing (e.g. save-as-reference, currently a property action).\n */\nconst dereferenceProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n var _a;\n const { component, config, scope, path } = context;\n if (!scope.dereference) {\n scope.dereference = {};\n }\n if (!isDereferenceableDataTableComponent(component)) {\n return;\n }\n if (!(config === null || config === void 0 ? void 0 : config.database)) {\n throw new error_1.ProcessorError('Cannot dereference resource value without a database config object', context, 'dereference');\n }\n try {\n const components = yield ((_a = config.database) === null || _a === void 0 ? void 0 : _a.dereferenceDataTableComponent(component));\n const vmCompatibleComponents = (0, utils_1.fastCloneDeep)(components);\n scope.dereference[path] = vmCompatibleComponents;\n // Modify the components in place; we have to do this now as opposed to a \"post-processor\" step because\n // eachComponentDataAsync will immediately turn around and introspect these components in the case of Data Table\n component.components = vmCompatibleComponents;\n }\n catch (err) {\n throw new error_1.ProcessorError(err.message || err, context, 'dereference');\n }\n});\nexports.dereferenceProcess = dereferenceProcess;\nexports.dereferenceProcessInfo = {\n name: 'dereference',\n shouldProcess: () => true,\n process: exports.dereferenceProcess,\n};\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/dereference/index.js?\n}");
2018
+ eval("{\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.dereferenceProcessInfo = exports.dereferenceProcess = void 0;\nconst error_1 = __webpack_require__(/*! ../../error */ \"../core/lib/error/index.js\");\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"../core/lib/utils/index.js\");\nconst lodash_1 = __webpack_require__(/*! lodash */ \"../../node_modules/.pnpm/lodash@4.17.23/node_modules/lodash/lodash.js\");\nconst isDereferenceableDataTableComponent = (component) => {\n var _a, _b, _c;\n return (component &&\n component.type === 'datatable' &&\n ((_a = component.fetch) === null || _a === void 0 ? void 0 : _a.enableFetch) === true &&\n ((_b = component.fetch) === null || _b === void 0 ? void 0 : _b.dataSrc) === 'resource' &&\n typeof ((_c = component.fetch) === null || _c === void 0 ? void 0 : _c.resource) === 'string');\n};\nconst isDereferenceableSelectResourceComponent = (component) => {\n return (component &&\n component.type === 'select' &&\n component.reference &&\n component.dataSrc === 'resource');\n};\n/**\n * This function is used to dereference reference IDs contained in the form.\n * It is currently only compatible with Data Table components.\n * @todo Add support for other components (if applicable) and for submission data dereferencing (e.g. save-as-reference, currently a property action).\n */\nconst dereferenceProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b;\n const { component, config, scope, path, value } = context;\n if (!scope.dereference) {\n scope.dereference = {};\n }\n const dtDereference = isDereferenceableDataTableComponent(component);\n const selectResourceDereference = isDereferenceableSelectResourceComponent(component);\n if (!dtDereference && !selectResourceDereference) {\n return;\n }\n if (!(config === null || config === void 0 ? void 0 : config.database)) {\n throw new error_1.ProcessorError('Cannot dereference resource value without a database config object', context, 'dereference');\n }\n try {\n if (dtDereference) {\n const components = yield ((_a = config.database) === null || _a === void 0 ? void 0 : _a.dereferenceDataTableComponent(component));\n const vmCompatibleComponents = (0, utils_1.fastCloneDeep)(components);\n scope.dereference[path] = vmCompatibleComponents;\n // Modify the components in place; we have to do this now as opposed to a \"post-processor\" step because\n // eachComponentDataAsync will immediately turn around and introspect these components in the case of Data Table\n component.components = vmCompatibleComponents;\n }\n else if (selectResourceDereference) {\n if ((0, lodash_1.isEmpty)(value) || !(0, lodash_1.isObject)(value)) {\n return;\n }\n const references = yield ((_b = config.database) === null || _b === void 0 ? void 0 : _b.dereferenceSelectResourceValue(component, value));\n if ((0, lodash_1.isEmpty)(references) || !(0, lodash_1.isArray)(references)) {\n return;\n }\n scope.dereference[path] = references;\n if (component.multiple) {\n (0, lodash_1.each)(value, (item) => {\n var _a;\n const itemId = (_a = item._id) === null || _a === void 0 ? void 0 : _a.toString();\n const reference = (0, lodash_1.find)(references, (refItem) => { var _a; return ((_a = refItem._id) === null || _a === void 0 ? void 0 : _a.toString()) === itemId; });\n if ((0, lodash_1.isObject)(reference)) {\n (0, lodash_1.assign)(item, reference);\n }\n });\n }\n else {\n (0, lodash_1.assign)(value, references[0]);\n }\n }\n }\n catch (err) {\n throw new error_1.ProcessorError(err.message || err, context, 'dereference');\n }\n});\nexports.dereferenceProcess = dereferenceProcess;\nexports.dereferenceProcessInfo = {\n name: 'dereference',\n shouldProcess: () => true,\n process: exports.dereferenceProcess,\n};\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/dereference/index.js?\n}");
2019
2019
 
2020
2020
  /***/ }),
2021
2021
 
@@ -2092,7 +2092,7 @@ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexp
2092
2092
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2093
2093
 
2094
2094
  "use strict";
2095
- eval("{\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ProcessTargets = exports.Processors = exports.ProcessorMap = void 0;\nexports.process = process;\nexports.processSync = processSync;\nconst formUtil_1 = __webpack_require__(/*! ../utils/formUtil */ \"../core/lib/utils/formUtil/index.js\");\nconst processOne_1 = __webpack_require__(/*! ./processOne */ \"../core/lib/process/processOne.js\");\nconst defaultValue_1 = __webpack_require__(/*! ./defaultValue */ \"../core/lib/process/defaultValue/index.js\");\nconst fetch_1 = __webpack_require__(/*! ./fetch */ \"../core/lib/process/fetch/index.js\");\nconst calculation_1 = __webpack_require__(/*! ./calculation */ \"../core/lib/process/calculation/index.js\");\nconst logic_1 = __webpack_require__(/*! ./logic */ \"../core/lib/process/logic/index.js\");\nconst conditions_1 = __webpack_require__(/*! ./conditions */ \"../core/lib/process/conditions/index.js\");\nconst validation_1 = __webpack_require__(/*! ./validation */ \"../core/lib/process/validation/index.js\");\nconst filter_1 = __webpack_require__(/*! ./filter */ \"../core/lib/process/filter/index.js\");\nconst normalize_1 = __webpack_require__(/*! ./normalize */ \"../core/lib/process/normalize/index.js\");\nconst dereference_1 = __webpack_require__(/*! ./dereference */ \"../core/lib/process/dereference/index.js\");\nconst clearHidden_1 = __webpack_require__(/*! ./clearHidden */ \"../core/lib/process/clearHidden/index.js\");\nconst serverOverride_1 = __webpack_require__(/*! ./serverOverride */ \"../core/lib/process/serverOverride/index.js\");\nfunction process(context) {\n return __awaiter(this, void 0, void 0, function* () {\n const { instances, components, data, scope, flat, local, parent, parentPaths } = context;\n yield (0, formUtil_1.eachComponentDataAsync)(components, data, (component, compData, row, path, components, index, parent, paths) => __awaiter(this, void 0, void 0, function* () {\n yield (0, processOne_1.processOne)(Object.assign(Object.assign({}, context), { data: compData, component,\n components,\n path,\n paths,\n row,\n index, instance: instances\n ? instances[component.modelType === 'none' && (paths === null || paths === void 0 ? void 0 : paths.fullPath) ? paths.fullPath : path]\n : undefined, parent }));\n if (flat) {\n return true;\n }\n if (scope.noRecurse) {\n scope.noRecurse = false;\n return true;\n }\n }), false, local, parent, parentPaths, false, (component, compData, row, path, components, index, parent, paths) => __awaiter(this, void 0, void 0, function* () {\n yield (0, processOne_1.postProcessOne)(Object.assign(Object.assign({}, context), { data: compData, component,\n components,\n path,\n paths,\n row,\n index, instance: instances\n ? instances[component.modelType === 'none' && (paths === null || paths === void 0 ? void 0 : paths.fullPath) ? paths.fullPath : path]\n : undefined, parent }));\n }));\n if (scope.filtered) {\n context.data = scope.filtered || {};\n }\n return scope;\n });\n}\nfunction processSync(context) {\n const { instances, components, data, scope, flat, local, parent, parentPaths } = context;\n (0, formUtil_1.eachComponentData)(components, data, (component, compData, row, path, components, index, parent, paths) => {\n (0, processOne_1.processOneSync)(Object.assign(Object.assign({}, context), { data: compData, component,\n components,\n path,\n paths,\n row,\n index, instance: instances\n ? instances[component.modelType === 'none' && (paths === null || paths === void 0 ? void 0 : paths.fullPath) ? paths.fullPath : path]\n : undefined, parent }));\n if (flat) {\n return true;\n }\n if (scope.noRecurse) {\n scope.noRecurse = false;\n return true;\n }\n }, false, local, parent, parentPaths, false, (component, compData, row, path, components, index, parent, paths) => {\n (0, processOne_1.postProcessOneSync)(Object.assign(Object.assign({}, context), { data: compData, component,\n components,\n path,\n paths,\n row,\n index, instance: instances\n ? instances[component.modelType === 'none' && (paths === null || paths === void 0 ? void 0 : paths.fullPath) ? paths.fullPath : path]\n : undefined, parent }));\n });\n if (scope.filtered) {\n context.data = scope.filtered || {};\n }\n return scope;\n}\nexports.ProcessorMap = {\n serverOverride: serverOverride_1.serverOverrideProcessInfo,\n filter: filter_1.filterProcessInfo,\n defaultValue: defaultValue_1.defaultValueProcessInfo,\n serverDefaultValue: defaultValue_1.serverDefaultValueProcessInfo,\n customDefaultValue: defaultValue_1.customDefaultValueProcessInfo,\n calculate: calculation_1.calculateProcessInfo,\n conditions: conditions_1.conditionProcessInfo,\n customConditions: conditions_1.customConditionProcessInfo,\n simpleConditions: conditions_1.simpleConditionProcessInfo,\n normalize: normalize_1.normalizeProcessInfo,\n dereference: dereference_1.dereferenceProcessInfo,\n clearHidden: clearHidden_1.clearHiddenProcessInfo,\n fetch: fetch_1.fetchProcessInfo,\n logic: logic_1.logicProcessInfo,\n validate: validation_1.validateProcessInfo,\n validateCustom: validation_1.validateCustomProcessInfo,\n validateServer: validation_1.validateServerProcessInfo,\n};\nexports.Processors = [\n serverOverride_1.serverOverrideProcessInfo,\n filter_1.filterProcessInfo,\n defaultValue_1.defaultValueProcessInfo,\n normalize_1.normalizeProcessInfo,\n dereference_1.dereferenceProcessInfo,\n fetch_1.fetchProcessInfo,\n calculation_1.calculateProcessInfo,\n conditions_1.conditionProcessInfo,\n logic_1.logicProcessInfo,\n clearHidden_1.clearHiddenProcessInfo,\n validation_1.postValidateProcessInfo,\n];\n// Deprecated: Use Processors instead\nexports.ProcessTargets = {\n submission: [\n serverOverride_1.serverOverrideProcessInfo,\n filter_1.filterProcessInfo,\n defaultValue_1.serverDefaultValueProcessInfo,\n normalize_1.normalizeProcessInfo,\n dereference_1.dereferenceProcessInfo,\n fetch_1.fetchProcessInfo,\n conditions_1.simpleConditionProcessInfo,\n validation_1.validateServerProcessInfo,\n ],\n evaluator: [\n defaultValue_1.customDefaultValueProcessInfo,\n calculation_1.calculateProcessInfo,\n logic_1.logicProcessInfo,\n conditions_1.conditionProcessInfo,\n clearHidden_1.clearHiddenProcessInfo,\n validation_1.validateProcessInfo,\n ],\n};\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/process.js?\n}");
2095
+ eval("{\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.ProcessTargets = exports.Processors = exports.ProcessorMap = void 0;\nexports.process = process;\nexports.processSync = processSync;\nconst formUtil_1 = __webpack_require__(/*! ../utils/formUtil */ \"../core/lib/utils/formUtil/index.js\");\nconst processOne_1 = __webpack_require__(/*! ./processOne */ \"../core/lib/process/processOne.js\");\nconst defaultValue_1 = __webpack_require__(/*! ./defaultValue */ \"../core/lib/process/defaultValue/index.js\");\nconst fetch_1 = __webpack_require__(/*! ./fetch */ \"../core/lib/process/fetch/index.js\");\nconst calculation_1 = __webpack_require__(/*! ./calculation */ \"../core/lib/process/calculation/index.js\");\nconst logic_1 = __webpack_require__(/*! ./logic */ \"../core/lib/process/logic/index.js\");\nconst conditions_1 = __webpack_require__(/*! ./conditions */ \"../core/lib/process/conditions/index.js\");\nconst validation_1 = __webpack_require__(/*! ./validation */ \"../core/lib/process/validation/index.js\");\nconst filter_1 = __webpack_require__(/*! ./filter */ \"../core/lib/process/filter/index.js\");\nconst normalize_1 = __webpack_require__(/*! ./normalize */ \"../core/lib/process/normalize/index.js\");\nconst dereference_1 = __webpack_require__(/*! ./dereference */ \"../core/lib/process/dereference/index.js\");\nconst clearHidden_1 = __webpack_require__(/*! ./clearHidden */ \"../core/lib/process/clearHidden/index.js\");\nconst serverOverride_1 = __webpack_require__(/*! ./serverOverride */ \"../core/lib/process/serverOverride/index.js\");\nfunction process(context) {\n return __awaiter(this, void 0, void 0, function* () {\n const { instances, components, data, scope, flat, local, parent, parentPaths } = context;\n yield (0, formUtil_1.eachComponentDataAsync)(components, data, (component, compData, row, path, components, index, parent, paths) => __awaiter(this, void 0, void 0, function* () {\n yield (0, processOne_1.processOne)(Object.assign(Object.assign({}, context), { data: compData, component,\n components,\n path,\n paths,\n row,\n index, instance: instances\n ? instances[(['none', 'content']).includes(component.modelType || '') && (paths === null || paths === void 0 ? void 0 : paths.fullPath) ? paths.fullPath : path]\n : undefined, parent }));\n if (flat) {\n return true;\n }\n if (scope.noRecurse) {\n scope.noRecurse = false;\n return true;\n }\n }), false, local, parent, parentPaths, false, (component, compData, row, path, components, index, parent, paths) => __awaiter(this, void 0, void 0, function* () {\n yield (0, processOne_1.postProcessOne)(Object.assign(Object.assign({}, context), { data: compData, component,\n components,\n path,\n paths,\n row,\n index, instance: instances\n ? instances[(['none', 'content']).includes(component.modelType || '') && (paths === null || paths === void 0 ? void 0 : paths.fullPath) ? paths.fullPath : path]\n : undefined, parent }));\n }));\n if (scope.filtered) {\n context.data = scope.filtered || {};\n }\n return scope;\n });\n}\nfunction processSync(context) {\n const { instances, components, data, scope, flat, local, parent, parentPaths } = context;\n (0, formUtil_1.eachComponentData)(components, data, (component, compData, row, path, components, index, parent, paths) => {\n (0, processOne_1.processOneSync)(Object.assign(Object.assign({}, context), { data: compData, component,\n components,\n path,\n paths,\n row,\n index, instance: instances\n ? instances[(['none', 'content']).includes(component.modelType || '') && (paths === null || paths === void 0 ? void 0 : paths.fullPath) ? paths.fullPath : path]\n : undefined, parent }));\n if (flat) {\n return true;\n }\n if (scope.noRecurse) {\n scope.noRecurse = false;\n return true;\n }\n }, false, local, parent, parentPaths, false, (component, compData, row, path, components, index, parent, paths) => {\n (0, processOne_1.postProcessOneSync)(Object.assign(Object.assign({}, context), { data: compData, component,\n components,\n path,\n paths,\n row,\n index, instance: instances\n ? instances[(['none', 'content']).includes(component.modelType || '') && (paths === null || paths === void 0 ? void 0 : paths.fullPath) ? paths.fullPath : path]\n : undefined, parent }));\n });\n if (scope.filtered) {\n context.data = scope.filtered || {};\n }\n return scope;\n}\nexports.ProcessorMap = {\n serverOverride: serverOverride_1.serverOverrideProcessInfo,\n filter: filter_1.filterProcessInfo,\n defaultValue: defaultValue_1.defaultValueProcessInfo,\n serverDefaultValue: defaultValue_1.serverDefaultValueProcessInfo,\n customDefaultValue: defaultValue_1.customDefaultValueProcessInfo,\n calculate: calculation_1.calculateProcessInfo,\n conditions: conditions_1.conditionProcessInfo,\n customConditions: conditions_1.customConditionProcessInfo,\n simpleConditions: conditions_1.simpleConditionProcessInfo,\n normalize: normalize_1.normalizeProcessInfo,\n dereference: dereference_1.dereferenceProcessInfo,\n clearHidden: clearHidden_1.clearHiddenProcessInfo,\n fetch: fetch_1.fetchProcessInfo,\n logic: logic_1.logicProcessInfo,\n validate: validation_1.validateProcessInfo,\n validateCustom: validation_1.validateCustomProcessInfo,\n validateServer: validation_1.validateServerProcessInfo,\n};\nexports.Processors = [\n serverOverride_1.serverOverrideProcessInfo,\n filter_1.filterProcessInfo,\n defaultValue_1.defaultValueProcessInfo,\n normalize_1.normalizeProcessInfo,\n dereference_1.dereferenceProcessInfo,\n fetch_1.fetchProcessInfo,\n calculation_1.calculateProcessInfo,\n conditions_1.conditionProcessInfo,\n logic_1.logicProcessInfo,\n clearHidden_1.clearHiddenProcessInfo,\n validation_1.postValidateProcessInfo,\n];\n// Deprecated: Use Processors instead\nexports.ProcessTargets = {\n submission: [\n serverOverride_1.serverOverrideProcessInfo,\n filter_1.filterProcessInfo,\n defaultValue_1.serverDefaultValueProcessInfo,\n normalize_1.normalizeProcessInfo,\n dereference_1.dereferenceProcessInfo,\n fetch_1.fetchProcessInfo,\n conditions_1.simpleConditionProcessInfo,\n validation_1.validateServerProcessInfo,\n ],\n evaluator: [\n defaultValue_1.customDefaultValueProcessInfo,\n calculation_1.calculateProcessInfo,\n logic_1.logicProcessInfo,\n conditions_1.conditionProcessInfo,\n clearHidden_1.clearHiddenProcessInfo,\n validation_1.validateProcessInfo,\n ],\n};\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/process.js?\n}");
2096
2096
 
2097
2097
  /***/ }),
2098
2098
 
@@ -3654,7 +3654,7 @@ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//
3654
3654
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3655
3655
 
3656
3656
  "use strict";
3657
- eval("{\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.FormBuilder = exports.Form = exports.Formio = void 0;\nconst CDN_js_1 = __importDefault(__webpack_require__(/*! ./CDN.js */ \"./lib/cjs/CDN.js\"));\nclass Formio {\n static setLicense(license, norecurse = false) {\n _a.license = license;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setLicense(license);\n }\n }\n static setBaseUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setBaseUrl(url);\n }\n }\n static setApiUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setApiUrl(url);\n }\n }\n static setProjectUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setProjectUrl(url);\n }\n }\n static setAppUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setAppUrl(url);\n }\n }\n static setPathType(type, norecurse = false) {\n _a.pathType = type;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setPathType(type);\n }\n }\n static debug(...args) {\n if (_a.config.debug) {\n console.log(...args);\n }\n }\n static clearCache() {\n if (_a.FormioClass) {\n _a.FormioClass.clearCache();\n }\n }\n static global(prop, flag = '') {\n const globalValue = window[prop];\n if (flag && globalValue && !globalValue[flag]) {\n return null;\n }\n _a.debug(`Getting global ${prop}`, globalValue);\n return globalValue;\n }\n static use(module) {\n if (_a.FormioClass && _a.FormioClass.isRenderer) {\n _a.FormioClass.use(module);\n }\n else {\n _a.modules.push(module);\n }\n }\n static createElement(type, attrs, children) {\n const element = document.createElement(type);\n if (!attrs) {\n return element;\n }\n Object.keys(attrs).forEach((key) => {\n element.setAttribute(key, attrs[key]);\n });\n (children || []).forEach((child) => {\n element.appendChild(_a.createElement(child.tag, child.attrs, child.children));\n });\n return element;\n }\n static addScript(wrapper, src, name, flag = '') {\n return __awaiter(this, void 0, void 0, function* () {\n if (!src) {\n return Promise.resolve();\n }\n if (typeof src !== 'string' && src.length) {\n return Promise.all(src.map((ref) => _a.addScript(wrapper, ref)));\n }\n if (name && _a.global(name, flag)) {\n _a.debug(`${name} already loaded.`);\n return Promise.resolve(_a.global(name));\n }\n _a.debug('Adding Script', src);\n try {\n wrapper.appendChild(_a.createElement('script', {\n src,\n }));\n }\n catch (err) {\n _a.debug(err);\n return Promise.resolve();\n }\n if (!name) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n _a.debug(`Waiting to load ${name}`);\n const wait = setInterval(() => {\n if (_a.global(name, flag)) {\n clearInterval(wait);\n _a.debug(`${name} loaded.`);\n resolve(_a.global(name));\n }\n }, 100);\n });\n });\n }\n static addStyles(wrapper, href) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!href) {\n return;\n }\n if (typeof href !== 'string' && href.length) {\n href.forEach((ref) => _a.addStyles(wrapper, ref));\n return;\n }\n _a.debug('Adding Styles', href);\n wrapper.appendChild(_a.createElement('link', {\n rel: 'stylesheet',\n href,\n }));\n });\n }\n static submitDone(instance, submission) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.debug('Submision Complete', submission);\n if (_a.config.submitDone) {\n _a.config.submitDone(submission, instance);\n }\n const successMessage = (_a.config.success || '').toString();\n if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {\n instance.element.innerHTML = `<div class=\"alert-success\" role=\"alert\">${successMessage}</div>`;\n }\n let returnUrl = _a.config.redirect;\n // Allow form based configuration for return url.\n if (!returnUrl &&\n instance._form &&\n instance._form.settings &&\n (instance._form.settings.returnUrl || instance._form.settings.redirect)) {\n _a.debug('Return url found in form configuration');\n returnUrl = instance._form.settings.returnUrl || instance._form.settings.redirect;\n }\n if (returnUrl) {\n const formSrc = instance.formio ? instance.formio.formUrl : '';\n const hasQuery = !!returnUrl.match(/\\?/);\n const isOrigin = returnUrl.indexOf(location.origin) === 0;\n returnUrl += hasQuery ? '&' : '?';\n returnUrl += `sub=${submission._id}`;\n if (!isOrigin && formSrc) {\n returnUrl += `&form=${encodeURIComponent(formSrc)}`;\n }\n _a.debug('Return URL', returnUrl);\n window.location.href = returnUrl;\n if (isOrigin) {\n window.location.reload();\n }\n }\n });\n }\n // Return the full script if the builder is being used.\n static formioScript(script, builder) {\n builder = builder || _a.config.includeBuilder;\n if (_a.fullAdded || builder) {\n _a.fullAdded = true;\n return script.replace('formio.form', 'formio.full');\n }\n return script;\n }\n static addLibrary(libWrapper, lib, name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!lib) {\n return;\n }\n if (lib.dependencies) {\n for (let i = 0; i < lib.dependencies.length; i++) {\n const libName = lib.dependencies[i];\n yield _a.addLibrary(libWrapper, _a.config.libs[libName], libName);\n }\n }\n if (lib.css) {\n yield _a.addStyles(lib.global ? document.body : libWrapper, lib.css);\n }\n if (lib.js) {\n const module = yield _a.addScript(lib.global ? document.body : libWrapper, lib.js, lib.use ? name : false);\n if (lib.use) {\n _a.debug(`Using ${name}`);\n const options = lib.options || {};\n if (!options.license && _a.license) {\n options.license = _a.license;\n }\n _a.use(typeof lib.use === 'function' ? lib.use(module) : module, options);\n }\n }\n if (lib.globalStyle) {\n const style = _a.createElement('style');\n style.type = 'text/css';\n style.innerHTML = lib.globalStyle;\n document.body.appendChild(style);\n }\n });\n }\n static addLoader(wrapper) {\n return __awaiter(this, void 0, void 0, function* () {\n wrapper.appendChild(_a.createElement('div', {\n class: 'formio-loader',\n }, [\n {\n tag: 'div',\n attrs: {\n class: 'loader-wrapper',\n },\n children: [\n {\n tag: 'div',\n attrs: {\n class: 'loader text-center',\n },\n },\n ],\n },\n ]));\n });\n }\n static init(element, options = {}, builder = false) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.cdn = new CDN_js_1.default(_a.config.cdn, _a.config.cdnUrls || {});\n _a.config.libs = _a.config.libs || {\n uswds: {\n dependencies: [\n 'fontawesome',\n ],\n js: `${_a.cdn.uswds}/uswds.min.js`,\n css: `${_a.cdn.uswds}/uswds.min.css`,\n use: true,\n },\n fontawesome: {\n // Due to an issue with font-face not loading in the shadowdom (https://issues.chromium.org/issues/41085401), we need\n // to do 2 things. 1.) Load the fonts from the global cdn, and 2.) add the font-face to the global styles on the page.\n css: `https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css`,\n globalStyle: `@font-face {\n font-family: 'FontAwesome';\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0');\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');\n font-weight: normal;\n font-style: normal;\n }`,\n },\n bootstrap4: {\n dependencies: [\n 'fontawesome',\n ],\n css: `${_a.cdn.bootstrap4}/css/bootstrap.min.css`,\n },\n bootstrap: {\n dependencies: [\n 'bootstrap-icons',\n ],\n css: `${_a.cdn.bootstrap}/css/bootstrap.min.css`,\n },\n 'bootstrap-icons': {\n // Due to an issue with font-face not loading in the shadowdom (https://issues.chromium.org/issues/41085401), we need\n // to do 2 things. 1.) Load the fonts from the global cdn, and 2.) add the font-face to the global styles on the page.\n css: 'https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.min.css',\n globalStyle: `@font-face {\n font-display: block;\n font-family: \"bootstrap-icons\";\n src: url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff2?dd67030699838ea613ee6dbda90effa6\") format(\"woff2\"),\n url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff?dd67030699838ea613ee6dbda90effa6\") format(\"woff\");\n }`,\n },\n };\n // Add all bootswatch templates.\n [\n 'cerulean',\n 'cosmo',\n 'cyborg',\n 'darkly',\n 'flatly',\n 'journal',\n 'litera',\n 'lumen',\n 'lux',\n 'materia',\n 'minty',\n 'pulse',\n 'sandstone',\n 'simplex',\n 'sketchy',\n 'slate',\n 'solar',\n 'spacelab',\n 'superhero',\n 'united',\n 'yeti',\n ].forEach((template) => {\n _a.config.libs[template] = {\n dependencies: [\n 'bootstrap-icons',\n ],\n css: `${_a.cdn.bootswatch}/dist/${template}/bootstrap.min.css`,\n };\n });\n const id = _a.config.id || `formio-${Math.random().toString(36).substring(7)}`;\n // Create a new wrapper and add the element inside of a new wrapper.\n let wrapper = _a.createElement('div', {\n id: `${id}-wrapper`,\n });\n element.parentNode.insertBefore(wrapper, element);\n // If we include the libraries, then we will attempt to run this in shadow dom.\n const useShadowDom = _a.config.includeLibs &&\n !_a.config.noshadow &&\n typeof wrapper.attachShadow === 'function';\n if (useShadowDom) {\n wrapper = wrapper.attachShadow({\n mode: 'open',\n });\n options.shadowRoot = wrapper;\n }\n element.parentNode.removeChild(element);\n wrapper.appendChild(element);\n // If this is inside of shadow dom, then we need to add the styles and scripts to the shadow dom.\n const libWrapper = useShadowDom ? wrapper : document.body;\n // Load the renderer styles.\n yield _a.addStyles(libWrapper, _a.config.embedCSS || `${_a.cdn.js}/formio.embed.css`);\n // Add a loader.\n _a.addLoader(wrapper);\n const formioSrc = _a.config.full ? 'formio.full' : 'formio.form';\n const renderer = _a.config.debug ? formioSrc : `${formioSrc}.min`;\n _a.FormioClass = yield _a.addScript(libWrapper, _a.formioScript(_a.config.script || `${_a.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');\n _a.FormioClass.cdn = _a.cdn;\n _a.FormioClass.setBaseUrl(options.baseUrl || _a.baseUrl || _a.config.base);\n _a.FormioClass.setProjectUrl(options.projectUrl || _a.projectUrl || _a.config.project);\n _a.FormioClass.language = _a.language;\n _a.setLicense(_a.license || _a.config.license || false);\n _a.modules.forEach((module) => {\n _a.FormioClass.use(module);\n });\n if (_a.icons) {\n _a.FormioClass.icons = _a.icons;\n }\n if (_a.pathType) {\n _a.FormioClass.setPathType(_a.pathType);\n }\n // Add libraries if they wish to include the libs.\n if (_a.config.template && _a.config.includeLibs) {\n yield _a.addLibrary(libWrapper, _a.config.libs[_a.config.template], _a.config.template);\n }\n if (!_a.config.libraries) {\n _a.config.libraries = _a.config.modules || {};\n }\n // Adding premium if it is provided via the config.\n if (_a.config.premium) {\n _a.config.libraries.premium = _a.config.premium;\n }\n // Allow adding dynamic modules.\n if (_a.config.libraries) {\n for (const name in _a.config.libraries) {\n const lib = _a.config.libraries[name];\n lib.use = lib.use || true;\n yield _a.addLibrary(libWrapper, lib, name);\n }\n }\n yield _a.addStyles(libWrapper, _a.formioScript(_a.config.style || `${_a.cdn.js}/${renderer}.css`, builder));\n if (_a.config.before) {\n yield _a.config.before(_a.FormioClass, element, _a.config);\n }\n _a.FormioClass.license = true;\n _a._formioReady(_a.FormioClass);\n return wrapper;\n });\n }\n // Called after an instance has been created.\n static afterCreate(instance, wrapper, readyEvent) {\n var _b;\n return __awaiter(this, void 0, void 0, function* () {\n const loader = wrapper.querySelector('.formio-loader');\n if (loader) {\n wrapper.removeChild(loader);\n }\n (_b = _a.FormioClass.events) === null || _b === void 0 ? void 0 : _b.emit(readyEvent, instance);\n if (_a.config.after) {\n _a.debug('Calling ready callback');\n _a.config.after(instance, _a.config);\n }\n return instance;\n });\n }\n // Create a new form.\n static createForm(element, form, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_a.FormioClass) {\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true }));\n }\n const wrapper = yield _a.init(element, options);\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true })).then((instance) => {\n // Set the default submission data.\n if (_a.config.submission) {\n _a.debug('Setting submission', _a.config.submission);\n instance.submission = _a.config.submission;\n }\n // Call the after create method.\n _a.afterCreate(instance, wrapper, 'formEmbedded');\n return instance;\n });\n });\n }\n // Create a form builder.\n static builder(element, form, options = {}) {\n var _b;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.builder) {\n return _a.FormioClass.builder(element, form, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.builder(element, form, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'builderEmbedded');\n return instance;\n });\n });\n }\n}\nexports.Formio = Formio;\n_a = Formio;\nFormio.FormioClass = null;\nFormio.config = {};\nFormio.modules = [];\nFormio.icons = '';\nFormio.license = '';\nFormio.formioReady = new Promise((ready, reject) => {\n _a._formioReady = ready;\n _a._formioReadyReject = reject;\n});\nFormio.version = '5.3.0';\n// Create a report.\nFormio.Report = {\n create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {\n var _b;\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.Report) {\n return _a.FormioClass.Report.create(element, submission, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.Report.create(element, submission, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'reportEmbedded');\n return instance;\n });\n }),\n};\nCDN_js_1.default.defaultCDN = Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nclass Form {\n constructor(element, form, options) {\n this.form = form;\n this.element = element;\n this.options = options || {};\n this.init();\n this.instance = {\n proxy: true,\n ready: this.ready,\n destroy: () => { },\n };\n }\n init() {\n if (this.instance && !this.instance.proxy) {\n this.instance.destroy();\n }\n this.element.innerHTML = '';\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.form = instance.form;\n return instance;\n });\n }\n create() {\n return Formio.createForm(this.element, this.form, this.options);\n }\n setForm(form) {\n this.form = form;\n if (this.instance) {\n this.instance.setForm(form);\n }\n }\n setDisplay(display) {\n if (this.instance.proxy) {\n return this.ready;\n }\n this.form.display = display;\n this.instance.destroy();\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.setForm(this.form);\n });\n return this.ready;\n }\n}\nexports.Form = Form;\nclass FormBuilder extends Form {\n create() {\n return Formio.builder(this.element, this.form, this.options);\n }\n}\nexports.FormBuilder = FormBuilder;\nFormio.Form = Form;\nFormio.FormBuilder = FormBuilder;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Embed.js?\n}");
3657
+ eval("{\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.FormBuilder = exports.Form = exports.Formio = void 0;\nconst CDN_js_1 = __importDefault(__webpack_require__(/*! ./CDN.js */ \"./lib/cjs/CDN.js\"));\nclass Formio {\n static setLicense(license, norecurse = false) {\n _a.license = license;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setLicense(license);\n }\n }\n static setBaseUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setBaseUrl(url);\n }\n }\n static setApiUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setApiUrl(url);\n }\n }\n static setProjectUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setProjectUrl(url);\n }\n }\n static setAppUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setAppUrl(url);\n }\n }\n static setPathType(type, norecurse = false) {\n _a.pathType = type;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setPathType(type);\n }\n }\n static debug(...args) {\n if (_a.config.debug) {\n console.log(...args);\n }\n }\n static clearCache() {\n if (_a.FormioClass) {\n _a.FormioClass.clearCache();\n }\n }\n static global(prop, flag = '') {\n const globalValue = window[prop];\n if (flag && globalValue && !globalValue[flag]) {\n return null;\n }\n _a.debug(`Getting global ${prop}`, globalValue);\n return globalValue;\n }\n static use(module) {\n if (_a.FormioClass && _a.FormioClass.isRenderer) {\n _a.FormioClass.use(module);\n }\n else {\n _a.modules.push(module);\n }\n }\n static createElement(type, attrs, children) {\n const element = document.createElement(type);\n if (!attrs) {\n return element;\n }\n Object.keys(attrs).forEach((key) => {\n element.setAttribute(key, attrs[key]);\n });\n (children || []).forEach((child) => {\n element.appendChild(_a.createElement(child.tag, child.attrs, child.children));\n });\n return element;\n }\n static addScript(wrapper, src, name, flag = '') {\n return __awaiter(this, void 0, void 0, function* () {\n if (!src) {\n return Promise.resolve();\n }\n if (typeof src !== 'string' && src.length) {\n return Promise.all(src.map((ref) => _a.addScript(wrapper, ref)));\n }\n if (name && _a.global(name, flag)) {\n _a.debug(`${name} already loaded.`);\n return Promise.resolve(_a.global(name));\n }\n _a.debug('Adding Script', src);\n try {\n wrapper.appendChild(_a.createElement('script', {\n src,\n }));\n }\n catch (err) {\n _a.debug(err);\n return Promise.resolve();\n }\n if (!name) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n _a.debug(`Waiting to load ${name}`);\n const wait = setInterval(() => {\n if (_a.global(name, flag)) {\n clearInterval(wait);\n _a.debug(`${name} loaded.`);\n resolve(_a.global(name));\n }\n }, 100);\n });\n });\n }\n static addStyles(wrapper, href) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!href) {\n return;\n }\n if (typeof href !== 'string' && href.length) {\n href.forEach((ref) => _a.addStyles(wrapper, ref));\n return;\n }\n _a.debug('Adding Styles', href);\n wrapper.appendChild(_a.createElement('link', {\n rel: 'stylesheet',\n href,\n }));\n });\n }\n static submitDone(instance, submission) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.debug('Submision Complete', submission);\n if (_a.config.submitDone) {\n _a.config.submitDone(submission, instance);\n }\n const successMessage = (_a.config.success || '').toString();\n if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {\n instance.element.innerHTML = `<div class=\"alert-success\" role=\"alert\">${successMessage}</div>`;\n }\n let returnUrl = _a.config.redirect;\n // Allow form based configuration for return url.\n if (!returnUrl &&\n instance._form &&\n instance._form.settings &&\n (instance._form.settings.returnUrl || instance._form.settings.redirect)) {\n _a.debug('Return url found in form configuration');\n returnUrl = instance._form.settings.returnUrl || instance._form.settings.redirect;\n }\n if (returnUrl) {\n const formSrc = instance.formio ? instance.formio.formUrl : '';\n const hasQuery = !!returnUrl.match(/\\?/);\n const isOrigin = returnUrl.indexOf(location.origin) === 0;\n returnUrl += hasQuery ? '&' : '?';\n returnUrl += `sub=${submission._id}`;\n if (!isOrigin && formSrc) {\n returnUrl += `&form=${encodeURIComponent(formSrc)}`;\n }\n _a.debug('Return URL', returnUrl);\n window.location.href = returnUrl;\n if (isOrigin) {\n window.location.reload();\n }\n }\n });\n }\n // Return the full script if the builder is being used.\n static formioScript(script, builder) {\n builder = builder || _a.config.includeBuilder;\n if (_a.fullAdded || builder) {\n _a.fullAdded = true;\n return script.replace('formio.form', 'formio.full');\n }\n return script;\n }\n static addLibrary(libWrapper, lib, name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!lib) {\n return;\n }\n if (lib.dependencies) {\n for (let i = 0; i < lib.dependencies.length; i++) {\n const libName = lib.dependencies[i];\n yield _a.addLibrary(libWrapper, _a.config.libs[libName], libName);\n }\n }\n if (lib.css) {\n yield _a.addStyles(lib.global ? document.body : libWrapper, lib.css);\n }\n if (lib.js) {\n const module = yield _a.addScript(lib.global ? document.body : libWrapper, lib.js, lib.use ? name : false);\n if (lib.use) {\n _a.debug(`Using ${name}`);\n const options = lib.options || {};\n if (!options.license && _a.license) {\n options.license = _a.license;\n }\n _a.use(typeof lib.use === 'function' ? lib.use(module) : module, options);\n }\n }\n if (lib.globalStyle) {\n const style = _a.createElement('style');\n style.type = 'text/css';\n style.innerHTML = lib.globalStyle;\n document.body.appendChild(style);\n }\n });\n }\n static addLoader(wrapper) {\n return __awaiter(this, void 0, void 0, function* () {\n wrapper.appendChild(_a.createElement('div', {\n class: 'formio-loader',\n }, [\n {\n tag: 'div',\n attrs: {\n class: 'loader-wrapper',\n },\n children: [\n {\n tag: 'div',\n attrs: {\n class: 'loader text-center',\n },\n },\n ],\n },\n ]));\n });\n }\n static init(element, options = {}, builder = false) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.cdn = new CDN_js_1.default(_a.config.cdn, _a.config.cdnUrls || {});\n _a.config.libs = _a.config.libs || {\n uswds: {\n dependencies: [\n 'fontawesome',\n ],\n js: `${_a.cdn.uswds}/uswds.min.js`,\n css: `${_a.cdn.uswds}/uswds.min.css`,\n use: true,\n },\n fontawesome: {\n // Due to an issue with font-face not loading in the shadowdom (https://issues.chromium.org/issues/41085401), we need\n // to do 2 things. 1.) Load the fonts from the global cdn, and 2.) add the font-face to the global styles on the page.\n css: `https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css`,\n globalStyle: `@font-face {\n font-family: 'FontAwesome';\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0');\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');\n font-weight: normal;\n font-style: normal;\n }`,\n },\n bootstrap4: {\n dependencies: [\n 'fontawesome',\n ],\n css: `${_a.cdn.bootstrap4}/css/bootstrap.min.css`,\n },\n bootstrap: {\n dependencies: [\n 'bootstrap-icons',\n ],\n css: `${_a.cdn.bootstrap}/css/bootstrap.min.css`,\n },\n 'bootstrap-icons': {\n // Due to an issue with font-face not loading in the shadowdom (https://issues.chromium.org/issues/41085401), we need\n // to do 2 things. 1.) Load the fonts from the global cdn, and 2.) add the font-face to the global styles on the page.\n css: 'https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.min.css',\n globalStyle: `@font-face {\n font-display: block;\n font-family: \"bootstrap-icons\";\n src: url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff2?dd67030699838ea613ee6dbda90effa6\") format(\"woff2\"),\n url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff?dd67030699838ea613ee6dbda90effa6\") format(\"woff\");\n }`,\n },\n };\n // Add all bootswatch templates.\n [\n 'cerulean',\n 'cosmo',\n 'cyborg',\n 'darkly',\n 'flatly',\n 'journal',\n 'litera',\n 'lumen',\n 'lux',\n 'materia',\n 'minty',\n 'pulse',\n 'sandstone',\n 'simplex',\n 'sketchy',\n 'slate',\n 'solar',\n 'spacelab',\n 'superhero',\n 'united',\n 'yeti',\n ].forEach((template) => {\n _a.config.libs[template] = {\n dependencies: [\n 'bootstrap-icons',\n ],\n css: `${_a.cdn.bootswatch}/dist/${template}/bootstrap.min.css`,\n };\n });\n const id = _a.config.id || `formio-${Math.random().toString(36).substring(7)}`;\n // Create a new wrapper and add the element inside of a new wrapper.\n let wrapper = _a.createElement('div', {\n id: `${id}-wrapper`,\n });\n element.parentNode.insertBefore(wrapper, element);\n // If we include the libraries, then we will attempt to run this in shadow dom.\n const useShadowDom = _a.config.includeLibs &&\n !_a.config.noshadow &&\n typeof wrapper.attachShadow === 'function';\n if (useShadowDom) {\n wrapper = wrapper.attachShadow({\n mode: 'open',\n });\n options.shadowRoot = wrapper;\n }\n element.parentNode.removeChild(element);\n wrapper.appendChild(element);\n // If this is inside of shadow dom, then we need to add the styles and scripts to the shadow dom.\n const libWrapper = useShadowDom ? wrapper : document.body;\n // Load the renderer styles.\n yield _a.addStyles(libWrapper, _a.config.embedCSS || `${_a.cdn.js}/formio.embed.css`);\n // Add a loader.\n _a.addLoader(wrapper);\n const formioSrc = _a.config.full ? 'formio.full' : 'formio.form';\n const renderer = _a.config.debug ? formioSrc : `${formioSrc}.min`;\n _a.FormioClass = yield _a.addScript(libWrapper, _a.formioScript(_a.config.script || `${_a.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');\n _a.FormioClass.cdn = _a.cdn;\n _a.FormioClass.setBaseUrl(options.baseUrl || _a.baseUrl || _a.config.base);\n _a.FormioClass.setProjectUrl(options.projectUrl || _a.projectUrl || _a.config.project);\n _a.FormioClass.language = _a.language;\n _a.setLicense(_a.license || _a.config.license || false);\n _a.modules.forEach((module) => {\n _a.FormioClass.use(module);\n });\n if (_a.icons) {\n _a.FormioClass.icons = _a.icons;\n }\n if (_a.pathType) {\n _a.FormioClass.setPathType(_a.pathType);\n }\n // Add libraries if they wish to include the libs.\n if (_a.config.template && _a.config.includeLibs) {\n yield _a.addLibrary(libWrapper, _a.config.libs[_a.config.template], _a.config.template);\n }\n if (!_a.config.libraries) {\n _a.config.libraries = _a.config.modules || {};\n }\n // Adding premium if it is provided via the config.\n if (_a.config.premium) {\n _a.config.libraries.premium = _a.config.premium;\n }\n // Allow adding dynamic modules.\n if (_a.config.libraries) {\n for (const name in _a.config.libraries) {\n const lib = _a.config.libraries[name];\n lib.use = lib.use || true;\n yield _a.addLibrary(libWrapper, lib, name);\n }\n }\n yield _a.addStyles(libWrapper, _a.formioScript(_a.config.style || `${_a.cdn.js}/${renderer}.css`, builder));\n if (_a.config.before) {\n yield _a.config.before(_a.FormioClass, element, _a.config);\n }\n _a.FormioClass.license = true;\n _a._formioReady(_a.FormioClass);\n return wrapper;\n });\n }\n // Called after an instance has been created.\n static afterCreate(instance, wrapper, readyEvent) {\n var _b;\n return __awaiter(this, void 0, void 0, function* () {\n const loader = wrapper.querySelector('.formio-loader');\n if (loader) {\n wrapper.removeChild(loader);\n }\n (_b = _a.FormioClass.events) === null || _b === void 0 ? void 0 : _b.emit(readyEvent, instance);\n if (_a.config.after) {\n _a.debug('Calling ready callback');\n _a.config.after(instance, _a.config);\n }\n return instance;\n });\n }\n // Create a new form.\n static createForm(element, form, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_a.FormioClass) {\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true }));\n }\n const wrapper = yield _a.init(element, options);\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true })).then((instance) => {\n // Set the default submission data.\n if (_a.config.submission) {\n _a.debug('Setting submission', _a.config.submission);\n instance.submission = _a.config.submission;\n }\n // Call the after create method.\n _a.afterCreate(instance, wrapper, 'formEmbedded');\n return instance;\n });\n });\n }\n // Create a form builder.\n static builder(element, form, options = {}) {\n var _b;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.builder) {\n return _a.FormioClass.builder(element, form, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.builder(element, form, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'builderEmbedded');\n return instance;\n });\n });\n }\n}\nexports.Formio = Formio;\n_a = Formio;\nFormio.FormioClass = null;\nFormio.config = {};\nFormio.modules = [];\nFormio.icons = '';\nFormio.license = '';\nFormio.formioReady = new Promise((ready, reject) => {\n _a._formioReady = ready;\n _a._formioReadyReject = reject;\n});\nFormio.version = '5.3.1';\n// Create a report.\nFormio.Report = {\n create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {\n var _b;\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.Report) {\n return _a.FormioClass.Report.create(element, submission, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.Report.create(element, submission, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'reportEmbedded');\n return instance;\n });\n }),\n};\nCDN_js_1.default.defaultCDN = Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nclass Form {\n constructor(element, form, options) {\n this.form = form;\n this.element = element;\n this.options = options || {};\n this.init();\n this.instance = {\n proxy: true,\n ready: this.ready,\n destroy: () => { },\n };\n }\n init() {\n if (this.instance && !this.instance.proxy) {\n this.instance.destroy();\n }\n this.element.innerHTML = '';\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.form = instance.form;\n return instance;\n });\n }\n create() {\n return Formio.createForm(this.element, this.form, this.options);\n }\n setForm(form) {\n this.form = form;\n if (this.instance) {\n this.instance.setForm(form);\n }\n }\n setDisplay(display) {\n if (this.instance.proxy) {\n return this.ready;\n }\n this.form.display = display;\n this.instance.destroy();\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.setForm(this.form);\n });\n return this.ready;\n }\n}\nexports.Form = Form;\nclass FormBuilder extends Form {\n create() {\n return Formio.builder(this.element, this.form, this.options);\n }\n}\nexports.FormBuilder = FormBuilder;\nFormio.Form = Form;\nFormio.FormBuilder = FormBuilder;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Embed.js?\n}");
3658
3658
 
3659
3659
  /***/ }),
3660
3660
 
@@ -3665,7 +3665,7 @@ eval("{\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argumen
3665
3665
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3666
3666
 
3667
3667
  "use strict";
3668
- eval("{\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = void 0;\nconst sdk_1 = __webpack_require__(/*! @formio/core/sdk */ \"../core/lib/sdk/index.js\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return sdk_1.Formio; } }));\nconst Embed_1 = __webpack_require__(/*! ./Embed */ \"./lib/cjs/Embed.js\");\nconst CDN_1 = __importDefault(__webpack_require__(/*! ./CDN */ \"./lib/cjs/CDN.js\"));\nconst providers_1 = __importDefault(__webpack_require__(/*! ./providers */ \"./lib/cjs/providers/index.js\"));\nsdk_1.Formio.cdn = new CDN_1.default();\nsdk_1.Formio.Providers = providers_1.default;\nsdk_1.Formio.version = '5.3.0';\nCDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc')\n ? 'https://cdn.test-form.io'\n : 'https://cdn.form.io';\nconst isNil = (val) => val === null || val === undefined;\nsdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {\n const requestArgs = {\n provider: storage,\n method: 'upload',\n file: file,\n fileName: fileName,\n dir: dir,\n };\n fileKey = fileKey || 'file';\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs).then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs).then((result) => {\n if (storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', storage);\n if (Provider) {\n const provider = new Provider(this);\n if (uploadStartCallback) {\n uploadStartCallback();\n }\n return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions);\n }\n else {\n throw 'Storage provider not found';\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.downloadFile = function (file, options) {\n const requestArgs = {\n method: 'download',\n file: file,\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs).then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs).then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.downloadFile(file, options);\n }\n else {\n throw 'Storage provider not found';\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.deleteFile = function (file, options) {\n const requestArgs = {\n method: 'delete',\n file: file,\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs).then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs).then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.deleteFile(file, options);\n }\n else {\n throw 'Storage provider not found';\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\n// Esnure we proxy the following methods to the FormioEmbed class.\n[\n 'setBaseUrl',\n 'setApiUrl',\n 'setAppUrl',\n 'setProjectUrl',\n 'setPathType',\n 'setLicense',\n].forEach((fn) => {\n const baseFn = sdk_1.Formio[fn];\n sdk_1.Formio[fn] = function (arg) {\n const retVal = Embed_1.Formio[fn](arg, true);\n return baseFn ? baseFn.call(this, arg) : retVal;\n };\n});\n// For reverse compatability.\nsdk_1.Formio.Promise = Promise;\nsdk_1.Formio.formioReady = Embed_1.Formio.formioReady;\nsdk_1.Formio.config = Embed_1.Formio.config;\nsdk_1.Formio.builder = Embed_1.Formio.builder;\nsdk_1.Formio.Report = Embed_1.Formio.Report;\nsdk_1.Formio.Form = Embed_1.Formio.Form;\nsdk_1.Formio.FormBuilder = Embed_1.Formio.FormBuilder;\nsdk_1.Formio.use = Embed_1.Formio.use;\nsdk_1.Formio.createForm = Embed_1.Formio.createForm;\nsdk_1.Formio.submitDone = Embed_1.Formio.submitDone;\nsdk_1.Formio.addLibrary = Embed_1.Formio.addLibrary;\nsdk_1.Formio.addLoader = Embed_1.Formio.addLoader;\nsdk_1.Formio.addToGlobal = (global) => {\n if (typeof global === 'object' && !global.Formio) {\n global.Formio = sdk_1.Formio;\n }\n};\nif (typeof globalThis !== 'undefined') {\n sdk_1.Formio.addToGlobal(globalThis);\n}\nif (typeof window !== 'undefined') {\n sdk_1.Formio.addToGlobal(window);\n}\nEmbed_1.Formio._formioReady(sdk_1.Formio);\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Formio.js?\n}");
3668
+ eval("{\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = void 0;\nconst sdk_1 = __webpack_require__(/*! @formio/core/sdk */ \"../core/lib/sdk/index.js\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return sdk_1.Formio; } }));\nconst Embed_1 = __webpack_require__(/*! ./Embed */ \"./lib/cjs/Embed.js\");\nconst CDN_1 = __importDefault(__webpack_require__(/*! ./CDN */ \"./lib/cjs/CDN.js\"));\nconst providers_1 = __importDefault(__webpack_require__(/*! ./providers */ \"./lib/cjs/providers/index.js\"));\nsdk_1.Formio.cdn = new CDN_1.default();\nsdk_1.Formio.Providers = providers_1.default;\nsdk_1.Formio.version = '5.3.1';\nCDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc')\n ? 'https://cdn.test-form.io'\n : 'https://cdn.form.io';\nconst isNil = (val) => val === null || val === undefined;\nsdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {\n const requestArgs = {\n provider: storage,\n method: 'upload',\n file: file,\n fileName: fileName,\n dir: dir,\n };\n fileKey = fileKey || 'file';\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs).then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs).then((result) => {\n if (storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', storage);\n if (Provider) {\n const provider = new Provider(this);\n if (uploadStartCallback) {\n uploadStartCallback();\n }\n return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions);\n }\n else {\n throw 'Storage provider not found';\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.downloadFile = function (file, options) {\n const requestArgs = {\n method: 'download',\n file: file,\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs).then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs).then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.downloadFile(file, options);\n }\n else {\n throw 'Storage provider not found';\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.deleteFile = function (file, options) {\n const requestArgs = {\n method: 'delete',\n file: file,\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs).then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs).then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.deleteFile(file, options);\n }\n else {\n throw 'Storage provider not found';\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\n// Esnure we proxy the following methods to the FormioEmbed class.\n[\n 'setBaseUrl',\n 'setApiUrl',\n 'setAppUrl',\n 'setProjectUrl',\n 'setPathType',\n 'setLicense',\n].forEach((fn) => {\n const baseFn = sdk_1.Formio[fn];\n sdk_1.Formio[fn] = function (arg) {\n const retVal = Embed_1.Formio[fn](arg, true);\n return baseFn ? baseFn.call(this, arg) : retVal;\n };\n});\n// For reverse compatability.\nsdk_1.Formio.Promise = Promise;\nsdk_1.Formio.formioReady = Embed_1.Formio.formioReady;\nsdk_1.Formio.config = Embed_1.Formio.config;\nsdk_1.Formio.builder = Embed_1.Formio.builder;\nsdk_1.Formio.Report = Embed_1.Formio.Report;\nsdk_1.Formio.Form = Embed_1.Formio.Form;\nsdk_1.Formio.FormBuilder = Embed_1.Formio.FormBuilder;\nsdk_1.Formio.use = Embed_1.Formio.use;\nsdk_1.Formio.createForm = Embed_1.Formio.createForm;\nsdk_1.Formio.submitDone = Embed_1.Formio.submitDone;\nsdk_1.Formio.addLibrary = Embed_1.Formio.addLibrary;\nsdk_1.Formio.addLoader = Embed_1.Formio.addLoader;\nsdk_1.Formio.addToGlobal = (global) => {\n if (typeof global === 'object' && !global.Formio) {\n global.Formio = sdk_1.Formio;\n }\n};\nif (typeof globalThis !== 'undefined') {\n sdk_1.Formio.addToGlobal(globalThis);\n}\nif (typeof window !== 'undefined') {\n sdk_1.Formio.addToGlobal(window);\n}\nEmbed_1.Formio._formioReady(sdk_1.Formio);\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Formio.js?\n}");
3669
3669
 
3670
3670
  /***/ }),
3671
3671