diff --git a/.github/workspace/formiojs/package-lock.json b/.github/workspace/formiojs/package-lock.json index 1ee793eb..44eb5bab 100644 --- a/.github/workspace/formiojs/package-lock.json +++ b/.github/workspace/formiojs/package-lock.json @@ -1,208 +1,158 @@ { "name": "formiojs-downloader", "version": "0.0.1", - "lockfileVersion": 3, + "lockfileVersion": 1, "requires": true, - "packages": { - "": { - "name": "formiojs-downloader", - "version": "0.0.1", - "license": "MIT", - "dependencies": { - "formiojs": "4.19.1", - "moment": "^2.29.4" - }, - "devDependencies": {} - }, - "node_modules/@babel/runtime": { - "version": "7.24.4", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@babel/runtime/-/runtime-7.24.4.tgz", - "integrity": "sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==", - "license": "MIT", - "dependencies": { + "dependencies": { + "@babel/runtime": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", + "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", + "requires": { "regenerator-runtime": "^0.14.0" - }, - "engines": { - "node": ">=6.9.0" } }, - "node_modules/@formio/bootstrap3": { + "@formio/bootstrap3": { "version": "2.12.4-rc.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/bootstrap3/-/bootstrap3-2.12.4-rc.1.tgz", + "resolved": "https://registry.npmjs.org/@formio/bootstrap3/-/bootstrap3-2.12.4-rc.1.tgz", "integrity": "sha512-4B5rs+w9tAk5i+wbdw2/NrTxPqnDX7/W19tiTd9lfXnIGQmaj0ecMEVqDmOJg8pIlyU02g3c4ih6JnA/JVmUbA==", - "license": "MIT", - "dependencies": { + "requires": { "resize-observer-polyfill": "^1.5.1" } }, - "node_modules/@formio/choices.js": { + "@formio/choices.js": { "version": "10.2.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/choices.js/-/choices.js-10.2.1.tgz", + "resolved": "https://registry.npmjs.org/@formio/choices.js/-/choices.js-10.2.1.tgz", "integrity": "sha512-NCE5u7jG3XGokJP16MyAbVSUptKu/mpJYAxd4PPIoLiO/l9Do5uoOQ0MgNb9qG9qABJiOX+qNRE8q8RybY/SwQ==", - "license": "MIT", - "dependencies": { + "requires": { "deepmerge": "^4.2.2", "fuse.js": "^6.6.2", "redux": "^4.2.0" } }, - "node_modules/@formio/semantic": { + "@formio/semantic": { "version": "2.6.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/semantic/-/semantic-2.6.1.tgz", - "integrity": "sha512-obp1BT5UnzD+uYBbqmnsTfO2hGxI2A2iR/cj3P5JUFLYSBpnr3TS2ShQ7Ee5GCRRtJPu0JnljuJj+YSKLCMuhg==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@formio/semantic/-/semantic-2.6.1.tgz", + "integrity": "sha512-obp1BT5UnzD+uYBbqmnsTfO2hGxI2A2iR/cj3P5JUFLYSBpnr3TS2ShQ7Ee5GCRRtJPu0JnljuJj+YSKLCMuhg==" }, - "node_modules/@formio/text-mask-addons": { + "@formio/text-mask-addons": { "version": "3.8.0-formio.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/text-mask-addons/-/text-mask-addons-3.8.0-formio.2.tgz", - "integrity": "sha512-H4Sm+1Sx59jbrlKxtKbzethhp5OIcP8Oi4JBpsvH/SB8P/KCRmtjKbN5ACqURnXmYtBHLJC6Yr9KZibOVRGxpA==", - "license": "Unlicense" + "resolved": "https://registry.npmjs.org/@formio/text-mask-addons/-/text-mask-addons-3.8.0-formio.2.tgz", + "integrity": "sha512-H4Sm+1Sx59jbrlKxtKbzethhp5OIcP8Oi4JBpsvH/SB8P/KCRmtjKbN5ACqURnXmYtBHLJC6Yr9KZibOVRGxpA==" }, - "node_modules/@formio/vanilla-text-mask": { + "@formio/vanilla-text-mask": { "version": "5.1.1-formio.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/vanilla-text-mask/-/vanilla-text-mask-5.1.1-formio.1.tgz", - "integrity": "sha512-rYBlvIPMNUd6sAaduOaiIwI4vfTAjHDRonko2qJn2RP1O//TQ7rcFIPYVYePJZ4OtOpwHiHAvAIh79McphZotQ==", - "license": "Unlicense" + "resolved": "https://registry.npmjs.org/@formio/vanilla-text-mask/-/vanilla-text-mask-5.1.1-formio.1.tgz", + "integrity": "sha512-rYBlvIPMNUd6sAaduOaiIwI4vfTAjHDRonko2qJn2RP1O//TQ7rcFIPYVYePJZ4OtOpwHiHAvAIh79McphZotQ==" }, - "node_modules/@popperjs/core": { + "@popperjs/core": { "version": "2.11.8", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==" }, - "node_modules/@sphinxxxx/color-conversion": { + "@sphinxxxx/color-conversion": { "version": "2.2.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@sphinxxxx/color-conversion/-/color-conversion-2.2.2.tgz", - "integrity": "sha512-XExJS3cLqgrmNBIP3bBw6+1oQ1ksGjFh0+oClDKFYpCCqx/hlqwWO5KO/S63fzUo67SxI9dMrF0y5T/Ey7h8Zw==", - "license": "ISC" + "resolved": "https://registry.npmjs.org/@sphinxxxx/color-conversion/-/color-conversion-2.2.2.tgz", + "integrity": "sha512-XExJS3cLqgrmNBIP3bBw6+1oQ1ksGjFh0+oClDKFYpCCqx/hlqwWO5KO/S63fzUo67SxI9dMrF0y5T/Ey7h8Zw==" }, - "node_modules/abortcontroller-polyfill": { + "abortcontroller-polyfill": { "version": "1.7.5", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz", - "integrity": "sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz", + "integrity": "sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==" }, - "node_modules/animation-frame-polyfill": { + "animation-frame-polyfill": { "version": "1.0.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/animation-frame-polyfill/-/animation-frame-polyfill-1.0.2.tgz", - "integrity": "sha512-PvO5poSMoHhaoNNgHPo+oqs/0L9UqjsUbqv0iOXVqLh6HX85fsOVQTUrzSBvjdZz7hydARlgLELyzJJKIrPJAQ==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/animation-frame-polyfill/-/animation-frame-polyfill-1.0.2.tgz", + "integrity": "sha512-PvO5poSMoHhaoNNgHPo+oqs/0L9UqjsUbqv0iOXVqLh6HX85fsOVQTUrzSBvjdZz7hydARlgLELyzJJKIrPJAQ==" }, - "node_modules/array-from": { + "array-from": { "version": "2.1.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha512-GQTc6Uupx1FCavi5mPzBvVT7nEOeWMmUA9P95wpfpW1XwMSKs+KaymD5C2Up7KAUKg/mYwbsUYzdZWcoajlNZg==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", + "integrity": "sha512-GQTc6Uupx1FCavi5mPzBvVT7nEOeWMmUA9P95wpfpW1XwMSKs+KaymD5C2Up7KAUKg/mYwbsUYzdZWcoajlNZg==" }, - "node_modules/atoa": { + "atoa": { "version": "1.0.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/atoa/-/atoa-1.0.0.tgz", - "integrity": "sha1-DMDpGkgOc4+SPrwQNnZHF3mzSkk=", - "license": "MIT" + "resolved": "https://registry.npmjs.org/atoa/-/atoa-1.0.0.tgz", + "integrity": "sha512-VVE1H6cc4ai+ZXo/CRWoJiHXrA1qfA31DPnx6D20+kSI547hQN5Greh51LQ1baMRMfxO5K5M4ImMtZbZt2DODQ==" }, - "node_modules/autocompleter": { + "autocompleter": { "version": "7.1.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/autocompleter/-/autocompleter-7.1.0.tgz", - "integrity": "sha512-uCToOnq7eAD/GJAteDbYuQ7ksDtrYWOy5CIAq43wh0dT+5frMpPlyD9tp+y5fz8KIcsP+zR2MjzoTAdW5aJESw==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/autocompleter/-/autocompleter-7.1.0.tgz", + "integrity": "sha512-uCToOnq7eAD/GJAteDbYuQ7ksDtrYWOy5CIAq43wh0dT+5frMpPlyD9tp+y5fz8KIcsP+zR2MjzoTAdW5aJESw==" }, - "node_modules/browser-cookies": { + "browser-cookies": { "version": "1.2.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/browser-cookies/-/browser-cookies-1.2.0.tgz", - "integrity": "sha1-/KP/ubamOq3E2MCZnGtX0Pp9KbU=", - "license": "Unlicence" + "resolved": "https://registry.npmjs.org/browser-cookies/-/browser-cookies-1.2.0.tgz", + "integrity": "sha512-cg2WuoOJo+F+g2XjEaP8nmeRp1vDHjt7sqpKJMsTNXKrpyIBNVslYJeehvs6FEddj8usV2+qyRSBEX244yN5/g==" }, - "node_modules/browser-md5-file": { + "browser-md5-file": { "version": "1.1.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/browser-md5-file/-/browser-md5-file-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/browser-md5-file/-/browser-md5-file-1.1.1.tgz", "integrity": "sha512-9h2UViTtZPhBa7oHvp5mb7MvJaX5OKEPUsplDwJ800OIV+In7BOR3RXOMB78obn2iQVIiS3WkVLhG7Zu1EMwbw==", - "license": "MIT", - "dependencies": { + "requires": { "spark-md5": "^2.0.2" } }, - "node_modules/compare-versions": { + "compare-versions": { "version": "5.0.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/compare-versions/-/compare-versions-5.0.3.tgz", - "integrity": "sha512-4UZlZP8Z99MGEY+Ovg/uJxJuvoXuN4M6B3hKaiackiHrgzQFEe3diJi1mf1PNHbFujM7FvLrK2bpgIaImbtZ1A==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-5.0.3.tgz", + "integrity": "sha512-4UZlZP8Z99MGEY+Ovg/uJxJuvoXuN4M6B3hKaiackiHrgzQFEe3diJi1mf1PNHbFujM7FvLrK2bpgIaImbtZ1A==" }, - "node_modules/contra": { + "contra": { "version": "1.9.4", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/contra/-/contra-1.9.4.tgz", - "integrity": "sha1-9TveQtfltZhcrk2ZqNYQUm3o8o0=", - "license": "MIT", - "dependencies": { + "resolved": "https://registry.npmjs.org/contra/-/contra-1.9.4.tgz", + "integrity": "sha512-N9ArHAqwR/lhPq4OdIAwH4e1btn6EIZMAz4TazjnzCiVECcWUPTma+dRAM38ERImEJBh8NiCCpjoQruSZ+agYg==", + "requires": { "atoa": "1.0.0", "ticky": "1.0.1" } }, - "node_modules/core-js": { - "version": "3.36.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/core-js/-/core-js-3.36.1.tgz", - "integrity": "sha512-BTvUrwxVBezj5SZ3f10ImnX2oRByMxql3EimVqMysepbC9EeMUOpLwdy6Eoili2x6E4kf+ZUB5k/+Jv55alPfA==", - "hasInstallScript": true, - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } + "core-js": { + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.1.tgz", + "integrity": "sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw==" }, - "node_modules/create-point-cb": { + "create-point-cb": { "version": "1.2.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/create-point-cb/-/create-point-cb-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/create-point-cb/-/create-point-cb-1.2.0.tgz", "integrity": "sha512-r4l6IO/YGI7hIZRMLggOzwM6XO80+Fdcv4hx1fXCEdU+hKd7zZki6i+cbYfK9OliMwMYx1wPfQLU/snvS+Dygw==", - "license": "MIT", - "dependencies": { + "requires": { "type-func": "^1.0.1" } }, - "node_modules/crossvent": { + "crossvent": { "version": "1.5.5", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/crossvent/-/crossvent-1.5.5.tgz", - "integrity": "sha1-rSCHjkkh6b5z2daXb4suzQ9xoLE=", - "license": "MIT", - "dependencies": { + "resolved": "https://registry.npmjs.org/crossvent/-/crossvent-1.5.5.tgz", + "integrity": "sha512-MY4xhBYEnVi+pmTpHCOCsCLYczc0PVtGdPBz6NXNXxikLaUZo4HdAeUb1UqAo3t3yXAloSelTmfxJ+/oUqkW5w==", + "requires": { "custom-event": "^1.0.0" } }, - "node_modules/custom-event": { + "custom-event": { "version": "1.0.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", - "license": "MIT" + "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", + "integrity": "sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==" }, - "node_modules/custom-event-polyfill": { + "custom-event-polyfill": { "version": "1.0.7", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/custom-event-polyfill/-/custom-event-polyfill-1.0.7.tgz", - "integrity": "sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/custom-event-polyfill/-/custom-event-polyfill-1.0.7.tgz", + "integrity": "sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==" }, - "node_modules/deepmerge": { + "deepmerge": { "version": "4.3.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==" }, - "node_modules/dialog-polyfill": { + "dialog-polyfill": { "version": "0.5.6", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/dialog-polyfill/-/dialog-polyfill-0.5.6.tgz", - "integrity": "sha512-ZbVDJI9uvxPAKze6z146rmfUZjBqNEwcnFTVamQzXH+svluiV7swmVIGr7miwADgfgt1G2JQIytypM9fbyhX4w==", - "license": "BSD" + "resolved": "https://registry.npmjs.org/dialog-polyfill/-/dialog-polyfill-0.5.6.tgz", + "integrity": "sha512-ZbVDJI9uvxPAKze6z146rmfUZjBqNEwcnFTVamQzXH+svluiV7swmVIGr7miwADgfgt1G2JQIytypM9fbyhX4w==" }, - "node_modules/dom-autoscroller": { + "dom-autoscroller": { "version": "2.3.4", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/dom-autoscroller/-/dom-autoscroller-2.3.4.tgz", + "resolved": "https://registry.npmjs.org/dom-autoscroller/-/dom-autoscroller-2.3.4.tgz", "integrity": "sha512-HcAdt/2Dq9x4CG6LWXc2x9Iq0MJPAu8fuzHncclq7byufqYEYVtx9sZ/dyzR+gdj4qwEC9p27Lw1G2HRRYX6jQ==", - "license": "MIT", - "dependencies": { + "requires": { "animation-frame-polyfill": "^1.0.0", "create-point-cb": "^1.0.0", "dom-mousemove-dispatcher": "^1.0.1", @@ -211,93 +161,81 @@ "type-func": "^1.0.1" } }, - "node_modules/dom-mousemove-dispatcher": { + "dom-mousemove-dispatcher": { "version": "1.0.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/dom-mousemove-dispatcher/-/dom-mousemove-dispatcher-1.0.1.tgz", - "integrity": "sha512-NMdqqMbgW8kqOdmod2hkS+9hD/v7h4XoSvwU9qqe+wAA/O+ba0jhpbfW0Kb/fCyR0RX9jf4dwfQrl04LQX4FzQ==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/dom-mousemove-dispatcher/-/dom-mousemove-dispatcher-1.0.1.tgz", + "integrity": "sha512-NMdqqMbgW8kqOdmod2hkS+9hD/v7h4XoSvwU9qqe+wAA/O+ba0jhpbfW0Kb/fCyR0RX9jf4dwfQrl04LQX4FzQ==" }, - "node_modules/dom-plane": { + "dom-plane": { "version": "1.0.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/dom-plane/-/dom-plane-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/dom-plane/-/dom-plane-1.0.2.tgz", "integrity": "sha512-/tR67G6ZGSciXoZLsD706yLxEXvX3mG/OWE8YNYj3A1yU/RAimtPXzklVTu5Y5xoeMoloA/Y+MaNjQm9apgAww==", - "license": "MIT", - "dependencies": { + "requires": { "create-point-cb": "^1.0.0" } }, - "node_modules/dom-set": { + "dom-set": { "version": "1.1.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/dom-set/-/dom-set-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/dom-set/-/dom-set-1.1.1.tgz", "integrity": "sha512-sUi2aSvRsK3Ixx++gwX9cnaWk9ZxGVFry8+HnTRVmDimybU5PaiI4wX0o00mVtjFKlQNZLmtGoPTLorYbN0+Rw==", - "license": "WTFPL", - "dependencies": { + "requires": { "array-from": "^2.1.1", "is-array": "^1.0.1", "iselement": "^1.1.4" } }, - "node_modules/dompurify": { - "version": "3.0.11", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/dompurify/-/dompurify-3.0.11.tgz", - "integrity": "sha512-Fan4uMuyB26gFV3ovPoEoQbxRRPfTu3CvImyZnhGq5fsIEO+gEFLp45ISFt+kQBWsK5ulDdT0oV28jS1UrwQLg==", - "license": "(MPL-2.0 OR Apache-2.0)" + "dompurify": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.5.tgz", + "integrity": "sha512-lwG+n5h8QNpxtyrJW/gJWckL+1/DQiYMX8f7t8Z2AZTPw1esVrqjI63i7Zc2Gz0aKzLVMYC1V1PL/ky+aY/NgA==" }, - "node_modules/downloadjs": { + "downloadjs": { "version": "1.4.7", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/downloadjs/-/downloadjs-1.4.7.tgz", - "integrity": "sha1-9p+W+UDg0FU9rCkROYZaPNAQHjw=", - "license": "MIT" + "resolved": "https://registry.npmjs.org/downloadjs/-/downloadjs-1.4.7.tgz", + "integrity": "sha512-LN1gO7+u9xjU5oEScGFKvXhYf7Y/empUIIEAGBs1LzUq/rg5duiDrkuH5A2lQGd5jfMOb9X9usDa2oVXwJ0U/Q==" }, - "node_modules/dragula": { + "dragula": { "version": "3.7.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/dragula/-/dragula-3.7.3.tgz", + "resolved": "https://registry.npmjs.org/dragula/-/dragula-3.7.3.tgz", "integrity": "sha512-/rRg4zRhcpf81TyDhaHLtXt6sEywdfpv1cRUMeFFy7DuypH2U0WUL0GTdyAQvXegviT4PJK4KuMmOaIDpICseQ==", - "license": "MIT", - "dependencies": { + "requires": { "contra": "1.9.4", "crossvent": "1.5.5" } }, - "node_modules/eventemitter3": { + "eventemitter3": { "version": "4.0.7", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" }, - "node_modules/fast-deep-equal": { + "fast-deep-equal": { "version": "3.1.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, - "node_modules/fast-diff": { + "fast-diff": { "version": "1.3.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/fast-diff/-/fast-diff-1.3.0.tgz", - "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", - "license": "Apache-2.0" + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==" }, - "node_modules/fast-json-patch": { + "fast-json-patch": { "version": "3.1.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/fast-json-patch/-/fast-json-patch-3.1.1.tgz", - "integrity": "sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.1.tgz", + "integrity": "sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==" }, - "node_modules/fetch-ponyfill": { + "fetch-ponyfill": { "version": "7.1.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/fetch-ponyfill/-/fetch-ponyfill-7.1.0.tgz", + "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-7.1.0.tgz", "integrity": "sha512-FhbbL55dj/qdVO3YNK7ZEkshvj3eQ7EuIGV2I6ic/2YiocvyWv+7jg2s4AyS0wdRU75s3tA8ZxI/xPigb0v5Aw==", - "license": "MIT", - "dependencies": { + "requires": { "node-fetch": "~2.6.1" } }, - "node_modules/formiojs": { - "version": "4.19.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/formiojs/-/formiojs-4.19.1.tgz", - "integrity": "sha512-CCgeDYYdnLbExr6Q4NmZZf4BVaUsQ3KFo2y772tM53YH3hIRaiR02PzcGIwmYf1s9Fsq1HOUa9Mc2E25soNxrg==", - "license": "MIT", - "dependencies": { + "formiojs": { + "version": "4.19.4", + "resolved": "https://registry.npmjs.org/formiojs/-/formiojs-4.19.4.tgz", + "integrity": "sha512-bVWAqyJ4gb8lGXHLi/XKJGu4Sn0IPBM3IporBtMcOBEUVtNKn3/PLB2lGKbzh5rF2QeEX1Uwb81oeakzDdSUTA==", + "requires": { "@formio/bootstrap3": "2.12.4-rc.1", "@formio/choices.js": "10.2.1", "@formio/semantic": "2.6.1", @@ -337,291 +275,212 @@ "vanilla-picker": "^2.12.1" } }, - "node_modules/fuse.js": { + "fuse.js": { "version": "6.6.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/fuse.js/-/fuse.js-6.6.2.tgz", - "integrity": "sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA==", - "license": "Apache-2.0", - "engines": { - "node": ">=10" - } + "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.6.2.tgz", + "integrity": "sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA==" }, - "node_modules/i18next": { + "i18next": { "version": "22.4.12", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/i18next/-/i18next-22.4.12.tgz", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-22.4.12.tgz", "integrity": "sha512-2lE+vRXxQ3lGLub1CVbwgO0IfkLHmUSDVOAVdPh22CsxttMXi+35n2qgxh2wZIkKl6t/NMzPfgFPRDiFQOmiCg==", - "funding": [ - { - "type": "individual", - "url": "https://locize.com" - }, - { - "type": "individual", - "url": "https://locize.com/i18next.html" - }, - { - "type": "individual", - "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" - } - ], - "license": "MIT", - "dependencies": { + "requires": { "@babel/runtime": "^7.20.6" } }, - "node_modules/idb": { + "idb": { "version": "7.1.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/idb/-/idb-7.1.1.tgz", - "integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==", - "license": "ISC" + "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz", + "integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==" }, - "node_modules/is-array": { + "is-array": { "version": "1.0.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/is-array/-/is-array-1.0.1.tgz", - "integrity": "sha512-gxiZ+y/u67AzpeFmAmo4CbtME/bs7J2C++su5zQzvQyaxUqVzkh69DI+jN+KZuSO6JaH6TIIU6M6LhqxMjxEpw==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/is-array/-/is-array-1.0.1.tgz", + "integrity": "sha512-gxiZ+y/u67AzpeFmAmo4CbtME/bs7J2C++su5zQzvQyaxUqVzkh69DI+jN+KZuSO6JaH6TIIU6M6LhqxMjxEpw==" }, - "node_modules/iselement": { + "iselement": { "version": "1.1.4", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/iselement/-/iselement-1.1.4.tgz", - "integrity": "sha512-4Q519eWmbHO1pbimiz7H1iJRUHVmAmfh0viSsUD+oAwVO4ntZt7gpf8i8AShVBTyOvRTZNYNBpUxOIvwZR+ffw==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/iselement/-/iselement-1.1.4.tgz", + "integrity": "sha512-4Q519eWmbHO1pbimiz7H1iJRUHVmAmfh0viSsUD+oAwVO4ntZt7gpf8i8AShVBTyOvRTZNYNBpUxOIvwZR+ffw==" }, - "node_modules/ismobilejs": { + "ismobilejs": { "version": "1.1.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ismobilejs/-/ismobilejs-1.1.1.tgz", - "integrity": "sha512-VaFW53yt8QO61k2WJui0dHf4SlL8lxBofUuUmwBo0ljPk0Drz2TiuDW4jo3wDcv41qy/SxrJ+VAzJ/qYqsmzRw==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ismobilejs/-/ismobilejs-1.1.1.tgz", + "integrity": "sha512-VaFW53yt8QO61k2WJui0dHf4SlL8lxBofUuUmwBo0ljPk0Drz2TiuDW4jo3wDcv41qy/SxrJ+VAzJ/qYqsmzRw==" }, - "node_modules/json-logic-js": { + "json-logic-js": { "version": "2.0.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/json-logic-js/-/json-logic-js-2.0.2.tgz", - "integrity": "sha512-ZBtBdMJieqQcH7IX/LaBsr5pX+Y5JIW+EhejtM3Ffg2jdN9Iwf+Ht6TbHnvAZ/YtwyuhPaCBlnvzrwVeWdvGDQ==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-logic-js/-/json-logic-js-2.0.2.tgz", + "integrity": "sha512-ZBtBdMJieqQcH7IX/LaBsr5pX+Y5JIW+EhejtM3Ffg2jdN9Iwf+Ht6TbHnvAZ/YtwyuhPaCBlnvzrwVeWdvGDQ==" }, - "node_modules/jstimezonedetect": { + "jstimezonedetect": { "version": "1.0.7", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/jstimezonedetect/-/jstimezonedetect-1.0.7.tgz", + "resolved": "https://registry.npmjs.org/jstimezonedetect/-/jstimezonedetect-1.0.7.tgz", "integrity": "sha512-ARADHortktl9IZ1tr4GHwGPIAzgz3mLNCbR/YjWtRtc/O0o634O3NeFlpLjv95EvuDA5dc8z6yfgbS8nUc4zcQ==" }, - "node_modules/jwt-decode": { + "jwt-decode": { "version": "3.1.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/jwt-decode/-/jwt-decode-3.1.2.tgz", - "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", + "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" }, - "node_modules/lodash": { + "lodash": { "version": "4.17.21", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash-es": { + "lodash-es": { "version": "4.17.21", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/lodash-es/-/lodash-es-4.17.21.tgz", - "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" }, - "node_modules/lodash.clonedeep": { + "lodash.clonedeep": { "version": "4.5.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" }, - "node_modules/lodash.isequal": { + "lodash.isequal": { "version": "4.5.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" }, - "node_modules/moment": { + "moment": { "version": "2.30.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/moment/-/moment-2.30.1.tgz", - "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", - "license": "MIT", - "engines": { - "node": "*" - } - }, - "node_modules/moment-timezone": { - "version": "0.5.43", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/moment-timezone/-/moment-timezone-0.5.43.tgz", - "integrity": "sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==", - "license": "MIT", - "dependencies": { + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==" + }, + "moment-timezone": { + "version": "0.5.45", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.45.tgz", + "integrity": "sha512-HIWmqA86KcmCAhnMAN0wuDOARV/525R2+lOLotuGFzn4HO+FH+/645z2wx0Dt3iDv6/p61SIvKnDstISainhLQ==", + "requires": { "moment": "^2.29.4" - }, - "engines": { - "node": "*" } }, - "node_modules/native-promise-only": { + "native-promise-only": { "version": "0.8.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/native-promise-only/-/native-promise-only-0.8.1.tgz", - "integrity": "sha1-IKMYwwy0X3H+et+/eyHJnBRy7xE=", - "license": "MIT" + "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", + "integrity": "sha512-zkVhZUA3y8mbz652WrL5x0fB0ehrBkulWT3TomAQ9iDtyXZvzKeEA6GPxAItBYeNYl5yngKRX612qHOhvMkDeg==" }, - "node_modules/node-fetch": { + "node-fetch": { "version": "2.6.13", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/node-fetch/-/node-fetch-2.6.13.tgz", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.13.tgz", "integrity": "sha512-StxNAxh15zr77QvvkmveSQ8uCQ4+v5FkvNTj0OESmiHu+VRi/gXArXtkWMElOsOUNLtUEvI4yS+rdtOHZTwlQA==", - "license": "MIT", - "dependencies": { + "requires": { "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } } }, - "node_modules/parchment": { - "version": "3.0.0-rc.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/parchment/-/parchment-3.0.0-rc.0.tgz", - "integrity": "sha512-JyVx3qaAkFPOCrJpENNYnQkxBYRbo9oPEU2LMJX4g1czXmwtzLDWztFRe90BXrw/LBRLDfZpHcL8TvIGkS1vIA==", - "license": "BSD-3-Clause" - }, - "node_modules/quill": { - "version": "2.0.0-rc.4", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/quill/-/quill-2.0.0-rc.4.tgz", - "integrity": "sha512-Fzz7JBH91zLK4sRMysAxXpZrredhFjCGjK4FWkcujQPOV+P8LSMUsuHcPg2g8ZU9Fu6dtRTrRTc/XBYBP9jWGg==", - "license": "BSD-3-Clause", - "dependencies": { + "parchment": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/parchment/-/parchment-3.0.0.tgz", + "integrity": "sha512-HUrJFQ/StvgmXRcQ1ftY6VEZUq3jA2t9ncFN4F84J/vN0/FPpQF+8FKXb3l6fLces6q0uOHj6NJn+2xvZnxO6A==" + }, + "quill": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/quill/-/quill-2.0.2.tgz", + "integrity": "sha512-QfazNrhMakEdRG57IoYFwffUIr04LWJxbS/ZkidRFXYCQt63c1gK6Z7IHUXMx/Vh25WgPBU42oBaNzQ0K1R/xw==", + "requires": { "eventemitter3": "^5.0.1", "lodash-es": "^4.17.21", - "parchment": "3.0.0-rc.0", + "parchment": "^3.0.0", "quill-delta": "^5.1.0" }, - "engines": { - "npm": ">=8.2.3" + "dependencies": { + "eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" + } } }, - "node_modules/quill-delta": { + "quill-delta": { "version": "5.1.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/quill-delta/-/quill-delta-5.1.0.tgz", + "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-5.1.0.tgz", "integrity": "sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==", - "license": "MIT", - "dependencies": { + "requires": { "fast-diff": "^1.3.0", "lodash.clonedeep": "^4.5.0", "lodash.isequal": "^4.5.0" - }, - "engines": { - "node": ">= 12.0.0" } }, - "node_modules/quill/node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "license": "MIT" - }, - "node_modules/redux": { + "redux": { "version": "4.2.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/redux/-/redux-4.2.1.tgz", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", - "license": "MIT", - "dependencies": { + "requires": { "@babel/runtime": "^7.9.2" } }, - "node_modules/regenerator-runtime": { + "regenerator-runtime": { "version": "0.14.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, - "node_modules/resize-observer-polyfill": { + "resize-observer-polyfill": { "version": "1.5.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", - "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==" }, - "node_modules/signature_pad": { + "signature_pad": { "version": "4.2.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/signature_pad/-/signature_pad-4.2.0.tgz", - "integrity": "sha512-YLWysmaUBaC5wosAKkgbX7XI+LBv2w5L0QUcI6Jc4moHYzv9BUBJtAyNLpWzHjtjKTeWOH6bfP4a4pzf0UinfQ==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/signature_pad/-/signature_pad-4.2.0.tgz", + "integrity": "sha512-YLWysmaUBaC5wosAKkgbX7XI+LBv2w5L0QUcI6Jc4moHYzv9BUBJtAyNLpWzHjtjKTeWOH6bfP4a4pzf0UinfQ==" }, - "node_modules/spark-md5": { + "spark-md5": { "version": "2.0.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/spark-md5/-/spark-md5-2.0.2.tgz", - "integrity": "sha512-9WfT+FYBEvlrOOBEs484/zmbtSX4BlGjzXih1qIEWA1yhHbcqgcMHkiwXoWk2Sq1aJjLpcs6ZKV7JxrDNjIlNg==", - "license": "WTFPL" + "resolved": "https://registry.npmjs.org/spark-md5/-/spark-md5-2.0.2.tgz", + "integrity": "sha512-9WfT+FYBEvlrOOBEs484/zmbtSX4BlGjzXih1qIEWA1yhHbcqgcMHkiwXoWk2Sq1aJjLpcs6ZKV7JxrDNjIlNg==" }, - "node_modules/string-hash": { + "string-hash": { "version": "1.1.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/string-hash/-/string-hash-1.1.3.tgz", - "integrity": "sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A==", - "license": "CC0-1.0" + "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", + "integrity": "sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A==" }, - "node_modules/ticky": { + "ticky": { "version": "1.0.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ticky/-/ticky-1.0.1.tgz", - "integrity": "sha1-t8+nHnaPHJAAxJe5FRswlHxQ5G0=", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ticky/-/ticky-1.0.1.tgz", + "integrity": "sha512-RX35iq/D+lrsqhcPWIazM9ELkjOe30MSeoBHQHSsRwd1YuhJO5ui1K1/R0r7N3mFvbLBs33idw+eR6j+w6i/DA==" }, - "node_modules/tippy.js": { + "tippy.js": { "version": "6.3.7", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/tippy.js/-/tippy.js-6.3.7.tgz", + "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz", "integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==", - "license": "MIT", - "dependencies": { + "requires": { "@popperjs/core": "^2.9.0" } }, - "node_modules/tr46": { + "tr46": { "version": "0.0.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, - "node_modules/type-func": { + "type-func": { "version": "1.0.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/type-func/-/type-func-1.0.3.tgz", - "integrity": "sha512-YA90CUk+i00tWESPNRMahywXhAz+12NLJLKlOWrgHIbqaFXjdZrWstRghaibOW/IxhPjui4SmXxO/03XSGRIjA==", - "license": "MIT" + "resolved": "https://registry.npmjs.org/type-func/-/type-func-1.0.3.tgz", + "integrity": "sha512-YA90CUk+i00tWESPNRMahywXhAz+12NLJLKlOWrgHIbqaFXjdZrWstRghaibOW/IxhPjui4SmXxO/03XSGRIjA==" }, - "node_modules/uuid": { + "uuid": { "version": "9.0.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==" }, - "node_modules/vanilla-picker": { + "vanilla-picker": { "version": "2.12.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/vanilla-picker/-/vanilla-picker-2.12.3.tgz", + "resolved": "https://registry.npmjs.org/vanilla-picker/-/vanilla-picker-2.12.3.tgz", "integrity": "sha512-qVkT1E7yMbUsB2mmJNFmaXMWE2hF8ffqzMMwe9zdAikd8u2VfnsVY2HQcOUi2F38bgbxzlJBEdS1UUhOXdF9GQ==", - "license": "ISC", - "dependencies": { + "requires": { "@sphinxxxx/color-conversion": "^2.2.2" } }, - "node_modules/webidl-conversions": { + "webidl-conversions": { "version": "3.0.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause" + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, - "node_modules/whatwg-url": { + "whatwg-url": { "version": "5.0.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/whatwg-url/-/whatwg-url-5.0.0.tgz", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "license": "MIT", - "dependencies": { + "requires": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } diff --git a/.github/workspace/formiojs/package.json b/.github/workspace/formiojs/package.json index d66814cc..dbff2682 100644 --- a/.github/workspace/formiojs/package.json +++ b/.github/workspace/formiojs/package.json @@ -30,7 +30,7 @@ }, "devDependencies": {}, "dependencies": { - "formiojs": "4.19.1", + "formiojs": "4.19.4", "moment": "^2.29.4" } } diff --git a/lib/formio.changelog.md b/lib/formio.changelog.md index 0f1cbfde..03a724a8 100644 --- a/lib/formio.changelog.md +++ b/lib/formio.changelog.md @@ -4,6 +4,75 @@ All notable changes to this project will be documented in this file The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 4.19.4 +### Changed + - Official Release + +## 4.19.4-rc.3 +### Changed + - FIO-8493: Added null check for this.root in builder mode + +## 4.19.4-rc.2 +### Changed + - FIO-8402: fixed an issue where Validation Triggering on initial Form load + +## 4.19.4-rc.1 +### Changed + - FIO-7395: Fixed the issue with loading nested form + - FIO-8433 fixed restore draft for nested forms + - FIO-8281: fixed selectData property for multiple select component + +### Changed + - FIO-8199: Fixes an issue where Checkbox does not have id and for attributes + +## 4.19.3 +### Changed + - Official Release + +## 4.19.3-rc.3 +### Changed + - FIO-8360 fixed submission state for nested form + +## 4.19.3-rc.2 +### Changed + - Resolved merge conflict with saveDraft + +## 4.19.3-rc.1 +### Changed + - FIO-8330 fixed saving draft if saveDraft and skipDraftRestore are true + - FIO-8342 fixed triggering saveDraft after submitting the form + - FIO-8111 fixed saveDraft Trigger for nested forms + - FIO-8074 Added Storage Type to Radio Components + - FIO-7595 fixed incorrect value for conditionally hidden Checkbox + - FIO-8240 fixed skipDraftRestore effect for the nested Forms + +## 4.19.2 +### Changed + - Official Release + +## 4.19.2-rc.5 +### Changed + - FIO-8280: Fixed setting incorrect option label + +## 4.19.2-rc.4 +### Changed + - FIO-7445: fixed an issue with interpolated data in HTML + +### Changed + - FIO-8091: added selectData calculation for url/resource select components + +## 4.19.2-rc.3 +### Changed + - FIO-7445: fixed an issue where the interpolated data does not show up on PDF + - FIO-8091: added selectData calculation for url/resource select components + +## 4.19.2-rc.1 +### Changed + - FIO-8009 fixed display of the required asterisk + - FIO-8109 fixed save draft triggering for nested components + - FIO-8146 fixed saveDraft triggering for nested forms after submitting + - FIO-4871 fixed calculated value issues + ## 4.19.1 ### Changed - Official Release diff --git a/lib/formio.full.css b/lib/formio.full.css index c5512a2a..8be739b1 100644 --- a/lib/formio.full.css +++ b/lib/formio.full.css @@ -3440,10 +3440,6 @@ body.formio-dialog-open { justify-content: flex-end; } -.formio-dialog.formio-dialog-theme-default .formio-dialog-buttons { - *zoom: 1; -} - .formio-dialog.formio-dialog-theme-default .formio-dialog-buttons:after { content: ""; display: table; @@ -3576,8 +3572,8 @@ body.formio-dialog-open { color: #EB0000; } -.formio-component-radio.formio-component-label-hidden.required .label-position-right.form-check-label:before, -.formio-component-selectboxes.formio-component-label-hidden.required .label-position-right.form-check-label:before { +.formio-component-radio.formio-component-label-hidden.required .form-check .label-position-right.form-check-label:before, +.formio-component-selectboxes.formio-component-label-hidden.required .form-check .label-position-right.form-check-label:before { right: 20px; } diff --git a/lib/formio.full.js b/lib/formio.full.js index 6e91f4a0..a33e3fc1 100644 --- a/lib/formio.full.js +++ b/lib/formio.full.js @@ -59,7 +59,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.weak-map.js */ \"./node_modules/core-js/modules/es.weak-map.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _Element2 = _interopRequireDefault(__webpack_require__(/*! ./Element */ \"./lib/Element.js\"));\nvar _Formio = __webpack_require__(/*! ./Formio */ \"./lib/Formio.js\");\nvar _displays = _interopRequireDefault(__webpack_require__(/*! ./displays */ \"./lib/displays/index.js\"));\nvar _templates = _interopRequireDefault(__webpack_require__(/*! ./templates */ \"./lib/templates/index.js\"));\nvar FormioUtils = _interopRequireWildcard(__webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar Form = /*#__PURE__*/function (_Element) {\n _inherits(Form, _Element);\n var _super = _createSuper(Form);\n /**\n * Creates an easy to use interface for embedding webforms, pdfs, and wizards into your application.\n *\n * @param {Object} element - The DOM element you wish to render this form within.\n * @param {Object | string} form - Either a Form JSON schema or the URL of a hosted form via. form.io.\n * @param {Object} options - The options to create a new form instance.\n * @param {boolean} options.readOnly - Set this form to readOnly\n * @param {boolean} options.noAlerts - Set to true to disable the alerts dialog.\n * @param {boolean} options.i18n - The translation file for this rendering. @see https://github.com/formio/formio.js/blob/master/i18n.js\n * @param {boolean} options.template - Provides a way to inject custom logic into the creation of every element rendered within the form.\n *\n * @example\n * import Form from 'formiojs/Form';\n * const form = new Form(document.getElementById('formio'), 'https://examples.form.io/example');\n * form.build();\n */\n function Form() {\n var _this;\n _classCallCheck(this, Form);\n var options = (arguments.length <= 0 ? undefined : arguments[0]) instanceof HTMLElement ? arguments.length <= 2 ? undefined : arguments[2] : arguments.length <= 1 ? undefined : arguments[1];\n if (_Formio.GlobalFormio.options && _Formio.GlobalFormio.options.form) {\n options = Object.assign(options, _Formio.GlobalFormio.options.form);\n }\n _this = _super.call(this, options);\n if (_this.options.useSessionToken) {\n _Formio.GlobalFormio.useSessionToken(_this.options);\n }\n _this.ready = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this.readyResolve = resolve;\n _this.readyReject = reject;\n });\n _this.instance = null;\n if ((arguments.length <= 0 ? undefined : arguments[0]) instanceof HTMLElement) {\n _this.element = arguments.length <= 0 ? undefined : arguments[0];\n _this.options = (arguments.length <= 2 ? undefined : arguments[2]) || {};\n _this.options.events = _this.events;\n _this.setForm(arguments.length <= 1 ? undefined : arguments[1]).then(function () {\n return _this.readyResolve(_this.instance);\n })[\"catch\"](_this.readyReject);\n } else if (arguments.length <= 0 ? undefined : arguments[0]) {\n _this.element = null;\n _this.options = (arguments.length <= 1 ? undefined : arguments[1]) || {};\n _this.options.events = _this.events;\n _this.setForm(arguments.length <= 0 ? undefined : arguments[0]).then(function () {\n return _this.readyResolve(_this.instance);\n })[\"catch\"](_this.readyReject);\n } else {\n _this.element = null;\n _this.options = {};\n _this.options.events = _this.events;\n }\n _this.display = '';\n return _this;\n }\n\n /**\n * Create a new form instance provided the display of the form.\n *\n * @param {string} display - The display of the form, either \"wizard\", \"form\", or \"pdf\"\n * @return {*}\n */\n _createClass(Form, [{\n key: \"create\",\n value: function create(display) {\n if (this.options && (this.options.flatten || this.options.renderMode === 'flat')) {\n display = 'form';\n }\n this.display = display;\n if (_displays[\"default\"].displays[display]) {\n return new _displays[\"default\"].displays[display](this.element, this.options);\n } else {\n // eslint-disable-next-line new-cap\n return new _displays[\"default\"].displays['webform'](this.element, this.options);\n }\n }\n\n /**\n * Sets the form. Either as JSON or a URL to a form JSON schema.\n *\n * @param {string|object} formParam - Either the form JSON or the URL of the form json.\n * @return {*}\n */\n }, {\n key: \"form\",\n get:\n /**\n * Returns the loaded forms JSON.\n *\n * @return {object} - The loaded form's JSON\n */\n function get() {\n return this._form;\n }\n\n /**\n * Changes the display of the form.\n *\n * @param {string} display - The display to set this form. Either \"wizard\", \"form\", or \"pdf\"\n * @return {Promise}\n */,\n set: function set(formParam) {\n return this.setForm(formParam);\n }\n }, {\n key: \"errorForm\",\n value: function errorForm(err) {\n return {\n components: [{\n 'label': 'HTML',\n 'tag': 'div',\n 'className': 'error error-message alert alert-danger ui red message',\n 'attrs': [{\n 'attr': 'role',\n 'value': 'alert'\n }],\n 'key': 'errorMessage',\n 'type': 'htmlelement',\n 'input': false,\n 'content': typeof err === 'string' ? err : err.message\n }]\n };\n }\n }, {\n key: \"setForm\",\n value: function setForm(formParam) {\n var _this2 = this;\n var result;\n formParam = formParam || this.form;\n if (typeof formParam === 'string') {\n var formio = new _Formio.GlobalFormio(formParam);\n var error;\n result = this.getSubmission(formio, this.options)[\"catch\"](function (err) {\n error = err;\n }).then(function (submission) {\n return formio.loadForm()\n // If the form returned an error, show it instead of the form.\n [\"catch\"](function (err) {\n error = err;\n }).then(function (form) {\n // If the submission returned an error, show it instead of the form.\n if (error) {\n form = _this2.errorForm(error);\n }\n _this2.instance = _this2.instance || _this2.create(form.display);\n _this2.instance.url = formParam;\n _this2.instance.nosubmit = false;\n _this2._form = _this2.instance.form = form;\n if (submission) {\n _this2.instance.submission = submission;\n }\n if (error) {\n throw error;\n }\n return _this2.instance;\n });\n });\n } else {\n this.instance = this.instance || this.create(formParam.display);\n this._form = this.instance.form = formParam;\n result = this.instance.ready;\n }\n\n // A redraw has occurred so save off the new element in case of a setDisplay causing a rebuild.\n return result.then(function () {\n _this2.element = _this2.instance.element;\n return _this2.instance;\n });\n }\n }, {\n key: \"getSubmission\",\n value: function getSubmission(formio, opts) {\n if (formio.submissionId) {\n return formio.loadSubmission(null, opts);\n }\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"setDisplay\",\n value: function setDisplay(display) {\n if (this.display === display && this.instance) {\n return _nativePromiseOnly[\"default\"].resolve(this.instance);\n }\n this.form.display = display;\n this.instance.destroy();\n this.instance = this.create(display);\n return this.setForm(this.form);\n }\n }, {\n key: \"empty\",\n value: function empty() {\n if (this.element) {\n while (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n }\n }\n }, {\n key: \"sanitize\",\n value:\n /**\n * Sanitize an html string.\n *\n * @param string\n * @returns {*}\n */\n function sanitize(dirty, forceSanitize) {\n // If Sanitize is turned off\n if (this.options.sanitize === false && !forceSanitize) {\n return dirty;\n }\n return FormioUtils.sanitize(dirty, this.options);\n }\n }, {\n key: \"setContent\",\n value: function setContent(element, content, forceSanitize) {\n if (element instanceof HTMLElement) {\n element.innerHTML = this.sanitize(content, forceSanitize);\n return true;\n }\n return false;\n }\n\n /**\n * Build a new form.\n *\n * @return {Promise}\n */\n }, {\n key: \"build\",\n value: function build() {\n var _this3 = this;\n if (!this.instance) {\n return _nativePromiseOnly[\"default\"].reject('Form not ready. Use form.ready promise');\n }\n if (!this.element) {\n return _nativePromiseOnly[\"default\"].reject('No DOM element for form.');\n }\n\n // Add temporary loader.\n var template = this.options && this.options.template ? this.options.template : 'bootstrap';\n var loader = _templates[\"default\"][template].loader || _templates[\"default\"].bootstrap.loader;\n this.setContent(this.element, loader.form);\n return this.render().then(function (html) {\n _this3.setContent(_this3.element, html);\n return _this3.attach(_this3.element).then(function () {\n return _this3.instance;\n });\n }).then(function (param) {\n _this3.emit('build', param);\n return param;\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n if (!this.instance) {\n return _nativePromiseOnly[\"default\"].reject('Form not ready. Use form.ready promise');\n }\n return _nativePromiseOnly[\"default\"].resolve(this.instance.render()).then(function (param) {\n _this4.emit('render', param);\n return param;\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this5 = this;\n if (!this.instance) {\n return _nativePromiseOnly[\"default\"].reject('Form not ready. Use form.ready promise');\n }\n this.element = element;\n return this.instance.attach(this.element).then(function (param) {\n _this5.emit('attach', param);\n return param;\n });\n }\n }], [{\n key: \"embed\",\n value: function embed(_embed) {\n var _this6 = this;\n return new _nativePromiseOnly[\"default\"](function (resolve) {\n if (!_embed || !_embed.src) {\n resolve();\n }\n var id = _this6.id || \"formio-\".concat(Math.random().toString(36).substring(7));\n var className = _embed[\"class\"] || 'formio-form-wrapper';\n var code = _embed.styles ? \"\") : '';\n code += \"
\");\n document.write(code);\n var attempts = 0;\n var wait = setInterval(function () {\n attempts++;\n var formElement = document.getElementById(id);\n if (formElement || attempts > 10) {\n resolve(new Form(formElement, _embed.src).ready);\n clearInterval(wait);\n }\n }, 10);\n });\n }\n }]);\n return Form;\n}(_Element2[\"default\"]); // Allow simple embedding.\nexports[\"default\"] = Form;\n_Formio.GlobalFormio.embedForm = function (embed) {\n return Form.embed(embed);\n};\n\n/**\n * Factory that creates a new form based on the form parameters.\n *\n * @param element {HMTLElement} - The HTML Element to add this form to.\n * @param form {string|Object} - The src of the form, or a form object.\n * @param options {Object} - The options to create this form.\n *\n * @return {Promise} - When the form is instance is ready.\n */\n_Formio.GlobalFormio.createForm = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _construct(Form, args).ready;\n};\n_Formio.GlobalFormio.Form = Form;\n\n//# sourceURL=webpack://Formio/./lib/Form.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.weak-map.js */ \"./node_modules/core-js/modules/es.weak-map.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _Element2 = _interopRequireDefault(__webpack_require__(/*! ./Element */ \"./lib/Element.js\"));\nvar _Formio = __webpack_require__(/*! ./Formio */ \"./lib/Formio.js\");\nvar _displays = _interopRequireDefault(__webpack_require__(/*! ./displays */ \"./lib/displays/index.js\"));\nvar _templates = _interopRequireDefault(__webpack_require__(/*! ./templates */ \"./lib/templates/index.js\"));\nvar FormioUtils = _interopRequireWildcard(__webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar Form = /*#__PURE__*/function (_Element) {\n _inherits(Form, _Element);\n var _super = _createSuper(Form);\n /**\n * Creates an easy to use interface for embedding webforms, pdfs, and wizards into your application.\n *\n * @param {Object} element - The DOM element you wish to render this form within.\n * @param {Object | string} form - Either a Form JSON schema or the URL of a hosted form via. form.io.\n * @param {Object} options - The options to create a new form instance.\n * @param {boolean} options.readOnly - Set this form to readOnly\n * @param {boolean} options.noAlerts - Set to true to disable the alerts dialog.\n * @param {boolean} options.i18n - The translation file for this rendering. @see https://github.com/formio/formio.js/blob/master/i18n.js\n * @param {boolean} options.template - Provides a way to inject custom logic into the creation of every element rendered within the form.\n *\n * @example\n * import Form from 'formiojs/Form';\n * const form = new Form(document.getElementById('formio'), 'https://examples.form.io/example');\n * form.build();\n */\n function Form() {\n var _this;\n _classCallCheck(this, Form);\n var options = (arguments.length <= 0 ? undefined : arguments[0]) instanceof HTMLElement ? arguments.length <= 2 ? undefined : arguments[2] : arguments.length <= 1 ? undefined : arguments[1];\n if (_Formio.GlobalFormio.options && _Formio.GlobalFormio.options.form) {\n options = Object.assign(options, _Formio.GlobalFormio.options.form);\n }\n _this = _super.call(this, options);\n if (_this.options.useSessionToken) {\n _Formio.GlobalFormio.useSessionToken(_this.options);\n }\n _this.ready = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this.readyResolve = resolve;\n _this.readyReject = reject;\n });\n _this.instance = null;\n if ((arguments.length <= 0 ? undefined : arguments[0]) instanceof HTMLElement) {\n _this.element = arguments.length <= 0 ? undefined : arguments[0];\n _this.options = (arguments.length <= 2 ? undefined : arguments[2]) || {};\n _this.options.events = _this.events;\n _this.setForm(arguments.length <= 1 ? undefined : arguments[1]).then(function () {\n return _this.readyResolve(_this.instance);\n })[\"catch\"](_this.readyReject);\n } else if (arguments.length <= 0 ? undefined : arguments[0]) {\n _this.element = null;\n _this.options = (arguments.length <= 1 ? undefined : arguments[1]) || {};\n _this.options.events = _this.events;\n _this.setForm(arguments.length <= 0 ? undefined : arguments[0]).then(function () {\n return _this.readyResolve(_this.instance);\n })[\"catch\"](_this.readyReject);\n } else {\n _this.element = null;\n _this.options = {};\n _this.options.events = _this.events;\n }\n _this.display = '';\n return _this;\n }\n\n /**\n * Create a new form instance provided the display of the form.\n *\n * @param {string} display - The display of the form, either \"wizard\", \"form\", or \"pdf\"\n * @return {*}\n */\n _createClass(Form, [{\n key: \"create\",\n value: function create(display) {\n if (this.options && (this.options.flatten || this.options.renderMode === 'flat')) {\n display = 'form';\n }\n this.display = display;\n if (_displays[\"default\"].displays[display]) {\n return new _displays[\"default\"].displays[display](this.element, this.options);\n } else {\n // eslint-disable-next-line new-cap\n return new _displays[\"default\"].displays['webform'](this.element, this.options);\n }\n }\n\n /**\n * Sets the form. Either as JSON or a URL to a form JSON schema.\n *\n * @param {string|object} formParam - Either the form JSON or the URL of the form json.\n * @return {*}\n */\n }, {\n key: \"form\",\n get:\n /**\n * Returns the loaded forms JSON.\n *\n * @return {object} - The loaded form's JSON\n */\n function get() {\n return this._form;\n }\n\n /**\n * Changes the display of the form.\n *\n * @param {string} display - The display to set this form. Either \"wizard\", \"form\", or \"pdf\"\n * @return {Promise}\n */,\n set: function set(formParam) {\n return this.setForm(formParam);\n }\n }, {\n key: \"errorForm\",\n value: function errorForm(err) {\n return {\n components: [{\n 'label': 'HTML',\n 'tag': 'div',\n 'className': 'error error-message alert alert-danger ui red message',\n 'attrs': [{\n 'attr': 'role',\n 'value': 'alert'\n }],\n 'key': 'errorMessage',\n 'type': 'htmlelement',\n 'input': false,\n 'content': typeof err === 'string' ? err : err.message\n }]\n };\n }\n\n /**\n * Check Subdirectories path and provide correct options\n *\n * @param {string} url - The the URL of the form json.\n * @param {form} object - The form json.\n * @return {object} The initial options with base and project.\n */\n }, {\n key: \"getFormInitOptions\",\n value: function getFormInitOptions(url, form) {\n var options = {};\n var index = url.indexOf(form === null || form === void 0 ? void 0 : form.path);\n // form url doesn't include form path\n if (index === -1) {\n return options;\n }\n var projectUrl = url.substring(0, index - 1);\n var urlParts = _Formio.GlobalFormio.getUrlParts(projectUrl);\n // project url doesn't include subdirectories path\n if (!urlParts || urlParts.filter(function (part) {\n return !!part;\n }).length < 4) {\n return options;\n }\n var baseUrl = \"\".concat(urlParts[1]).concat(urlParts[2]);\n // Skip if baseUrl has already been set\n if (baseUrl !== _Formio.GlobalFormio.baseUrl) {\n return {\n base: baseUrl,\n project: projectUrl\n };\n }\n return {};\n }\n }, {\n key: \"setForm\",\n value: function setForm(formParam) {\n var _this2 = this;\n var result;\n formParam = formParam || this.form;\n if (typeof formParam === 'string') {\n var formio = new _Formio.GlobalFormio(formParam);\n var error;\n result = this.getSubmission(formio, this.options)[\"catch\"](function (err) {\n error = err;\n }).then(function (submission) {\n return formio.loadForm()\n // If the form returned an error, show it instead of the form.\n [\"catch\"](function (err) {\n error = err;\n }).then(function (form) {\n // If the submission returned an error, show it instead of the form.\n if (error) {\n form = _this2.errorForm(error);\n }\n _this2.instance = _this2.instance || _this2.create(form.display);\n var options = _this2.getFormInitOptions(formParam, form);\n _this2.instance.setUrl(formParam, options);\n _this2.instance.nosubmit = false;\n _this2._form = _this2.instance.form = form;\n if (submission) {\n _this2.instance.submission = submission;\n }\n if (error) {\n throw error;\n }\n return _this2.instance;\n });\n });\n } else {\n this.instance = this.instance || this.create(formParam.display);\n this._form = this.instance.form = formParam;\n result = this.instance.ready;\n }\n\n // A redraw has occurred so save off the new element in case of a setDisplay causing a rebuild.\n return result.then(function () {\n _this2.element = _this2.instance.element;\n return _this2.instance;\n });\n }\n }, {\n key: \"getSubmission\",\n value: function getSubmission(formio, opts) {\n if (formio.submissionId) {\n return formio.loadSubmission(null, opts);\n }\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"setDisplay\",\n value: function setDisplay(display) {\n if (this.display === display && this.instance) {\n return _nativePromiseOnly[\"default\"].resolve(this.instance);\n }\n this.form.display = display;\n this.instance.destroy();\n this.instance = this.create(display);\n return this.setForm(this.form);\n }\n }, {\n key: \"empty\",\n value: function empty() {\n if (this.element) {\n while (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n }\n }\n }, {\n key: \"sanitize\",\n value:\n /**\n * Sanitize an html string.\n *\n * @param string\n * @returns {*}\n */\n function sanitize(dirty, forceSanitize) {\n // If Sanitize is turned off\n if (this.options.sanitize === false && !forceSanitize) {\n return dirty;\n }\n return FormioUtils.sanitize(dirty, this.options);\n }\n }, {\n key: \"setContent\",\n value: function setContent(element, content, forceSanitize) {\n if (element instanceof HTMLElement) {\n element.innerHTML = this.sanitize(content, forceSanitize);\n return true;\n }\n return false;\n }\n\n /**\n * Build a new form.\n *\n * @return {Promise}\n */\n }, {\n key: \"build\",\n value: function build() {\n var _this3 = this;\n if (!this.instance) {\n return _nativePromiseOnly[\"default\"].reject('Form not ready. Use form.ready promise');\n }\n if (!this.element) {\n return _nativePromiseOnly[\"default\"].reject('No DOM element for form.');\n }\n\n // Add temporary loader.\n var template = this.options && this.options.template ? this.options.template : 'bootstrap';\n var loader = _templates[\"default\"][template].loader || _templates[\"default\"].bootstrap.loader;\n this.setContent(this.element, loader.form);\n return this.render().then(function (html) {\n _this3.setContent(_this3.element, html);\n return _this3.attach(_this3.element).then(function () {\n return _this3.instance;\n });\n }).then(function (param) {\n _this3.emit('build', param);\n return param;\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n if (!this.instance) {\n return _nativePromiseOnly[\"default\"].reject('Form not ready. Use form.ready promise');\n }\n return _nativePromiseOnly[\"default\"].resolve(this.instance.render()).then(function (param) {\n _this4.emit('render', param);\n return param;\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this5 = this;\n if (!this.instance) {\n return _nativePromiseOnly[\"default\"].reject('Form not ready. Use form.ready promise');\n }\n this.element = element;\n return this.instance.attach(this.element).then(function (param) {\n _this5.emit('attach', param);\n return param;\n });\n }\n }], [{\n key: \"embed\",\n value: function embed(_embed) {\n var _this6 = this;\n return new _nativePromiseOnly[\"default\"](function (resolve) {\n if (!_embed || !_embed.src) {\n resolve();\n }\n var id = _this6.id || \"formio-\".concat(Math.random().toString(36).substring(7));\n var className = _embed[\"class\"] || 'formio-form-wrapper';\n var code = _embed.styles ? \"\") : '';\n code += \"
\");\n document.write(code);\n var attempts = 0;\n var wait = setInterval(function () {\n attempts++;\n var formElement = document.getElementById(id);\n if (formElement || attempts > 10) {\n resolve(new Form(formElement, _embed.src).ready);\n clearInterval(wait);\n }\n }, 10);\n });\n }\n }]);\n return Form;\n}(_Element2[\"default\"]); // Allow simple embedding.\nexports[\"default\"] = Form;\n_Formio.GlobalFormio.embedForm = function (embed) {\n return Form.embed(embed);\n};\n\n/**\n * Factory that creates a new form based on the form parameters.\n *\n * @param element {HMTLElement} - The HTML Element to add this form to.\n * @param form {string|Object} - The src of the form, or a form object.\n * @param options {Object} - The options to create this form.\n *\n * @return {Promise} - When the form is instance is ready.\n */\n_Formio.GlobalFormio.createForm = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _construct(Form, args).ready;\n};\n_Formio.GlobalFormio.Form = Form;\n\n//# sourceURL=webpack://Formio/./lib/Form.js?"); /***/ }), @@ -81,7 +81,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = exports.GlobalFormio = void 0;\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.match.js */ \"./node_modules/core-js/modules/es.string.match.js\");\n__webpack_require__(/*! core-js/modules/es.string.search.js */ \"./node_modules/core-js/modules/es.string.search.js\");\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.constructor.js */ \"./node_modules/core-js/modules/es.regexp.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.sort.js */ \"./node_modules/core-js/modules/es.array.sort.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _fetchPonyfill2 = _interopRequireDefault(__webpack_require__(/*! fetch-ponyfill */ \"./node_modules/fetch-ponyfill/build/fetch-browser.js\"));\nvar _EventEmitter = _interopRequireDefault(__webpack_require__(/*! ./EventEmitter */ \"./lib/EventEmitter.js\"));\nvar _browserCookies = _interopRequireDefault(__webpack_require__(/*! browser-cookies */ \"./node_modules/browser-cookies/src/browser-cookies.js\"));\nvar _providers = _interopRequireDefault(__webpack_require__(/*! ./providers */ \"./lib/providers/index.js\"));\nvar _intersection2 = _interopRequireDefault(__webpack_require__(/*! lodash/intersection */ \"./node_modules/lodash/intersection.js\"));\nvar _get2 = _interopRequireDefault(__webpack_require__(/*! lodash/get */ \"./node_modules/lodash/get.js\"));\nvar _cloneDeep2 = _interopRequireDefault(__webpack_require__(/*! lodash/cloneDeep */ \"./node_modules/lodash/cloneDeep.js\"));\nvar _defaults2 = _interopRequireDefault(__webpack_require__(/*! lodash/defaults */ \"./node_modules/lodash/defaults.js\"));\nvar _utils = __webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\");\nvar _jwtDecode = _interopRequireDefault(__webpack_require__(/*! jwt-decode */ \"./node_modules/jwt-decode/build/jwt-decode.esm.js\"));\n__webpack_require__(/*! ./polyfills */ \"./lib/polyfills/index.js\");\nvar _CDN = _interopRequireDefault(__webpack_require__(/*! ./CDN */ \"./lib/CDN.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _fetchPonyfill = (0, _fetchPonyfill2[\"default\"])({\n Promise: _nativePromiseOnly[\"default\"]\n }),\n fetch = _fetchPonyfill.fetch,\n Headers = _fetchPonyfill.Headers;\nvar isBoolean = function isBoolean(val) {\n return _typeof(val) === _typeof(true);\n};\nvar isNil = function isNil(val) {\n return val === null || val === undefined;\n};\nvar isObject = function isObject(val) {\n return val && _typeof(val) === 'object';\n};\nfunction cloneResponse(response) {\n var copy = (0, _cloneDeep2[\"default\"])(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/**\n * The Formio interface class.\n *\n * let formio = new Formio('https://examples.form.io/example');\n */\nvar Formio = /*#__PURE__*/function () {\n /* eslint-disable max-statements */\n function Formio(path) {\n var _this = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, Formio);\n // Ensure we have an instance of Formio.\n if (!(this instanceof Formio)) {\n return new Formio(path);\n }\n\n // Initialize our variables.\n this.base = '';\n this.projectsUrl = '';\n this.projectUrl = '';\n this.projectId = '';\n this.roleUrl = '';\n this.rolesUrl = '';\n this.roleId = '';\n this.formUrl = '';\n this.formsUrl = '';\n this.formId = '';\n this.submissionsUrl = '';\n this.submissionUrl = '';\n this.submissionId = '';\n this.actionsUrl = '';\n this.actionId = '';\n this.actionUrl = '';\n this.vsUrl = '';\n this.vId = '';\n this.vUrl = '';\n this.query = '';\n\n // Store the original path and options.\n this.path = path;\n this.options = options;\n if (options.useSessionToken) {\n Formio.useSessionToken(options);\n }\n if (options.hasOwnProperty('base')) {\n this.base = options.base;\n } else if (Formio.baseUrl) {\n this.base = Formio.baseUrl;\n } else if (typeof window !== 'undefined') {\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 || \"\".concat(this.base, \"/project\");\n this.projectsUrl = \"\".concat(this.base, \"/project\");\n this.projectId = false;\n this.query = '';\n return;\n }\n if (options.hasOwnProperty('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\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\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 parts = [];\n var 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 = \"?\".concat(queryparts[1]);\n }\n\n // Register a specific path.\n var registerPath = function registerPath(name, base) {\n _this[\"\".concat(name, \"sUrl\")] = \"\".concat(base, \"/\").concat(name);\n var regex = new RegExp(\"/\".concat(name, \"/([^/]+)\"));\n if (path.search(regex) !== -1) {\n parts = path.match(regex);\n _this[\"\".concat(name, \"Url\")] = parts ? base + parts[0] : '';\n _this[\"\".concat(name, \"Id\")] = parts.length > 1 ? parts[1] : '';\n base += parts[0];\n }\n return base;\n };\n\n // Register an array of items.\n var registerItems = function registerItems(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 } 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 = \"^\".concat(hostName.replace(/\\//g, '\\\\/'), \".[^/]+\");\n var match = project.match(new RegExp(regex));\n this.projectUrl = match ? match[0] : hostName;\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 } else if (hostName === this.base) {\n // Get project id as first part of path (subdirectory).\n if (hostparts.length > 3 && path.split('/').length > 1) {\n var isFile = path.match(/.json/);\n var pathParts = path.split('/');\n if (isFile) {\n this.projectUrl = hostName;\n } else {\n pathParts.shift(); // Throw away the first /.\n this.projectId = pathParts.shift();\n path = \"/\".concat(pathParts.join('/'));\n this.projectUrl = \"\".concat(hostName, \"/\").concat(this.projectId);\n }\n }\n } else {\n // Get project id from subdomain.\n if (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 || \"\".concat(this.base, \"/project\");\n }\n\n // Configure Role urls and role ids.\n registerItems(['role'], this.projectUrl);\n\n // Configure Form urls and form ids.\n if (/(^|\\/)(form)($|\\/)/.test(path)) {\n registerItems(['form', ['submission', 'action', 'v']], this.projectUrl);\n } else {\n var subRegEx = new RegExp('/(submission|action|v)($|/.*)');\n var subs = path.match(subRegEx);\n this.pathType = subs && subs.length > 1 ? subs[1] : '';\n path = path.replace(subRegEx, '');\n path = path.replace(/\\/$/, '');\n this.formsUrl = \"\".concat(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[\"\".concat(item, \"sUrl\")] = \"\".concat(this.projectUrl + path, \"/\").concat(item);\n if (this.pathType === item && subs.length > 2 && subs[2]) {\n this[\"\".concat(item, \"Id\")] = subs[2].replace(/^\\/+|\\/+$/g, '');\n this[\"\".concat(item, \"Url\")] = this.projectUrl + path + subs[0];\n }\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 _createClass(Formio, [{\n key: \"delete\",\n value: function _delete(type, opts) {\n var _id = \"\".concat(type, \"Id\");\n var _url = \"\".concat(type, \"Url\");\n if (!this[_id]) {\n return _nativePromiseOnly[\"default\"].reject('Nothing to delete');\n }\n Formio.cache = {};\n return this.makeRequest(type, this[_url], 'delete', null, opts);\n }\n }, {\n key: \"index\",\n value: function index(type, query, opts) {\n var _url = \"\".concat(type, \"Url\");\n query = query || '';\n if (query && isObject(query)) {\n query = \"?\".concat(Formio.serialize(query.params));\n }\n return this.makeRequest(type, this[_url] + query, 'get', null, opts);\n }\n }, {\n key: \"save\",\n value: function save(type, data, opts) {\n var _id = \"\".concat(type, \"Id\");\n var _url = \"\".concat(type, \"Url\");\n var method = this[_id] || data._id ? 'put' : 'post';\n var reqUrl = this[_id] ? this[_url] : this[\"\".concat(type, \"sUrl\")];\n if (!this[_id] && data._id && method === 'put' && !reqUrl.includes(data._id)) {\n reqUrl += \"/\".concat(data._id);\n }\n Formio.cache = {};\n return this.makeRequest(type, reqUrl + this.query, method, data, opts);\n }\n }, {\n key: \"load\",\n value: function load(type, query, opts) {\n var _id = \"\".concat(type, \"Id\");\n var _url = \"\".concat(type, \"Url\");\n if (query && isObject(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = this.query ? \"\".concat(this.query, \"&\").concat(query) : \"?\".concat(query);\n } else {\n query = this.query;\n }\n if (!this[_id]) {\n return _nativePromiseOnly[\"default\"].reject(\"Missing \".concat(_id));\n }\n var url = this[_url] + query;\n if (type === 'form' && !isNaN(parseInt(this.vId)) && parseInt(this.vId) !== 0) {\n url += url.match(/\\?/) ? '&' : '?';\n url += \"formRevision=\".concat(this.vId);\n }\n return this.makeRequest(type, url, 'get', null, opts);\n }\n }, {\n key: \"makeRequest\",\n value: function makeRequest() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return Formio.makeRequest.apply(Formio, [this].concat(args));\n }\n }, {\n key: \"loadProject\",\n value: function loadProject(query, opts) {\n return this.load('project', query, opts);\n }\n }, {\n key: \"saveProject\",\n value: function saveProject(data, opts) {\n return this.save('project', data, opts);\n }\n }, {\n key: \"deleteProject\",\n value: function deleteProject(opts) {\n return this[\"delete\"]('project', opts);\n }\n }, {\n key: \"loadRole\",\n value: function loadRole(opts) {\n return this.load('role', null, opts);\n }\n }, {\n key: \"saveRole\",\n value: function saveRole(data, opts) {\n return this.save('role', data, opts);\n }\n }, {\n key: \"deleteRole\",\n value: function deleteRole(opts) {\n return this[\"delete\"]('role', opts);\n }\n }, {\n key: \"loadRoles\",\n value: function loadRoles(opts) {\n return this.index('roles', null, opts);\n }\n }, {\n key: \"loadForm\",\n value: function loadForm(query, opts) {\n var _this2 = this;\n return this.load('form', query, opts).then(function (currentForm) {\n // Check to see if there isn't a number in vId.\n if (!currentForm.revisions || isNaN(parseInt(_this2.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' && _this2.submissionId) {\n return currentForm;\n }\n // eslint-disable-next-line eqeqeq\n if (currentForm._vid == _this2.vId || currentForm.revisionId === _this2.vId) {\n return currentForm;\n }\n // If they specified a revision form, load the revised form components.\n if (query && isObject(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = _this2.query ? \"\".concat(_this2.query, \"&\").concat(query) : \"?\".concat(query);\n } else {\n query = _this2.query;\n }\n return _this2.makeRequest('form', _this2.vUrl + query, 'get', null, opts).then(function (revisionForm) {\n currentForm._vid = revisionForm._vid;\n currentForm.components = revisionForm.components;\n currentForm.settings = revisionForm.settings;\n currentForm.revisionId = revisionForm.revisionId;\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 () {\n return Object.assign({}, currentForm);\n });\n });\n }\n }, {\n key: \"saveForm\",\n value: function saveForm(data, opts) {\n return this.save('form', data, opts);\n }\n }, {\n key: \"deleteForm\",\n value: function deleteForm(opts) {\n return this[\"delete\"]('form', opts);\n }\n }, {\n key: \"loadForms\",\n value: function loadForms(query, opts) {\n return this.index('forms', query, opts);\n }\n }, {\n key: \"loadSubmission\",\n value: function loadSubmission(query, opts) {\n var _this3 = this;\n return this.load('submission', query, opts).then(function (submission) {\n _this3.vId = submission._frid || submission._fvid;\n _this3.vUrl = \"\".concat(_this3.formUrl, \"/v/\").concat(_this3.vId);\n return submission;\n });\n }\n }, {\n key: \"saveSubmission\",\n value: function saveSubmission(data, opts) {\n if (!isNaN(parseInt(this.vId))) {\n data._fvid = this.vId;\n }\n return this.save('submission', data, opts);\n }\n }, {\n key: \"deleteSubmission\",\n value: function deleteSubmission(opts) {\n return this[\"delete\"]('submission', opts);\n }\n }, {\n key: \"loadSubmissions\",\n value: function loadSubmissions(query, opts) {\n return this.index('submissions', query, opts);\n }\n }, {\n key: \"loadAction\",\n value: function loadAction(query, opts) {\n return this.load('action', query, opts);\n }\n }, {\n key: \"saveAction\",\n value: function saveAction(data, opts) {\n return this.save('action', data, opts);\n }\n }, {\n key: \"deleteAction\",\n value: function deleteAction(opts) {\n return this[\"delete\"]('action', opts);\n }\n }, {\n key: \"loadActions\",\n value: function loadActions(query, opts) {\n return this.index('actions', query, opts);\n }\n }, {\n key: \"availableActions\",\n value: function availableActions() {\n return this.makeRequest('availableActions', \"\".concat(this.formUrl, \"/actions\"));\n }\n }, {\n key: \"actionInfo\",\n value: function actionInfo(name) {\n return this.makeRequest('actionInfo', \"\".concat(this.formUrl, \"/actions/\").concat(name));\n }\n }, {\n key: \"isObjectId\",\n value: function isObjectId(id) {\n var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');\n return checkForHexRegExp.test(id);\n }\n }, {\n key: \"getProjectId\",\n value: function getProjectId() {\n if (!this.projectId) {\n return _nativePromiseOnly[\"default\"].resolve('');\n }\n if (this.isObjectId(this.projectId)) {\n return _nativePromiseOnly[\"default\"].resolve(this.projectId);\n } else {\n return this.loadProject().then(function (project) {\n return project._id;\n });\n }\n }\n }, {\n key: \"getFormId\",\n value: function getFormId() {\n if (!this.formId) {\n return _nativePromiseOnly[\"default\"].resolve('');\n }\n if (this.isObjectId(this.formId)) {\n return _nativePromiseOnly[\"default\"].resolve(this.formId);\n } else {\n return this.loadForm().then(function (form) {\n return form._id;\n });\n }\n }\n }, {\n key: \"currentUser\",\n value: function currentUser(options) {\n return Formio.currentUser(this, options);\n }\n }, {\n key: \"accessInfo\",\n value: function accessInfo() {\n return Formio.accessInfo(this);\n }\n\n /**\n * Sets OAuth Logout URL.\n *\n * @return {*}\n */\n }, {\n key: \"oauthLogoutURI\",\n value: function oauthLogoutURI(uri, options) {\n return Formio.oauthLogoutURI(uri, Object.assign({\n formio: this\n }, this.options, options));\n }\n\n /**\n * Returns the JWT token for this instance.\n *\n * @return {*}\n */\n }, {\n key: \"getToken\",\n value: function getToken(options) {\n return Formio.getToken(Object.assign({\n formio: this\n }, this.options, options));\n }\n\n /**\n * Sets the JWT token for this instance.\n *\n * @return {*}\n */\n }, {\n key: \"setToken\",\n value: function setToken(token, options) {\n return Formio.setToken(token, Object.assign({\n formio: this\n }, this.options, options));\n }\n\n /**\n * Returns a temporary authentication token for single purpose token generation.\n */\n }, {\n key: \"getTempToken\",\n value: function getTempToken(expire, allowed, options) {\n var token = Formio.getToken(options);\n if (!token) {\n return _nativePromiseOnly[\"default\"].reject('You must be authenticated to generate a temporary auth token.');\n }\n var authUrl = Formio.authUrl || this.projectUrl;\n return this.makeRequest('tempToken', \"\".concat(authUrl, \"/token\"), 'GET', null, {\n ignoreCache: true,\n header: new Headers({\n 'x-expire': expire,\n 'x-allow': allowed\n })\n });\n }\n\n /**\n * Get a download url for a submission PDF of this submission.\n *\n * @return {*}\n */\n }, {\n key: \"getDownloadUrl\",\n value: function getDownloadUrl(form) {\n var _this4 = this;\n if (!this.submissionId) {\n return _nativePromiseOnly[\"default\"].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 _this4.getDownloadUrl(_form);\n });\n }\n var apiUrl = \"/project/\".concat(form.project);\n apiUrl += \"/form/\".concat(form._id);\n apiUrl += \"/submission/\".concat(this.submissionId);\n var postfix = form.submissionRevisions && form.settings.changeLog ? '/download/changelog' : '/download';\n apiUrl += postfix;\n var download = this.base + apiUrl;\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this4.getTempToken(3600, \"GET:\".concat(apiUrl)).then(function (tempToken) {\n download += \"?token=\".concat(tempToken.key);\n resolve(download);\n }, function () {\n resolve(download);\n })[\"catch\"](reject);\n });\n }\n }, {\n key: \"uploadFile\",\n value: function uploadFile(storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {\n var _this5 = this;\n var requestArgs = {\n provider: storage,\n method: 'upload',\n file: file,\n fileName: fileName,\n dir: dir\n };\n fileKey = fileKey || 'file';\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('fileRequest', requestArgs).then(function (result) {\n if (storage && isNil(result)) {\n var Provider = _providers[\"default\"].getProvider('storage', storage);\n if (Provider) {\n var provider = new Provider(_this5);\n if (uploadStartCallback) {\n uploadStartCallback();\n }\n return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions);\n } else {\n throw 'Storage provider not found';\n }\n }\n return result || {\n url: ''\n };\n });\n });\n return Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n }\n }, {\n key: \"downloadFile\",\n value: function downloadFile(file, options) {\n var _this6 = this;\n var requestArgs = {\n method: 'download',\n file: file\n };\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('fileRequest', requestArgs).then(function (result) {\n if (file.storage && isNil(result)) {\n var Provider = _providers[\"default\"].getProvider('storage', file.storage);\n if (Provider) {\n var provider = new Provider(_this6);\n return provider.downloadFile(file, options);\n } else {\n throw 'Storage provider not found';\n }\n }\n return result || {\n url: ''\n };\n });\n });\n return Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n }\n }, {\n key: \"deleteFile\",\n value: function deleteFile(file, options) {\n var _this7 = this;\n var requestArgs = {\n method: 'delete',\n file: file\n };\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('fileRequest', requestArgs).then(function (result) {\n if (file.storage && isNil(result)) {\n var Provider = _providers[\"default\"].getProvider('storage', file.storage);\n if (Provider) {\n var provider = new Provider(_this7);\n return provider.deleteFile(file, options);\n } else {\n throw 'Storage provider not found';\n }\n }\n return result || {\n url: ''\n };\n });\n });\n return Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\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 }, {\n key: \"userPermissions\",\n value: function userPermissions(user, form, submission) {\n return _nativePromiseOnly[\"default\"].all([form !== undefined ? _nativePromiseOnly[\"default\"].resolve(form) : this.loadForm(), user !== undefined ? _nativePromiseOnly[\"default\"].resolve(user) : this.currentUser(), submission !== undefined || !this.submissionId ? _nativePromiseOnly[\"default\"].resolve(submission) : this.loadSubmission(), this.accessInfo()]).then(function (results) {\n var form = results.shift();\n var user = results.shift() || {\n _id: false,\n roles: []\n };\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 } 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 _permission$type$spli = permission.type.split('_'),\n _permission$type$spli2 = _slicedToArray(_permission$type$spli, 2),\n perm = _permission$type$spli2[0],\n scope = _permission$type$spli2[1];\n if (['create', 'read', 'update', 'delete'].includes(perm)) {\n if ((0, _intersection2[\"default\"])(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 (0, _utils.eachComponent)(form.components, function (component, path) {\n if (component && component.defaultPermission) {\n var value = (0, _get2[\"default\"])(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 &&\n // 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 /**\n * Determine if the current user can submit a form.\n * @return {*}\n */\n }, {\n key: \"canSubmit\",\n value: function canSubmit() {\n var _this8 = 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 _this8.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 }, {\n key: \"getUrlParts\",\n value: function getUrlParts(url) {\n return Formio.getUrlParts(url, this);\n }\n }], [{\n key: \"useSessionToken\",\n value: function useSessionToken(options) {\n var tokenName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"Token\");\n var token = localStorage.getItem(tokenName);\n if (token) {\n localStorage.removeItem(tokenName);\n sessionStorage.setItem(tokenName, token);\n }\n var userName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"User\");\n var user = localStorage.getItem(userName);\n if (user) {\n localStorage.removeItem(userName);\n sessionStorage.setItem(userName, user);\n }\n localStorage.setItem('useSessionToken', true);\n }\n }, {\n key: \"loadProjects\",\n value: function loadProjects(query, opts) {\n query = query || '';\n if (isObject(query)) {\n query = \"?\".concat(Formio.serialize(query.params));\n }\n return Formio.makeStaticRequest(\"\".concat(Formio.baseUrl, \"/project\").concat(query), 'GET', null, opts);\n }\n }, {\n key: \"getUrlParts\",\n value: function getUrlParts(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 += \"(\".concat(base.replace(/^http[s]?:\\/\\//, ''), \")\");\n } else {\n regex += '([^/]+)';\n }\n regex += '($|\\\\/.*)';\n return url.match(new RegExp(regex));\n }\n }, {\n key: \"serialize\",\n value: function serialize(obj, _interpolate) {\n var str = [];\n var interpolate = function interpolate(item) {\n return _interpolate ? _interpolate(item) : item;\n };\n for (var p in obj) {\n if (obj.hasOwnProperty(p)) {\n str.push(\"\".concat(encodeURIComponent(p), \"=\").concat(encodeURIComponent(interpolate(obj[p]))));\n }\n }\n return str.join('&');\n }\n }, {\n key: \"getRequestArgs\",\n value: function getRequestArgs(formio, type, url, method, data, opts) {\n method = (method || 'GET').toUpperCase();\n if (!opts || !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 }, {\n key: \"makeStaticRequest\",\n value: function makeStaticRequest(url, method, data, opts) {\n var requestArgs = Formio.getRequestArgs(null, '', url, method, data, opts);\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('staticRequest', requestArgs).then(function (result) {\n if (isNil(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n });\n });\n return Formio.pluginAlter('wrapStaticRequestPromise', request, requestArgs);\n }\n }, {\n key: \"makeRequest\",\n value: function makeRequest(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\n //for Formio requests default Accept and Content-type headers\n if (!requestArgs.opts.headers) {\n requestArgs.opts.headers = {};\n }\n requestArgs.opts.headers = (0, _defaults2[\"default\"])(requestArgs.opts.headers, {\n 'Accept': 'application/json',\n 'Content-type': 'application/json'\n });\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('request', requestArgs).then(function (result) {\n if (isNil(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n });\n });\n return Formio.pluginAlter('wrapRequestPromise', request, requestArgs);\n }\n }, {\n key: \"request\",\n value: function request(url, method, data, header, opts) {\n if (!url) {\n return _nativePromiseOnly[\"default\"].reject('No url provided');\n }\n var _Formio = Formio;\n method = (method || 'GET').toUpperCase();\n\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 (isBoolean(opts)) {\n opts = {\n ignoreCache: opts\n };\n }\n if (!opts || !isObject(opts)) {\n opts = {};\n }\n\n // Generate a cachekey.\n var cacheKey = btoa(encodeURI(url));\n\n // Get the cached promise to save multiple loads.\n if (!opts.ignoreCache && method === 'GET' && _Formio.cache.hasOwnProperty(cacheKey)) {\n return _nativePromiseOnly[\"default\"].resolve(cloneResponse(_Formio.cache[cacheKey]));\n }\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\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\n // Allow plugins to alter the options.\n options = _Formio.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 = _Formio.pluginAlter('wrapFetchRequestPromise', _Formio.fetch(url, options), {\n url: url,\n method: method,\n data: data,\n opts: opts\n }).then(function (response) {\n // Allow plugins to respond.\n response = _Formio.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 } else if (response.status === 401) {\n _Formio.events.emit('formio.unauthorized', response.body);\n } else if (response.status === 416) {\n _Formio.events.emit('formio.rangeIsNotSatisfiable', response.body);\n } else if (response.status === 504) {\n return _nativePromiseOnly[\"default\"].reject(new Error('Network request failed'));\n }\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') ? response.json() : response.text()).then(function (error) {\n return _nativePromiseOnly[\"default\"].reject(error);\n });\n }\n\n // Handle fetch results\n var token = response.headers.get('x-jwt-token');\n\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' && !requestToken && token && !opts.external && !url.includes('token=') && !url.includes('x-jwt-token=')) {\n console.warn('Token was introduced in request.');\n tokenIntroduced = true;\n }\n if (response.status >= 200 && response.status < 300 && token && token !== '' && !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') ? response.json() : 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 && 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\n // Return the result with the headers.\n return {\n result: result,\n headers: headers\n };\n });\n }).then(function (result) {\n if (opts.getHeaders) {\n return result;\n }\n\n // Cache the response.\n if (method === 'GET') {\n _Formio.cache[cacheKey] = result;\n }\n return cloneResponse(result);\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 = new Error(\"Could not connect to API server (\".concat(err.message, \"): \").concat(url));\n err.networkError = true;\n }\n if (method === 'GET') {\n delete _Formio.cache[cacheKey];\n }\n return _nativePromiseOnly[\"default\"].reject(err);\n });\n return result;\n }\n\n // Needed to maintain reverse compatability...\n }, {\n key: \"token\",\n get: function get() {\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n return Formio.tokens.formioToken || '';\n }\n\n // Needed to maintain reverse compatability...\n ,\n set: function set(token) {\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n Formio.tokens.formioToken = token || '';\n }\n }, {\n key: \"setToken\",\n value: function setToken() {\n var token = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var opts = arguments.length > 1 ? arguments[1] : undefined;\n token = token || '';\n opts = typeof opts === 'string' ? {\n namespace: opts\n } : opts || {};\n var tokenName = \"\".concat(opts.namespace || Formio.namespace || 'formio', \"Token\");\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n var storage = localStorage.getItem('useSessionToken') ? sessionStorage : localStorage;\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 storage.removeItem(tokenName);\n } catch (err) {\n _browserCookies[\"default\"].erase(tokenName, {\n path: '/'\n });\n }\n Formio.tokens[tokenName] = token;\n return _nativePromiseOnly[\"default\"].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 storage.setItem(tokenName, token);\n } catch (err) {\n _browserCookies[\"default\"].set(tokenName, token, {\n path: '/'\n });\n }\n }\n // Return or updates the current user\n return this.currentUserResolved ? Formio.currentUser(opts.formio, opts) : _nativePromiseOnly[\"default\"].resolve(null);\n }\n }, {\n key: \"getToken\",\n value: function getToken(options) {\n options = typeof options === 'string' ? {\n namespace: options\n } : options || {};\n var tokenName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"Token\");\n var decodedTokenName = options.decode ? \"\".concat(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 var token = localStorage.getItem('useSessionToken') ? sessionStorage.getItem(tokenName) : localStorage.getItem(tokenName);\n Formio.tokens[tokenName] = token || '';\n if (options.decode) {\n Formio.tokens[decodedTokenName] = Formio.tokens[tokenName] ? (0, _jwtDecode[\"default\"])(Formio.tokens[tokenName]) : {};\n return Formio.tokens[decodedTokenName];\n }\n return Formio.tokens[tokenName];\n } catch (e) {\n Formio.tokens[tokenName] = _browserCookies[\"default\"].get(tokenName);\n return Formio.tokens[tokenName];\n }\n }\n }, {\n key: \"oauthLogoutURI\",\n value: function oauthLogoutURI(uri, options) {\n options = typeof options === 'string' ? {\n namespace: options\n } : options || {};\n var logoutURIName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"LogoutAuthUrl\");\n Formio.tokens[logoutURIName];\n localStorage.setItem(logoutURIName, uri);\n return Formio.tokens[logoutURIName];\n }\n }, {\n key: \"setUser\",\n value: function setUser(user) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var userName = \"\".concat(opts.namespace || Formio.namespace || 'formio', \"User\");\n var storage = localStorage.getItem('useSessionToken') ? sessionStorage : localStorage;\n if (!user) {\n if (!opts.fromToken) {\n opts.fromUser = true;\n Formio.setToken(null, opts);\n }\n\n // Emit an event on the cleared user.\n Formio.events.emit('formio.user', null);\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 return storage.removeItem(userName);\n } catch (err) {\n return _browserCookies[\"default\"].erase(userName, {\n path: '/'\n });\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 storage.setItem(userName, JSON.stringify(user));\n } catch (err) {\n _browserCookies[\"default\"].set(userName, JSON.stringify(user), {\n path: '/'\n });\n }\n\n // Emit an event on the authenticated user.\n Formio.events.emit('formio.user', user);\n }\n }, {\n key: \"getUser\",\n value: function getUser(options) {\n options = options || {};\n var userName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"User\");\n try {\n return JSON.parse((localStorage.getItem('useSessionToken') ? sessionStorage : localStorage).getItem(userName) || null);\n } catch (e) {\n return JSON.parse(_browserCookies[\"default\"].get(userName));\n }\n }\n }, {\n key: \"setBaseUrl\",\n value: function setBaseUrl(url) {\n Formio.baseUrl = url;\n if (!Formio.projectUrlSet) {\n Formio.projectUrl = url;\n }\n }\n }, {\n key: \"getBaseUrl\",\n value: function getBaseUrl() {\n return Formio.baseUrl;\n }\n }, {\n key: \"setApiUrl\",\n value: function setApiUrl(url) {\n return Formio.setBaseUrl(url);\n }\n }, {\n key: \"getApiUrl\",\n value: function getApiUrl() {\n return Formio.getBaseUrl();\n }\n }, {\n key: \"setAppUrl\",\n value: function setAppUrl(url) {\n console.warn('Formio.setAppUrl() is deprecated. Use Formio.setProjectUrl instead.');\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n }\n }, {\n key: \"setProjectUrl\",\n value: function setProjectUrl(url) {\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n }\n }, {\n key: \"setAuthUrl\",\n value: function setAuthUrl(url) {\n Formio.authUrl = url;\n }\n }, {\n key: \"getAppUrl\",\n value: function getAppUrl() {\n console.warn('Formio.getAppUrl() is deprecated. Use Formio.getProjectUrl instead.');\n return Formio.projectUrl;\n }\n }, {\n key: \"getProjectUrl\",\n value: function getProjectUrl() {\n return Formio.projectUrl;\n }\n }, {\n key: \"clearCache\",\n value: function clearCache() {\n Formio.cache = {};\n }\n }, {\n key: \"noop\",\n value: function noop() {}\n }, {\n key: \"identity\",\n value: function identity(value) {\n return value;\n }\n }, {\n key: \"deregisterPlugin\",\n value: function deregisterPlugin(plugin) {\n var beforeLength = Formio.plugins.length;\n Formio.plugins = Formio.plugins.filter(function (p) {\n if (p !== plugin && p.__name !== plugin) {\n return true;\n }\n (p.deregister || Formio.noop).call(plugin, Formio);\n return false;\n });\n return beforeLength !== Formio.plugins.length;\n }\n }, {\n key: \"registerPlugin\",\n value: function registerPlugin(plugin, name) {\n var __Formio = Formio;\n __Formio.plugins.push(plugin);\n __Formio.plugins.sort(function (a, b) {\n return (b.priority || 0) - (a.priority || 0);\n });\n plugin.__name = name;\n (plugin.init || __Formio.noop).call(plugin, __Formio);\n }\n }, {\n key: \"getPlugin\",\n value: function getPlugin(name) {\n var _iterator = _createForOfIteratorHelper(Formio.plugins),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var plugin = _step.value;\n if (plugin.__name === name) {\n return plugin;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return null;\n }\n }, {\n key: \"pluginWait\",\n value: function pluginWait(pluginFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n return _nativePromiseOnly[\"default\"].all(Formio.plugins.map(function (plugin) {\n var _ref;\n return (_ref = plugin[pluginFn] || Formio.noop).call.apply(_ref, [plugin].concat(args));\n }));\n }\n }, {\n key: \"pluginGet\",\n value: function pluginGet(pluginFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n var callPlugin = function callPlugin(index) {\n var _ref2;\n var plugin = Formio.plugins[index];\n if (!plugin) {\n return _nativePromiseOnly[\"default\"].resolve(null);\n }\n return _nativePromiseOnly[\"default\"].resolve((_ref2 = plugin[pluginFn] || Formio.noop).call.apply(_ref2, [plugin].concat(args))).then(function (result) {\n if (!isNil(result)) {\n return result;\n }\n return callPlugin(index + 1);\n });\n };\n return callPlugin(0);\n }\n }, {\n key: \"pluginAlter\",\n value: function pluginAlter(pluginFn, value) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) {\n args[_key4 - 2] = arguments[_key4];\n }\n return Formio.plugins.reduce(function (value, plugin) {\n return (plugin[pluginFn] || Formio.identity).apply(void 0, [value].concat(args));\n }, value);\n }\n }, {\n key: \"accessInfo\",\n value: function accessInfo(formio) {\n var projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'accessInfo', \"\".concat(projectUrl, \"/access\"));\n }\n }, {\n key: \"projectRoles\",\n value: function projectRoles(formio) {\n var projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'projectRoles', \"\".concat(projectUrl, \"/role\"));\n }\n }, {\n key: \"currentUser\",\n value: function currentUser(formio, options) {\n var _this9 = this;\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 Formio.pluginAlter('wrapStaticRequestPromise', _nativePromiseOnly[\"default\"].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 Formio.pluginAlter('wrapStaticRequestPromise', _nativePromiseOnly[\"default\"].resolve(null), {\n url: authUrl,\n method: 'GET',\n options: options\n });\n }\n this.currentUserResolved = false;\n return Formio.makeRequest(formio, 'currentUser', authUrl, 'GET', null, options).then(function (response) {\n _this9.currentUserResolved = true;\n Formio.setUser(response, options);\n return response;\n });\n }\n }, {\n key: \"logout\",\n value: function logout(formio, options) {\n options = options || {};\n options.formio = formio;\n var projectUrl = Formio.authUrl ? Formio.authUrl : formio ? formio.projectUrl : Formio.baseUrl;\n var logout = function logout() {\n Formio.setToken(null, options);\n Formio.setUser(null, options);\n Formio.clearCache();\n localStorage.removeItem('useSessionToken');\n };\n return Formio.makeRequest(formio, 'logout', \"\".concat(projectUrl, \"/logout\")).then(function (result) {\n logout();\n return result;\n })[\"catch\"](function (err) {\n logout();\n throw err;\n });\n }\n }, {\n key: \"pageQuery\",\n value: function pageQuery() {\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 } else if (item.indexOf('/') === 0) {\n pageQuery.paths = item.substr(1).split('/');\n }\n });\n return pageQuery;\n }\n }, {\n key: \"oAuthCurrentUser\",\n value: function oAuthCurrentUser(formio, token) {\n return Formio.currentUser(formio, {\n external: true,\n headers: {\n Authorization: \"Bearer \".concat(token)\n }\n });\n }\n }, {\n key: \"samlInit\",\n value: function samlInit(options) {\n options = 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\n // Set the relay if not provided.\n if (!options.relay) {\n options.relay = window.location.href;\n }\n\n // go to the saml sso endpoint for this project.\n var authUrl = Formio.authUrl || Formio.projectUrl;\n window.location.href = \"\".concat(authUrl, \"/saml/sso?relay=\").concat(encodeURI(options.relay));\n return false;\n }\n }, {\n key: \"oktaInit\",\n value: function oktaInit(options) {\n options = options || {};\n if ((typeof OktaAuth === \"undefined\" ? \"undefined\" : _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 _nativePromiseOnly[\"default\"].reject(errorMessage);\n }\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n var Okta = options.OktaAuth;\n delete options.OktaAuth;\n var authClient = new Okta(options);\n authClient.tokenManager.get('accessToken').then(function (accessToken) {\n if (accessToken) {\n resolve(Formio.oAuthCurrentUser(options.formio, accessToken.accessToken));\n } else if (location.hash) {\n authClient.token.parseFromUrl().then(function (token) {\n authClient.tokenManager.add('accessToken', token);\n resolve(Formio.oAuthCurrentUser(options.formio, token.accessToken));\n })[\"catch\"](function (err) {\n console.warn(err);\n reject(err);\n });\n } else {\n authClient.token.getWithRedirect({\n responseType: 'token',\n scopes: options.scopes\n });\n resolve(false);\n }\n })[\"catch\"](function (error) {\n reject(error);\n });\n });\n }\n }, {\n key: \"ssoInit\",\n value: function ssoInit(type, 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 _nativePromiseOnly[\"default\"].reject('Unknown SSO type');\n }\n }\n }, {\n key: \"requireLibrary\",\n value: function requireLibrary(name, property, src, polling, onload) {\n if (!Formio.libraries.hasOwnProperty(name)) {\n Formio.libraries[name] = {};\n Formio.libraries[name].ready = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n Formio.libraries[name].resolve = resolve;\n Formio.libraries[name].reject = reject;\n });\n var callbackName = \"\".concat(name, \"Callback\");\n if (!polling && !window[callbackName]) {\n window[callbackName] = function () {\n return Formio.libraries[name].resolve();\n };\n }\n\n // See if the plugin already exists.\n var plugin = (0, _get2[\"default\"])(window, property);\n if (plugin) {\n Formio.libraries[name].resolve(plugin);\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\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 if (onload) {\n element.addEventListener('load', function () {\n Formio.libraries[name].loaded = true;\n onload(Formio.libraries[name].ready);\n });\n }\n var _document = document,\n head = _document.head;\n if (head) {\n head.appendChild(element);\n }\n });\n\n // if no callback is provided, then check periodically for the script.\n if (polling) {\n var interval = setInterval(function () {\n var plugin = (0, _get2[\"default\"])(window, property);\n if (plugin) {\n clearInterval(interval);\n Formio.libraries[name].resolve(plugin);\n }\n }, 200);\n }\n }\n }\n var lib = Formio.libraries[name];\n return onload && lib.loaded ? onload(lib.ready) : lib.ready;\n }\n }, {\n key: \"libraryReady\",\n value: function libraryReady(name) {\n if (Formio.libraries.hasOwnProperty(name) && Formio.libraries[name].ready) {\n return Formio.libraries[name].ready;\n }\n return _nativePromiseOnly[\"default\"].reject(\"\".concat(name, \" library was not required.\"));\n }\n }, {\n key: \"addToGlobal\",\n value: function addToGlobal(global) {\n if (_typeof(global) === 'object' && !global.Formio) {\n global.Formio = Formio;\n }\n }\n }, {\n key: \"setPathType\",\n value: function setPathType(type) {\n if (typeof type === 'string') {\n Formio.pathType = type;\n }\n }\n }, {\n key: \"getPathType\",\n value: function getPathType() {\n return Formio.pathType;\n }\n }, {\n key: \"rulesEntities\",\n get: function get() {\n return {\n ValueSources: Formio.ValueSources,\n Conjunctions: Formio.Conjunctions,\n Operators: Formio.Operators,\n Transformers: Formio.Transformers,\n QuickRules: Formio.QuickRules,\n Rules: Formio.Rules\n };\n }\n }, {\n key: \"GlobalFormio\",\n get: function get() {\n if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.Formio) {\n return __webpack_require__.g.Formio;\n } else if (typeof window !== 'undefined' && window.Formio) {\n return window.Formio;\n }\n return Formio;\n }\n }]);\n return Formio;\n}(); // Define all the static properties.\n_defineProperty(Formio, \"currentUserResolved\", true);\nFormio.libraries = {};\nFormio.Promise = _nativePromiseOnly[\"default\"];\nFormio.fetch = fetch;\nFormio.Headers = Headers;\nFormio.baseUrl = 'https://api.form.io';\nFormio.projectUrl = Formio.baseUrl;\nFormio.authUrl = '';\nFormio.projectUrlSet = false;\nFormio.plugins = [];\nFormio.cache = {};\nFormio.Providers = _providers[\"default\"];\nFormio.version = '4.19.1';\nFormio.pathType = '';\nFormio.events = new _EventEmitter[\"default\"]();\nFormio.cdn = new _CDN[\"default\"]();\nif ((Formio.version || '').includes('rc')) {\n Formio.cdn.setBaseUrl('https://cdn.test-form.io');\n}\nif (typeof __webpack_require__.g !== 'undefined') {\n Formio.addToGlobal(__webpack_require__.g);\n}\nif (typeof window !== 'undefined') {\n Formio.addToGlobal(window);\n}\nvar GlobalFormio = Formio.GlobalFormio;\nexports.GlobalFormio = GlobalFormio;\nvar _default = Formio;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/Formio.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = exports.GlobalFormio = void 0;\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.match.js */ \"./node_modules/core-js/modules/es.string.match.js\");\n__webpack_require__(/*! core-js/modules/es.string.search.js */ \"./node_modules/core-js/modules/es.string.search.js\");\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.constructor.js */ \"./node_modules/core-js/modules/es.regexp.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.sort.js */ \"./node_modules/core-js/modules/es.array.sort.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _fetchPonyfill2 = _interopRequireDefault(__webpack_require__(/*! fetch-ponyfill */ \"./node_modules/fetch-ponyfill/build/fetch-browser.js\"));\nvar _EventEmitter = _interopRequireDefault(__webpack_require__(/*! ./EventEmitter */ \"./lib/EventEmitter.js\"));\nvar _browserCookies = _interopRequireDefault(__webpack_require__(/*! browser-cookies */ \"./node_modules/browser-cookies/src/browser-cookies.js\"));\nvar _providers = _interopRequireDefault(__webpack_require__(/*! ./providers */ \"./lib/providers/index.js\"));\nvar _intersection2 = _interopRequireDefault(__webpack_require__(/*! lodash/intersection */ \"./node_modules/lodash/intersection.js\"));\nvar _get2 = _interopRequireDefault(__webpack_require__(/*! lodash/get */ \"./node_modules/lodash/get.js\"));\nvar _cloneDeep2 = _interopRequireDefault(__webpack_require__(/*! lodash/cloneDeep */ \"./node_modules/lodash/cloneDeep.js\"));\nvar _defaults2 = _interopRequireDefault(__webpack_require__(/*! lodash/defaults */ \"./node_modules/lodash/defaults.js\"));\nvar _utils = __webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\");\nvar _jwtDecode = _interopRequireDefault(__webpack_require__(/*! jwt-decode */ \"./node_modules/jwt-decode/build/jwt-decode.esm.js\"));\n__webpack_require__(/*! ./polyfills */ \"./lib/polyfills/index.js\");\nvar _CDN = _interopRequireDefault(__webpack_require__(/*! ./CDN */ \"./lib/CDN.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _fetchPonyfill = (0, _fetchPonyfill2[\"default\"])({\n Promise: _nativePromiseOnly[\"default\"]\n }),\n fetch = _fetchPonyfill.fetch,\n Headers = _fetchPonyfill.Headers;\nvar isBoolean = function isBoolean(val) {\n return _typeof(val) === _typeof(true);\n};\nvar isNil = function isNil(val) {\n return val === null || val === undefined;\n};\nvar isObject = function isObject(val) {\n return val && _typeof(val) === 'object';\n};\nfunction cloneResponse(response) {\n var copy = (0, _cloneDeep2[\"default\"])(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/**\n * The Formio interface class.\n *\n * let formio = new Formio('https://examples.form.io/example');\n */\nvar Formio = /*#__PURE__*/function () {\n /* eslint-disable max-statements */\n function Formio(path) {\n var _this = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, Formio);\n // Ensure we have an instance of Formio.\n if (!(this instanceof Formio)) {\n return new Formio(path);\n }\n\n // Initialize our variables.\n this.base = '';\n this.projectsUrl = '';\n this.projectUrl = '';\n this.projectId = '';\n this.roleUrl = '';\n this.rolesUrl = '';\n this.roleId = '';\n this.formUrl = '';\n this.formsUrl = '';\n this.formId = '';\n this.submissionsUrl = '';\n this.submissionUrl = '';\n this.submissionId = '';\n this.actionsUrl = '';\n this.actionId = '';\n this.actionUrl = '';\n this.vsUrl = '';\n this.vId = '';\n this.vUrl = '';\n this.query = '';\n\n // Store the original path and options.\n this.path = path;\n this.options = options;\n if (options.useSessionToken) {\n Formio.useSessionToken(options);\n }\n if (options.hasOwnProperty('base')) {\n this.base = options.base;\n } else if (Formio.baseUrl) {\n this.base = Formio.baseUrl;\n } else if (typeof window !== 'undefined') {\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 || \"\".concat(this.base, \"/project\");\n this.projectsUrl = \"\".concat(this.base, \"/project\");\n this.projectId = false;\n this.query = '';\n return;\n }\n if (options.hasOwnProperty('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\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\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 parts = [];\n var 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 = \"?\".concat(queryparts[1]);\n }\n\n // Register a specific path.\n var registerPath = function registerPath(name, base) {\n _this[\"\".concat(name, \"sUrl\")] = \"\".concat(base, \"/\").concat(name);\n var regex = new RegExp(\"/\".concat(name, \"/([^/]+)\"));\n if (path.search(regex) !== -1) {\n parts = path.match(regex);\n _this[\"\".concat(name, \"Url\")] = parts ? base + parts[0] : '';\n _this[\"\".concat(name, \"Id\")] = parts.length > 1 ? parts[1] : '';\n base += parts[0];\n }\n return base;\n };\n\n // Register an array of items.\n var registerItems = function registerItems(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 } 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 = \"^\".concat(hostName.replace(/\\//g, '\\\\/'), \".[^/]+\");\n var match = project.match(new RegExp(regex));\n this.projectUrl = match ? match[0] : hostName;\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 } else if (hostName === this.base) {\n // Get project id as first part of path (subdirectory).\n if (hostparts.length > 3 && path.split('/').length > 1) {\n var isFile = path.match(/.json/);\n var pathParts = path.split('/');\n if (isFile) {\n this.projectUrl = hostName;\n } else {\n pathParts.shift(); // Throw away the first /.\n this.projectId = pathParts.shift();\n path = \"/\".concat(pathParts.join('/'));\n this.projectUrl = \"\".concat(hostName, \"/\").concat(this.projectId);\n }\n }\n } else {\n // Get project id from subdomain.\n if (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 || \"\".concat(this.base, \"/project\");\n }\n\n // Configure Role urls and role ids.\n registerItems(['role'], this.projectUrl);\n\n // Configure Form urls and form ids.\n if (/(^|\\/)(form)($|\\/)/.test(path)) {\n registerItems(['form', ['submission', 'action', 'v']], this.projectUrl);\n } else {\n var subRegEx = new RegExp('/(submission|action|v)($|/.*)');\n var subs = path.match(subRegEx);\n this.pathType = subs && subs.length > 1 ? subs[1] : '';\n path = path.replace(subRegEx, '');\n path = path.replace(/\\/$/, '');\n this.formsUrl = \"\".concat(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[\"\".concat(item, \"sUrl\")] = \"\".concat(this.projectUrl + path, \"/\").concat(item);\n if (this.pathType === item && subs.length > 2 && subs[2]) {\n this[\"\".concat(item, \"Id\")] = subs[2].replace(/^\\/+|\\/+$/g, '');\n this[\"\".concat(item, \"Url\")] = this.projectUrl + path + subs[0];\n }\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 _createClass(Formio, [{\n key: \"delete\",\n value: function _delete(type, opts) {\n var _id = \"\".concat(type, \"Id\");\n var _url = \"\".concat(type, \"Url\");\n if (!this[_id]) {\n return _nativePromiseOnly[\"default\"].reject('Nothing to delete');\n }\n Formio.cache = {};\n return this.makeRequest(type, this[_url], 'delete', null, opts);\n }\n }, {\n key: \"index\",\n value: function index(type, query, opts) {\n var _url = \"\".concat(type, \"Url\");\n query = query || '';\n if (query && isObject(query)) {\n query = \"?\".concat(Formio.serialize(query.params));\n }\n return this.makeRequest(type, this[_url] + query, 'get', null, opts);\n }\n }, {\n key: \"save\",\n value: function save(type, data, opts) {\n var _id = \"\".concat(type, \"Id\");\n var _url = \"\".concat(type, \"Url\");\n var method = this[_id] || data._id ? 'put' : 'post';\n var reqUrl = this[_id] ? this[_url] : this[\"\".concat(type, \"sUrl\")];\n if (!this[_id] && data._id && method === 'put' && !reqUrl.includes(data._id)) {\n reqUrl += \"/\".concat(data._id);\n }\n Formio.cache = {};\n return this.makeRequest(type, reqUrl + this.query, method, data, opts);\n }\n }, {\n key: \"load\",\n value: function load(type, query, opts) {\n var _id = \"\".concat(type, \"Id\");\n var _url = \"\".concat(type, \"Url\");\n if (query && isObject(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = this.query ? \"\".concat(this.query, \"&\").concat(query) : \"?\".concat(query);\n } else {\n query = this.query;\n }\n if (!this[_id]) {\n return _nativePromiseOnly[\"default\"].reject(\"Missing \".concat(_id));\n }\n var url = this[_url] + query;\n if (type === 'form' && !isNaN(parseInt(this.vId)) && parseInt(this.vId) !== 0) {\n url += url.match(/\\?/) ? '&' : '?';\n url += \"formRevision=\".concat(this.vId);\n }\n return this.makeRequest(type, url, 'get', null, opts);\n }\n }, {\n key: \"makeRequest\",\n value: function makeRequest() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return Formio.makeRequest.apply(Formio, [this].concat(args));\n }\n }, {\n key: \"loadProject\",\n value: function loadProject(query, opts) {\n return this.load('project', query, opts);\n }\n }, {\n key: \"saveProject\",\n value: function saveProject(data, opts) {\n return this.save('project', data, opts);\n }\n }, {\n key: \"deleteProject\",\n value: function deleteProject(opts) {\n return this[\"delete\"]('project', opts);\n }\n }, {\n key: \"loadRole\",\n value: function loadRole(opts) {\n return this.load('role', null, opts);\n }\n }, {\n key: \"saveRole\",\n value: function saveRole(data, opts) {\n return this.save('role', data, opts);\n }\n }, {\n key: \"deleteRole\",\n value: function deleteRole(opts) {\n return this[\"delete\"]('role', opts);\n }\n }, {\n key: \"loadRoles\",\n value: function loadRoles(opts) {\n return this.index('roles', null, opts);\n }\n }, {\n key: \"loadForm\",\n value: function loadForm(query, opts) {\n var _this2 = this;\n return this.load('form', query, opts).then(function (currentForm) {\n // Check to see if there isn't a number in vId.\n if (!currentForm.revisions || isNaN(parseInt(_this2.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' && _this2.submissionId) {\n return currentForm;\n }\n // eslint-disable-next-line eqeqeq\n if (currentForm._vid == _this2.vId || currentForm.revisionId === _this2.vId) {\n return currentForm;\n }\n // If they specified a revision form, load the revised form components.\n if (query && isObject(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = _this2.query ? \"\".concat(_this2.query, \"&\").concat(query) : \"?\".concat(query);\n } else {\n query = _this2.query;\n }\n return _this2.makeRequest('form', _this2.vUrl + query, 'get', null, opts).then(function (revisionForm) {\n currentForm._vid = revisionForm._vid;\n currentForm.components = revisionForm.components;\n currentForm.settings = revisionForm.settings;\n currentForm.revisionId = revisionForm.revisionId;\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 () {\n return Object.assign({}, currentForm);\n });\n });\n }\n }, {\n key: \"saveForm\",\n value: function saveForm(data, opts) {\n return this.save('form', data, opts);\n }\n }, {\n key: \"deleteForm\",\n value: function deleteForm(opts) {\n return this[\"delete\"]('form', opts);\n }\n }, {\n key: \"loadForms\",\n value: function loadForms(query, opts) {\n return this.index('forms', query, opts);\n }\n }, {\n key: \"loadSubmission\",\n value: function loadSubmission(query, opts) {\n var _this3 = this;\n return this.load('submission', query, opts).then(function (submission) {\n _this3.vId = submission._frid || submission._fvid;\n _this3.vUrl = \"\".concat(_this3.formUrl, \"/v/\").concat(_this3.vId);\n return submission;\n });\n }\n }, {\n key: \"saveSubmission\",\n value: function saveSubmission(data, opts) {\n if (!isNaN(parseInt(this.vId))) {\n data._fvid = this.vId;\n }\n return this.save('submission', data, opts);\n }\n }, {\n key: \"deleteSubmission\",\n value: function deleteSubmission(opts) {\n return this[\"delete\"]('submission', opts);\n }\n }, {\n key: \"loadSubmissions\",\n value: function loadSubmissions(query, opts) {\n return this.index('submissions', query, opts);\n }\n }, {\n key: \"loadAction\",\n value: function loadAction(query, opts) {\n return this.load('action', query, opts);\n }\n }, {\n key: \"saveAction\",\n value: function saveAction(data, opts) {\n return this.save('action', data, opts);\n }\n }, {\n key: \"deleteAction\",\n value: function deleteAction(opts) {\n return this[\"delete\"]('action', opts);\n }\n }, {\n key: \"loadActions\",\n value: function loadActions(query, opts) {\n return this.index('actions', query, opts);\n }\n }, {\n key: \"availableActions\",\n value: function availableActions() {\n return this.makeRequest('availableActions', \"\".concat(this.formUrl, \"/actions\"));\n }\n }, {\n key: \"actionInfo\",\n value: function actionInfo(name) {\n return this.makeRequest('actionInfo', \"\".concat(this.formUrl, \"/actions/\").concat(name));\n }\n }, {\n key: \"isObjectId\",\n value: function isObjectId(id) {\n var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');\n return checkForHexRegExp.test(id);\n }\n }, {\n key: \"getProjectId\",\n value: function getProjectId() {\n if (!this.projectId) {\n return _nativePromiseOnly[\"default\"].resolve('');\n }\n if (this.isObjectId(this.projectId)) {\n return _nativePromiseOnly[\"default\"].resolve(this.projectId);\n } else {\n return this.loadProject().then(function (project) {\n return project._id;\n });\n }\n }\n }, {\n key: \"getFormId\",\n value: function getFormId() {\n if (!this.formId) {\n return _nativePromiseOnly[\"default\"].resolve('');\n }\n if (this.isObjectId(this.formId)) {\n return _nativePromiseOnly[\"default\"].resolve(this.formId);\n } else {\n return this.loadForm().then(function (form) {\n return form._id;\n });\n }\n }\n }, {\n key: \"currentUser\",\n value: function currentUser(options) {\n return Formio.currentUser(this, options);\n }\n }, {\n key: \"accessInfo\",\n value: function accessInfo() {\n return Formio.accessInfo(this);\n }\n\n /**\n * Sets OAuth Logout URL.\n *\n * @return {*}\n */\n }, {\n key: \"oauthLogoutURI\",\n value: function oauthLogoutURI(uri, options) {\n return Formio.oauthLogoutURI(uri, Object.assign({\n formio: this\n }, this.options, options));\n }\n\n /**\n * Returns the JWT token for this instance.\n *\n * @return {*}\n */\n }, {\n key: \"getToken\",\n value: function getToken(options) {\n return Formio.getToken(Object.assign({\n formio: this\n }, this.options, options));\n }\n\n /**\n * Sets the JWT token for this instance.\n *\n * @return {*}\n */\n }, {\n key: \"setToken\",\n value: function setToken(token, options) {\n return Formio.setToken(token, Object.assign({\n formio: this\n }, this.options, options));\n }\n\n /**\n * Returns a temporary authentication token for single purpose token generation.\n */\n }, {\n key: \"getTempToken\",\n value: function getTempToken(expire, allowed, options) {\n var token = Formio.getToken(options);\n if (!token) {\n return _nativePromiseOnly[\"default\"].reject('You must be authenticated to generate a temporary auth token.');\n }\n var authUrl = Formio.authUrl || this.projectUrl;\n return this.makeRequest('tempToken', \"\".concat(authUrl, \"/token\"), 'GET', null, {\n ignoreCache: true,\n header: new Headers({\n 'x-expire': expire,\n 'x-allow': allowed\n })\n });\n }\n\n /**\n * Get a download url for a submission PDF of this submission.\n *\n * @return {*}\n */\n }, {\n key: \"getDownloadUrl\",\n value: function getDownloadUrl(form) {\n var _this4 = this;\n if (!this.submissionId) {\n return _nativePromiseOnly[\"default\"].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 _this4.getDownloadUrl(_form);\n });\n }\n var apiUrl = \"/project/\".concat(form.project);\n apiUrl += \"/form/\".concat(form._id);\n apiUrl += \"/submission/\".concat(this.submissionId);\n var postfix = form.submissionRevisions && form.settings.changeLog ? '/download/changelog' : '/download';\n apiUrl += postfix;\n var download = this.base + apiUrl;\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this4.getTempToken(3600, \"GET:\".concat(apiUrl)).then(function (tempToken) {\n download += \"?token=\".concat(tempToken.key);\n resolve(download);\n }, function () {\n resolve(download);\n })[\"catch\"](reject);\n });\n }\n }, {\n key: \"uploadFile\",\n value: function uploadFile(storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {\n var _this5 = this;\n var requestArgs = {\n provider: storage,\n method: 'upload',\n file: file,\n fileName: fileName,\n dir: dir\n };\n fileKey = fileKey || 'file';\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('fileRequest', requestArgs).then(function (result) {\n if (storage && isNil(result)) {\n var Provider = _providers[\"default\"].getProvider('storage', storage);\n if (Provider) {\n var provider = new Provider(_this5);\n if (uploadStartCallback) {\n uploadStartCallback();\n }\n return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions);\n } else {\n throw 'Storage provider not found';\n }\n }\n return result || {\n url: ''\n };\n });\n });\n return Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n }\n }, {\n key: \"downloadFile\",\n value: function downloadFile(file, options) {\n var _this6 = this;\n var requestArgs = {\n method: 'download',\n file: file\n };\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('fileRequest', requestArgs).then(function (result) {\n if (file.storage && isNil(result)) {\n var Provider = _providers[\"default\"].getProvider('storage', file.storage);\n if (Provider) {\n var provider = new Provider(_this6);\n return provider.downloadFile(file, options);\n } else {\n throw 'Storage provider not found';\n }\n }\n return result || {\n url: ''\n };\n });\n });\n return Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n }\n }, {\n key: \"deleteFile\",\n value: function deleteFile(file, options) {\n var _this7 = this;\n var requestArgs = {\n method: 'delete',\n file: file\n };\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('fileRequest', requestArgs).then(function (result) {\n if (file.storage && isNil(result)) {\n var Provider = _providers[\"default\"].getProvider('storage', file.storage);\n if (Provider) {\n var provider = new Provider(_this7);\n return provider.deleteFile(file, options);\n } else {\n throw 'Storage provider not found';\n }\n }\n return result || {\n url: ''\n };\n });\n });\n return Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\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 }, {\n key: \"userPermissions\",\n value: function userPermissions(user, form, submission) {\n return _nativePromiseOnly[\"default\"].all([form !== undefined ? _nativePromiseOnly[\"default\"].resolve(form) : this.loadForm(), user !== undefined ? _nativePromiseOnly[\"default\"].resolve(user) : this.currentUser(), submission !== undefined || !this.submissionId ? _nativePromiseOnly[\"default\"].resolve(submission) : this.loadSubmission(), this.accessInfo()]).then(function (results) {\n var form = results.shift();\n var user = results.shift() || {\n _id: false,\n roles: []\n };\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 } 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 _permission$type$spli = permission.type.split('_'),\n _permission$type$spli2 = _slicedToArray(_permission$type$spli, 2),\n perm = _permission$type$spli2[0],\n scope = _permission$type$spli2[1];\n if (['create', 'read', 'update', 'delete'].includes(perm)) {\n if ((0, _intersection2[\"default\"])(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 (0, _utils.eachComponent)(form.components, function (component, path) {\n if (component && component.defaultPermission) {\n var value = (0, _get2[\"default\"])(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 &&\n // 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 /**\n * Determine if the current user can submit a form.\n * @return {*}\n */\n }, {\n key: \"canSubmit\",\n value: function canSubmit() {\n var _this8 = 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 _this8.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 }, {\n key: \"getUrlParts\",\n value: function getUrlParts(url) {\n return Formio.getUrlParts(url, this);\n }\n }], [{\n key: \"useSessionToken\",\n value: function useSessionToken(options) {\n var tokenName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"Token\");\n var token = localStorage.getItem(tokenName);\n if (token) {\n localStorage.removeItem(tokenName);\n sessionStorage.setItem(tokenName, token);\n }\n var userName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"User\");\n var user = localStorage.getItem(userName);\n if (user) {\n localStorage.removeItem(userName);\n sessionStorage.setItem(userName, user);\n }\n localStorage.setItem('useSessionToken', true);\n }\n }, {\n key: \"loadProjects\",\n value: function loadProjects(query, opts) {\n query = query || '';\n if (isObject(query)) {\n query = \"?\".concat(Formio.serialize(query.params));\n }\n return Formio.makeStaticRequest(\"\".concat(Formio.baseUrl, \"/project\").concat(query), 'GET', null, opts);\n }\n }, {\n key: \"getUrlParts\",\n value: function getUrlParts(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 += \"(\".concat(base.replace(/^http[s]?:\\/\\//, ''), \")\");\n } else {\n regex += '([^/]+)';\n }\n regex += '($|\\\\/.*)';\n return url.match(new RegExp(regex));\n }\n }, {\n key: \"serialize\",\n value: function serialize(obj, _interpolate) {\n var str = [];\n var interpolate = function interpolate(item) {\n return _interpolate ? _interpolate(item) : item;\n };\n for (var p in obj) {\n if (obj.hasOwnProperty(p)) {\n str.push(\"\".concat(encodeURIComponent(p), \"=\").concat(encodeURIComponent(interpolate(obj[p]))));\n }\n }\n return str.join('&');\n }\n }, {\n key: \"getRequestArgs\",\n value: function getRequestArgs(formio, type, url, method, data, opts) {\n method = (method || 'GET').toUpperCase();\n if (!opts || !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 }, {\n key: \"makeStaticRequest\",\n value: function makeStaticRequest(url, method, data, opts) {\n var requestArgs = Formio.getRequestArgs(null, '', url, method, data, opts);\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('staticRequest', requestArgs).then(function (result) {\n if (isNil(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n });\n });\n return Formio.pluginAlter('wrapStaticRequestPromise', request, requestArgs);\n }\n }, {\n key: \"makeRequest\",\n value: function makeRequest(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\n //for Formio requests default Accept and Content-type headers\n if (!requestArgs.opts.headers) {\n requestArgs.opts.headers = {};\n }\n requestArgs.opts.headers = (0, _defaults2[\"default\"])(requestArgs.opts.headers, {\n 'Accept': 'application/json',\n 'Content-type': 'application/json'\n });\n var request = Formio.pluginWait('preRequest', requestArgs).then(function () {\n return Formio.pluginGet('request', requestArgs).then(function (result) {\n if (isNil(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n });\n });\n return Formio.pluginAlter('wrapRequestPromise', request, requestArgs);\n }\n }, {\n key: \"request\",\n value: function request(url, method, data, header, opts) {\n if (!url) {\n return _nativePromiseOnly[\"default\"].reject('No url provided');\n }\n var _Formio = Formio;\n method = (method || 'GET').toUpperCase();\n\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 (isBoolean(opts)) {\n opts = {\n ignoreCache: opts\n };\n }\n if (!opts || !isObject(opts)) {\n opts = {};\n }\n\n // Generate a cachekey.\n var cacheKey = btoa(encodeURI(url));\n\n // Get the cached promise to save multiple loads.\n if (!opts.ignoreCache && method === 'GET' && _Formio.cache.hasOwnProperty(cacheKey)) {\n return _nativePromiseOnly[\"default\"].resolve(cloneResponse(_Formio.cache[cacheKey]));\n }\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\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\n // Allow plugins to alter the options.\n options = _Formio.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 = _Formio.pluginAlter('wrapFetchRequestPromise', _Formio.fetch(url, options), {\n url: url,\n method: method,\n data: data,\n opts: opts\n }).then(function (response) {\n // Allow plugins to respond.\n response = _Formio.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 } else if (response.status === 401) {\n _Formio.events.emit('formio.unauthorized', response.body);\n } else if (response.status === 416) {\n _Formio.events.emit('formio.rangeIsNotSatisfiable', response.body);\n } else if (response.status === 504) {\n return _nativePromiseOnly[\"default\"].reject(new Error('Network request failed'));\n }\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') ? response.json() : response.text()).then(function (error) {\n return _nativePromiseOnly[\"default\"].reject(error);\n });\n }\n\n // Handle fetch results\n var token = response.headers.get('x-jwt-token');\n\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' && !requestToken && token && !opts.external && !url.includes('token=') && !url.includes('x-jwt-token=')) {\n console.warn('Token was introduced in request.');\n tokenIntroduced = true;\n }\n if (response.status >= 200 && response.status < 300 && token && token !== '' && !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') ? response.json() : 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 && 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\n // Return the result with the headers.\n return {\n result: result,\n headers: headers\n };\n });\n }).then(function (result) {\n if (opts.getHeaders) {\n return result;\n }\n\n // Cache the response.\n if (method === 'GET') {\n _Formio.cache[cacheKey] = result;\n }\n return cloneResponse(result);\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 = new Error(\"Could not connect to API server (\".concat(err.message, \"): \").concat(url));\n err.networkError = true;\n }\n if (method === 'GET') {\n delete _Formio.cache[cacheKey];\n }\n return _nativePromiseOnly[\"default\"].reject(err);\n });\n return result;\n }\n\n // Needed to maintain reverse compatability...\n }, {\n key: \"token\",\n get: function get() {\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n return Formio.tokens.formioToken || '';\n }\n\n // Needed to maintain reverse compatability...\n ,\n set: function set(token) {\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n Formio.tokens.formioToken = token || '';\n }\n }, {\n key: \"setToken\",\n value: function setToken() {\n var token = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var opts = arguments.length > 1 ? arguments[1] : undefined;\n token = token || '';\n opts = typeof opts === 'string' ? {\n namespace: opts\n } : opts || {};\n var tokenName = \"\".concat(opts.namespace || Formio.namespace || 'formio', \"Token\");\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n var storage = localStorage.getItem('useSessionToken') ? sessionStorage : localStorage;\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 storage.removeItem(tokenName);\n } catch (err) {\n _browserCookies[\"default\"].erase(tokenName, {\n path: '/'\n });\n }\n Formio.tokens[tokenName] = token;\n return _nativePromiseOnly[\"default\"].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 storage.setItem(tokenName, token);\n } catch (err) {\n _browserCookies[\"default\"].set(tokenName, token, {\n path: '/'\n });\n }\n }\n // Return or updates the current user\n return this.currentUserResolved ? Formio.currentUser(opts.formio, opts) : _nativePromiseOnly[\"default\"].resolve(null);\n }\n }, {\n key: \"getToken\",\n value: function getToken(options) {\n options = typeof options === 'string' ? {\n namespace: options\n } : options || {};\n var tokenName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"Token\");\n var decodedTokenName = options.decode ? \"\".concat(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 var token = localStorage.getItem('useSessionToken') ? sessionStorage.getItem(tokenName) : localStorage.getItem(tokenName);\n Formio.tokens[tokenName] = token || '';\n if (options.decode) {\n Formio.tokens[decodedTokenName] = Formio.tokens[tokenName] ? (0, _jwtDecode[\"default\"])(Formio.tokens[tokenName]) : {};\n return Formio.tokens[decodedTokenName];\n }\n return Formio.tokens[tokenName];\n } catch (e) {\n Formio.tokens[tokenName] = _browserCookies[\"default\"].get(tokenName);\n return Formio.tokens[tokenName];\n }\n }\n }, {\n key: \"oauthLogoutURI\",\n value: function oauthLogoutURI(uri, options) {\n options = typeof options === 'string' ? {\n namespace: options\n } : options || {};\n var logoutURIName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"LogoutAuthUrl\");\n Formio.tokens[logoutURIName];\n localStorage.setItem(logoutURIName, uri);\n return Formio.tokens[logoutURIName];\n }\n }, {\n key: \"setUser\",\n value: function setUser(user) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var userName = \"\".concat(opts.namespace || Formio.namespace || 'formio', \"User\");\n var storage = localStorage.getItem('useSessionToken') ? sessionStorage : localStorage;\n if (!user) {\n if (!opts.fromToken) {\n opts.fromUser = true;\n Formio.setToken(null, opts);\n }\n\n // Emit an event on the cleared user.\n Formio.events.emit('formio.user', null);\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 return storage.removeItem(userName);\n } catch (err) {\n return _browserCookies[\"default\"].erase(userName, {\n path: '/'\n });\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 storage.setItem(userName, JSON.stringify(user));\n } catch (err) {\n _browserCookies[\"default\"].set(userName, JSON.stringify(user), {\n path: '/'\n });\n }\n\n // Emit an event on the authenticated user.\n Formio.events.emit('formio.user', user);\n }\n }, {\n key: \"getUser\",\n value: function getUser(options) {\n options = options || {};\n var userName = \"\".concat(options.namespace || Formio.namespace || 'formio', \"User\");\n try {\n return JSON.parse((localStorage.getItem('useSessionToken') ? sessionStorage : localStorage).getItem(userName) || null);\n } catch (e) {\n return JSON.parse(_browserCookies[\"default\"].get(userName));\n }\n }\n }, {\n key: \"setBaseUrl\",\n value: function setBaseUrl(url) {\n Formio.baseUrl = url;\n if (!Formio.projectUrlSet) {\n Formio.projectUrl = url;\n }\n }\n }, {\n key: \"getBaseUrl\",\n value: function getBaseUrl() {\n return Formio.baseUrl;\n }\n }, {\n key: \"setApiUrl\",\n value: function setApiUrl(url) {\n return Formio.setBaseUrl(url);\n }\n }, {\n key: \"getApiUrl\",\n value: function getApiUrl() {\n return Formio.getBaseUrl();\n }\n }, {\n key: \"setAppUrl\",\n value: function setAppUrl(url) {\n console.warn('Formio.setAppUrl() is deprecated. Use Formio.setProjectUrl instead.');\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n }\n }, {\n key: \"setProjectUrl\",\n value: function setProjectUrl(url) {\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n }\n }, {\n key: \"setAuthUrl\",\n value: function setAuthUrl(url) {\n Formio.authUrl = url;\n }\n }, {\n key: \"getAppUrl\",\n value: function getAppUrl() {\n console.warn('Formio.getAppUrl() is deprecated. Use Formio.getProjectUrl instead.');\n return Formio.projectUrl;\n }\n }, {\n key: \"getProjectUrl\",\n value: function getProjectUrl() {\n return Formio.projectUrl;\n }\n }, {\n key: \"clearCache\",\n value: function clearCache() {\n Formio.cache = {};\n }\n }, {\n key: \"noop\",\n value: function noop() {}\n }, {\n key: \"identity\",\n value: function identity(value) {\n return value;\n }\n }, {\n key: \"deregisterPlugin\",\n value: function deregisterPlugin(plugin) {\n var beforeLength = Formio.plugins.length;\n Formio.plugins = Formio.plugins.filter(function (p) {\n if (p !== plugin && p.__name !== plugin) {\n return true;\n }\n (p.deregister || Formio.noop).call(plugin, Formio);\n return false;\n });\n return beforeLength !== Formio.plugins.length;\n }\n }, {\n key: \"registerPlugin\",\n value: function registerPlugin(plugin, name) {\n var __Formio = Formio;\n __Formio.plugins.push(plugin);\n __Formio.plugins.sort(function (a, b) {\n return (b.priority || 0) - (a.priority || 0);\n });\n plugin.__name = name;\n (plugin.init || __Formio.noop).call(plugin, __Formio);\n }\n }, {\n key: \"getPlugin\",\n value: function getPlugin(name) {\n var _iterator = _createForOfIteratorHelper(Formio.plugins),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var plugin = _step.value;\n if (plugin.__name === name) {\n return plugin;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return null;\n }\n }, {\n key: \"pluginWait\",\n value: function pluginWait(pluginFn) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n return _nativePromiseOnly[\"default\"].all(Formio.plugins.map(function (plugin) {\n var _ref;\n return (_ref = plugin[pluginFn] || Formio.noop).call.apply(_ref, [plugin].concat(args));\n }));\n }\n }, {\n key: \"pluginGet\",\n value: function pluginGet(pluginFn) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n var callPlugin = function callPlugin(index) {\n var _ref2;\n var plugin = Formio.plugins[index];\n if (!plugin) {\n return _nativePromiseOnly[\"default\"].resolve(null);\n }\n return _nativePromiseOnly[\"default\"].resolve((_ref2 = plugin[pluginFn] || Formio.noop).call.apply(_ref2, [plugin].concat(args))).then(function (result) {\n if (!isNil(result)) {\n return result;\n }\n return callPlugin(index + 1);\n });\n };\n return callPlugin(0);\n }\n }, {\n key: \"pluginAlter\",\n value: function pluginAlter(pluginFn, value) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 2 ? _len4 - 2 : 0), _key4 = 2; _key4 < _len4; _key4++) {\n args[_key4 - 2] = arguments[_key4];\n }\n return Formio.plugins.reduce(function (value, plugin) {\n return (plugin[pluginFn] || Formio.identity).apply(void 0, [value].concat(args));\n }, value);\n }\n }, {\n key: \"accessInfo\",\n value: function accessInfo(formio) {\n var projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'accessInfo', \"\".concat(projectUrl, \"/access\"));\n }\n }, {\n key: \"projectRoles\",\n value: function projectRoles(formio) {\n var projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'projectRoles', \"\".concat(projectUrl, \"/role\"));\n }\n }, {\n key: \"currentUser\",\n value: function currentUser(formio, options) {\n var _this9 = this;\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 Formio.pluginAlter('wrapStaticRequestPromise', _nativePromiseOnly[\"default\"].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 Formio.pluginAlter('wrapStaticRequestPromise', _nativePromiseOnly[\"default\"].resolve(null), {\n url: authUrl,\n method: 'GET',\n options: options\n });\n }\n this.currentUserResolved = false;\n return Formio.makeRequest(formio, 'currentUser', authUrl, 'GET', null, options).then(function (response) {\n _this9.currentUserResolved = true;\n Formio.setUser(response, options);\n return response;\n });\n }\n }, {\n key: \"logout\",\n value: function logout(formio, options) {\n options = options || {};\n options.formio = formio;\n var projectUrl = Formio.authUrl ? Formio.authUrl : formio ? formio.projectUrl : Formio.baseUrl;\n var logout = function logout() {\n Formio.setToken(null, options);\n Formio.setUser(null, options);\n Formio.clearCache();\n localStorage.removeItem('useSessionToken');\n };\n return Formio.makeRequest(formio, 'logout', \"\".concat(projectUrl, \"/logout\")).then(function (result) {\n logout();\n return result;\n })[\"catch\"](function (err) {\n logout();\n throw err;\n });\n }\n }, {\n key: \"pageQuery\",\n value: function pageQuery() {\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 } else if (item.indexOf('/') === 0) {\n pageQuery.paths = item.substr(1).split('/');\n }\n });\n return pageQuery;\n }\n }, {\n key: \"oAuthCurrentUser\",\n value: function oAuthCurrentUser(formio, token) {\n return Formio.currentUser(formio, {\n external: true,\n headers: {\n Authorization: \"Bearer \".concat(token)\n }\n });\n }\n }, {\n key: \"samlInit\",\n value: function samlInit(options) {\n options = 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\n // Set the relay if not provided.\n if (!options.relay) {\n options.relay = window.location.href;\n }\n\n // go to the saml sso endpoint for this project.\n var authUrl = Formio.authUrl || Formio.projectUrl;\n window.location.href = \"\".concat(authUrl, \"/saml/sso?relay=\").concat(encodeURI(options.relay));\n return false;\n }\n }, {\n key: \"oktaInit\",\n value: function oktaInit(options) {\n options = options || {};\n if ((typeof OktaAuth === \"undefined\" ? \"undefined\" : _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 _nativePromiseOnly[\"default\"].reject(errorMessage);\n }\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n var Okta = options.OktaAuth;\n delete options.OktaAuth;\n var authClient = new Okta(options);\n authClient.tokenManager.get('accessToken').then(function (accessToken) {\n if (accessToken) {\n resolve(Formio.oAuthCurrentUser(options.formio, accessToken.accessToken));\n } else if (location.hash) {\n authClient.token.parseFromUrl().then(function (token) {\n authClient.tokenManager.add('accessToken', token);\n resolve(Formio.oAuthCurrentUser(options.formio, token.accessToken));\n })[\"catch\"](function (err) {\n console.warn(err);\n reject(err);\n });\n } else {\n authClient.token.getWithRedirect({\n responseType: 'token',\n scopes: options.scopes\n });\n resolve(false);\n }\n })[\"catch\"](function (error) {\n reject(error);\n });\n });\n }\n }, {\n key: \"ssoInit\",\n value: function ssoInit(type, 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 _nativePromiseOnly[\"default\"].reject('Unknown SSO type');\n }\n }\n }, {\n key: \"requireLibrary\",\n value: function requireLibrary(name, property, src, polling, onload) {\n if (!Formio.libraries.hasOwnProperty(name)) {\n Formio.libraries[name] = {};\n Formio.libraries[name].ready = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n Formio.libraries[name].resolve = resolve;\n Formio.libraries[name].reject = reject;\n });\n var callbackName = \"\".concat(name, \"Callback\");\n if (!polling && !window[callbackName]) {\n window[callbackName] = function () {\n return Formio.libraries[name].resolve();\n };\n }\n\n // See if the plugin already exists.\n var plugin = (0, _get2[\"default\"])(window, property);\n if (plugin) {\n Formio.libraries[name].resolve(plugin);\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\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 if (onload) {\n element.addEventListener('load', function () {\n Formio.libraries[name].loaded = true;\n onload(Formio.libraries[name].ready);\n });\n }\n var _document = document,\n head = _document.head;\n if (head) {\n head.appendChild(element);\n }\n });\n\n // if no callback is provided, then check periodically for the script.\n if (polling) {\n var interval = setInterval(function () {\n var plugin = (0, _get2[\"default\"])(window, property);\n if (plugin) {\n clearInterval(interval);\n Formio.libraries[name].resolve(plugin);\n }\n }, 200);\n }\n }\n }\n var lib = Formio.libraries[name];\n return onload && lib.loaded ? onload(lib.ready) : lib.ready;\n }\n }, {\n key: \"libraryReady\",\n value: function libraryReady(name) {\n if (Formio.libraries.hasOwnProperty(name) && Formio.libraries[name].ready) {\n return Formio.libraries[name].ready;\n }\n return _nativePromiseOnly[\"default\"].reject(\"\".concat(name, \" library was not required.\"));\n }\n }, {\n key: \"addToGlobal\",\n value: function addToGlobal(global) {\n if (_typeof(global) === 'object' && !global.Formio) {\n global.Formio = Formio;\n }\n }\n }, {\n key: \"setPathType\",\n value: function setPathType(type) {\n if (typeof type === 'string') {\n Formio.pathType = type;\n }\n }\n }, {\n key: \"getPathType\",\n value: function getPathType() {\n return Formio.pathType;\n }\n }, {\n key: \"rulesEntities\",\n get: function get() {\n return {\n ValueSources: Formio.ValueSources,\n Conjunctions: Formio.Conjunctions,\n Operators: Formio.Operators,\n Transformers: Formio.Transformers,\n QuickRules: Formio.QuickRules,\n Rules: Formio.Rules\n };\n }\n }, {\n key: \"GlobalFormio\",\n get: function get() {\n if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.Formio) {\n return __webpack_require__.g.Formio;\n } else if (typeof window !== 'undefined' && window.Formio) {\n return window.Formio;\n }\n return Formio;\n }\n }]);\n return Formio;\n}(); // Define all the static properties.\n_defineProperty(Formio, \"currentUserResolved\", true);\nFormio.libraries = {};\nFormio.Promise = _nativePromiseOnly[\"default\"];\nFormio.fetch = fetch;\nFormio.Headers = Headers;\nFormio.baseUrl = 'https://api.form.io';\nFormio.projectUrl = Formio.baseUrl;\nFormio.authUrl = '';\nFormio.projectUrlSet = false;\nFormio.plugins = [];\nFormio.cache = {};\nFormio.Providers = _providers[\"default\"];\nFormio.version = '4.19.4';\nFormio.pathType = '';\nFormio.events = new _EventEmitter[\"default\"]();\nFormio.cdn = new _CDN[\"default\"]();\nif ((Formio.version || '').includes('rc')) {\n Formio.cdn.setBaseUrl('https://cdn.test-form.io');\n}\nif (typeof __webpack_require__.g !== 'undefined') {\n Formio.addToGlobal(__webpack_require__.g);\n}\nif (typeof window !== 'undefined') {\n Formio.addToGlobal(window);\n}\nvar GlobalFormio = Formio.GlobalFormio;\nexports.GlobalFormio = GlobalFormio;\nvar _default = Formio;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/Formio.js?"); /***/ }), @@ -114,7 +114,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\n__webpack_require__(/*! core-js/modules/es.string.trim.js */ \"./node_modules/core-js/modules/es.string.trim.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _compareVersions = _interopRequireDefault(__webpack_require__(/*! compare-versions */ \"./node_modules/compare-versions/lib/esm/index.js\"));\nvar _EventEmitter = _interopRequireDefault(__webpack_require__(/*! ./EventEmitter */ \"./lib/EventEmitter.js\"));\nvar _i18next = _interopRequireDefault(__webpack_require__(/*! i18next */ \"./node_modules/i18next/dist/cjs/i18next.js\"));\nvar _i18n = _interopRequireDefault(__webpack_require__(/*! ./i18n */ \"./lib/i18n.js\"));\nvar _Formio = __webpack_require__(/*! ./Formio */ \"./lib/Formio.js\");\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _Components = _interopRequireDefault(__webpack_require__(/*! ./components/Components */ \"./lib/components/Components.js\"));\nvar _NestedDataComponent2 = _interopRequireDefault(__webpack_require__(/*! ./components/_classes/nesteddata/NestedDataComponent */ \"./lib/components/_classes/nesteddata/NestedDataComponent.js\"));\nvar _utils = __webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\");\nvar _formUtils = __webpack_require__(/*! ./utils/formUtils */ \"./lib/utils/formUtils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n// Initialize the available forms.\n_Formio.GlobalFormio.forms = {};\n\n// Allow people to register components.\n_Formio.GlobalFormio.registerComponent = _Components[\"default\"].setComponent;\nfunction getIconSet(icons) {\n if (icons === 'fontawesome') {\n return 'fa';\n }\n return icons || '';\n}\nfunction getOptions(options) {\n options = _lodash[\"default\"].defaults(options, {\n submitOnEnter: false,\n iconset: getIconSet(options && options.icons ? options.icons : _Formio.GlobalFormio.icons),\n i18next: _i18next[\"default\"],\n saveDraft: false,\n alwaysDirty: false,\n saveDraftThrottle: 5000,\n display: 'form',\n cdnUrl: _Formio.GlobalFormio.cdn.baseUrl\n });\n if (!options.events) {\n options.events = new _EventEmitter[\"default\"]();\n }\n return options;\n}\n\n/**\n * Renders a Form.io form within the webpage.\n */\nvar Webform = /*#__PURE__*/function (_NestedDataComponent) {\n _inherits(Webform, _NestedDataComponent);\n var _super = _createSuper(Webform);\n /**\n * Creates a new Form instance.\n *\n * @param {Object} options - The options to create a new form instance.\n * @param {boolean} options.saveDraft - Set this if you would like to enable the save draft feature.\n * @param {boolean} options.saveDraftThrottle - The throttle for the save draft feature.\n * @param {boolean} options.readOnly - Set this form to readOnly\n * @param {boolean} options.noAlerts - Set to true to disable the alerts dialog.\n * @param {boolean} options.i18n - The translation file for this rendering. @see https://github.com/formio/formio.js/blob/master/i18n.js\n * @param {boolean} options.template - Provides a way to inject custom logic into the creation of every element rendered within the form.\n */\n /* eslint-disable max-statements */\n function Webform() {\n var _this2;\n _classCallCheck(this, Webform);\n var element, options;\n if (arguments[0] instanceof HTMLElement || arguments[1]) {\n element = arguments[0];\n options = arguments[1];\n } else {\n options = arguments[0];\n }\n _this2 = _super.call(this, null, getOptions(options));\n _defineProperty(_assertThisInitialized(_this2), \"executeShortcuts\", function (event) {\n var target = event.target;\n if (!_this2.keyboardCatchableElement(target)) {\n return;\n }\n var ctrl = event.ctrlKey || event.metaKey;\n var keyCode = event.keyCode;\n var _char = '';\n if (65 <= keyCode && keyCode <= 90) {\n _char = String.fromCharCode(keyCode);\n } else if (keyCode === 13) {\n _char = 'Enter';\n } else if (keyCode === 27) {\n _char = 'Esc';\n }\n _lodash[\"default\"].each(_this2.shortcuts, function (shortcut) {\n if (shortcut.ctrl && !ctrl) {\n return;\n }\n if (shortcut.shortcut === _char) {\n shortcut.element.click();\n event.preventDefault();\n }\n });\n });\n _this2.element = element;\n\n // Keep track of all available forms globally.\n _Formio.GlobalFormio.forms[_this2.id] = _assertThisInitialized(_this2);\n\n // Set the base url.\n if (_this2.options.baseUrl) {\n _Formio.GlobalFormio.setBaseUrl(_this2.options.baseUrl);\n }\n\n /**\n * The i18n configuration for this component.\n */\n var i18n = _i18n[\"default\"];\n if (options && options.i18n && !options.i18nReady) {\n // Support legacy way of doing translations.\n if (options.i18n.resources) {\n i18n = options.i18n;\n } else {\n _lodash[\"default\"].each(options.i18n, function (lang, code) {\n if (code === 'options') {\n _lodash[\"default\"].merge(i18n, lang);\n } else if (!i18n.resources[code]) {\n // extend the default translations (validations, buttons etc.) in case they are not in the options.\n i18n.resources[code] = {\n translation: _lodash[\"default\"].assign((0, _utils.fastCloneDeep)(_i18n[\"default\"].resources.en.translation), lang)\n };\n } else {\n _lodash[\"default\"].assign(i18n.resources[code].translation, lang);\n }\n });\n }\n options.i18n = i18n;\n options.i18nReady = true;\n }\n if (options && options.i18n) {\n _this2.options.i18n = options.i18n;\n } else {\n _this2.options.i18n = i18n;\n }\n\n // Set the language.\n if (_this2.options.language) {\n _this2.options.i18n.lng = _this2.options.language;\n }\n\n /**\n * The type of this element.\n * @type {string}\n */\n _this2.type = 'form';\n _this2._src = '';\n _this2._loading = false;\n _this2._form = {};\n _this2.draftEnabled = false;\n _this2.savingDraft = true;\n if (_this2.options.saveDraftThrottle) {\n _this2.triggerSaveDraft = _lodash[\"default\"].throttle(_this2.saveDraft.bind(_assertThisInitialized(_this2)), _this2.options.saveDraftThrottle);\n } else {\n _this2.triggerSaveDraft = _this2.saveDraft.bind(_assertThisInitialized(_this2));\n }\n _this2.customErrors = [];\n\n /**\n * Determines if this form should submit the API on submit.\n * @type {boolean}\n */\n _this2.nosubmit = false;\n\n /**\n * Determines if the form has tried to be submitted, error or not.\n *\n * @type {boolean}\n */\n _this2.submitted = false;\n\n /**\n * Determines if the form is being submitted at the moment.\n *\n * @type {boolean}\n */\n _this2.submitting = false;\n\n /**\n * The Formio instance for this form.\n * @type {Formio}\n */\n _this2.formio = null;\n\n /**\n * The loader HTML element.\n * @type {HTMLElement}\n */\n _this2.loader = null;\n\n /**\n * The alert HTML element\n * @type {HTMLElement}\n */\n _this2.alert = null;\n\n /**\n * Promise that is triggered when the submission is done loading.\n * @type {Promise}\n */\n _this2.onSubmission = null;\n\n /**\n * Determines if this submission is explicitly set.\n * @type {boolean}\n */\n _this2.submissionSet = false;\n\n /**\n * Promise that executes when the form is ready and rendered.\n * @type {Promise}\n *\n * @example\n * import Webform from 'formiojs/Webform';\n * let form = new Webform(document.getElementById('formio'));\n * form.formReady.then(() => {\n * console.log('The form is ready!');\n * });\n * form.src = 'https://examples.form.io/example';\n */\n _this2.formReady = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n /**\n * Called when the formReady state of this form has been resolved.\n *\n * @type {function}\n */\n _this2.formReadyResolve = resolve;\n\n /**\n * Called when this form could not load and is rejected.\n *\n * @type {function}\n */\n _this2.formReadyReject = reject;\n });\n\n /**\n * Promise that executes when the submission is ready and rendered.\n * @type {Promise}\n *\n * @example\n * import Webform from 'formiojs/Webform';\n * let form = new Webform(document.getElementById('formio'));\n * form.submissionReady.then(() => {\n * console.log('The submission is ready!');\n * });\n * form.src = 'https://examples.form.io/example/submission/234234234234234243';\n */\n _this2.submissionReady = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n /**\n * Called when the formReady state of this form has been resolved.\n *\n * @type {function}\n */\n _this2.submissionReadyResolve = resolve;\n\n /**\n * Called when this form could not load and is rejected.\n *\n * @type {function}\n */\n _this2.submissionReadyReject = reject;\n });\n _this2.shortcuts = [];\n\n // Set language after everything is established.\n _this2.localize().then(function () {\n _this2.language = _this2.options.language;\n });\n\n // See if we need to restore the draft from a user.\n if (_this2.options.saveDraft && !_this2.options.skipDraftRestore) {\n _this2.formReady.then(function () {\n var user = _Formio.GlobalFormio.getUser();\n // Only restore a draft if the submission isn't explicitly set.\n if (user && !_this2.submissionSet) {\n _this2.restoreDraft(user._id);\n }\n });\n }\n _this2.component.clearOnHide = false;\n\n // Ensure the root is set to this component.\n _this2.root = _assertThisInitialized(_this2);\n _this2.localRoot = _assertThisInitialized(_this2);\n return _this2;\n }\n /* eslint-enable max-statements */\n _createClass(Webform, [{\n key: \"language\",\n get: function get() {\n return this.options.language;\n },\n set:\n /**\n * Sets the language for this form.\n *\n * @param lang\n * @return {Promise}\n */\n function set(lang) {\n var _this3 = this;\n this.options.language = lang;\n if (this.i18next.language === lang) {\n return;\n }\n try {\n this.i18next.changeLanguage(lang, function (err) {\n if (err) {\n return;\n }\n _this3.rebuild();\n _this3.emit('languageChanged');\n });\n } catch (err) {\n return;\n }\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return null;\n }\n }, {\n key: \"componentContext\",\n value: function componentContext() {\n return this._data;\n }\n }, {\n key: \"componentComponents\",\n get: function get() {\n return this.form.components;\n }\n }, {\n key: \"shadowRoot\",\n get: function get() {\n return this.options.shadowRoot;\n }\n\n /**\n * Add a language for translations\n *\n * @param code\n * @param lang\n * @param active\n * @return {*}\n */\n }, {\n key: \"addLanguage\",\n value: function addLanguage(code, lang) {\n var active = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var translations = _lodash[\"default\"].assign((0, _utils.fastCloneDeep)(_i18n[\"default\"].resources.en.translation), lang);\n this.i18next.addResourceBundle(code, 'translation', translations, true, true);\n if (active) {\n this.language = code;\n }\n }\n\n /**\n * Perform the localization initialization.\n * @returns {*}\n */\n }, {\n key: \"localize\",\n value: function localize() {\n var _this4 = this;\n if (this.i18next.initialized) {\n return _nativePromiseOnly[\"default\"].resolve(this.i18next);\n }\n this.i18next.initialized = true;\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n try {\n _this4.i18next.init(_objectSpread(_objectSpread({}, _this4.options.i18n), {\n compatibilityJSON: 'v3'\n }), function (err) {\n // Get language but remove any ;q=1 that might exist on it.\n _this4.options.language = _this4.i18next.language.split(';')[0];\n if (err) {\n return reject(err);\n }\n resolve(_this4.i18next);\n });\n } catch (err) {\n return reject(err);\n }\n });\n }\n }, {\n key: \"keyboardCatchableElement\",\n value: function keyboardCatchableElement(element) {\n if (element.nodeName === 'TEXTAREA') {\n return false;\n }\n if (element.nodeName === 'INPUT') {\n return ['text', 'email', 'password'].indexOf(element.type) === -1;\n }\n return true;\n }\n }, {\n key: \"addShortcut\",\n value: function addShortcut(element, shortcut) {\n if (!shortcut || !/^([A-Z]|Enter|Esc)$/i.test(shortcut)) {\n return;\n }\n shortcut = _lodash[\"default\"].capitalize(shortcut);\n if (shortcut === 'Enter' || shortcut === 'Esc') {\n // Restrict Enter and Esc only for buttons\n if (element.tagName !== 'BUTTON') {\n return;\n }\n this.shortcuts.push({\n shortcut: shortcut,\n element: element\n });\n } else {\n this.shortcuts.push({\n ctrl: true,\n shortcut: shortcut,\n element: element\n });\n }\n }\n }, {\n key: \"removeShortcut\",\n value: function removeShortcut(element, shortcut) {\n if (!shortcut || !/^([A-Z]|Enter|Esc)$/i.test(shortcut)) {\n return;\n }\n _lodash[\"default\"].remove(this.shortcuts, {\n shortcut: shortcut,\n element: element\n });\n }\n\n /**\n * Get the embed source of the form.\n *\n * @returns {string}\n */\n }, {\n key: \"src\",\n get: function get() {\n return this._src;\n }\n\n /**\n * Loads the submission if applicable.\n */,\n set:\n /**\n * Set the Form source, which is typically the Form.io embed URL.\n *\n * @param {string} value - The value of the form embed url.\n *\n * @example\n * import Webform from 'formiojs/Webform';\n * let form = new Webform(document.getElementById('formio'));\n * form.formReady.then(() => {\n * console.log('The form is formReady!');\n * });\n * form.src = 'https://examples.form.io/example';\n */\n function set(value) {\n this.setSrc(value);\n }\n\n /**\n * Get the embed source of the form.\n *\n * @returns {string}\n */\n }, {\n key: \"loadSubmission\",\n value: function loadSubmission() {\n var _this5 = this;\n this.loadingSubmission = true;\n if (this.formio.submissionId) {\n this.onSubmission = this.formio.loadSubmission().then(function (submission) {\n return _this5.setSubmission(submission);\n }, function (err) {\n return _this5.submissionReadyReject(err);\n })[\"catch\"](function (err) {\n return _this5.submissionReadyReject(err);\n });\n } else {\n this.submissionReadyResolve();\n }\n return this.submissionReady;\n }\n\n /**\n * Set the src of the form renderer.\n *\n * @param value\n * @param options\n */\n }, {\n key: \"setSrc\",\n value: function setSrc(value, options) {\n var _this6 = this;\n if (this.setUrl(value, options)) {\n this.nosubmit = false;\n return this.formio.loadForm({\n params: {\n live: 1\n }\n }).then(function (form) {\n var setForm = _this6.setForm(form);\n _this6.loadSubmission();\n return setForm;\n })[\"catch\"](function (err) {\n console.warn(err);\n _this6.formReadyReject(err);\n });\n }\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"url\",\n get: function get() {\n return this._src;\n }\n\n /**\n * Sets the url of the form renderer.\n *\n * @param value\n * @param options\n */,\n set:\n /**\n * Set the form source but don't initialize the form and submission from the url.\n *\n * @param {string} value - The value of the form embed url.\n */\n function set(value) {\n this.setUrl(value);\n }\n\n /**\n * Called when both the form and submission have been loaded.\n *\n * @returns {Promise} - The promise to trigger when both form and submission have loaded.\n */\n }, {\n key: \"setUrl\",\n value: function setUrl(value, options) {\n if (!value || typeof value !== 'string' || value === this._src) {\n return false;\n }\n this._src = value;\n this.nosubmit = true;\n this.formio = this.options.formio = new _Formio.GlobalFormio(value, options);\n if (this.type === 'form') {\n // Set the options source so this can be passed to other components.\n this.options.src = value;\n }\n return true;\n }\n }, {\n key: \"ready\",\n get: function get() {\n var _this7 = this;\n return this.formReady.then(function () {\n return _get(_getPrototypeOf(Webform.prototype), \"ready\", _this7).then(function () {\n return _this7.loadingSubmission ? _this7.submissionReady : true;\n });\n });\n }\n\n /**\n * Returns if this form is loading.\n *\n * @returns {boolean} - TRUE means the form is loading, FALSE otherwise.\n */\n }, {\n key: \"loading\",\n get: function get() {\n return this._loading;\n }\n\n /**\n * Set the loading state for this form, and also show the loader spinner.\n *\n * @param {boolean} loading - If this form should be \"loading\" or not.\n */,\n set: function set(loading) {\n if (this._loading !== loading) {\n this._loading = loading;\n if (!this.loader && loading) {\n this.loader = this.ce('div', {\n \"class\": 'loader-wrapper'\n });\n var spinner = this.ce('div', {\n \"class\": 'loader text-center'\n });\n this.loader.appendChild(spinner);\n }\n /* eslint-disable max-depth */\n if (this.loader) {\n try {\n if (loading) {\n this.prependTo(this.loader, this.wrapper);\n } else {\n this.removeChildFrom(this.loader, this.wrapper);\n }\n } catch (err) {\n // ingore\n }\n }\n /* eslint-enable max-depth */\n }\n }\n\n /**\n * Sets the JSON schema for the form to be rendered.\n *\n * @example\n * import Webform from 'formiojs/Webform';\n * let form = new Webform(document.getElementById('formio'));\n * form.setForm({\n * components: [\n * {\n * type: 'textfield',\n * key: 'firstName',\n * label: 'First Name',\n * placeholder: 'Enter your first name.',\n * input: true\n * },\n * {\n * type: 'textfield',\n * key: 'lastName',\n * label: 'Last Name',\n * placeholder: 'Enter your last name',\n * input: true\n * },\n * {\n * type: 'button',\n * action: 'submit',\n * label: 'Submit',\n * theme: 'primary'\n * }\n * ]\n * });\n *\n * @param {Object} form - The JSON schema of the form @see https://examples.form.io/example for an example JSON schema.\n * @param flags\n * @returns {*}\n */\n }, {\n key: \"setForm\",\n value: function setForm(form, flags) {\n var _this$_form$component,\n _this8 = this;\n var isFormAlreadySet = this._form && ((_this$_form$component = this._form.components) === null || _this$_form$component === void 0 ? void 0 : _this$_form$component.length);\n try {\n var _this$parent, _this$parent$componen;\n // Do not set the form again if it has been already set\n if (isFormAlreadySet && JSON.stringify(this._form) === JSON.stringify(form)) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n\n // Create the form.\n this._form = flags !== null && flags !== void 0 && flags.keepAsReference ? form : _lodash[\"default\"].cloneDeep(form);\n if (this.onSetForm) {\n this.onSetForm(_lodash[\"default\"].cloneDeep(this._form), form);\n }\n if ((_this$parent = this.parent) !== null && _this$parent !== void 0 && (_this$parent$componen = _this$parent.component) !== null && _this$parent$componen !== void 0 && _this$parent$componen.modalEdit) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n } catch (err) {\n console.warn(err);\n // If provided form is not a valid JSON object, do not set it too\n return _nativePromiseOnly[\"default\"].resolve();\n }\n\n // Allow the form to provide component overrides.\n if (form && form.settings && form.settings.components) {\n this.options.components = form.settings.components;\n }\n if (form && form.properties) {\n this.options.properties = form.properties;\n }\n if ('schema' in form && (0, _compareVersions[\"default\"])(form.schema, '1.x') > 0) {\n this.ready.then(function () {\n _this8.setAlert('alert alert-danger', 'Form schema is for a newer version, please upgrade your renderer. Some functionality may not work.');\n });\n }\n\n // See if they pass a module, and evaluate it if so.\n if (form && form.module) {\n var formModule = null;\n if (typeof form.module === 'string') {\n try {\n formModule = this.evaluate(\"return \".concat(form.module));\n } catch (err) {\n console.warn(err);\n }\n } else {\n formModule = form.module;\n }\n if (formModule) {\n _Formio.GlobalFormio.use(formModule);\n\n // Since we got here after instantiation, we need to manually apply form options.\n if (formModule.options && formModule.options.form) {\n this.options = Object.assign(this.options, formModule.options.form);\n }\n }\n }\n this.initialized = false;\n var rebuild = this.rebuild() || _nativePromiseOnly[\"default\"].resolve();\n return rebuild.then(function () {\n _this8.emit('formLoad', form);\n _this8.triggerRecaptcha();\n // Make sure to trigger onChange after a render event occurs to speed up form rendering.\n setTimeout(function () {\n _this8.onChange(flags);\n _this8.formReadyResolve();\n }, 0);\n return _this8.formReady;\n });\n }\n\n /**\n * Gets the form object.\n *\n * @returns {Object} - The form JSON schema.\n */\n }, {\n key: \"form\",\n get: function get() {\n if (!this._form) {\n this._form = {\n components: []\n };\n }\n return this._form;\n }\n\n /**\n * Sets the form value.\n *\n * @alias setForm\n * @param {Object} form - The form schema object.\n */,\n set: function set(form) {\n this.setForm(form);\n }\n\n /**\n * Returns the submission object that was set within this form.\n *\n * @returns {Object}\n */\n }, {\n key: \"submission\",\n get: function get() {\n return this.getValue();\n }\n\n /**\n * Sets the submission of a form.\n *\n * @example\n * import Webform from 'formiojs/Webform';\n * let form = new Webform(document.getElementById('formio'));\n * form.src = 'https://examples.form.io/example';\n * form.submission = {data: {\n * firstName: 'Joe',\n * lastName: 'Smith',\n * email: 'joe@example.com'\n * }};\n *\n * @param {Object} submission - The Form.io submission object.\n */,\n set: function set(submission) {\n this.setSubmission(submission);\n }\n\n /**\n * Sets a submission and returns the promise when it is ready.\n * @param submission\n * @param flags\n * @return {Promise.}\n */\n }, {\n key: \"setSubmission\",\n value: function setSubmission(submission) {\n var _this9 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n flags = _objectSpread(_objectSpread({}, flags), {}, {\n fromSubmission: _lodash[\"default\"].has(flags, 'fromSubmission') ? flags.fromSubmission : true\n });\n return this.onSubmission = this.formReady.then(function (resolveFlags) {\n if (resolveFlags) {\n flags = _objectSpread(_objectSpread({}, flags), resolveFlags);\n }\n _this9.submissionSet = true;\n _this9.triggerChange(flags);\n _this9.emit('beforeSetSubmission', submission);\n _this9.setValue(submission, flags);\n return _this9.submissionReadyResolve(submission);\n }, function (err) {\n return _this9.submissionReadyReject(err);\n })[\"catch\"](function (err) {\n return _this9.submissionReadyReject(err);\n });\n }\n }, {\n key: \"handleDraftError\",\n value: function handleDraftError(errName, errDetails, restoreDraft) {\n var errorMessage = _lodash[\"default\"].trim(\"\".concat(this.t(errName), \" \").concat(errDetails || ''));\n console.warn(errorMessage);\n this.emit(restoreDraft ? 'restoreDraftError' : 'saveDraftError', errDetails || errorMessage);\n }\n\n /**\n * Saves a submission draft.\n */\n }, {\n key: \"saveDraft\",\n value: function saveDraft() {\n var _this10 = this;\n if (!this.draftEnabled) {\n return;\n }\n if (!this.formio) {\n this.handleDraftError('saveDraftInstanceError');\n return;\n }\n if (!_Formio.GlobalFormio.getUser()) {\n this.handleDraftError('saveDraftAuthError');\n return;\n }\n var draft = (0, _utils.fastCloneDeep)(this.submission);\n draft.state = 'draft';\n if (!this.savingDraft) {\n this.emit('saveDraftBegin');\n this.savingDraft = true;\n this.formio.saveSubmission(draft).then(function (sub) {\n // Set id to submission to avoid creating new draft submission\n _this10.submission._id = sub._id;\n _this10.savingDraft = false;\n _this10.emit('saveDraft', sub);\n })[\"catch\"](function (err) {\n _this10.savingDraft = false;\n _this10.handleDraftError('saveDraftError', err);\n });\n }\n }\n\n /**\n * Restores a draft submission based on the user who is authenticated.\n *\n * @param {userId} - The user id where we need to restore the draft from.\n */\n }, {\n key: \"restoreDraft\",\n value: function restoreDraft(userId) {\n var _this11 = this;\n if (!this.formio) {\n this.handleDraftError('restoreDraftInstanceError', null, true);\n return;\n }\n this.savingDraft = true;\n this.formio.loadSubmissions({\n params: {\n state: 'draft',\n owner: userId\n }\n }).then(function (submissions) {\n if (submissions.length > 0 && !_this11.options.skipDraftRestore) {\n var draft = (0, _utils.fastCloneDeep)(submissions[0]);\n return _this11.setSubmission(draft).then(function () {\n _this11.draftEnabled = true;\n _this11.savingDraft = false;\n _this11.emit('restoreDraft', draft);\n });\n }\n // Enable drafts so that we can keep track of changes.\n _this11.draftEnabled = true;\n _this11.savingDraft = false;\n _this11.emit('restoreDraft', null);\n })[\"catch\"](function (err) {\n _this11.draftEnabled = true;\n _this11.savingDraft = false;\n _this11.handleDraftError('restoreDraftError', err, true);\n });\n }\n }, {\n key: \"schema\",\n get: function get() {\n var schema = (0, _utils.fastCloneDeep)(_lodash[\"default\"].omit(this._form, ['components']));\n schema.components = [];\n this.eachComponent(function (component) {\n return schema.components.push(component.schema);\n });\n return schema;\n }\n }, {\n key: \"mergeData\",\n value: function mergeData(_this, _that) {\n _lodash[\"default\"].mergeWith(_this, _that, function (thisValue, thatValue) {\n if (Array.isArray(thisValue) && Array.isArray(thatValue) && thisValue.length !== thatValue.length) {\n return thatValue;\n }\n });\n }\n }, {\n key: \"setValue\",\n value: function setValue(submission) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!submission || !submission.data) {\n submission = {\n data: {}\n };\n }\n // Metadata needs to be available before setValue\n this._submission.metadata = submission.metadata || {};\n this.editing = !!submission._id;\n\n // Set the timezone in the options if available.\n if (!this.options.submissionTimezone && submission.metadata && submission.metadata.timezone) {\n this.options.submissionTimezone = submission.metadata.timezone;\n }\n var changed = _get(_getPrototypeOf(Webform.prototype), \"setValue\", this).call(this, submission.data, flags);\n if (!flags.sanitize) {\n this.mergeData(this.data, submission.data);\n }\n submission.data = this.data;\n this._submission = submission;\n return changed;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n if (!this._submission.data) {\n this._submission.data = {};\n }\n if (this.viewOnly) {\n return this._submission;\n }\n var submission = this._submission;\n submission.data = this.data;\n return this._submission;\n }\n\n /**\n * Build the form.\n */\n }, {\n key: \"init\",\n value: function init() {\n var _this12 = this;\n this._submission = this._submission || {\n data: {}\n };\n\n // Remove any existing components.\n if (this.components && this.components.length) {\n this.destroyComponents();\n this.components = [];\n }\n if (this.component) {\n this.component.components = this.form ? this.form.components : [];\n } else {\n this.component = this.form;\n }\n this.component.type = 'form';\n this.component.input = false;\n this.addComponents();\n this.on('submitButton', function (options) {\n _this12.submit(false, options)[\"catch\"](function (e) {\n return e !== false && console.log(e);\n });\n }, true);\n this.on('checkValidity', function (data) {\n return _this12.checkValidity(data, true, data);\n }, true);\n this.on('requestUrl', function (args) {\n return _this12.submitUrl(args.url, args.headers);\n }, true);\n this.on('resetForm', function () {\n return _this12.resetValue();\n }, true);\n this.on('deleteSubmission', function () {\n return _this12.deleteSubmission();\n }, true);\n this.on('refreshData', function () {\n return _this12.updateValue();\n }, true);\n this.executeFormController();\n return this.formReady;\n }\n }, {\n key: \"executeFormController\",\n value: function executeFormController() {\n var _this13 = this;\n // If no controller value or\n // hidden and set to clearOnHide (Don't calculate a value for a hidden field set to clear when hidden)\n if (!this.form || !this.form.controller || (!this.visible || this.component.hidden) && this.component.clearOnHide && !this.rootPristine) {\n return false;\n }\n this.formReady.then(function () {\n _this13.evaluate(_this13.form.controller, {\n components: _this13.components,\n instance: _this13\n });\n });\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n var deleteFromGlobal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n this.off('submitButton');\n this.off('checkValidity');\n this.off('requestUrl');\n this.off('resetForm');\n this.off('deleteSubmission');\n this.off('refreshData');\n if (deleteFromGlobal) {\n this.emit('formDelete', this.id);\n delete _Formio.GlobalFormio.forms[this.id];\n }\n return _get(_getPrototypeOf(Webform.prototype), \"destroy\", this).call(this);\n }\n }, {\n key: \"build\",\n value: function build(element) {\n var _this14 = this;\n if (element || this.element) {\n return this.ready.then(function () {\n element = element || _this14.element;\n _get(_getPrototypeOf(Webform.prototype), \"build\", _this14).call(_this14, element);\n });\n }\n return this.ready;\n }\n }, {\n key: \"getClassName\",\n value: function getClassName() {\n var classes = 'formio-form';\n if (this.options.readOnly) {\n classes += ' formio-read-only';\n }\n return classes;\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(Webform.prototype), \"render\", this).call(this, this.renderTemplate('webform', {\n classes: this.getClassName(),\n children: this.renderComponents()\n }), this.builderMode ? 'builder' : 'form', true);\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n // Don't bother if we have not built yet.\n if (!this.element) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n this.clear();\n this.setContent(this.element, this.render());\n return this.attach(this.element);\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this15 = this;\n this.element = element;\n this.loadRefs(element, {\n webform: 'single'\n });\n var childPromise = this.attachComponents(this.refs.webform);\n this.addEventListener(document, 'keydown', this.executeShortcuts);\n this.currentForm = this;\n this.hook('attachWebform', element, this);\n return childPromise.then(function () {\n _this15.emit('render', _this15.element);\n return _this15.setValue(_this15._submission, {\n noUpdateEvent: true\n });\n });\n }\n }, {\n key: \"hasRequiredFields\",\n value: function hasRequiredFields() {\n var result = false;\n (0, _formUtils.eachComponent)(this.form.components, function (component) {\n if (component.validate.required) {\n result = true;\n return true;\n }\n }, true);\n return result;\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n _lodash[\"default\"].each(this.getComponents(), function (comp) {\n return comp.resetValue();\n });\n this.setPristine(true);\n this.onChange({\n resetValue: true\n });\n }\n\n /**\n * Sets a new alert to display in the error dialog of the form.\n *\n * @param {string} type - The type of alert to display. \"danger\", \"success\", \"warning\", etc.\n * @param {string} message - The message to show in the alert.\n * @param {Object} options\n */\n }, {\n key: \"setAlert\",\n value: function setAlert(type, message, options) {\n var _this16 = this;\n if (!type && this.submitted) {\n if (this.alert) {\n if (this.refs.errorRef && this.refs.errorRef.length) {\n this.refs.errorRef.forEach(function (el) {\n _this16.removeEventListener(el, 'click');\n _this16.removeEventListener(el, 'keypress');\n });\n }\n this.removeChild(this.alert);\n this.alert = null;\n }\n return;\n }\n if (this.options.noAlerts) {\n if (!message) {\n this.emit('error', false);\n }\n return;\n }\n if (this.alert) {\n try {\n if (this.refs.errorRef && this.refs.errorRef.length) {\n this.refs.errorRef.forEach(function (el) {\n _this16.removeEventListener(el, 'click');\n _this16.removeEventListener(el, 'keypress');\n });\n }\n this.removeChild(this.alert);\n this.alert = null;\n } catch (err) {\n // ignore\n }\n }\n if (message) {\n var attrs = {\n \"class\": options && options.classes || \"alert alert-\".concat(type),\n id: \"error-list-\".concat(this.id)\n };\n var templateOptions = {\n message: message instanceof HTMLElement ? message.outerHTML : message,\n attrs: attrs,\n type: type\n };\n this.alert = (0, _utils.convertStringToHTMLElement)(this.renderTemplate('alert', templateOptions), \"#\".concat(attrs.id));\n }\n if (!this.alert) {\n return;\n }\n this.loadRefs(this.alert, {\n errorRef: 'multiple'\n });\n if (this.refs.errorRef && this.refs.errorRef.length) {\n this.refs.errorRef.forEach(function (el) {\n _this16.addEventListener(el, 'click', function (e) {\n var key = e.currentTarget.dataset.componentKey;\n _this16.focusOnComponent(key);\n });\n _this16.addEventListener(el, 'keydown', function (e) {\n if (e.keyCode === 13) {\n e.preventDefault();\n var key = e.currentTarget.dataset.componentKey;\n _this16.focusOnComponent(key);\n }\n });\n });\n }\n this.prepend(this.alert);\n }\n\n /**\n * Focus on selected component.\n *\n * @param {string} key - The key of selected component.\n * @returns {*}\n */\n }, {\n key: \"focusOnComponent\",\n value: function focusOnComponent(key) {\n if (key) {\n var component = this.getComponent(key);\n if (component) {\n component.focus();\n }\n }\n }\n\n /**\n * Show the errors of this form within the alert dialog.\n *\n * @param {Object} error - An optional additional error to display along with the component errors.\n * @returns {*}\n */\n /* eslint-disable no-unused-vars */\n }, {\n key: \"showErrors\",\n value: function showErrors(error, triggerEvent, onChange) {\n var _this17 = this;\n this.loading = false;\n var errors = this.errors;\n if (error) {\n if (Array.isArray(error)) {\n errors = errors.concat(error);\n } else {\n errors.push(error);\n }\n } else {\n errors = _get(_getPrototypeOf(Webform.prototype), \"errors\", this);\n }\n errors = errors.concat(this.customErrors);\n errors = errors.concat(this.serverErrors || []);\n if (!errors.length) {\n this.setAlert(false);\n return;\n }\n\n // Mark any components as invalid if in a custom message.\n errors.forEach(function (err) {\n var _err$components = err.components,\n components = _err$components === void 0 ? [] : _err$components;\n if (err.component) {\n components.push(err.component);\n }\n if (err.path) {\n components.push(err.path);\n }\n components.forEach(function (path) {\n var originalPath = _this17._parentPath + (0, _utils.getStringFromComponentPath)(path);\n var component = _this17.getComponent(path, _lodash[\"default\"].identity, originalPath);\n if (err.fromServer) {\n if (component.serverErrors) {\n component.serverErrors.push(err);\n } else {\n component.serverErrors = [err];\n }\n }\n var components = _lodash[\"default\"].compact(Array.isArray(component) ? component : [component]);\n components.forEach(function (component) {\n return component.setCustomValidity(err.message, true);\n });\n });\n });\n var displayedErrors = [];\n errors.forEach(function (err) {\n if (err) {\n var createListItem = function createListItem(message, index) {\n var messageFromIndex = !_lodash[\"default\"].isUndefined(index) && err.messages && err.messages[index];\n var keyOrPath = messageFromIndex && messageFromIndex.formattedKeyOrPath || messageFromIndex.path || err.component && err.component.key || err.fromServer && err.path;\n var formattedKeyOrPath = keyOrPath ? (0, _utils.getStringFromComponentPath)(keyOrPath) : '';\n formattedKeyOrPath = _this17._parentPath + formattedKeyOrPath;\n if (typeof err !== 'string' && !err.formattedKeyOrPath) {\n err.formattedKeyOrPath = formattedKeyOrPath;\n }\n return {\n message: (0, _utils.unescapeHTML)(message),\n keyOrPath: formattedKeyOrPath\n };\n };\n err.messages = _lodash[\"default\"].uniqBy(err.messages, function (message) {\n return message.message;\n });\n if (err.messages && err.messages.length) {\n var component = err.component;\n err.messages.forEach(function (_ref, index) {\n var message = _ref.message,\n context = _ref.context,\n fromServer = _ref.fromServer;\n var text = context !== null && context !== void 0 && context.hasLabel || fromServer ? _this17.t('alertMessage', {\n message: _this17.t(message)\n }) : _this17.t('alertMessageWithLabel', {\n label: _this17.t(component.label),\n message: _this17.t(message)\n });\n displayedErrors.push(createListItem(text, index));\n });\n } else if (err) {\n var message = _lodash[\"default\"].isObject(err) ? _this17.t('alertMessage', {\n message: _this17.t(err.message || '')\n }) : _this17.t('alertMessage', {\n message: _this17.t(err)\n });\n displayedErrors.push(createListItem(message));\n }\n }\n });\n var errorsList = this.renderTemplate('errorsList', {\n errors: displayedErrors\n });\n this.root.setAlert('danger', errorsList);\n if (triggerEvent) {\n this.emit('error', errors);\n }\n return errors;\n }\n /* eslint-enable no-unused-vars */\n\n /**\n * Called when the submission has completed, or if the submission needs to be sent to an external library.\n *\n * @param {Object} submission - The submission object.\n * @param {boolean} saved - Whether or not this submission was saved to the server.\n * @returns {object} - The submission object.\n */\n }, {\n key: \"onSubmit\",\n value: function onSubmit(submission, saved) {\n var _this$triggerSaveDraf;\n this.loading = false;\n this.submitting = false;\n this.setPristine(true);\n // We want to return the submitted submission and setValue will mutate the submission so cloneDeep it here.\n this.setValue((0, _utils.fastCloneDeep)(submission), {\n noValidate: true,\n noCheck: true\n });\n this.setAlert('success', \"

\".concat(this.t('complete'), \"

\"));\n // Cancel triggered saveDraft to prevent overriding the submitted state\n if (this.draftEnabled && (_this$triggerSaveDraf = this.triggerSaveDraft) !== null && _this$triggerSaveDraf !== void 0 && _this$triggerSaveDraf.cancel) {\n this.triggerSaveDraft.cancel();\n }\n this.emit('submit', submission, saved);\n if (saved) {\n this.emit('submitDone', submission);\n }\n return submission;\n }\n }, {\n key: \"normalizeError\",\n value: function normalizeError(error) {\n if (error) {\n if (_typeof(error) === 'object' && 'details' in error) {\n error = error.details;\n }\n if (typeof error === 'string') {\n error = {\n message: error\n };\n }\n }\n return error;\n }\n\n /**\n * Called when an error occurs during the submission.\n *\n * @param {Object} error - The error that occured.\n */\n }, {\n key: \"onSubmissionError\",\n value: function onSubmissionError(error) {\n error = this.normalizeError(error);\n this.submitting = false;\n this.setPristine(false);\n this.emit('submitError', error);\n\n // Allow for silent cancellations (no error message, no submit button error state)\n if (error && error.silent) {\n this.emit('change', {\n isValid: true\n }, {\n silent: true\n });\n return false;\n }\n var errors;\n if (this.submitted) {\n errors = this.showErrors();\n } else {\n errors = this.showErrors(error, true);\n }\n if (this.root && this.root.alert) {\n this.scrollIntoView(this.root.alert);\n }\n return errors;\n }\n\n /**\n * Trigger the change event for this form.\n *\n * @param changed\n * @param flags\n */\n }, {\n key: \"onChange\",\n value: function onChange(flags, changed, modified, changes) {\n flags = flags || {};\n var isChangeEventEmitted = false;\n // For any change events, clear any custom errors for that component.\n if (changed && changed.component) {\n this.customErrors = this.customErrors.filter(function (err) {\n return err.component && err.component !== changed.component.key;\n });\n }\n _get(_getPrototypeOf(Webform.prototype), \"onChange\", this).call(this, flags, true);\n var value = _lodash[\"default\"].clone(this.submission);\n flags.changed = value.changed = changed;\n flags.changes = changes;\n if (modified && this.pristine) {\n this.pristine = false;\n }\n value.isValid = this.checkData(value.data, flags);\n this.loading = false;\n if (this.submitted) {\n this.showErrors();\n }\n\n // See if we need to save the draft of the form.\n if (modified && this.options.saveDraft) {\n this.triggerSaveDraft();\n }\n if (!flags || !flags.noEmit) {\n this.emit('change', value, flags, modified);\n isChangeEventEmitted = true;\n }\n\n // The form is initialized after the first change event occurs.\n if (isChangeEventEmitted && !this.initialized) {\n this.emit('initialized');\n this.initialized = true;\n }\n }\n }, {\n key: \"checkData\",\n value: function checkData(data) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var valid = _get(_getPrototypeOf(Webform.prototype), \"checkData\", this).call(this, data, flags);\n if ((_lodash[\"default\"].isEmpty(flags) || flags.noValidate) && this.submitted) {\n this.showErrors();\n }\n return valid;\n }\n\n /**\n * Send a delete request to the server.\n */\n }, {\n key: \"deleteSubmission\",\n value: function deleteSubmission() {\n var _this18 = this;\n return this.formio.deleteSubmission().then(function () {\n _this18.emit('submissionDeleted', _this18.submission);\n _this18.resetValue();\n });\n }\n\n /**\n * Cancels the submission.\n *\n * @alias reset\n */\n }, {\n key: \"cancel\",\n value: function cancel(noconfirm) {\n var shouldReset = this.hook('beforeCancel', true);\n if (shouldReset && (noconfirm || confirm(this.t('confirmCancel')))) {\n this.resetValue();\n return true;\n } else {\n this.emit('cancelSubmit');\n return false;\n }\n }\n }, {\n key: \"setMetadata\",\n value: function setMetadata(submission) {\n // Add in metadata about client submitting the form\n submission.metadata = submission.metadata || {};\n _lodash[\"default\"].defaults(submission.metadata, {\n timezone: _lodash[\"default\"].get(this, '_submission.metadata.timezone', (0, _utils.currentTimezone)()),\n offset: parseInt(_lodash[\"default\"].get(this, '_submission.metadata.offset', (0, _moment[\"default\"])().utcOffset()), 10),\n origin: document.location.origin,\n referrer: document.referrer,\n browserName: navigator.appName,\n userAgent: navigator.userAgent,\n pathName: window.location.pathname,\n onLine: navigator.onLine\n });\n }\n }, {\n key: \"submitForm\",\n value: function submitForm() {\n var _this19 = this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.clearServerErrors();\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n // Read-only forms should never submit.\n if (_this19.options.readOnly) {\n return resolve({\n submission: _this19.submission,\n saved: false\n });\n }\n var submission = (0, _utils.fastCloneDeep)(_this19.submission || {});\n _this19.setMetadata(submission);\n submission.state = options.state || 'submitted';\n var isDraft = submission.state === 'draft';\n _this19.hook('beforeSubmit', _objectSpread(_objectSpread({}, submission), {}, {\n component: options.component\n }), function (err, data) {\n if (err) {\n return reject(err);\n }\n submission._vnote = data && data._vnote ? data._vnote : '';\n if (!isDraft && !submission.data) {\n return reject('Invalid Submission');\n }\n if (!isDraft && !_this19.checkValidity(submission.data, true)) {\n return reject();\n }\n _this19.everyComponent(function (comp) {\n var persistent = comp.component.persistent;\n if (persistent === 'client-only') {\n _lodash[\"default\"].unset(submission.data, comp.path);\n }\n });\n _this19.hook('customValidation', _objectSpread(_objectSpread({}, submission), {}, {\n component: options.component\n }), function (err) {\n if (err) {\n // If string is returned, cast to object.\n if (typeof err === 'string') {\n err = {\n message: err\n };\n }\n\n // Ensure err is an array.\n err = Array.isArray(err) ? err : [err];\n\n // Set as custom errors.\n _this19.customErrors = err;\n return reject();\n }\n _this19.loading = true;\n\n // Use the form action to submit the form if available.\n if (_this19._form && _this19._form.action) {\n var method = submission.data._id && _this19._form.action.includes(submission.data._id) ? 'PUT' : 'POST';\n return _Formio.GlobalFormio.makeStaticRequest(_this19._form.action, method, submission, _this19.formio ? _this19.formio.options : {}).then(function (result) {\n return resolve({\n submission: result,\n saved: true\n });\n })[\"catch\"](function (error) {\n _this19.setServerErrors(error);\n return reject(error);\n });\n }\n var submitFormio = _this19.formio;\n if (_this19.nosubmit || !submitFormio) {\n return resolve({\n submission: submission,\n saved: false\n });\n }\n // If this is an actionUrl, then make sure to save the action and not the submission.\n var submitMethod = submitFormio.actionUrl ? 'saveAction' : 'saveSubmission';\n submitFormio[submitMethod](submission).then(function (result) {\n return resolve({\n submission: result,\n saved: true\n });\n })[\"catch\"](function (error) {\n _this19.setServerErrors(error);\n return reject(error);\n });\n });\n });\n });\n }\n }, {\n key: \"setServerErrors\",\n value: function setServerErrors(error) {\n if (error.details) {\n this.serverErrors = error.details.filter(function (err) {\n return err.level ? err.level === 'error' : err;\n }).map(function (err) {\n err.fromServer = true;\n return err;\n });\n } else if (typeof error === 'string') {\n this.serverErrors = [{\n fromServer: true,\n level: 'error',\n message: error\n }];\n }\n }\n }, {\n key: \"executeSubmit\",\n value: function executeSubmit(options) {\n var _this20 = this;\n this.submitted = true;\n this.submitting = true;\n return this.submitForm(options).then(function (_ref2) {\n var submission = _ref2.submission,\n saved = _ref2.saved;\n return _this20.onSubmit(submission, saved);\n }).then(function (results) {\n _this20.submissionInProcess = false;\n return results;\n })[\"catch\"](function (err) {\n _this20.submissionInProcess = false;\n return _nativePromiseOnly[\"default\"].reject(_this20.onSubmissionError(err));\n });\n }\n }, {\n key: \"clearServerErrors\",\n value: function clearServerErrors() {\n var _this$serverErrors,\n _this21 = this;\n (_this$serverErrors = this.serverErrors) === null || _this$serverErrors === void 0 ? void 0 : _this$serverErrors.forEach(function (error) {\n if (error.path) {\n var pathArray = (0, _utils.getArrayFromComponentPath)(error.path);\n var component = _this21.getComponent(pathArray, _lodash[\"default\"].identity, error.formattedKeyOrPath);\n if (component) {\n component.serverErrors = [];\n }\n }\n });\n this.serverErrors = [];\n }\n\n /**\n * Submits the form.\n *\n * @example\n * import Webform from 'formiojs/Webform';\n * let form = new Webform(document.getElementById('formio'));\n * form.src = 'https://examples.form.io/example';\n * form.submission = {data: {\n * firstName: 'Joe',\n * lastName: 'Smith',\n * email: 'joe@example.com'\n * }};\n * form.submit().then((submission) => {\n * console.log(submission);\n * });\n *\n * @param {boolean} before - If this submission occured from the before handlers.\n *\n * @returns {Promise} - A promise when the form is done submitting.\n */\n }, {\n key: \"submit\",\n value: function submit(before, options) {\n var _this22 = this;\n this.submissionInProcess = true;\n if (!before) {\n return this.beforeSubmit(options).then(function () {\n return _this22.executeSubmit(options);\n });\n } else {\n return this.executeSubmit(options);\n }\n }\n }, {\n key: \"submitUrl\",\n value: function submitUrl(URL, headers) {\n var _this23 = this;\n if (!URL) {\n return console.warn('Missing URL argument');\n }\n var submission = this.submission || {};\n var API_URL = URL;\n var settings = {\n method: 'POST',\n headers: {}\n };\n if (headers && headers.length > 0) {\n headers.map(function (e) {\n if (e.header !== '' && e.value !== '') {\n settings.headers[e.header] = _this23.interpolate(e.value, submission);\n }\n });\n }\n if (API_URL && settings) {\n _Formio.GlobalFormio.makeStaticRequest(API_URL, settings.method, submission, {\n headers: settings.headers\n }).then(function () {\n _this23.emit('requestDone');\n _this23.setAlert('success', '

Success

');\n })[\"catch\"](function (e) {\n _this23.showErrors(\"\".concat(e.statusText ? e.statusText : '', \" \").concat(e.status ? e.status : e));\n _this23.emit('error', \"\".concat(e.statusText ? e.statusText : '', \" \").concat(e.status ? e.status : e));\n console.error(\"\".concat(e.statusText ? e.statusText : '', \" \").concat(e.status ? e.status : e));\n _this23.setAlert('danger', \"

\".concat(e.statusText ? e.statusText : '', \" \").concat(e.status ? e.status : e, \"

\"));\n });\n } else {\n this.emit('error', 'You should add a URL to this button.');\n this.setAlert('warning', 'You should add a URL to this button.');\n return console.warn('You should add a URL to this button.');\n }\n }\n }, {\n key: \"triggerRecaptcha\",\n value: function triggerRecaptcha() {\n if (!this || !this.components) {\n return;\n }\n var recaptchaComponent = (0, _utils.searchComponents)(this.components, {\n 'component.type': 'recaptcha',\n 'component.eventType': 'formLoad'\n });\n if (recaptchaComponent.length > 0) {\n recaptchaComponent[0].verify(\"\".concat(this.form.name ? this.form.name : 'form', \"Load\"));\n }\n }\n }, {\n key: \"nosubmit\",\n get: function get() {\n return this._nosubmit || false;\n },\n set: function set(value) {\n this._nosubmit = !!value;\n this.emit('nosubmit', this._nosubmit);\n }\n }, {\n key: \"conditions\",\n get: function get() {\n var _this$schema$settings, _this$schema$settings2;\n return (_this$schema$settings = (_this$schema$settings2 = this.schema.settings) === null || _this$schema$settings2 === void 0 ? void 0 : _this$schema$settings2.conditions) !== null && _this$schema$settings !== void 0 ? _this$schema$settings : [];\n }\n }, {\n key: \"variables\",\n get: function get() {\n var _this$schema$settings3, _this$schema$settings4;\n return (_this$schema$settings3 = (_this$schema$settings4 = this.schema.settings) === null || _this$schema$settings4 === void 0 ? void 0 : _this$schema$settings4.variables) !== null && _this$schema$settings3 !== void 0 ? _this$schema$settings3 : [];\n }\n }]);\n return Webform;\n}(_NestedDataComponent2[\"default\"]);\nexports[\"default\"] = Webform;\nWebform.setBaseUrl = _Formio.GlobalFormio.setBaseUrl;\nWebform.setApiUrl = _Formio.GlobalFormio.setApiUrl;\nWebform.setAppUrl = _Formio.GlobalFormio.setAppUrl;\n\n//# sourceURL=webpack://Formio/./lib/Webform.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\n__webpack_require__(/*! core-js/modules/es.string.trim.js */ \"./node_modules/core-js/modules/es.string.trim.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _compareVersions = _interopRequireDefault(__webpack_require__(/*! compare-versions */ \"./node_modules/compare-versions/lib/esm/index.js\"));\nvar _EventEmitter = _interopRequireDefault(__webpack_require__(/*! ./EventEmitter */ \"./lib/EventEmitter.js\"));\nvar _i18next = _interopRequireDefault(__webpack_require__(/*! i18next */ \"./node_modules/i18next/dist/cjs/i18next.js\"));\nvar _i18n = _interopRequireDefault(__webpack_require__(/*! ./i18n */ \"./lib/i18n.js\"));\nvar _Formio = __webpack_require__(/*! ./Formio */ \"./lib/Formio.js\");\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _Components = _interopRequireDefault(__webpack_require__(/*! ./components/Components */ \"./lib/components/Components.js\"));\nvar _NestedDataComponent2 = _interopRequireDefault(__webpack_require__(/*! ./components/_classes/nesteddata/NestedDataComponent */ \"./lib/components/_classes/nesteddata/NestedDataComponent.js\"));\nvar _utils = __webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\");\nvar _formUtils = __webpack_require__(/*! ./utils/formUtils */ \"./lib/utils/formUtils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n// Initialize the available forms.\n_Formio.GlobalFormio.forms = {};\n\n// Allow people to register components.\n_Formio.GlobalFormio.registerComponent = _Components[\"default\"].setComponent;\nfunction getIconSet(icons) {\n if (icons === 'fontawesome') {\n return 'fa';\n }\n return icons || '';\n}\nfunction getOptions(options) {\n options = _lodash[\"default\"].defaults(options, {\n submitOnEnter: false,\n iconset: getIconSet(options && options.icons ? options.icons : _Formio.GlobalFormio.icons),\n i18next: _i18next[\"default\"],\n saveDraft: false,\n alwaysDirty: false,\n saveDraftThrottle: 5000,\n display: 'form',\n cdnUrl: _Formio.GlobalFormio.cdn.baseUrl\n });\n if (!options.events) {\n options.events = new _EventEmitter[\"default\"]();\n }\n return options;\n}\n\n/**\n * Renders a Form.io form within the webpage.\n */\nvar Webform = /*#__PURE__*/function (_NestedDataComponent) {\n _inherits(Webform, _NestedDataComponent);\n var _super = _createSuper(Webform);\n /**\n * Creates a new Form instance.\n *\n * @param {Object} options - The options to create a new form instance.\n * @param {boolean} options.saveDraft - Set this if you would like to enable the save draft feature.\n * @param {boolean} options.saveDraftThrottle - The throttle for the save draft feature.\n * @param {boolean} options.readOnly - Set this form to readOnly\n * @param {boolean} options.noAlerts - Set to true to disable the alerts dialog.\n * @param {boolean} options.i18n - The translation file for this rendering. @see https://github.com/formio/formio.js/blob/master/i18n.js\n * @param {boolean} options.template - Provides a way to inject custom logic into the creation of every element rendered within the form.\n */\n /* eslint-disable max-statements */\n function Webform() {\n var _this2;\n _classCallCheck(this, Webform);\n var element, options;\n if (arguments[0] instanceof HTMLElement || arguments[1]) {\n element = arguments[0];\n options = arguments[1];\n } else {\n options = arguments[0];\n }\n _this2 = _super.call(this, null, getOptions(options));\n _defineProperty(_assertThisInitialized(_this2), \"executeShortcuts\", function (event) {\n var target = event.target;\n if (!_this2.keyboardCatchableElement(target)) {\n return;\n }\n var ctrl = event.ctrlKey || event.metaKey;\n var keyCode = event.keyCode;\n var _char = '';\n if (65 <= keyCode && keyCode <= 90) {\n _char = String.fromCharCode(keyCode);\n } else if (keyCode === 13) {\n _char = 'Enter';\n } else if (keyCode === 27) {\n _char = 'Esc';\n }\n _lodash[\"default\"].each(_this2.shortcuts, function (shortcut) {\n if (shortcut.ctrl && !ctrl) {\n return;\n }\n if (shortcut.shortcut === _char) {\n shortcut.element.click();\n event.preventDefault();\n }\n });\n });\n _this2.element = element;\n\n // Keep track of all available forms globally.\n _Formio.GlobalFormio.forms[_this2.id] = _assertThisInitialized(_this2);\n\n // Set the base url.\n if (_this2.options.baseUrl) {\n _Formio.GlobalFormio.setBaseUrl(_this2.options.baseUrl);\n }\n\n /**\n * The i18n configuration for this component.\n */\n var i18n = _i18n[\"default\"];\n if (options && options.i18n && !options.i18nReady) {\n // Support legacy way of doing translations.\n if (options.i18n.resources) {\n i18n = options.i18n;\n } else {\n _lodash[\"default\"].each(options.i18n, function (lang, code) {\n if (code === 'options') {\n _lodash[\"default\"].merge(i18n, lang);\n } else if (!i18n.resources[code]) {\n // extend the default translations (validations, buttons etc.) in case they are not in the options.\n i18n.resources[code] = {\n translation: _lodash[\"default\"].assign((0, _utils.fastCloneDeep)(_i18n[\"default\"].resources.en.translation), lang)\n };\n } else {\n _lodash[\"default\"].assign(i18n.resources[code].translation, lang);\n }\n });\n }\n options.i18n = i18n;\n options.i18nReady = true;\n }\n if (options && options.i18n) {\n _this2.options.i18n = options.i18n;\n } else {\n _this2.options.i18n = i18n;\n }\n\n // Set the language.\n if (_this2.options.language) {\n _this2.options.i18n.lng = _this2.options.language;\n }\n\n /**\n * The type of this element.\n * @type {string}\n */\n _this2.type = 'form';\n _this2._src = '';\n _this2._loading = false;\n _this2._form = {};\n _this2.draftEnabled = false;\n _this2.savingDraft = true;\n if (_this2.options.saveDraftThrottle) {\n _this2.triggerSaveDraft = _lodash[\"default\"].throttle(_this2.saveDraft.bind(_assertThisInitialized(_this2)), _this2.options.saveDraftThrottle);\n } else {\n _this2.triggerSaveDraft = _this2.saveDraft.bind(_assertThisInitialized(_this2));\n }\n _this2.customErrors = [];\n\n /**\n * Determines if this form should submit the API on submit.\n * @type {boolean}\n */\n _this2.nosubmit = false;\n\n /**\n * Determines if the form has tried to be submitted, error or not.\n *\n * @type {boolean}\n */\n _this2.submitted = false;\n\n /**\n * Determines if the form is being submitted at the moment.\n *\n * @type {boolean}\n */\n _this2.submitting = false;\n\n /**\n * The Formio instance for this form.\n * @type {Formio}\n */\n _this2.formio = null;\n\n /**\n * The loader HTML element.\n * @type {HTMLElement}\n */\n _this2.loader = null;\n\n /**\n * The alert HTML element\n * @type {HTMLElement}\n */\n _this2.alert = null;\n\n /**\n * Promise that is triggered when the submission is done loading.\n * @type {Promise}\n */\n _this2.onSubmission = null;\n\n /**\n * Determines if this submission is explicitly set.\n * @type {boolean}\n */\n _this2.submissionSet = false;\n\n /**\n * Promise that executes when the form is ready and rendered.\n * @type {Promise}\n *\n * @example\n * import Webform from 'formiojs/Webform';\n * let form = new Webform(document.getElementById('formio'));\n * form.formReady.then(() => {\n * console.log('The form is ready!');\n * });\n * form.src = 'https://examples.form.io/example';\n */\n _this2.formReady = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n /**\n * Called when the formReady state of this form has been resolved.\n *\n * @type {function}\n */\n _this2.formReadyResolve = resolve;\n\n /**\n * Called when this form could not load and is rejected.\n *\n * @type {function}\n */\n _this2.formReadyReject = reject;\n });\n\n /**\n * Promise that executes when the submission is ready and rendered.\n * @type {Promise}\n *\n * @example\n * import Webform from 'formiojs/Webform';\n * let form = new Webform(document.getElementById('formio'));\n * form.submissionReady.then(() => {\n * console.log('The submission is ready!');\n * });\n * form.src = 'https://examples.form.io/example/submission/234234234234234243';\n */\n _this2.submissionReady = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n /**\n * Called when the formReady state of this form has been resolved.\n *\n * @type {function}\n */\n _this2.submissionReadyResolve = resolve;\n\n /**\n * Called when this form could not load and is rejected.\n *\n * @type {function}\n */\n _this2.submissionReadyReject = reject;\n });\n _this2.shortcuts = [];\n\n // Set language after everything is established.\n _this2.localize().then(function () {\n _this2.language = _this2.options.language;\n });\n\n // See if we need to restore the draft from a user.\n if (_this2.options.saveDraft) {\n _this2.formReady.then(function () {\n if (!_this2.options.skipDraftRestore) {\n var user = _Formio.GlobalFormio.getUser();\n // Only restore a draft if the submission isn't explicitly set.\n if (user && !_this2.submissionSet) {\n _this2.restoreDraft(user._id);\n }\n } else {\n // Enable drafts\n _this2.draftEnabled = true;\n _this2.savingDraft = false;\n }\n });\n }\n _this2.component.clearOnHide = false;\n\n // Ensure the root is set to this component.\n _this2.root = _assertThisInitialized(_this2);\n _this2.localRoot = _assertThisInitialized(_this2);\n return _this2;\n }\n /* eslint-enable max-statements */\n _createClass(Webform, [{\n key: \"language\",\n get: function get() {\n return this.options.language;\n },\n set:\n /**\n * Sets the language for this form.\n *\n * @param lang\n * @return {Promise}\n */\n function set(lang) {\n var _this3 = this;\n this.options.language = lang;\n if (this.i18next.language === lang) {\n return;\n }\n try {\n this.i18next.changeLanguage(lang, function (err) {\n if (err) {\n return;\n }\n _this3.rebuild();\n _this3.emit('languageChanged');\n });\n } catch (err) {\n return;\n }\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return null;\n }\n }, {\n key: \"componentContext\",\n value: function componentContext() {\n return this._data;\n }\n }, {\n key: \"componentComponents\",\n get: function get() {\n return this.form.components;\n }\n }, {\n key: \"shadowRoot\",\n get: function get() {\n return this.options.shadowRoot;\n }\n\n /**\n * Add a language for translations\n *\n * @param code\n * @param lang\n * @param active\n * @return {*}\n */\n }, {\n key: \"addLanguage\",\n value: function addLanguage(code, lang) {\n var active = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var translations = _lodash[\"default\"].assign((0, _utils.fastCloneDeep)(_i18n[\"default\"].resources.en.translation), lang);\n this.i18next.addResourceBundle(code, 'translation', translations, true, true);\n if (active) {\n this.language = code;\n }\n }\n\n /**\n * Perform the localization initialization.\n * @returns {*}\n */\n }, {\n key: \"localize\",\n value: function localize() {\n var _this4 = this;\n if (this.i18next.initialized) {\n return _nativePromiseOnly[\"default\"].resolve(this.i18next);\n }\n this.i18next.initialized = true;\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n try {\n _this4.i18next.init(_objectSpread(_objectSpread({}, _this4.options.i18n), {\n compatibilityJSON: 'v3'\n }), function (err) {\n // Get language but remove any ;q=1 that might exist on it.\n _this4.options.language = _this4.i18next.language.split(';')[0];\n if (err) {\n return reject(err);\n }\n resolve(_this4.i18next);\n });\n } catch (err) {\n return reject(err);\n }\n });\n }\n }, {\n key: \"keyboardCatchableElement\",\n value: function keyboardCatchableElement(element) {\n if (element.nodeName === 'TEXTAREA') {\n return false;\n }\n if (element.nodeName === 'INPUT') {\n return ['text', 'email', 'password'].indexOf(element.type) === -1;\n }\n return true;\n }\n }, {\n key: \"addShortcut\",\n value: function addShortcut(element, shortcut) {\n if (!shortcut || !/^([A-Z]|Enter|Esc)$/i.test(shortcut)) {\n return;\n }\n shortcut = _lodash[\"default\"].capitalize(shortcut);\n if (shortcut === 'Enter' || shortcut === 'Esc') {\n // Restrict Enter and Esc only for buttons\n if (element.tagName !== 'BUTTON') {\n return;\n }\n this.shortcuts.push({\n shortcut: shortcut,\n element: element\n });\n } else {\n this.shortcuts.push({\n ctrl: true,\n shortcut: shortcut,\n element: element\n });\n }\n }\n }, {\n key: \"removeShortcut\",\n value: function removeShortcut(element, shortcut) {\n if (!shortcut || !/^([A-Z]|Enter|Esc)$/i.test(shortcut)) {\n return;\n }\n _lodash[\"default\"].remove(this.shortcuts, {\n shortcut: shortcut,\n element: element\n });\n }\n\n /**\n * Get the embed source of the form.\n *\n * @returns {string}\n */\n }, {\n key: \"src\",\n get: function get() {\n return this._src;\n }\n\n /**\n * Loads the submission if applicable.\n */,\n set:\n /**\n * Set the Form source, which is typically the Form.io embed URL.\n *\n * @param {string} value - The value of the form embed url.\n *\n * @example\n * import Webform from 'formiojs/Webform';\n * let form = new Webform(document.getElementById('formio'));\n * form.formReady.then(() => {\n * console.log('The form is formReady!');\n * });\n * form.src = 'https://examples.form.io/example';\n */\n function set(value) {\n this.setSrc(value);\n }\n\n /**\n * Get the embed source of the form.\n *\n * @returns {string}\n */\n }, {\n key: \"loadSubmission\",\n value: function loadSubmission() {\n var _this5 = this;\n this.loadingSubmission = true;\n if (this.formio.submissionId) {\n this.onSubmission = this.formio.loadSubmission().then(function (submission) {\n return _this5.setSubmission(submission);\n }, function (err) {\n return _this5.submissionReadyReject(err);\n })[\"catch\"](function (err) {\n return _this5.submissionReadyReject(err);\n });\n } else {\n this.submissionReadyResolve();\n }\n return this.submissionReady;\n }\n\n /**\n * Set the src of the form renderer.\n *\n * @param value\n * @param options\n */\n }, {\n key: \"setSrc\",\n value: function setSrc(value, options) {\n var _this6 = this;\n if (this.setUrl(value, options)) {\n this.nosubmit = false;\n return this.formio.loadForm({\n params: {\n live: 1\n }\n }).then(function (form) {\n var setForm = _this6.setForm(form);\n _this6.loadSubmission();\n return setForm;\n })[\"catch\"](function (err) {\n console.warn(err);\n _this6.formReadyReject(err);\n });\n }\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"url\",\n get: function get() {\n return this._src;\n }\n\n /**\n * Sets the url of the form renderer.\n *\n * @param value\n * @param options\n */,\n set:\n /**\n * Set the form source but don't initialize the form and submission from the url.\n *\n * @param {string} value - The value of the form embed url.\n */\n function set(value) {\n this.setUrl(value);\n }\n\n /**\n * Called when both the form and submission have been loaded.\n *\n * @returns {Promise} - The promise to trigger when both form and submission have loaded.\n */\n }, {\n key: \"setUrl\",\n value: function setUrl(value, options) {\n if (!value || typeof value !== 'string' || value === this._src) {\n return false;\n }\n this._src = value;\n this.nosubmit = true;\n this.formio = this.options.formio = new _Formio.GlobalFormio(value, options);\n if (this.type === 'form') {\n // Set the options source so this can be passed to other components.\n this.options.src = value;\n }\n return true;\n }\n }, {\n key: \"ready\",\n get: function get() {\n var _this7 = this;\n return this.formReady.then(function () {\n return _get(_getPrototypeOf(Webform.prototype), \"ready\", _this7).then(function () {\n return _this7.loadingSubmission ? _this7.submissionReady : true;\n });\n });\n }\n\n /**\n * Returns if this form is loading.\n *\n * @returns {boolean} - TRUE means the form is loading, FALSE otherwise.\n */\n }, {\n key: \"loading\",\n get: function get() {\n return this._loading;\n }\n\n /**\n * Set the loading state for this form, and also show the loader spinner.\n *\n * @param {boolean} loading - If this form should be \"loading\" or not.\n */,\n set: function set(loading) {\n if (this._loading !== loading) {\n this._loading = loading;\n if (!this.loader && loading) {\n this.loader = this.ce('div', {\n \"class\": 'loader-wrapper'\n });\n var spinner = this.ce('div', {\n \"class\": 'loader text-center'\n });\n this.loader.appendChild(spinner);\n }\n /* eslint-disable max-depth */\n if (this.loader) {\n try {\n if (loading) {\n this.prependTo(this.loader, this.wrapper);\n } else {\n this.removeChildFrom(this.loader, this.wrapper);\n }\n } catch (err) {\n // ingore\n }\n }\n /* eslint-enable max-depth */\n }\n }\n\n /**\n * Sets the JSON schema for the form to be rendered.\n *\n * @example\n * import Webform from 'formiojs/Webform';\n * let form = new Webform(document.getElementById('formio'));\n * form.setForm({\n * components: [\n * {\n * type: 'textfield',\n * key: 'firstName',\n * label: 'First Name',\n * placeholder: 'Enter your first name.',\n * input: true\n * },\n * {\n * type: 'textfield',\n * key: 'lastName',\n * label: 'Last Name',\n * placeholder: 'Enter your last name',\n * input: true\n * },\n * {\n * type: 'button',\n * action: 'submit',\n * label: 'Submit',\n * theme: 'primary'\n * }\n * ]\n * });\n *\n * @param {Object} form - The JSON schema of the form @see https://examples.form.io/example for an example JSON schema.\n * @param flags\n * @returns {*}\n */\n }, {\n key: \"setForm\",\n value: function setForm(form, flags) {\n var _this$_form$component,\n _this8 = this;\n var isFormAlreadySet = this._form && ((_this$_form$component = this._form.components) === null || _this$_form$component === void 0 ? void 0 : _this$_form$component.length);\n try {\n var _this$parent, _this$parent$componen;\n // Do not set the form again if it has been already set\n if (isFormAlreadySet && JSON.stringify(this._form) === JSON.stringify(form)) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n\n // Create the form.\n this._form = flags !== null && flags !== void 0 && flags.keepAsReference ? form : _lodash[\"default\"].cloneDeep(form);\n if (this.onSetForm) {\n this.onSetForm(_lodash[\"default\"].cloneDeep(this._form), form);\n }\n if ((_this$parent = this.parent) !== null && _this$parent !== void 0 && (_this$parent$componen = _this$parent.component) !== null && _this$parent$componen !== void 0 && _this$parent$componen.modalEdit) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n } catch (err) {\n console.warn(err);\n // If provided form is not a valid JSON object, do not set it too\n return _nativePromiseOnly[\"default\"].resolve();\n }\n\n // Allow the form to provide component overrides.\n if (form && form.settings && form.settings.components) {\n this.options.components = form.settings.components;\n }\n if (form && form.properties) {\n this.options.properties = form.properties;\n }\n if ('schema' in form && (0, _compareVersions[\"default\"])(form.schema, '1.x') > 0) {\n this.ready.then(function () {\n _this8.setAlert('alert alert-danger', 'Form schema is for a newer version, please upgrade your renderer. Some functionality may not work.');\n });\n }\n\n // See if they pass a module, and evaluate it if so.\n if (form && form.module) {\n var formModule = null;\n if (typeof form.module === 'string') {\n try {\n formModule = this.evaluate(\"return \".concat(form.module));\n } catch (err) {\n console.warn(err);\n }\n } else {\n formModule = form.module;\n }\n if (formModule) {\n _Formio.GlobalFormio.use(formModule);\n\n // Since we got here after instantiation, we need to manually apply form options.\n if (formModule.options && formModule.options.form) {\n this.options = Object.assign(this.options, formModule.options.form);\n }\n }\n }\n this.initialized = false;\n var rebuild = this.rebuild() || _nativePromiseOnly[\"default\"].resolve();\n return rebuild.then(function () {\n _this8.emit('formLoad', form);\n _this8.triggerRecaptcha();\n // Make sure to trigger onChange after a render event occurs to speed up form rendering.\n setTimeout(function () {\n _this8.onChange(flags);\n _this8.formReadyResolve();\n }, 0);\n return _this8.formReady;\n });\n }\n\n /**\n * Gets the form object.\n *\n * @returns {Object} - The form JSON schema.\n */\n }, {\n key: \"form\",\n get: function get() {\n if (!this._form) {\n this._form = {\n components: []\n };\n }\n return this._form;\n }\n\n /**\n * Sets the form value.\n *\n * @alias setForm\n * @param {Object} form - The form schema object.\n */,\n set: function set(form) {\n this.setForm(form);\n }\n\n /**\n * Returns the submission object that was set within this form.\n *\n * @returns {Object}\n */\n }, {\n key: \"submission\",\n get: function get() {\n return this.getValue();\n }\n\n /**\n * Sets the submission of a form.\n *\n * @example\n * import Webform from 'formiojs/Webform';\n * let form = new Webform(document.getElementById('formio'));\n * form.src = 'https://examples.form.io/example';\n * form.submission = {data: {\n * firstName: 'Joe',\n * lastName: 'Smith',\n * email: 'joe@example.com'\n * }};\n *\n * @param {Object} submission - The Form.io submission object.\n */,\n set: function set(submission) {\n this.setSubmission(submission);\n }\n\n /**\n * Sets a submission and returns the promise when it is ready.\n * @param submission\n * @param flags\n * @return {Promise.}\n */\n }, {\n key: \"setSubmission\",\n value: function setSubmission(submission) {\n var _this9 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n flags = _objectSpread(_objectSpread({}, flags), {}, {\n fromSubmission: _lodash[\"default\"].has(flags, 'fromSubmission') ? flags.fromSubmission : true\n });\n return this.onSubmission = this.formReady.then(function (resolveFlags) {\n if (resolveFlags) {\n flags = _objectSpread(_objectSpread({}, flags), resolveFlags);\n }\n _this9.submissionSet = true;\n _this9.triggerChange(flags);\n _this9.emit('beforeSetSubmission', submission);\n _this9.setValue(submission, flags);\n return _this9.submissionReadyResolve(submission);\n }, function (err) {\n return _this9.submissionReadyReject(err);\n })[\"catch\"](function (err) {\n return _this9.submissionReadyReject(err);\n });\n }\n }, {\n key: \"handleDraftError\",\n value: function handleDraftError(errName, errDetails, restoreDraft) {\n var errorMessage = _lodash[\"default\"].trim(\"\".concat(this.t(errName), \" \").concat(errDetails || ''));\n console.warn(errorMessage);\n this.emit(restoreDraft ? 'restoreDraftError' : 'saveDraftError', errDetails || errorMessage);\n }\n\n /**\n * Saves a submission draft.\n */\n }, {\n key: \"saveDraft\",\n value: function saveDraft() {\n var _this10 = this;\n if (!this.draftEnabled) {\n return;\n }\n if (!this.formio) {\n this.handleDraftError('saveDraftInstanceError');\n return;\n }\n if (!_Formio.GlobalFormio.getUser()) {\n this.handleDraftError('saveDraftAuthError');\n return;\n }\n var draft = (0, _utils.fastCloneDeep)(this.submission);\n draft.state = 'draft';\n if (!this.savingDraft && !this.submitting) {\n this.emit('saveDraftBegin');\n this.savingDraft = true;\n this.formio.saveSubmission(draft).then(function (sub) {\n // Set id to submission to avoid creating new draft submission\n _this10.submission._id = sub._id;\n _this10.savingDraft = false;\n _this10.emit('saveDraft', sub);\n })[\"catch\"](function (err) {\n _this10.savingDraft = false;\n _this10.handleDraftError('saveDraftError', err);\n });\n }\n }\n\n /**\n * Restores a draft submission based on the user who is authenticated.\n *\n * @param {userId} - The user id where we need to restore the draft from.\n */\n }, {\n key: \"restoreDraft\",\n value: function restoreDraft(userId) {\n var _this11 = this;\n var formio = this.formio || this.options.formio;\n if (!formio) {\n this.handleDraftError('restoreDraftInstanceError', null, true);\n return;\n }\n this.savingDraft = true;\n formio.loadSubmissions({\n params: {\n state: 'draft',\n owner: userId,\n sort: '-created'\n }\n }).then(function (submissions) {\n if (submissions.length > 0 && !_this11.options.skipDraftRestore) {\n var draft = (0, _utils.fastCloneDeep)(submissions[0]);\n return _this11.setSubmission(draft).then(function () {\n _this11.draftEnabled = true;\n _this11.savingDraft = false;\n _this11.emit('restoreDraft', draft);\n });\n }\n // Enable drafts so that we can keep track of changes.\n _this11.draftEnabled = true;\n _this11.savingDraft = false;\n _this11.emit('restoreDraft', null);\n })[\"catch\"](function (err) {\n _this11.draftEnabled = true;\n _this11.savingDraft = false;\n _this11.handleDraftError('restoreDraftError', err, true);\n });\n }\n }, {\n key: \"schema\",\n get: function get() {\n var schema = (0, _utils.fastCloneDeep)(_lodash[\"default\"].omit(this._form, ['components']));\n schema.components = [];\n this.eachComponent(function (component) {\n return schema.components.push(component.schema);\n });\n return schema;\n }\n }, {\n key: \"mergeData\",\n value: function mergeData(_this, _that) {\n _lodash[\"default\"].mergeWith(_this, _that, function (thisValue, thatValue) {\n if (Array.isArray(thisValue) && Array.isArray(thatValue) && thisValue.length !== thatValue.length) {\n return thatValue;\n }\n });\n }\n }, {\n key: \"setValue\",\n value: function setValue(submission) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!submission || !submission.data) {\n submission = {\n data: {}\n };\n }\n // Metadata needs to be available before setValue\n this._submission.metadata = submission.metadata ? _lodash[\"default\"].cloneDeep(submission.metadata) : {};\n this.editing = !!submission._id;\n\n // Set the timezone in the options if available.\n if (!this.options.submissionTimezone && submission.metadata && submission.metadata.timezone) {\n this.options.submissionTimezone = submission.metadata.timezone;\n }\n var changed = _get(_getPrototypeOf(Webform.prototype), \"setValue\", this).call(this, submission.data, flags);\n if (!flags.sanitize) {\n this.mergeData(this.data, submission.data);\n }\n submission.data = this.data;\n this._submission = submission;\n return changed;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n if (!this._submission.data) {\n this._submission.data = {};\n }\n if (this.viewOnly) {\n return this._submission;\n }\n var submission = this._submission;\n submission.data = this.data;\n return this._submission;\n }\n\n /**\n * Build the form.\n */\n }, {\n key: \"init\",\n value: function init() {\n var _this12 = this;\n this._submission = this._submission || {\n data: {}\n };\n\n // Remove any existing components.\n if (this.components && this.components.length) {\n this.destroyComponents();\n this.components = [];\n }\n if (this.component) {\n this.component.components = this.form ? this.form.components : [];\n } else {\n this.component = this.form;\n }\n this.component.type = 'form';\n this.component.input = false;\n this.addComponents();\n this.on('submitButton', function (options) {\n _this12.submit(false, options)[\"catch\"](function (e) {\n return e !== false && console.log(e);\n });\n }, true);\n this.on('checkValidity', function (data) {\n return _this12.checkValidity(data, true, data);\n }, true);\n this.on('requestUrl', function (args) {\n return _this12.submitUrl(args.url, args.headers);\n }, true);\n this.on('resetForm', function () {\n return _this12.resetValue();\n }, true);\n this.on('deleteSubmission', function () {\n return _this12.deleteSubmission();\n }, true);\n this.on('refreshData', function () {\n return _this12.updateValue();\n }, true);\n this.executeFormController();\n return this.formReady;\n }\n }, {\n key: \"executeFormController\",\n value: function executeFormController() {\n var _this13 = this;\n // If no controller value or\n // hidden and set to clearOnHide (Don't calculate a value for a hidden field set to clear when hidden)\n if (!this.form || !this.form.controller || (!this.visible || this.component.hidden) && this.component.clearOnHide && !this.rootPristine) {\n return false;\n }\n this.formReady.then(function () {\n _this13.evaluate(_this13.form.controller, {\n components: _this13.components,\n instance: _this13\n });\n });\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n var deleteFromGlobal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n this.off('submitButton');\n this.off('checkValidity');\n this.off('requestUrl');\n this.off('resetForm');\n this.off('deleteSubmission');\n this.off('refreshData');\n if (deleteFromGlobal) {\n this.emit('formDelete', this.id);\n delete _Formio.GlobalFormio.forms[this.id];\n }\n return _get(_getPrototypeOf(Webform.prototype), \"destroy\", this).call(this);\n }\n }, {\n key: \"build\",\n value: function build(element) {\n var _this14 = this;\n if (element || this.element) {\n return this.ready.then(function () {\n element = element || _this14.element;\n _get(_getPrototypeOf(Webform.prototype), \"build\", _this14).call(_this14, element);\n });\n }\n return this.ready;\n }\n }, {\n key: \"getClassName\",\n value: function getClassName() {\n var classes = 'formio-form';\n if (this.options.readOnly) {\n classes += ' formio-read-only';\n }\n return classes;\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(Webform.prototype), \"render\", this).call(this, this.renderTemplate('webform', {\n classes: this.getClassName(),\n children: this.renderComponents()\n }), this.builderMode ? 'builder' : 'form', true);\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n // Don't bother if we have not built yet.\n if (!this.element) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n this.clear();\n this.setContent(this.element, this.render());\n return this.attach(this.element);\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this15 = this;\n this.element = element;\n this.loadRefs(element, {\n webform: 'single'\n });\n var childPromise = this.attachComponents(this.refs.webform);\n this.addEventListener(document, 'keydown', this.executeShortcuts);\n this.currentForm = this;\n this.hook('attachWebform', element, this);\n return childPromise.then(function () {\n _this15.emit('render', _this15.element);\n return _this15.setValue(_this15._submission, {\n noUpdateEvent: true\n });\n });\n }\n }, {\n key: \"hasRequiredFields\",\n value: function hasRequiredFields() {\n var result = false;\n (0, _formUtils.eachComponent)(this.form.components, function (component) {\n if (component.validate.required) {\n result = true;\n return true;\n }\n }, true);\n return result;\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n _lodash[\"default\"].each(this.getComponents(), function (comp) {\n return comp.resetValue();\n });\n this.setPristine(true);\n this.onChange({\n resetValue: true\n });\n }\n\n /**\n * Sets a new alert to display in the error dialog of the form.\n *\n * @param {string} type - The type of alert to display. \"danger\", \"success\", \"warning\", etc.\n * @param {string} message - The message to show in the alert.\n * @param {Object} options\n */\n }, {\n key: \"setAlert\",\n value: function setAlert(type, message, options) {\n var _this16 = this;\n if (!type && this.submitted) {\n if (this.alert) {\n if (this.refs.errorRef && this.refs.errorRef.length) {\n this.refs.errorRef.forEach(function (el) {\n _this16.removeEventListener(el, 'click');\n _this16.removeEventListener(el, 'keypress');\n });\n }\n this.removeChild(this.alert);\n this.alert = null;\n }\n return;\n }\n if (this.options.noAlerts) {\n if (!message) {\n this.emit('error', false);\n }\n return;\n }\n if (this.alert) {\n try {\n if (this.refs.errorRef && this.refs.errorRef.length) {\n this.refs.errorRef.forEach(function (el) {\n _this16.removeEventListener(el, 'click');\n _this16.removeEventListener(el, 'keypress');\n });\n }\n this.removeChild(this.alert);\n this.alert = null;\n } catch (err) {\n // ignore\n }\n }\n if (message) {\n var attrs = {\n \"class\": options && options.classes || \"alert alert-\".concat(type),\n id: \"error-list-\".concat(this.id)\n };\n var templateOptions = {\n message: message instanceof HTMLElement ? message.outerHTML : message,\n attrs: attrs,\n type: type\n };\n this.alert = (0, _utils.convertStringToHTMLElement)(this.renderTemplate('alert', templateOptions), \"#\".concat(attrs.id));\n }\n if (!this.alert) {\n return;\n }\n this.loadRefs(this.alert, {\n errorRef: 'multiple'\n });\n if (this.refs.errorRef && this.refs.errorRef.length) {\n this.refs.errorRef.forEach(function (el) {\n _this16.addEventListener(el, 'click', function (e) {\n var key = e.currentTarget.dataset.componentKey;\n _this16.focusOnComponent(key);\n });\n _this16.addEventListener(el, 'keydown', function (e) {\n if (e.keyCode === 13) {\n e.preventDefault();\n var key = e.currentTarget.dataset.componentKey;\n _this16.focusOnComponent(key);\n }\n });\n });\n }\n this.prepend(this.alert);\n }\n\n /**\n * Focus on selected component.\n *\n * @param {string} key - The key of selected component.\n * @returns {*}\n */\n }, {\n key: \"focusOnComponent\",\n value: function focusOnComponent(key) {\n if (key) {\n var component = this.getComponent(key);\n if (component) {\n component.focus();\n }\n }\n }\n\n /**\n * Show the errors of this form within the alert dialog.\n *\n * @param {Object} error - An optional additional error to display along with the component errors.\n * @returns {*}\n */\n /* eslint-disable no-unused-vars */\n }, {\n key: \"showErrors\",\n value: function showErrors(error, triggerEvent, onChange) {\n var _this17 = this;\n this.loading = false;\n var errors = this.errors;\n if (error) {\n if (Array.isArray(error)) {\n errors = errors.concat(error);\n } else {\n errors.push(error);\n }\n } else {\n errors = _get(_getPrototypeOf(Webform.prototype), \"errors\", this);\n }\n errors = errors.concat(this.customErrors);\n errors = errors.concat(this.serverErrors || []);\n if (!errors.length) {\n this.setAlert(false);\n return;\n }\n\n // Mark any components as invalid if in a custom message.\n errors.forEach(function (err) {\n var _err$components = err.components,\n components = _err$components === void 0 ? [] : _err$components;\n if (err.component) {\n components.push(err.component);\n }\n if (err.path) {\n components.push(err.path);\n }\n components.forEach(function (path) {\n var originalPath = _this17._parentPath + (0, _utils.getStringFromComponentPath)(path);\n var component = _this17.getComponent(path, _lodash[\"default\"].identity, originalPath);\n if (err.fromServer) {\n if (component.serverErrors) {\n component.serverErrors.push(err);\n } else {\n component.serverErrors = [err];\n }\n }\n var components = _lodash[\"default\"].compact(Array.isArray(component) ? component : [component]);\n components.forEach(function (component) {\n return component.setCustomValidity(err.message, true);\n });\n });\n });\n var displayedErrors = [];\n errors.forEach(function (err) {\n if (err) {\n var createListItem = function createListItem(message, index) {\n var messageFromIndex = !_lodash[\"default\"].isUndefined(index) && err.messages && err.messages[index];\n var keyOrPath = messageFromIndex && messageFromIndex.formattedKeyOrPath || messageFromIndex.path || err.component && err.component.key || err.fromServer && err.path;\n var formattedKeyOrPath = keyOrPath ? (0, _utils.getStringFromComponentPath)(keyOrPath) : '';\n formattedKeyOrPath = _this17._parentPath + formattedKeyOrPath;\n if (typeof err !== 'string' && !err.formattedKeyOrPath) {\n err.formattedKeyOrPath = formattedKeyOrPath;\n }\n return {\n message: (0, _utils.unescapeHTML)(message),\n keyOrPath: formattedKeyOrPath\n };\n };\n err.messages = _lodash[\"default\"].uniqBy(err.messages, function (message) {\n return message.message;\n });\n if (err.messages && err.messages.length) {\n var component = err.component;\n err.messages.forEach(function (_ref, index) {\n var message = _ref.message,\n context = _ref.context,\n fromServer = _ref.fromServer;\n var text = context !== null && context !== void 0 && context.hasLabel || fromServer ? _this17.t('alertMessage', {\n message: _this17.t(message)\n }) : _this17.t('alertMessageWithLabel', {\n label: _this17.t(component.label),\n message: _this17.t(message)\n });\n displayedErrors.push(createListItem(text, index));\n });\n } else if (err) {\n var message = _lodash[\"default\"].isObject(err) ? _this17.t('alertMessage', {\n message: _this17.t(err.message || '')\n }) : _this17.t('alertMessage', {\n message: _this17.t(err)\n });\n displayedErrors.push(createListItem(message));\n }\n }\n });\n var errorsList = this.renderTemplate('errorsList', {\n errors: displayedErrors\n });\n this.root.setAlert('danger', errorsList);\n if (triggerEvent) {\n this.emit('error', errors);\n }\n return errors;\n }\n /* eslint-enable no-unused-vars */\n\n /**\n * Called when the submission has completed, or if the submission needs to be sent to an external library.\n *\n * @param {Object} submission - The submission object.\n * @param {boolean} saved - Whether or not this submission was saved to the server.\n * @returns {object} - The submission object.\n */\n }, {\n key: \"onSubmit\",\n value: function onSubmit(submission, saved) {\n var _this$triggerSaveDraf;\n this.loading = false;\n this.submitting = false;\n this.setPristine(true);\n // We want to return the submitted submission and setValue will mutate the submission so cloneDeep it here.\n this.setValue((0, _utils.fastCloneDeep)(submission), {\n noValidate: true,\n noCheck: true\n });\n this.setAlert('success', \"

\".concat(this.t('complete'), \"

\"));\n // Cancel triggered saveDraft to prevent overriding the submitted state\n if (this.draftEnabled && (_this$triggerSaveDraf = this.triggerSaveDraft) !== null && _this$triggerSaveDraf !== void 0 && _this$triggerSaveDraf.cancel) {\n this.triggerSaveDraft.cancel();\n }\n this.emit('submit', submission, saved);\n if (saved) {\n this.emit('submitDone', submission);\n }\n return submission;\n }\n }, {\n key: \"normalizeError\",\n value: function normalizeError(error) {\n if (error) {\n if (_typeof(error) === 'object' && 'details' in error) {\n error = error.details;\n }\n if (typeof error === 'string') {\n error = {\n message: error\n };\n }\n }\n return error;\n }\n\n /**\n * Called when an error occurs during the submission.\n *\n * @param {Object} error - The error that occured.\n */\n }, {\n key: \"onSubmissionError\",\n value: function onSubmissionError(error) {\n error = this.normalizeError(error);\n this.submitting = false;\n this.setPristine(false);\n this.emit('submitError', error);\n\n // Allow for silent cancellations (no error message, no submit button error state)\n if (error && error.silent) {\n this.emit('change', {\n isValid: true\n }, {\n silent: true\n });\n return false;\n }\n var errors;\n if (this.submitted) {\n errors = this.showErrors();\n } else {\n errors = this.showErrors(error, true);\n }\n if (this.root && this.root.alert) {\n this.scrollIntoView(this.root.alert);\n }\n return errors;\n }\n\n /**\n * Trigger the change event for this form.\n *\n * @param changed\n * @param flags\n */\n }, {\n key: \"onChange\",\n value: function onChange(flags, changed, modified, changes) {\n flags = flags || {};\n var isChangeEventEmitted = false;\n // For any change events, clear any custom errors for that component.\n if (changed && changed.component) {\n this.customErrors = this.customErrors.filter(function (err) {\n return err.component && err.component !== changed.component.key;\n });\n }\n _get(_getPrototypeOf(Webform.prototype), \"onChange\", this).call(this, flags, true);\n var value = _lodash[\"default\"].clone(this.submission);\n flags.changed = value.changed = changed;\n flags.changes = changes;\n if (modified && this.pristine) {\n this.pristine = false;\n }\n value.isValid = this.checkData(value.data, flags);\n this.loading = false;\n if (this.submitted) {\n this.showErrors();\n }\n\n // See if we need to save the draft of the form.\n if (modified && this.options.saveDraft) {\n this.triggerSaveDraft();\n }\n if (!flags || !flags.noEmit) {\n this.emit('change', value, flags, modified);\n isChangeEventEmitted = true;\n }\n\n // The form is initialized after the first change event occurs.\n if (isChangeEventEmitted && !this.initialized) {\n this.emit('initialized');\n this.initialized = true;\n }\n }\n }, {\n key: \"checkData\",\n value: function checkData(data) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var valid = _get(_getPrototypeOf(Webform.prototype), \"checkData\", this).call(this, data, flags);\n if ((_lodash[\"default\"].isEmpty(flags) || flags.noValidate) && this.submitted) {\n this.showErrors();\n }\n return valid;\n }\n\n /**\n * Send a delete request to the server.\n */\n }, {\n key: \"deleteSubmission\",\n value: function deleteSubmission() {\n var _this18 = this;\n return this.formio.deleteSubmission().then(function () {\n _this18.emit('submissionDeleted', _this18.submission);\n _this18.resetValue();\n });\n }\n\n /**\n * Cancels the submission.\n *\n * @alias reset\n */\n }, {\n key: \"cancel\",\n value: function cancel(noconfirm) {\n var shouldReset = this.hook('beforeCancel', true);\n if (shouldReset && (noconfirm || confirm(this.t('confirmCancel')))) {\n this.resetValue();\n return true;\n } else {\n this.emit('cancelSubmit');\n return false;\n }\n }\n }, {\n key: \"setMetadata\",\n value: function setMetadata(submission) {\n // Add in metadata about client submitting the form\n submission.metadata = submission.metadata || {};\n _lodash[\"default\"].defaults(submission.metadata, {\n timezone: _lodash[\"default\"].get(this, '_submission.metadata.timezone', (0, _utils.currentTimezone)()),\n offset: parseInt(_lodash[\"default\"].get(this, '_submission.metadata.offset', (0, _moment[\"default\"])().utcOffset()), 10),\n origin: document.location.origin,\n referrer: document.referrer,\n browserName: navigator.appName,\n userAgent: navigator.userAgent,\n pathName: window.location.pathname,\n onLine: navigator.onLine\n });\n }\n }, {\n key: \"submitForm\",\n value: function submitForm() {\n var _this19 = this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.clearServerErrors();\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n // Read-only forms should never submit.\n if (_this19.options.readOnly) {\n return resolve({\n submission: _this19.submission,\n saved: false\n });\n }\n var submission = (0, _utils.fastCloneDeep)(_this19.submission || {});\n _this19.setMetadata(submission);\n submission.state = options.state || 'submitted';\n var isDraft = submission.state === 'draft';\n _this19.hook('beforeSubmit', _objectSpread(_objectSpread({}, submission), {}, {\n component: options.component\n }), function (err, data) {\n if (err) {\n return reject(err);\n }\n submission._vnote = data && data._vnote ? data._vnote : '';\n if (!isDraft && !submission.data) {\n return reject('Invalid Submission');\n }\n if (!isDraft && !_this19.checkValidity(submission.data, true)) {\n return reject();\n }\n _this19.everyComponent(function (comp) {\n var persistent = comp.component.persistent;\n if (persistent === 'client-only') {\n _lodash[\"default\"].unset(submission.data, comp.path);\n }\n });\n _this19.hook('customValidation', _objectSpread(_objectSpread({}, submission), {}, {\n component: options.component\n }), function (err) {\n if (err) {\n // If string is returned, cast to object.\n if (typeof err === 'string') {\n err = {\n message: err\n };\n }\n\n // Ensure err is an array.\n err = Array.isArray(err) ? err : [err];\n\n // Set as custom errors.\n _this19.customErrors = err;\n return reject();\n }\n _this19.loading = true;\n\n // Use the form action to submit the form if available.\n if (_this19._form && _this19._form.action) {\n var method = submission.data._id && _this19._form.action.includes(submission.data._id) ? 'PUT' : 'POST';\n return _Formio.GlobalFormio.makeStaticRequest(_this19._form.action, method, submission, _this19.formio ? _this19.formio.options : {}).then(function (result) {\n return resolve({\n submission: result,\n saved: true\n });\n })[\"catch\"](function (error) {\n _this19.setServerErrors(error);\n return reject(error);\n });\n }\n var submitFormio = _this19.formio;\n if (_this19.nosubmit || !submitFormio) {\n return resolve({\n submission: submission,\n saved: false\n });\n }\n // If this is an actionUrl, then make sure to save the action and not the submission.\n var submitMethod = submitFormio.actionUrl ? 'saveAction' : 'saveSubmission';\n submitFormio[submitMethod](submission).then(function (result) {\n return resolve({\n submission: result,\n saved: true\n });\n })[\"catch\"](function (error) {\n _this19.setServerErrors(error);\n return reject(error);\n });\n });\n });\n });\n }\n }, {\n key: \"setServerErrors\",\n value: function setServerErrors(error) {\n if (error.details) {\n this.serverErrors = error.details.filter(function (err) {\n return err.level ? err.level === 'error' : err;\n }).map(function (err) {\n err.fromServer = true;\n return err;\n });\n } else if (typeof error === 'string') {\n this.serverErrors = [{\n fromServer: true,\n level: 'error',\n message: error\n }];\n }\n }\n }, {\n key: \"executeSubmit\",\n value: function executeSubmit(options) {\n var _this20 = this;\n this.submitted = true;\n this.submitting = true;\n return this.submitForm(options).then(function (_ref2) {\n var submission = _ref2.submission,\n saved = _ref2.saved;\n return _this20.onSubmit(submission, saved);\n }).then(function (results) {\n _this20.submissionInProcess = false;\n return results;\n })[\"catch\"](function (err) {\n _this20.submissionInProcess = false;\n return _nativePromiseOnly[\"default\"].reject(_this20.onSubmissionError(err));\n });\n }\n }, {\n key: \"clearServerErrors\",\n value: function clearServerErrors() {\n var _this$serverErrors,\n _this21 = this;\n (_this$serverErrors = this.serverErrors) === null || _this$serverErrors === void 0 ? void 0 : _this$serverErrors.forEach(function (error) {\n if (error.path) {\n var pathArray = (0, _utils.getArrayFromComponentPath)(error.path);\n var component = _this21.getComponent(pathArray, _lodash[\"default\"].identity, error.formattedKeyOrPath);\n if (component) {\n component.serverErrors = [];\n }\n }\n });\n this.serverErrors = [];\n }\n\n /**\n * Submits the form.\n *\n * @example\n * import Webform from 'formiojs/Webform';\n * let form = new Webform(document.getElementById('formio'));\n * form.src = 'https://examples.form.io/example';\n * form.submission = {data: {\n * firstName: 'Joe',\n * lastName: 'Smith',\n * email: 'joe@example.com'\n * }};\n * form.submit().then((submission) => {\n * console.log(submission);\n * });\n *\n * @param {boolean} before - If this submission occured from the before handlers.\n *\n * @returns {Promise} - A promise when the form is done submitting.\n */\n }, {\n key: \"submit\",\n value: function submit(before, options) {\n var _this22 = this;\n this.submissionInProcess = true;\n if (!before) {\n return this.beforeSubmit(options).then(function () {\n return _this22.executeSubmit(options);\n });\n } else {\n return this.executeSubmit(options);\n }\n }\n }, {\n key: \"submitUrl\",\n value: function submitUrl(URL, headers) {\n var _this23 = this;\n if (!URL) {\n return console.warn('Missing URL argument');\n }\n var submission = this.submission || {};\n var API_URL = URL;\n var settings = {\n method: 'POST',\n headers: {}\n };\n if (headers && headers.length > 0) {\n headers.map(function (e) {\n if (e.header !== '' && e.value !== '') {\n settings.headers[e.header] = _this23.interpolate(e.value, submission);\n }\n });\n }\n if (API_URL && settings) {\n _Formio.GlobalFormio.makeStaticRequest(API_URL, settings.method, submission, {\n headers: settings.headers\n }).then(function () {\n _this23.emit('requestDone');\n _this23.setAlert('success', '

Success

');\n })[\"catch\"](function (e) {\n _this23.showErrors(\"\".concat(e.statusText ? e.statusText : '', \" \").concat(e.status ? e.status : e));\n _this23.emit('error', \"\".concat(e.statusText ? e.statusText : '', \" \").concat(e.status ? e.status : e));\n console.error(\"\".concat(e.statusText ? e.statusText : '', \" \").concat(e.status ? e.status : e));\n _this23.setAlert('danger', \"

\".concat(e.statusText ? e.statusText : '', \" \").concat(e.status ? e.status : e, \"

\"));\n });\n } else {\n this.emit('error', 'You should add a URL to this button.');\n this.setAlert('warning', 'You should add a URL to this button.');\n return console.warn('You should add a URL to this button.');\n }\n }\n }, {\n key: \"triggerRecaptcha\",\n value: function triggerRecaptcha() {\n if (!this || !this.components) {\n return;\n }\n var recaptchaComponent = (0, _utils.searchComponents)(this.components, {\n 'component.type': 'recaptcha',\n 'component.eventType': 'formLoad'\n });\n if (recaptchaComponent.length > 0) {\n recaptchaComponent[0].verify(\"\".concat(this.form.name ? this.form.name : 'form', \"Load\"));\n }\n }\n }, {\n key: \"nosubmit\",\n get: function get() {\n return this._nosubmit || false;\n },\n set: function set(value) {\n this._nosubmit = !!value;\n this.emit('nosubmit', this._nosubmit);\n }\n }, {\n key: \"conditions\",\n get: function get() {\n var _this$schema$settings, _this$schema$settings2;\n return (_this$schema$settings = (_this$schema$settings2 = this.schema.settings) === null || _this$schema$settings2 === void 0 ? void 0 : _this$schema$settings2.conditions) !== null && _this$schema$settings !== void 0 ? _this$schema$settings : [];\n }\n }, {\n key: \"variables\",\n get: function get() {\n var _this$schema$settings3, _this$schema$settings4;\n return (_this$schema$settings3 = (_this$schema$settings4 = this.schema.settings) === null || _this$schema$settings4 === void 0 ? void 0 : _this$schema$settings4.variables) !== null && _this$schema$settings3 !== void 0 ? _this$schema$settings3 : [];\n }\n }]);\n return Webform;\n}(_NestedDataComponent2[\"default\"]);\nexports[\"default\"] = Webform;\nWebform.setBaseUrl = _Formio.GlobalFormio.setBaseUrl;\nWebform.setApiUrl = _Formio.GlobalFormio.setApiUrl;\nWebform.setAppUrl = _Formio.GlobalFormio.setAppUrl;\n\n//# sourceURL=webpack://Formio/./lib/Webform.js?"); /***/ }), @@ -246,7 +246,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.weak-map.js */ \"./node_modules/core-js/modules/es.weak-map.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.flags.js */ \"./node_modules/core-js/modules/es.regexp.flags.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.string.starts-with.js */ \"./node_modules/core-js/modules/es.string.starts-with.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/esnext.string.replace-all.js */ \"./node_modules/core-js/modules/esnext.string.replace-all.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.some.js */ \"./node_modules/core-js/modules/es.array.some.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\nvar _vanillaTextMask = __webpack_require__(/*! @formio/vanilla-text-mask */ \"./node_modules/@formio/vanilla-text-mask/dist/vanillaTextMask.js\");\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _tippy = _interopRequireDefault(__webpack_require__(/*! tippy.js */ \"./node_modules/tippy.js/dist/tippy.esm.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _ismobilejs = _interopRequireDefault(__webpack_require__(/*! ismobilejs */ \"./node_modules/ismobilejs/esm/index.js\"));\nvar _Formio = __webpack_require__(/*! ../../../Formio */ \"./lib/Formio.js\");\nvar FormioUtils = _interopRequireWildcard(__webpack_require__(/*! ../../../utils/utils */ \"./lib/utils/utils.js\"));\nvar _Validator = _interopRequireDefault(__webpack_require__(/*! ../../../validator/Validator */ \"./lib/validator/Validator.js\"));\nvar _Element2 = _interopRequireDefault(__webpack_require__(/*! ../../../Element */ \"./lib/Element.js\"));\nvar _ComponentModal = _interopRequireDefault(__webpack_require__(/*! ../componentModal/ComponentModal */ \"./lib/components/_classes/componentModal/ComponentModal.js\"));\nvar _widgets = _interopRequireDefault(__webpack_require__(/*! ../../../widgets */ \"./lib/widgets/index.js\"));\nvar _addons = _interopRequireDefault(__webpack_require__(/*! ../../../addons */ \"./lib/addons/index.js\"));\nvar _uploadAdapter = __webpack_require__(/*! ../../../providers/storage/uploadAdapter */ \"./lib/providers/storage/uploadAdapter.js\");\nvar _en = _interopRequireDefault(__webpack_require__(/*! ../../../translations/en */ \"./lib/translations/en.js\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar isIEBrowser = FormioUtils.getBrowserInfo().ie;\nvar Templates = _Formio.GlobalFormio.Templates;\nif (!Templates) {\n Templates = (__webpack_require__(/*! ../../../templates/Templates */ \"./lib/templates/Templates.js\")[\"default\"]);\n}\n\n/**\n * This is the Component class\n which all elements within the FormioForm derive from.\n */\nvar Component = /*#__PURE__*/function (_Element) {\n _inherits(Component, _Element);\n var _super = _createSuper(Component);\n /* eslint-enable no-unused-vars */\n\n /**\n * Initialize a new Component.\n *\n * @param {Object} component - The component JSON you wish to initialize.\n * @param {Object} options - The options for this component.\n * @param {Object} data - The global data submission object this component will belong.\n */\n /* eslint-disable max-statements */\n function Component(component, options, data) {\n var _this;\n _classCallCheck(this, Component);\n _this = _super.call(this, Object.assign({\n renderMode: 'form',\n attachMode: 'full',\n noDefaults: false\n }, options || {}));\n\n // Restore the component id.\n if (component && component.id) {\n _this.id = component.id;\n }\n\n /**\n * Determines if this component has a condition assigned to it.\n * @type {null}\n * @private\n */\n _this._hasCondition = null;\n\n /**\n * References to dom elements\n */\n _this.refs = {};\n\n // Allow global override for any component JSON.\n if (component && _this.options.components && _this.options.components[component.type]) {\n _lodash[\"default\"].merge(component, _this.options.components[component.type]);\n }\n\n /**\n * Set the validator instance.\n */\n _this.validator = _Validator[\"default\"];\n\n /**\n * The data path to this specific component instance.\n *\n * @type {string}\n */\n _this.path = '';\n\n /**\n * The Form.io component JSON schema.\n * @type {*}\n */\n _this.component = _this.mergeSchema(component || {});\n\n // Add the id to the component.\n _this.component.id = _this.id;\n _this.afterComponentAssign();\n\n // Save off the original component to be used in logic.\n _this.originalComponent = (0, FormioUtils.fastCloneDeep)(_this.component);\n\n /**\n * If the component has been attached\n */\n _this.attached = false;\n\n /**\n * If the component has been rendered\n */\n _this.rendered = false;\n\n /**\n * The data object in which this component resides.\n * @type {*}\n */\n _this._data = data || {};\n\n /**\n * The existing error that this component has.\n * @type {string}\n */\n _this.error = '';\n\n /**\n * Tool tip text after processing\n * @type {string}\n */\n _this.tooltip = '';\n\n /**\n * The row path of this component.\n * @type {number}\n */\n _this.row = _this.options.row;\n\n /**\n * Determines if this component is disabled, or not.\n *\n * @type {boolean}\n */\n _this._disabled = (0, FormioUtils.boolValue)(_this.component.disabled) ? _this.component.disabled : false;\n\n /**\n * Points to the root component, usually the FormComponent.\n *\n * @type {Component}\n */\n _this.root = _this.options.root;\n _this.localRoot = _this.options.localRoot;\n\n /**\n * If this input has been input and provided value.\n *\n * @type {boolean}\n */\n _this.pristine = true;\n\n /**\n * Points to the parent component.\n *\n * @type {Component}\n */\n _this.parent = _this.options.parent;\n _this.options.name = _this.options.name || 'data';\n\n /**\n * The validators that are assigned to this component.\n * @type {[string]}\n */\n _this.validators = ['required', 'minLength', 'maxLength', 'minWords', 'maxWords', 'custom', 'pattern', 'json', 'mask'];\n _this._path = '';\n // Nested forms don't have parents so we need to pass their path in.\n _this._parentPath = _this.options.parentPath || '';\n\n // Needs for Nextgen Rules Engine\n _this.resetCaches();\n\n /**\n * Determines if this component is visible, or not.\n */\n _this._parentVisible = _this.options.hasOwnProperty('parentVisible') ? _this.options.parentVisible : true;\n _this._visible = _this._parentVisible && _this.conditionallyVisible(null, data);\n _this._parentDisabled = false;\n\n /**\n * Used to trigger a new change in this component.\n * @type {function} - Call to trigger a change in this component.\n */\n var changes = [];\n var lastChanged = null;\n var triggerArgs = [];\n var _triggerChange = _lodash[\"default\"].debounce(function () {\n var _this2;\n if (_this.root) {\n _this.root.changing = false;\n }\n triggerArgs = [];\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (!args[1] && lastChanged) {\n // Set the changed component if one isn't provided.\n args[1] = lastChanged;\n }\n if (_lodash[\"default\"].isEmpty(args[0]) && lastChanged) {\n // Set the flags if it is empty and lastChanged exists.\n args[0] = lastChanged.flags;\n }\n lastChanged = null;\n args[3] = changes;\n var retVal = (_this2 = _this).onChange.apply(_this2, args);\n changes = [];\n return retVal;\n }, 100);\n _this.triggerChange = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (args[1]) {\n // Make sure that during the debounce that we always track lastChanged component, even if they\n // don't provide one later.\n lastChanged = args[1];\n changes.push(lastChanged);\n }\n if (_this.root) {\n _this.root.changing = true;\n }\n if (args.length) {\n triggerArgs = args;\n }\n return _triggerChange.apply(void 0, _toConsumableArray(triggerArgs));\n };\n\n /**\n * Used to trigger a redraw event within this component.\n *\n * @type {Function}\n */\n _this.triggerRedraw = _lodash[\"default\"].debounce(_this.redraw.bind(_assertThisInitialized(_this)), 100);\n\n /**\n * list of attached tooltips\n * @type {Array}\n */\n _this.tooltips = [];\n\n /**\n * List of attached addons\n * @type {Array}\n */\n _this.addons = [];\n\n // To force this component to be invalid.\n _this.invalid = false;\n if (_this.component) {\n _this.type = _this.component.type;\n if (_this.allowData && _this.key) {\n _this.options.name += \"[\".concat(_this.key, \"]\");\n // If component is visible or not set to clear on hide, set the default value.\n if (_this.visible || !_this.component.clearOnHide) {\n if (!_this.hasValue()) {\n if (_this.shouldAddDefaultValue) {\n _this.dataValue = _this.defaultValue;\n }\n } else {\n // Ensure the dataValue is set.\n /* eslint-disable no-self-assign */\n _this.dataValue = _this.dataValue;\n /* eslint-enable no-self-assign */\n }\n }\n }\n\n /**\n * The element information for creating the input element.\n * @type {*}\n */\n _this.info = _this.elementInfo();\n }\n\n // Allow anyone to hook into the component creation.\n _this.hook('component');\n if (!_this.options.skipInit) {\n _this.init();\n }\n return _this;\n }\n /* eslint-enable max-statements */\n _createClass(Component, [{\n key: \"data\",\n get: function get() {\n return this._data;\n },\n set: function set(value) {\n this._data = value;\n }\n }, {\n key: \"mergeSchema\",\n value: function mergeSchema() {\n var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _lodash[\"default\"].defaultsDeep(component, this.defaultSchema);\n }\n\n // Allow componets to notify when ready.\n }, {\n key: \"ready\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].resolve(this);\n }\n }, {\n key: \"isPDFReadOnlyMode\",\n get: function get() {\n return this.parent && this.parent.form && this.parent.form.display === 'pdf' && this.options.readOnly;\n }\n }, {\n key: \"labelInfo\",\n get: function get() {\n var label = {};\n label.hidden = this.labelIsHidden();\n label.className = '';\n label.labelPosition = this.component.labelPosition;\n label.tooltipClass = \"\".concat(this.iconClass('question-sign'), \" text-muted\");\n var isPDFReadOnlyMode = this.isPDFReadOnlyMode;\n if (this.hasInput && this.component.validate && (0, FormioUtils.boolValue)(this.component.validate.required) && !isPDFReadOnlyMode) {\n label.className += ' field-required';\n }\n if (label.hidden) {\n label.className += ' control-label--hidden';\n }\n if (this.info.attr.id) {\n label[\"for\"] = this.info.attr.id;\n }\n return label;\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this$component$addon,\n _this3 = this;\n this.disabled = this.shouldDisabled;\n this._visible = this.conditionallyVisible(null, null);\n if ((_this$component$addon = this.component.addons) !== null && _this$component$addon !== void 0 && _this$component$addon.length) {\n this.component.addons.forEach(function (addon) {\n return _this3.createAddon(addon);\n });\n }\n }\n }, {\n key: \"afterComponentAssign\",\n value: function afterComponentAssign() {\n //implement in extended classes\n }\n }, {\n key: \"createAddon\",\n value: function createAddon(addonConfiguration) {\n var _addonConfiguration$s;\n var name = addonConfiguration.name;\n if (!name) {\n return;\n }\n var settings = ((_addonConfiguration$s = addonConfiguration.settings) === null || _addonConfiguration$s === void 0 ? void 0 : _addonConfiguration$s.data) || {};\n var Addon = _addons[\"default\"][name.value];\n var addon = null;\n if (Addon) {\n var supportedComponents = Addon.info.supportedComponents;\n var supportsThisComponentType = !(supportedComponents !== null && supportedComponents !== void 0 && supportedComponents.length) || supportedComponents.indexOf(this.component.type) !== -1;\n if (supportsThisComponentType) {\n addon = new Addon(settings, this);\n this.addons.push(addon);\n } else {\n console.warn(\"Addon \".concat(name.label, \" does not support component of type \").concat(this.component.type, \".\"));\n }\n }\n return addon;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(Component.prototype), \"destroy\", this).call(this);\n this.detach();\n this.addons.forEach(function (addon) {\n return addon.destroy();\n });\n }\n }, {\n key: \"shouldDisabled\",\n get: function get() {\n return this.options.readOnly || this.component.disabled || this.options.hasOwnProperty('disabled') && this.options.disabled[this.key];\n }\n }, {\n key: \"isInputComponent\",\n get: function get() {\n return !this.component.hasOwnProperty('input') || this.component.input;\n }\n }, {\n key: \"allowData\",\n get: function get() {\n return this.hasInput;\n }\n }, {\n key: \"hasInput\",\n get: function get() {\n return this.isInputComponent || this.refs.input && this.refs.input.length;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return Component.schema();\n }\n }, {\n key: \"key\",\n get: function get() {\n return _lodash[\"default\"].get(this.component, 'key', '');\n }\n }, {\n key: \"parentVisible\",\n get: function get() {\n return this._parentVisible;\n },\n set: function set(value) {\n this._parentVisible = value;\n }\n }, {\n key: \"parentDisabled\",\n get: function get() {\n return this._parentDisabled;\n },\n set: function set(value) {\n this._parentDisabled = value;\n }\n }, {\n key: \"shouldForceVisibility\",\n value: function shouldForceVisibility(component, visibility) {\n if (!this.options[visibility]) {\n return false;\n }\n if (!component) {\n component = this.component;\n }\n if (_lodash[\"default\"].isArray(this.options[visibility])) {\n return this.options[visibility].includes(component.key);\n }\n return this.options[visibility][component.key];\n }\n }, {\n key: \"shouldForceHide\",\n value: function shouldForceHide(component) {\n return this.shouldForceVisibility(component, 'hide');\n }\n }, {\n key: \"shouldForceShow\",\n value: function shouldForceShow(component) {\n return this.shouldForceVisibility(component, 'show');\n }\n\n /**\n *\n * @param value {boolean}\n */\n }, {\n key: \"visible\",\n get:\n /**\n *\n * @returns {boolean}\n */\n function get() {\n // Show only if visibility changes or if we are in builder mode or if hidden fields should be shown.\n if (this.builderMode || this.previewMode || this.options.showHiddenFields) {\n return true;\n }\n if (this.shouldForceHide()) {\n return false;\n }\n if (this.shouldForceShow()) {\n return true;\n }\n return this._visible && this._parentVisible;\n },\n set: function set(value) {\n if (this._visible !== value) {\n // Skip if this component is set to visible and is supposed to be hidden.\n if (value && this.shouldForceHide()) {\n return;\n }\n // Skip if this component is set to hidden and is supposed to be shown.\n if (!value && this.shouldForceShow()) {\n return;\n }\n this._visible = value;\n this.clearOnHide();\n this.redraw();\n }\n }\n }, {\n key: \"currentForm\",\n get: function get() {\n return this._currentForm;\n },\n set: function set(instance) {\n this._currentForm = instance;\n }\n }, {\n key: \"fullMode\",\n get: function get() {\n return this.options.attachMode === 'full';\n }\n }, {\n key: \"builderMode\",\n get: function get() {\n return this.options.attachMode === 'builder';\n }\n }, {\n key: \"calculatedPath\",\n get: function get() {\n console.error('component.calculatedPath was deprecated, use component.path instead.');\n return this.path;\n }\n }, {\n key: \"labelPosition\",\n get: function get() {\n return this.component.labelPosition;\n }\n }, {\n key: \"labelWidth\",\n get: function get() {\n var width = this.component.labelWidth;\n return width >= 0 ? width : 30;\n }\n }, {\n key: \"labelMargin\",\n get: function get() {\n var margin = this.component.labelMargin;\n return margin >= 0 ? margin : 3;\n }\n }, {\n key: \"isAdvancedLabel\",\n get: function get() {\n return ['left-left', 'left-right', 'right-left', 'right-right'].includes(this.labelPosition);\n }\n }, {\n key: \"labelPositions\",\n get: function get() {\n return this.labelPosition.split('-');\n }\n }, {\n key: \"skipInEmail\",\n get: function get() {\n return false;\n }\n }, {\n key: \"rightDirection\",\n value: function rightDirection(direction) {\n if (this.options.condensedMode) {\n return false;\n }\n return direction === 'right';\n }\n }, {\n key: \"getLabelInfo\",\n value: function getLabelInfo() {\n var isCondensed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var isRightPosition = this.rightDirection(this.labelPositions[0]);\n var isLeftPosition = this.labelPositions[0] === 'left' || isCondensed;\n var isRightAlign = this.rightDirection(this.labelPositions[1]);\n var contentMargin = '';\n if (this.component.hideLabel) {\n var margin = isCondensed ? 0 : this.labelWidth + this.labelMargin;\n contentMargin = isRightPosition ? \"margin-right: \".concat(margin, \"%\") : '';\n contentMargin = isLeftPosition ? \"margin-left: \".concat(margin, \"%\") : '';\n }\n var labelStyles = \"\\n flex: \".concat(this.labelWidth, \";\\n \").concat(isRightPosition ? 'margin-left' : 'margin-right', \": \").concat(this.labelMargin, \"%;\\n \");\n var contentStyles = \"\\n flex: \".concat(100 - this.labelWidth - this.labelMargin, \";\\n \").concat(contentMargin, \";\\n \").concat(this.component.hideLabel ? \"max-width: \".concat(100 - this.labelWidth - this.labelMargin) : '', \";\\n \");\n return {\n isRightPosition: isRightPosition,\n isRightAlign: isRightAlign,\n labelStyles: labelStyles,\n contentStyles: contentStyles\n };\n }\n\n /**\n * Returns only the schema that is different from the default.\n *\n * @param schema\n * @param defaultSchema\n */\n }, {\n key: \"getModifiedSchema\",\n value: function getModifiedSchema(schema, defaultSchema, recursion) {\n var _this4 = this;\n var modified = {};\n if (!defaultSchema) {\n return schema;\n }\n _lodash[\"default\"].each(schema, function (val, key) {\n if (!_lodash[\"default\"].isArray(val) && _lodash[\"default\"].isObject(val) && defaultSchema.hasOwnProperty(key)) {\n var subModified = _this4.getModifiedSchema(val, defaultSchema[key], true);\n if (!_lodash[\"default\"].isEmpty(subModified)) {\n modified[key] = subModified;\n }\n } else if (_lodash[\"default\"].isArray(val)) {\n if (val.length !== 0 && !_lodash[\"default\"].isEqual(val, defaultSchema[key])) {\n modified[key] = val;\n }\n } else if (!recursion && key === 'type' || !recursion && key === 'key' || !recursion && key === 'label' || !recursion && key === 'input' || !recursion && key === 'tableView' || val !== '' && !defaultSchema.hasOwnProperty(key) || val !== '' && val !== defaultSchema[key] || defaultSchema[key] && val !== defaultSchema[key]) {\n modified[key] = val;\n }\n });\n return modified;\n }\n\n /**\n * Returns the JSON schema for this component.\n */\n }, {\n key: \"schema\",\n get: function get() {\n return (0, FormioUtils.fastCloneDeep)(this.getModifiedSchema(_lodash[\"default\"].omit(this.component, 'id'), this.defaultSchema));\n }\n\n /**\n * Returns true if component is inside DataGrid\n */\n }, {\n key: \"isInDataGrid\",\n get: function get() {\n return this.inDataGrid;\n }\n\n /**\n * Translate a text using the i18n system.\n *\n * @param {string} text - The i18n identifier.\n * @param {Object} params - The i18n parameters to use for translation.\n */\n }, {\n key: \"t\",\n value: function t(text) {\n var _get2;\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!text) {\n return '';\n }\n // Use _userInput: true to ignore translations from defaults\n if (text in _en[\"default\"] && params._userInput) {\n return text;\n }\n params.data = this.rootValue;\n params.row = this.data;\n params.component = this.component;\n for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n args[_key3 - 2] = arguments[_key3];\n }\n return (_get2 = _get(_getPrototypeOf(Component.prototype), \"t\", this)).call.apply(_get2, [this, text, params].concat(args));\n }\n }, {\n key: \"labelIsHidden\",\n value: function labelIsHidden() {\n return !this.component.label || (!this.isInDataGrid && this.component.hideLabel || this.isInDataGrid && !this.component.dataGridLabel || this.options.inputsOnly) && !this.builderMode;\n }\n }, {\n key: \"transform\",\n value: function transform(type, value) {\n var frameworkTemplates = this.options.template ? Templates.templates[this.options.template] : Templates.current;\n return frameworkTemplates.hasOwnProperty('transform') ? frameworkTemplates.transform(type, value) : function (type, value) {\n return value;\n };\n }\n }, {\n key: \"getTemplate\",\n value: function getTemplate(names, modes) {\n modes = Array.isArray(modes) ? modes : [modes];\n names = Array.isArray(names) ? names : [names];\n if (!modes.includes('form')) {\n modes.push('form');\n }\n var result = null;\n if (this.options.templates) {\n result = this.checkTemplate(this.options.templates, names, modes);\n if (result) {\n return result;\n }\n }\n var frameworkTemplates = this.options.template ? Templates.templates[this.options.template] : Templates.current;\n result = this.checkTemplate(frameworkTemplates, names, modes);\n if (result) {\n return result;\n }\n\n // Default back to bootstrap if not defined.\n var name = names[names.length - 1];\n var templatesByName = Templates.defaultTemplates[name];\n if (!templatesByName) {\n return \"Unknown template: \".concat(name);\n }\n var templateByMode = this.checkTemplateMode(templatesByName, modes);\n if (templateByMode) {\n return templateByMode;\n }\n return templatesByName.form;\n }\n }, {\n key: \"checkTemplate\",\n value: function checkTemplate(templates, names, modes) {\n var _iterator = _createForOfIteratorHelper(names),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var name = _step.value;\n var templatesByName = templates[name];\n if (templatesByName) {\n var templateByMode = this.checkTemplateMode(templatesByName, modes);\n if (templateByMode) {\n return templateByMode;\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return null;\n }\n }, {\n key: \"checkTemplateMode\",\n value: function checkTemplateMode(templatesByName, modes) {\n var _iterator2 = _createForOfIteratorHelper(modes),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var mode = _step2.value;\n var templateByMode = templatesByName[mode];\n if (templateByMode) {\n return templateByMode;\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n return null;\n }\n }, {\n key: \"getFormattedAttribute\",\n value: function getFormattedAttribute(attr) {\n return attr ? this.t(attr, {\n _userInput: true\n }).replace(/\"/g, '"') : '';\n }\n }, {\n key: \"getFormattedTooltip\",\n value: function getFormattedTooltip(tooltipValue) {\n var tooltip = this.interpolate(tooltipValue || '').replace(/(?:\\r\\n|\\r|\\n)/g, '
');\n return this.getFormattedAttribute(tooltip);\n }\n }, {\n key: \"isHtmlRenderMode\",\n value: function isHtmlRenderMode() {\n return this.options.renderMode === 'html';\n }\n }, {\n key: \"renderTemplate\",\n value: function renderTemplate(name) {\n var _this5 = this;\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var modeOption = arguments.length > 2 ? arguments[2] : undefined;\n // Need to make this fall back to form if renderMode is not found similar to how we search templates.\n var mode = modeOption || this.options.renderMode || 'form';\n data.component = this.component;\n data.self = this;\n data.options = this.options;\n data.readOnly = this.options.readOnly;\n data.iconClass = this.iconClass.bind(this);\n data.size = this.size.bind(this);\n data.t = this.t.bind(this);\n data.transform = this.transform.bind(this);\n data.id = data.id || this.id;\n data.key = data.key || this.key;\n data.value = data.value || this.dataValue;\n data.disabled = this.disabled;\n data.builder = this.builderMode;\n data.render = function () {\n console.warn(\"Form.io 'render' template function is deprecated.\\n If you need to render template (template A) inside of another template (template B),\\n pass pre-compiled template A (use this.renderTemplate('template_A_name') as template context variable for template B\");\n return _this5.renderTemplate.apply(_this5, arguments);\n };\n data.label = data.labelInfo || this.labelInfo;\n data.tooltip = this.getFormattedTooltip(this.component.tooltip);\n\n // Allow more specific template names\n var names = [\"\".concat(name, \"-\").concat(this.component.type, \"-\").concat(this.key), \"\".concat(name, \"-\").concat(this.component.type), \"\".concat(name, \"-\").concat(this.key), \"\".concat(name)];\n\n // Allow template alters.\n return this.hook(\"render\".concat(name.charAt(0).toUpperCase() + name.substring(1, name.length)), this.interpolate(this.getTemplate(names, mode), data), data, mode);\n }\n\n /**\n * Sanitize an html string.\n *\n * @param string\n * @returns {*}\n */\n }, {\n key: \"sanitize\",\n value: function sanitize(dirty, forceSanitize, options) {\n var _this$options;\n if (!this.shouldSanitizeValue && !forceSanitize) {\n return dirty;\n }\n return FormioUtils.sanitize(dirty, {\n sanitizeConfig: _lodash[\"default\"].merge(((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.sanitizeConfig) || {}, options || {})\n });\n }\n\n /**\n * Render a template string into html.\n *\n * @param template\n * @param data\n * @param actions\n *\n * @return {HTMLElement|String} - The created element or an empty string if template is not specified.\n */\n }, {\n key: \"renderString\",\n value: function renderString(template, data) {\n if (!template) {\n return '';\n }\n // Interpolate the template and populate\n return this.interpolate(template, data);\n }\n }, {\n key: \"performInputMapping\",\n value: function performInputMapping(input) {\n return input;\n }\n }, {\n key: \"widget\",\n get: function get() {\n var _this$root;\n var settings = this.component.widget;\n if (settings && (_this$root = this.root) !== null && _this$root !== void 0 && _this$root.shadowRoot) {\n settings.shadowRoot = this.root.shadowRoot;\n }\n var widget = settings && _widgets[\"default\"][settings.type] ? new _widgets[\"default\"][settings.type](settings, this.component, this) : null;\n return widget;\n }\n }, {\n key: \"getBrowserLanguage\",\n value: function getBrowserLanguage() {\n var nav = window.navigator;\n var browserLanguagePropertyKeys = ['language', 'browserLanguage', 'systemLanguage', 'userLanguage'];\n var language;\n\n // support for HTML 5.1 \"navigator.languages\"\n if (Array.isArray(nav.languages)) {\n for (var i = 0; i < nav.languages.length; i++) {\n language = nav.languages[i];\n if (language && language.length) {\n return language.split(';')[0];\n }\n }\n }\n\n // support for other well known properties in browsers\n for (var _i = 0; _i < browserLanguagePropertyKeys.length; _i++) {\n language = nav[browserLanguagePropertyKeys[_i]];\n if (language && language.length) {\n return language.split(';')[0];\n }\n }\n return null;\n }\n\n /**\n * Called before a next and previous page is triggered allowing the components\n * to perform special functions.\n *\n * @return {*}\n */\n }, {\n key: \"beforePage\",\n value: function beforePage() {\n return _nativePromiseOnly[\"default\"].resolve(true);\n }\n }, {\n key: \"beforeNext\",\n value: function beforeNext() {\n return this.beforePage(true);\n }\n\n /**\n * Called before a submission is triggered allowing the components\n * to perform special async functions.\n *\n * @return {*}\n */\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n return _nativePromiseOnly[\"default\"].resolve(true);\n }\n\n /**\n * Return the submission timezone.\n *\n * @return {*}\n */\n }, {\n key: \"submissionTimezone\",\n get: function get() {\n this.options.submissionTimezone = this.options.submissionTimezone || _lodash[\"default\"].get(this.root, 'options.submissionTimezone');\n return this.options.submissionTimezone;\n }\n }, {\n key: \"timezone\",\n get: function get() {\n return this.getTimezone(this.component);\n }\n }, {\n key: \"getTimezone\",\n value: function getTimezone(settings) {\n if (settings.timezone) {\n return settings.timezone;\n }\n if (settings.displayInTimezone === 'utc') {\n return 'UTC';\n }\n var submissionTimezone = this.submissionTimezone;\n if (submissionTimezone && (settings.displayInTimezone === 'submission' || (this.options.pdf || this.options.server) && settings.displayInTimezone === 'viewer')) {\n return submissionTimezone;\n }\n\n // Return current timezone if none are provided.\n return (0, FormioUtils.currentTimezone)();\n }\n }, {\n key: \"loadRefs\",\n value: function loadRefs(element, refs) {\n for (var ref in refs) {\n var refType = refs[ref];\n var isString = typeof refType === 'string';\n var selector = isString && refType.includes('scope') ? \":scope > [ref=\\\"\".concat(ref, \"\\\"]\") : \"[ref=\\\"\".concat(ref, \"\\\"]\");\n if (isString && refType.startsWith('single')) {\n this.refs[ref] = element.querySelector(selector);\n } else {\n this.refs[ref] = element.querySelectorAll(selector);\n }\n }\n }\n }, {\n key: \"setOpenModalElement\",\n value: function setOpenModalElement(template) {\n this.componentModal.setOpenModalElement(template || this.getModalPreviewTemplate());\n }\n }, {\n key: \"getModalPreviewTemplate\",\n value: function getModalPreviewTemplate() {\n var _this$component$valid;\n var dataValue = this.component.type === 'password' ? this.dataValue.replace(/./g, '•') : this.dataValue;\n var message = this.error ? {\n level: 'error',\n message: this.error.message\n } : '';\n var modalLabel;\n if (this.hasInput && (_this$component$valid = this.component.validate) !== null && _this$component$valid !== void 0 && _this$component$valid.required && !this.isPDFReadOnlyMode) {\n modalLabel = {\n className: 'field-required'\n };\n }\n return this.renderTemplate('modalPreview', {\n previewText: this.getValueAsString(dataValue, {\n modalPreview: true\n }) || this.t('Click to set value'),\n messages: message && this.renderTemplate('message', message),\n labelInfo: modalLabel\n });\n }\n }, {\n key: \"build\",\n value: function build(element) {\n element = element || this.element;\n this.empty(element);\n this.setContent(element, this.render());\n return this.attach(element);\n }\n }, {\n key: \"hasModalSaveButton\",\n get: function get() {\n return true;\n }\n }, {\n key: \"render\",\n value: function render() {\n var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"Unknown component: \".concat(this.component.type);\n var topLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isVisible = this.visible;\n this.rendered = true;\n if (!this.builderMode && !this.previewMode && this.component.modalEdit) {\n return _ComponentModal[\"default\"].render(this, {\n visible: isVisible,\n showSaveButton: this.hasModalSaveButton,\n id: this.id,\n classes: this.className,\n styles: this.customStyle,\n children: children\n }, topLevel);\n } else {\n return this.renderTemplate('component', {\n visible: isVisible,\n id: this.id,\n classes: this.className,\n styles: this.customStyle,\n children: children\n }, topLevel);\n }\n }\n }, {\n key: \"attachTooltips\",\n value: function attachTooltips(toolTipsRefs) {\n var _this6 = this;\n toolTipsRefs === null || toolTipsRefs === void 0 ? void 0 : toolTipsRefs.forEach(function (tooltip, index) {\n if (tooltip) {\n var tooltipAttribute = tooltip.getAttribute('data-tooltip');\n var tooltipDataTitle = tooltip.getAttribute('data-title');\n var tooltipText = _this6.interpolate(tooltipDataTitle || tooltipAttribute).replace(/(?:\\r\\n|\\r|\\n)/g, '
');\n _this6.tooltips[index] = (0, _tippy[\"default\"])(tooltip, {\n allowHTML: true,\n trigger: 'mouseenter click focus',\n placement: 'right',\n zIndex: 10000,\n interactive: true,\n content: _this6.t(_this6.sanitize(tooltipText), {\n _userInput: true\n })\n });\n }\n });\n }\n }, {\n key: \"createComponentModal\",\n value: function createComponentModal(element, modalShouldBeOpened, currentValue) {\n return new _ComponentModal[\"default\"](this, element, modalShouldBeOpened, currentValue);\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n if (!this.builderMode && !this.previewMode && this.component.modalEdit) {\n var modalShouldBeOpened = this.componentModal ? this.componentModal.isOpened : false;\n var currentValue = modalShouldBeOpened ? this.componentModal.currentValue : this.dataValue;\n var openModalTemplate = this.componentModal && modalShouldBeOpened ? this.componentModal.openModalTemplate : null;\n this.componentModal = this.createComponentModal(element, modalShouldBeOpened, currentValue);\n this.setOpenModalElement(openModalTemplate);\n }\n this.attached = true;\n this.element = element;\n element.component = this;\n\n // If this already has an id, get it from the dom. If SSR, it could be different from the initiated id.\n if (this.element.id) {\n this.id = this.element.id;\n this.component.id = this.id;\n }\n this.loadRefs(element, {\n messageContainer: 'single',\n tooltip: 'multiple'\n });\n this.attachTooltips(this.refs.tooltip);\n\n // Attach logic.\n this.attachLogic();\n this.autofocus();\n\n // Allow global attach.\n this.hook('attachComponent', element, this);\n // Allow attach per component type.\n var type = this.component.type;\n if (type) {\n this.hook(\"attach\".concat(type.charAt(0).toUpperCase() + type.substring(1, type.length)), element, this);\n }\n this.restoreFocus();\n this.addons.forEach(function (addon) {\n return addon.attach(element);\n });\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"restoreFocus\",\n value: function restoreFocus() {\n var _this$root2, _this$root2$focusedCo;\n var isFocused = ((_this$root2 = this.root) === null || _this$root2 === void 0 ? void 0 : (_this$root2$focusedCo = _this$root2.focusedComponent) === null || _this$root2$focusedCo === void 0 ? void 0 : _this$root2$focusedCo.path) === this.path;\n if (isFocused) {\n var _this$root$currentSel;\n this.loadRefs(this.element, {\n input: 'multiple'\n });\n this.focus((_this$root$currentSel = this.root.currentSelection) === null || _this$root$currentSel === void 0 ? void 0 : _this$root$currentSel.index);\n this.restoreCaretPosition();\n }\n }\n }, {\n key: \"addShortcut\",\n value: function addShortcut(element, shortcut) {\n // Avoid infinite recursion.\n if (!element || !this.root || this.root === this) {\n return;\n }\n if (!shortcut) {\n shortcut = this.component.shortcut;\n }\n this.root.addShortcut(element, shortcut);\n }\n }, {\n key: \"removeShortcut\",\n value: function removeShortcut(element, shortcut) {\n // Avoid infinite recursion.\n if (!element || this.root === this) {\n return;\n }\n if (!shortcut) {\n shortcut = this.component.shortcut;\n }\n this.root.removeShortcut(element, shortcut);\n }\n\n /**\n * Remove all event handlers.\n */\n }, {\n key: \"detach\",\n value: function detach() {\n this.refs = {};\n this.removeEventListeners();\n this.detachLogic();\n if (this.tooltip) {\n this.tooltip.destroy();\n }\n }\n }, {\n key: \"checkRefresh\",\n value: function checkRefresh(refreshData, changed, flags) {\n var changePath = _lodash[\"default\"].get(changed, 'instance.path', false);\n // Don't let components change themselves.\n if (changePath && this.path === changePath) {\n return;\n }\n if (refreshData === 'data') {\n this.refresh(this.data, changed, flags);\n } else if (changePath && (0, FormioUtils.getComponentPath)(changed.instance) === refreshData && changed && changed.instance &&\n // Make sure the changed component is not in a different \"context\". Solves issues where refreshOn being set\n // in fields inside EditGrids could alter their state from other rows (which is bad).\n this.inContext(changed.instance)) {\n this.refresh(changed.value, changed, flags);\n }\n }\n }, {\n key: \"checkRefreshOn\",\n value: function checkRefreshOn(changes) {\n var _this7 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n changes = changes || [];\n if (flags.noRefresh) {\n return;\n }\n if (!changes.length && flags.changed) {\n changes = [flags.changed];\n }\n var refreshOn = flags.fromBlur ? this.component.refreshOnBlur : this.component.refreshOn || this.component.redrawOn;\n // If they wish to refresh on a value, then add that here.\n if (refreshOn) {\n if (Array.isArray(refreshOn)) {\n refreshOn.forEach(function (refreshData) {\n return changes.forEach(function (changed) {\n return _this7.checkRefresh(refreshData, changed, flags);\n });\n });\n } else {\n changes.forEach(function (changed) {\n return _this7.checkRefresh(refreshOn, changed, flags);\n });\n }\n }\n }\n\n /**\n * Refreshes the component with a new value.\n *\n * @param value\n */\n }, {\n key: \"refresh\",\n value: function refresh(value) {\n if (this.hasOwnProperty('refreshOnValue')) {\n this.refreshOnChanged = !_lodash[\"default\"].isEqual(value, this.refreshOnValue);\n } else {\n this.refreshOnChanged = true;\n }\n this.refreshOnValue = (0, FormioUtils.fastCloneDeep)(value);\n if (this.refreshOnChanged) {\n if (this.component.clearOnRefresh) {\n this.setValue(null);\n }\n this.triggerRedraw();\n }\n }\n\n /**\n * Checks to see if a separate component is in the \"context\" of this component. This is determined by first checking\n * if they share the same \"data\" object. It will then walk up the parent tree and compare its parents data objects\n * with the components data and returns true if they are in the same context.\n *\n * Different rows of the same EditGrid, for example, are in different contexts.\n *\n * @param component\n */\n }, {\n key: \"inContext\",\n value: function inContext(component) {\n if (component.data === this.data) {\n return true;\n }\n var parent = this.parent;\n while (parent) {\n if (parent.data === component.data) {\n return true;\n }\n parent = parent.parent;\n }\n return false;\n }\n }, {\n key: \"viewOnly\",\n get: function get() {\n return this.options.readOnly && this.options.viewAsHtml;\n }\n }, {\n key: \"createViewOnlyElement\",\n value: function createViewOnlyElement() {\n this.element = this.ce('dl', {\n id: this.id\n });\n if (this.element) {\n // Ensure you can get the component info from the element.\n this.element.component = this;\n }\n return this.element;\n }\n }, {\n key: \"defaultViewOnlyValue\",\n get: function get() {\n return '-';\n }\n\n /**\n * Uses the widget to determine the output string.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"getWidgetValueAsString\",\n value: function getWidgetValueAsString(value, options) {\n var _this8 = this;\n var noInputWidget = !this.refs.input || !this.refs.input[0] || !this.refs.input[0].widget;\n if (!value || noInputWidget) {\n if (!this.widget || !value) {\n return value;\n } else {\n return this.widget.getValueAsString(value);\n }\n }\n if (Array.isArray(value)) {\n var values = [];\n value.forEach(function (val, index) {\n var widget = _this8.refs.input[index] && _this8.refs.input[index].widget;\n if (widget) {\n values.push(widget.getValueAsString(val, options));\n }\n });\n return values;\n }\n var widget = this.refs.input[0].widget;\n return widget.getValueAsString(value, options);\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (!value) {\n return '';\n }\n value = this.getWidgetValueAsString(value, options);\n if (Array.isArray(value)) {\n return value.join(', ');\n }\n if (_lodash[\"default\"].isPlainObject(value)) {\n return JSON.stringify(value);\n }\n if (value === null || value === undefined) {\n return '';\n }\n var stringValue = value.toString();\n return this.sanitize(stringValue);\n }\n }, {\n key: \"getView\",\n value: function getView(value, options) {\n if (this.component[\"protected\"]) {\n return '--- PROTECTED ---';\n }\n return this.getValueAsString(value, options);\n }\n }, {\n key: \"updateItems\",\n value: function updateItems() {\n this.restoreValue();\n this.onChange.apply(this, arguments);\n }\n\n /**\n * @param {*} data\n * @param {boolean} [forceUseValue=false] - if true, return 'value' property of the data\n * @return {*}\n */\n }, {\n key: \"itemValue\",\n value: function itemValue(data) {\n var forceUseValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (_lodash[\"default\"].isObject(data) && !_lodash[\"default\"].isArray(data)) {\n if (this.valueProperty) {\n return _lodash[\"default\"].get(data, this.valueProperty);\n }\n if (forceUseValue) {\n return data.value;\n }\n }\n return data;\n }\n }, {\n key: \"itemValueForHTMLMode\",\n value: function itemValueForHTMLMode(value) {\n var _this9 = this;\n if (Array.isArray(value)) {\n var values = value.map(function (item) {\n return Array.isArray(item) ? _this9.itemValueForHTMLMode(item) : _this9.itemValue(item);\n });\n return values.join(', ');\n }\n return this.itemValue(value);\n }\n }, {\n key: \"createModal\",\n value: function createModal(element, attr, confirm) {\n var _this10 = this;\n var dialog = this.ce('div', attr || {});\n this.setContent(dialog, this.renderTemplate('dialog'));\n\n // Add refs to dialog, not \"this\".\n dialog.refs = {};\n this.loadRefs.call(dialog, dialog, {\n dialogOverlay: 'single',\n dialogContents: 'single',\n dialogClose: 'single'\n });\n dialog.refs.dialogContents.appendChild(element);\n document.body.appendChild(dialog);\n document.body.classList.add('modal-open');\n dialog.close = function () {\n document.body.classList.remove('modal-open');\n dialog.dispatchEvent(new CustomEvent('close'));\n };\n this.addEventListener(dialog, 'close', function () {\n return _this10.removeChildFrom(dialog, document.body);\n });\n var close = function close(event) {\n event.preventDefault();\n dialog.close();\n };\n var handleCloseClick = function handleCloseClick(e) {\n if (confirm) {\n confirm().then(function () {\n return close(e);\n })[\"catch\"](function () {});\n } else {\n close(e);\n }\n };\n this.addEventListener(dialog.refs.dialogOverlay, 'click', handleCloseClick);\n this.addEventListener(dialog.refs.dialogClose, 'click', handleCloseClick);\n return dialog;\n }\n }, {\n key: \"optimizeRedraw\",\n get: function get() {\n if (this.options.optimizeRedraw && this.element && !this.visible) {\n this.addClass(this.element, 'formio-removed');\n return true;\n }\n return false;\n }\n\n /**\n * Retrieves the CSS class name of this component.\n * @returns {string} - The class name of this component.\n */\n }, {\n key: \"className\",\n get: function get() {\n var className = this.hasInput ? \"\".concat(this.transform('class', 'form-group'), \" has-feedback \") : '';\n className += \"formio-component formio-component-\".concat(this.component.type, \" \");\n // TODO: find proper way to avoid overriding of default type-based component styles\n if (this.key && this.key !== 'form') {\n className += \"formio-component-\".concat(this.key, \" \");\n }\n if (this.component.multiple) {\n className += 'formio-component-multiple ';\n }\n if (this.component.customClass) {\n className += this.component.customClass;\n }\n if (this.hasInput && this.component.validate && (0, FormioUtils.boolValue)(this.component.validate.required)) {\n className += ' required';\n }\n if (this.labelIsHidden()) {\n className += ' formio-component-label-hidden';\n }\n if (!this.visible) {\n className += ' formio-hidden';\n }\n return className;\n }\n\n /**\n * Build the custom style from the layout values\n * @return {string} - The custom style\n */\n }, {\n key: \"customStyle\",\n get: function get() {\n var customCSS = '';\n _lodash[\"default\"].each(this.component.style, function (value, key) {\n if (value !== '') {\n customCSS += \"\".concat(key, \":\").concat(value, \";\");\n }\n });\n return customCSS;\n }\n }, {\n key: \"isMobile\",\n get: function get() {\n return (0, _ismobilejs[\"default\"])();\n }\n\n /**\n * Returns the outside wrapping element of this component.\n * @returns {HTMLElement}\n */\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n\n /**\n * Create an evaluation context for all script executions and interpolations.\n *\n * @param additional\n * @return {*}\n */\n }, {\n key: \"evalContext\",\n value: function evalContext(additional) {\n return _get(_getPrototypeOf(Component.prototype), \"evalContext\", this).call(this, Object.assign({\n component: this.component,\n row: this.data,\n rowIndex: this.rowIndex,\n data: this.rootValue,\n iconClass: this.iconClass.bind(this),\n // Bind the translate function to the data context of any interpolated string.\n // It is useful to translate strings in different scenarions (eg: custom edit grid templates, custom error messages etc.)\n // and desirable to be publicly available rather than calling the internal {instance.t} function in the template string.\n t: this.t.bind(this),\n submission: this.root ? this.root._submission : {\n data: this.rootValue\n },\n form: this.root ? this.root._form : {},\n options: this.options\n }, additional));\n }\n\n /**\n * Sets the pristine flag for this component.\n *\n * @param pristine {boolean} - TRUE to make pristine, FALSE not pristine.\n */\n }, {\n key: \"setPristine\",\n value: function setPristine(pristine) {\n this.pristine = pristine;\n }\n }, {\n key: \"isPristine\",\n get: function get() {\n return this.pristine;\n }\n }, {\n key: \"setDirty\",\n value: function setDirty(dirty) {\n this.dirty = dirty;\n }\n }, {\n key: \"isDirty\",\n get: function get() {\n return this.dirty;\n }\n\n /**\n * Removes a value out of the data array and rebuild the rows.\n * @param {number} index - The index of the data element to remove.\n */\n }, {\n key: \"removeValue\",\n value: function removeValue(index) {\n this.splice(index);\n this.redraw();\n this.restoreValue();\n this.triggerRootChange();\n }\n }, {\n key: \"iconClass\",\n value: function iconClass(name, spinning) {\n var iconset = this.options.iconset || Templates.current.defaultIconset || 'fa';\n return Templates.current.hasOwnProperty('iconClass') ? Templates.current.iconClass(iconset, name, spinning) : this.options.iconset === 'fa' ? Templates.defaultTemplates.iconClass(iconset, name, spinning) : name;\n }\n }, {\n key: \"size\",\n value: function size(_size) {\n return Templates.current.hasOwnProperty('size') ? Templates.current.size(_size) : _size;\n }\n\n /**\n * The readible name for this component.\n * @returns {string} - The name of the component.\n */\n }, {\n key: \"name\",\n get: function get() {\n return this.t(this.component.label || this.component.placeholder || this.key, {\n _userInput: true\n });\n }\n\n /**\n * Returns the error label for this component.\n * @return {*}\n */\n }, {\n key: \"errorLabel\",\n get: function get() {\n return this.t(this.component.errorLabel || this.component.label || this.component.placeholder || this.key);\n }\n\n /**\n * Get the error message provided a certain type of error.\n * @param type\n * @return {*}\n */\n }, {\n key: \"errorMessage\",\n value: function errorMessage(type) {\n return this.component.errors && this.component.errors[type] ? this.component.errors[type] : type;\n }\n }, {\n key: \"setContent\",\n value: function setContent(element, content, forceSanitize, sanitizeOptions) {\n if (element instanceof HTMLElement) {\n element.innerHTML = this.sanitize(content, forceSanitize, sanitizeOptions);\n return true;\n }\n return false;\n }\n }, {\n key: \"restoreCaretPosition\",\n value: function restoreCaretPosition() {\n var _this$root3;\n if ((_this$root3 = this.root) !== null && _this$root3 !== void 0 && _this$root3.currentSelection) {\n var _this$refs$input;\n if ((_this$refs$input = this.refs.input) !== null && _this$refs$input !== void 0 && _this$refs$input.length) {\n var _this$root$currentSel2 = this.root.currentSelection,\n selection = _this$root$currentSel2.selection,\n index = _this$root$currentSel2.index;\n var input = this.refs.input[index];\n var isInputRangeSelectable = function isInputRangeSelectable(i) {\n return /text|search|password|tel|url/i.test((i === null || i === void 0 ? void 0 : i.type) || '');\n };\n if (input) {\n if (isInputRangeSelectable(input)) {\n var _input;\n (_input = input).setSelectionRange.apply(_input, _toConsumableArray(selection));\n }\n } else {\n var _input$value;\n input = this.refs.input[this.refs.input.length];\n var lastCharacter = ((_input$value = input.value) === null || _input$value === void 0 ? void 0 : _input$value.length) || 0;\n if (isInputRangeSelectable(input)) {\n input.setSelectionRange(lastCharacter, lastCharacter);\n }\n }\n }\n }\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n // Don't bother if we have not built yet.\n if (!this.element || !this.element.parentNode || this.optimizeRedraw) {\n // Return a non-resolving promise.\n return _nativePromiseOnly[\"default\"].resolve();\n }\n this.detach();\n this.emit('redraw');\n // Since we are going to replace the element, we need to know it's position so we can find it in the parent's children.\n var parent = this.element.parentNode;\n var index = Array.prototype.indexOf.call(parent.children, this.element);\n this.element.outerHTML = this.sanitize(this.render());\n this.element = parent.children[index];\n return this.attach(this.element);\n }\n }, {\n key: \"rebuild\",\n value: function rebuild() {\n this.destroy();\n this.init();\n this.visible = this.conditionallyVisible(null, null);\n return this.redraw();\n }\n }, {\n key: \"removeEventListeners\",\n value: function removeEventListeners() {\n _get(_getPrototypeOf(Component.prototype), \"removeEventListeners\", this).call(this);\n this.tooltips.forEach(function (tooltip) {\n return tooltip.destroy();\n });\n this.tooltips = [];\n }\n }, {\n key: \"hasClass\",\n value: function hasClass(element, className) {\n if (!element) {\n return;\n }\n return _get(_getPrototypeOf(Component.prototype), \"hasClass\", this).call(this, element, this.transform('class', className));\n }\n }, {\n key: \"addClass\",\n value: function addClass(element, className) {\n if (!element) {\n return;\n }\n return _get(_getPrototypeOf(Component.prototype), \"addClass\", this).call(this, element, this.transform('class', className));\n }\n }, {\n key: \"removeClass\",\n value: function removeClass(element, className) {\n if (!element) {\n return;\n }\n return _get(_getPrototypeOf(Component.prototype), \"removeClass\", this).call(this, element, this.transform('class', className));\n }\n\n /**\n * Determines if this component has a condition defined.\n *\n * @return {null}\n */\n }, {\n key: \"hasCondition\",\n value: function hasCondition() {\n if (this._hasCondition !== null) {\n return this._hasCondition;\n }\n this._hasCondition = FormioUtils.hasCondition(this.component);\n return this._hasCondition;\n }\n\n /**\n * Check if this component is conditionally visible.\n *\n * @param data\n * @return {boolean}\n */\n }, {\n key: \"conditionallyVisible\",\n value: function conditionallyVisible(data, row) {\n data = data || this.rootValue;\n row = row || this.data;\n if (this.builderMode || this.previewMode || !this.hasCondition()) {\n return !this.component.hidden;\n }\n data = data || (this.root ? this.root.data : {});\n return this.checkCondition(row, data);\n }\n\n /**\n * Checks the condition of this component.\n *\n * TODO: Switch row and data parameters to be consistent with other methods.\n *\n * @param row - The row contextual data.\n * @param data - The global data object.\n * @return {boolean} - True if the condition applies to this component.\n */\n }, {\n key: \"checkCondition\",\n value: function checkCondition(row, data) {\n return FormioUtils.checkCondition(this.component, row || this.data, data || this.rootValue, this.root ? this.root._form : {}, this);\n }\n\n /**\n * Check for conditionals and hide/show the element based on those conditions.\n */\n }, {\n key: \"checkComponentConditions\",\n value: function checkComponentConditions(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n if (!this.builderMode & !this.previewMode && this.fieldLogic(data, row)) {\n this.redraw();\n }\n\n // Check advanced conditions\n var visible = this.conditionallyVisible(data, row);\n if (this.visible !== visible) {\n this.visible = visible;\n }\n return visible;\n }\n\n /**\n * Checks conditions for this component and any sub components.\n * @param args\n * @return {boolean}\n */\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n return this.checkComponentConditions(data, flags, row);\n }\n }, {\n key: \"logic\",\n get: function get() {\n return this.component.logic || [];\n }\n\n /**\n * Check all triggers and apply necessary actions.\n *\n * @param data\n */\n }, {\n key: \"fieldLogic\",\n value: function fieldLogic(data, row) {\n var _this11 = this;\n data = data || this.rootValue;\n row = row || this.data;\n var logics = this.logic;\n\n // If there aren't logic, don't go further.\n if (logics.length === 0) {\n return;\n }\n var newComponent = (0, FormioUtils.fastCloneDeep)(this.originalComponent);\n var changed = logics.reduce(function (changed, logic) {\n var result = FormioUtils.checkTrigger(newComponent, logic.trigger, row, data, _this11.root ? _this11.root._form : {}, _this11);\n return (result ? _this11.applyActions(newComponent, logic.actions, result, row, data) : false) || changed;\n }, false);\n\n // If component definition changed, replace and mark as changed.\n if (!_lodash[\"default\"].isEqual(this.component, newComponent)) {\n this.component = newComponent;\n changed = true;\n var disabled = this.shouldDisabled;\n // Change disabled state if it has changed\n if (this.disabled !== disabled) {\n this.disabled = disabled;\n }\n }\n return changed;\n }\n }, {\n key: \"isIE\",\n value: function isIE() {\n if (typeof window === 'undefined') {\n return false;\n }\n var userAgent = window.navigator.userAgent;\n var msie = userAgent.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(userAgent.substring(msie + 5, userAgent.indexOf('.', msie)), 10);\n }\n var trident = userAgent.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = userAgent.indexOf('rv:');\n return parseInt(userAgent.substring(rv + 3, userAgent.indexOf('.', rv)), 10);\n }\n var edge = userAgent.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 (aka Edge) => return version number\n return parseInt(userAgent.substring(edge + 5, userAgent.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }\n }, {\n key: \"defineActionValue\",\n value: function defineActionValue(action, argsObject) {\n return this.evaluate(action.value, argsObject, 'value');\n }\n }, {\n key: \"applyActions\",\n value: function applyActions(newComponent, actions, result, row, data) {\n var _this12 = this;\n data = data || this.rootValue;\n row = row || this.data;\n return actions.reduce(function (changed, action) {\n switch (action.type) {\n case 'property':\n {\n FormioUtils.setActionProperty(newComponent, action, result, row, data, _this12);\n var property = action.property.value;\n if (!_lodash[\"default\"].isEqual(_lodash[\"default\"].get(_this12.component, property), _lodash[\"default\"].get(newComponent, property))) {\n changed = true;\n }\n break;\n }\n case 'value':\n {\n var oldValue = _this12.getValue();\n var newValue = _this12.defineActionValue(action, {\n value: _lodash[\"default\"].clone(oldValue),\n data: data,\n row: row,\n component: newComponent,\n result: result\n });\n if (!_lodash[\"default\"].isEqual(oldValue, newValue) && !(_this12.component.clearOnHide && !_this12.visible)) {\n _this12.setValue(newValue);\n if (_this12.viewOnly) {\n _this12.dataValue = newValue;\n }\n changed = true;\n }\n break;\n }\n case 'mergeComponentSchema':\n {\n var schema = _this12.evaluate(action.schemaDefinition, {\n value: _lodash[\"default\"].clone(_this12.getValue()),\n data: data,\n row: row,\n component: newComponent,\n result: result\n }, 'schema');\n _lodash[\"default\"].assign(newComponent, schema);\n if (!_lodash[\"default\"].isEqual(_this12.component, newComponent)) {\n changed = true;\n }\n break;\n }\n case 'customAction':\n {\n var _oldValue = _this12.getValue();\n var _newValue = _this12.evaluate(action.customAction, {\n value: _lodash[\"default\"].clone(_oldValue),\n data: data,\n row: row,\n input: _oldValue,\n component: newComponent,\n result: result\n }, 'value');\n if (!_lodash[\"default\"].isEqual(_oldValue, _newValue) && !(_this12.component.clearOnHide && !_this12.visible)) {\n _this12.setValue(_newValue);\n if (_this12.viewOnly) {\n _this12.dataValue = _newValue;\n }\n changed = true;\n }\n break;\n }\n }\n return changed;\n }, false);\n }\n\n // Deprecated\n }, {\n key: \"addInputError\",\n value: function addInputError(message, dirty, elements) {\n this.addMessages(message);\n this.setErrorClasses(elements, dirty, !!message);\n }\n\n // Deprecated\n }, {\n key: \"removeInputError\",\n value: function removeInputError(elements) {\n this.setErrorClasses(elements, true, false);\n }\n\n /**\n * Add a new input error to this element.\n *\n * @param message\n * @param dirty\n */\n }, {\n key: \"addMessages\",\n value: function addMessages(messages) {\n var _this13 = this;\n if (!messages) {\n return;\n }\n\n // Standardize on array of objects for message.\n if (typeof messages === 'string') {\n messages = {\n messages: messages,\n level: 'error'\n };\n }\n if (!Array.isArray(messages)) {\n messages = [messages];\n }\n messages = _lodash[\"default\"].uniqBy(messages, function (message) {\n return message.message;\n });\n if (this.refs.messageContainer) {\n this.setContent(this.refs.messageContainer, messages.map(function (message) {\n if (message.message && typeof message.message === 'string') {\n message.message = message.message.replaceAll('<', '<').replaceAll('>', '>');\n }\n return _this13.renderTemplate('message', message);\n }).join(''));\n }\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(elements, dirty, hasErrors, hasMessages) {\n var _this14 = this;\n var element = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.element;\n this.clearErrorClasses();\n elements.forEach(function (element) {\n _this14.setElementInvalid(_this14.performInputMapping(element), false);\n });\n this.setInputWidgetErrorClasses(elements, hasErrors);\n if (hasErrors) {\n // Add error classes\n elements.forEach(function (input) {\n _this14.setElementInvalid(_this14.performInputMapping(input), true);\n });\n if (dirty && this.options.highlightErrors) {\n this.addClass(element, this.options.componentErrorClass);\n } else {\n this.addClass(element, 'has-error');\n }\n }\n if (hasMessages) {\n this.addClass(element, 'has-message');\n }\n }\n }, {\n key: \"setElementInvalid\",\n value: function setElementInvalid(element, invalid) {\n if (!element) return;\n if (invalid) {\n this.addClass(element, 'is-invalid');\n } else {\n this.removeClass(element, 'is-invalid');\n }\n element.setAttribute('aria-invalid', invalid ? 'true' : 'false');\n }\n }, {\n key: \"clearOnHide\",\n value: function clearOnHide() {\n // clearOnHide defaults to true for old forms (without the value set) so only trigger if the value is false.\n if (\n // if change happens inside EditGrid's row, it doesn't trigger change on the root level, so rootPristine will be true\n (!this.rootPristine || this.options.server || (0, FormioUtils.isInsideScopingComponent)(this)) && this.component.clearOnHide !== false && !this.options.readOnly && !this.options.showHiddenFields) {\n if (!this.visible) {\n this.deleteValue();\n } else if (!this.hasValue() && this.shouldAddDefaultValue) {\n // If shown, ensure the default is set.\n this.setValue(this.defaultValue, {\n noUpdateEvent: true\n });\n }\n }\n }\n }, {\n key: \"triggerRootChange\",\n value: function triggerRootChange() {\n if (this.options.onChange) {\n var _this$options2;\n (_this$options2 = this.options).onChange.apply(_this$options2, arguments);\n } else if (this.root) {\n var _this$root4;\n (_this$root4 = this.root).triggerChange.apply(_this$root4, arguments);\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(flags, fromRoot) {\n flags = flags || {};\n if (flags.modified) {\n if (!flags.noPristineChangeOnModified) {\n this.pristine = false;\n }\n this.addClass(this.getElement(), 'formio-modified');\n }\n\n // If we are supposed to validate on blur, then don't trigger validation yet.\n if (this.component.validateOn === 'blur' && !this.errors.length) {\n flags.noValidate = true;\n }\n if (this.component.onChange) {\n this.evaluate(this.component.onChange, {\n flags: flags\n });\n }\n\n // Set the changed variable.\n var changed = {\n instance: this,\n component: this.component,\n value: this.dataValue,\n flags: flags\n };\n\n // Emit the change.\n this.emit('componentChange', changed);\n\n // Do not propogate the modified flag.\n var modified = false;\n if (flags.modified) {\n modified = true;\n delete flags.modified;\n }\n\n // Bubble this change up to the top.\n if (!fromRoot) {\n this.triggerRootChange(flags, changed, modified);\n }\n return changed;\n }\n }, {\n key: \"wysiwygDefault\",\n get: function get() {\n return {\n quill: {\n theme: 'snow',\n placeholder: this.t(this.component.placeholder, {\n _userInput: true\n }),\n modules: {\n toolbar: [[{\n 'size': ['small', false, 'large', 'huge']\n }],\n // custom dropdown\n [{\n 'header': [1, 2, 3, 4, 5, 6, false]\n }], [{\n 'font': []\n }], ['bold', 'italic', 'underline', 'strike', {\n 'script': 'sub'\n }, {\n 'script': 'super'\n }, 'clean'], [{\n 'color': []\n }, {\n 'background': []\n }], [{\n 'list': 'ordered'\n }, {\n 'list': 'bullet'\n }, {\n 'indent': '-1'\n }, {\n 'indent': '+1'\n }, {\n 'align': []\n }], ['blockquote', 'code-block'], ['link', 'image', 'video', 'formula', 'source']]\n }\n },\n ace: {\n theme: 'ace/theme/xcode',\n maxLines: 12,\n minLines: 12,\n tabSize: 2,\n mode: 'ace/mode/javascript',\n placeholder: this.t(this.component.placeholder, {\n _userInput: true\n })\n },\n ckeditor: {\n image: {\n toolbar: ['imageTextAlternative', '|', 'imageStyle:full', 'imageStyle:alignLeft', 'imageStyle:alignCenter', 'imageStyle:alignRight'],\n styles: ['full', 'alignLeft', 'alignCenter', 'alignRight']\n },\n extraPlugins: []\n },\n \"default\": {}\n };\n }\n }, {\n key: \"addCKE\",\n value: function addCKE(element, settings, onChange) {\n settings = _lodash[\"default\"].isEmpty(settings) ? {} : settings;\n settings.base64Upload = this.component.isUploadEnabled ? false : true;\n settings.mediaEmbed = {\n previewsInData: true\n };\n settings = _lodash[\"default\"].merge(this.wysiwygDefault.ckeditor, _lodash[\"default\"].get(this.options, 'editors.ckeditor.settings', {}), settings);\n if (this.component.isUploadEnabled) {\n settings.extraPlugins.push((0, _uploadAdapter.getFormioUploadAdapterPlugin)(this.fileService, this));\n }\n return _Formio.GlobalFormio.requireLibrary('ckeditor', isIEBrowser ? 'CKEDITOR' : 'ClassicEditor', _lodash[\"default\"].get(this.options, 'editors.ckeditor.src', \"\".concat(_Formio.GlobalFormio.cdn.ckeditor, \"/ckeditor.js\")), true).then(function () {\n if (!element.parentNode) {\n return _nativePromiseOnly[\"default\"].reject();\n }\n if (isIEBrowser) {\n var editor = CKEDITOR.replace(element);\n editor.on('change', function () {\n return onChange(editor.getData());\n });\n return _nativePromiseOnly[\"default\"].resolve(editor);\n } else {\n return ClassicEditor.create(element, settings).then(function (editor) {\n editor.model.document.on('change', function () {\n return onChange(editor.data.get());\n });\n return editor;\n });\n }\n });\n }\n }, {\n key: \"addQuill\",\n value: function addQuill(element, settings, onChange) {\n var _this15 = this;\n settings = _lodash[\"default\"].isEmpty(settings) ? this.wysiwygDefault.quill : settings;\n settings = _lodash[\"default\"].merge(this.wysiwygDefault.quill, _lodash[\"default\"].get(this.options, 'editors.quill.settings', {}), settings);\n settings = _objectSpread(_objectSpread({}, settings), {}, {\n modules: _objectSpread({\n table: true\n }, settings.modules)\n });\n // Lazy load the quill css.\n _Formio.GlobalFormio.requireLibrary(\"quill-css-\".concat(settings.theme), 'Quill', [{\n type: 'styles',\n src: \"\".concat(_Formio.GlobalFormio.cdn.quill, \"/quill.\").concat(settings.theme, \".css\")\n }], true);\n\n // Lazy load the quill library.\n return _Formio.GlobalFormio.requireLibrary('quill', 'Quill', _lodash[\"default\"].get(this.options, 'editors.quill.src', \"\".concat(_Formio.GlobalFormio.cdn.quill, \"/quill.min.js\")), true).then(function () {\n return _Formio.GlobalFormio.requireLibrary('quill-table', 'Quill', \"\".concat(_Formio.GlobalFormio.cdn.baseUrl, \"/quill/quill-table.js\"), true).then(function () {\n if (!element.parentNode) {\n return _nativePromiseOnly[\"default\"].reject();\n }\n _this15.quill = new Quill(element, isIEBrowser ? _objectSpread(_objectSpread({}, settings), {}, {\n modules: {}\n }) : settings);\n\n /** This block of code adds the [source] capabilities. See https://codepen.io/anon/pen/ZyEjrQ **/\n var txtArea = document.createElement('textarea');\n txtArea.setAttribute('class', 'quill-source-code');\n _this15.quill.addContainer('ql-custom').appendChild(txtArea);\n var qlSource = element.parentNode.querySelector('.ql-source');\n if (qlSource) {\n _this15.addEventListener(qlSource, 'click', function (event) {\n event.preventDefault();\n if (txtArea.style.display === 'inherit') {\n _this15.quill.setContents(_this15.quill.clipboard.convert({\n html: txtArea.value\n }));\n }\n txtArea.style.display = txtArea.style.display === 'none' ? 'inherit' : 'none';\n });\n }\n /** END CODEBLOCK **/\n\n // Make sure to select cursor when they click on the element.\n _this15.addEventListener(element, 'click', function () {\n return _this15.quill.focus();\n });\n\n // Allows users to skip toolbar items when tabbing though form\n var elm = document.querySelectorAll('.ql-formats > button');\n for (var i = 0; i < elm.length; i++) {\n elm[i].setAttribute('tabindex', '-1');\n }\n _this15.quill.on('text-change', function () {\n txtArea.value = _this15.quill.root.innerHTML;\n onChange(txtArea);\n });\n return _this15.quill;\n });\n });\n }\n }, {\n key: \"shouldSanitizeValue\",\n get: function get() {\n var _this$options3;\n // Sanitize value if sanitizing for thw whole content is turned off\n return ((_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.sanitize) !== false;\n }\n }, {\n key: \"addAce\",\n value: function addAce(element, settings, onChange) {\n if (!settings || settings.theme === 'snow') {\n var mode = settings ? settings.mode : '';\n settings = {};\n if (mode) {\n settings.mode = mode;\n }\n }\n settings = _lodash[\"default\"].merge(this.wysiwygDefault.ace, _lodash[\"default\"].get(this.options, 'editors.ace.settings', {}), settings || {});\n return _Formio.GlobalFormio.requireLibrary('ace', 'ace', _lodash[\"default\"].get(this.options, 'editors.ace.src', \"\".concat(_Formio.GlobalFormio.cdn.ace, \"/ace.js\")), true).then(function (editor) {\n editor = editor.edit(element);\n editor.removeAllListeners('change');\n editor.setOptions(settings);\n editor.getSession().setMode(settings.mode);\n editor.on('change', function () {\n return onChange(editor.getValue());\n });\n if (settings.isUseWorkerDisabled) {\n editor.session.setUseWorker(false);\n }\n return editor;\n });\n }\n }, {\n key: \"tree\",\n get: function get() {\n return this.component.tree || false;\n }\n\n /**\n * The empty value for this component.\n *\n * @return {null}\n */\n }, {\n key: \"emptyValue\",\n get: function get() {\n return null;\n }\n\n /**\n * Returns if this component has a value set.\n *\n */\n }, {\n key: \"hasValue\",\n value: function hasValue(data) {\n return !_lodash[\"default\"].isUndefined(_lodash[\"default\"].get(data || this.data, this.key));\n }\n\n /**\n * Get the data value at the root level.\n *\n * @return {*}\n */\n }, {\n key: \"rootValue\",\n get: function get() {\n return this.root ? this.root.data : this.data;\n }\n }, {\n key: \"rootPristine\",\n get: function get() {\n return _lodash[\"default\"].get(this, 'root.pristine', false);\n }\n\n /**\n * Get the static value of this component.\n * @return {*}\n */\n }, {\n key: \"dataValue\",\n get: function get() {\n if (!this.key || !this.visible && this.component.clearOnHide && !this.rootPristine) {\n return this.emptyValue;\n }\n if (!this.hasValue() && this.shouldAddDefaultValue) {\n var empty = this.component.multiple ? [] : this.emptyValue;\n if (!this.rootPristine) {\n this.dataValue = empty;\n }\n return empty;\n }\n return _lodash[\"default\"].get(this._data, this.key);\n }\n\n /**\n * Sets the static value of this component.\n *\n * @param value\n */,\n set: function set(value) {\n if (!this.allowData || !this.key || !this.visible && this.component.clearOnHide && !this.rootPristine) {\n return;\n }\n if (value !== null && value !== undefined) {\n value = this.hook('setDataValue', value, this.key, this._data);\n }\n if (value === null || value === undefined) {\n this.unset();\n return;\n }\n _lodash[\"default\"].set(this._data, this.key, value);\n return;\n }\n\n /**\n * Splice a value from the dataValue.\n *\n * @param index\n */\n }, {\n key: \"splice\",\n value: function splice(index) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (this.hasValue()) {\n var dataValue = this.dataValue || [];\n if (_lodash[\"default\"].isArray(dataValue) && dataValue.hasOwnProperty(index)) {\n dataValue.splice(index, 1);\n this.dataValue = dataValue;\n this.triggerChange(flags);\n }\n }\n }\n }, {\n key: \"unset\",\n value: function unset() {\n _lodash[\"default\"].unset(this._data, this.key);\n }\n\n /**\n * Deletes the value of the component.\n */\n }, {\n key: \"deleteValue\",\n value: function deleteValue() {\n this.setValue(null, {\n noUpdateEvent: true,\n noDefault: true\n });\n this.unset();\n }\n }, {\n key: \"getCustomDefaultValue\",\n value: function getCustomDefaultValue(defaultValue) {\n if (this.component.customDefaultValue && !this.options.preview) {\n defaultValue = this.evaluate(this.component.customDefaultValue, {\n value: ''\n }, 'value');\n }\n return defaultValue;\n }\n }, {\n key: \"shouldAddDefaultValue\",\n get: function get() {\n return !this.options.noDefaults || this.component.defaultValue && !this.isEmpty(this.component.defaultValue) || this.component.customDefaultValue;\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var _this16 = this;\n var defaultValue = this.emptyValue;\n if (this.component.defaultValue) {\n defaultValue = this.component.defaultValue;\n }\n defaultValue = this.getCustomDefaultValue(defaultValue);\n var checkMask = function checkMask(value) {\n if (typeof value === 'string') {\n var placeholderChar = _this16.placeholderChar;\n value = (0, _vanillaTextMask.conformToMask)(value, _this16.defaultMask, {\n placeholderChar: placeholderChar\n }).conformedValue;\n if (!FormioUtils.matchInputMask(value, _this16.defaultMask)) {\n value = '';\n }\n } else {\n value = '';\n }\n return value;\n };\n if (this.defaultMask) {\n if (Array.isArray(defaultValue)) {\n defaultValue = defaultValue.map(checkMask);\n } else {\n defaultValue = checkMask(defaultValue);\n }\n }\n\n // Clone so that it creates a new instance.\n return _lodash[\"default\"].cloneDeep(defaultValue);\n }\n\n /**\n * Get the input value of this component.\n *\n * @return {*}\n */\n }, {\n key: \"getValue\",\n value: function getValue() {\n if (!this.hasInput || this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var values = [];\n for (var i in this.refs.input) {\n if (this.refs.input.hasOwnProperty(i)) {\n if (!this.component.multiple) {\n return this.getValueAt(i);\n }\n values.push(this.getValueAt(i));\n }\n }\n if (values.length === 0 && !this.component.multiple) {\n return '';\n }\n return values;\n }\n\n /**\n * Get the value at a specific index.\n *\n * @param index\n * @returns {*}\n */\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n var input = this.performInputMapping(this.refs.input[index]);\n return input ? input.value : undefined;\n }\n\n /**\n * Set the value of this component.\n *\n * @param value\n * @param flags\n *\n * @return {boolean} - If the value changed.\n */\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = this.updateValue(value, flags);\n value = this.dataValue;\n if (!this.hasInput) {\n return changed;\n }\n var isArray = Array.isArray(value);\n var valueInput = this.refs.fileLink || this.refs.input;\n if (isArray && Array.isArray(this.defaultValue) && this.refs.hasOwnProperty('input') && valueInput && valueInput.length !== value.length && this.visible) {\n this.redraw();\n }\n if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {\n this.redraw();\n return changed;\n }\n for (var i in this.refs.input) {\n if (this.refs.input.hasOwnProperty(i)) {\n this.setValueAt(i, isArray ? value[i] : value, flags);\n }\n }\n return changed;\n }\n\n /**\n * Set the value at a specific index.\n *\n * @param index\n * @param value\n */\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!flags.noDefault && (value === null || value === undefined) && !this.component.multiple) {\n value = this.defaultValue;\n }\n var input = this.performInputMapping(this.refs.input[index]);\n var valueMaskInput = this.refs.valueMaskInput;\n if (valueMaskInput !== null && valueMaskInput !== void 0 && valueMaskInput.mask) {\n valueMaskInput.mask.textMaskInputElement.update(value);\n }\n if (input.mask) {\n input.mask.textMaskInputElement.update(value);\n } else if (input.widget && input.widget.setValue) {\n input.widget.setValue(value);\n } else {\n input.value = value;\n }\n }\n }, {\n key: \"hasSetValue\",\n get: function get() {\n return this.hasValue() && !this.isEmpty(this.dataValue);\n }\n }, {\n key: \"setDefaultValue\",\n value: function setDefaultValue() {\n if (this.defaultValue && this.shouldAddDefaultValue) {\n var defaultValue = this.component.multiple && !this.dataValue.length ? [] : this.defaultValue;\n this.setValue(defaultValue, {\n noUpdateEvent: true\n });\n }\n }\n\n /**\n * Restore the value of a control.\n */\n }, {\n key: \"restoreValue\",\n value: function restoreValue() {\n if (this.hasSetValue) {\n this.setValue(this.dataValue, {\n noUpdateEvent: true\n });\n } else {\n this.setDefaultValue();\n }\n }\n\n /**\n * Normalize values coming into updateValue.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n if (this.component.multiple && !Array.isArray(value)) {\n value = value ? [value] : [];\n }\n return value;\n }\n\n /**\n * Update a value of this component.\n *\n * @param flags\n */\n }, {\n key: \"updateComponentValue\",\n value: function updateComponentValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var newValue = !flags.resetValue && (value === undefined || value === null) ? this.getValue() : value;\n newValue = this.normalizeValue(newValue, flags);\n var oldValue = this.dataValue;\n var changed = newValue !== undefined ? this.hasChanged(newValue, oldValue) : false;\n if (changed) {\n this.dataValue = newValue;\n changed = this.dataValue !== oldValue;\n this.updateOnChange(flags, changed);\n }\n if (this.componentModal && flags && flags.fromSubmission) {\n this.componentModal.setValue(value);\n }\n return changed;\n }\n\n /**\n * Updates the value of this component plus all sub-components.\n *\n * @param args\n * @return {boolean}\n */\n }, {\n key: \"updateValue\",\n value: function updateValue() {\n return this.updateComponentValue.apply(this, arguments);\n }\n }, {\n key: \"getIcon\",\n value: function getIcon(name, content, styles) {\n var ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'icon';\n return this.renderTemplate('icon', {\n className: this.iconClass(name),\n ref: ref,\n styles: styles,\n content: content\n });\n }\n\n /**\n * Resets the value of this component.\n */\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n this.unset();\n this.setValue(this.emptyValue, {\n noUpdateEvent: true,\n noValidate: true,\n resetValue: true\n });\n }\n\n /**\n * Determine if the value of this component has changed.\n *\n * @param newValue\n * @param oldValue\n * @return {boolean}\n */\n }, {\n key: \"hasChanged\",\n value: function hasChanged(newValue, oldValue) {\n if ((newValue === undefined || newValue === null) && (oldValue === undefined || oldValue === null || this.isEmpty(oldValue))) {\n return false;\n }\n // If we do not have a value and are getting set to anything other than undefined or null, then we changed.\n if (newValue !== undefined && newValue !== null && this.allowData && !this.hasValue()) {\n return true;\n }\n return !_lodash[\"default\"].isEqual(newValue, oldValue);\n }\n\n /**\n * Update the value on change.\n *\n * @param flags\n */\n }, {\n key: \"updateOnChange\",\n value: function updateOnChange() {\n var flags = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var changed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (!flags.noUpdateEvent && changed) {\n this.triggerChange(flags);\n return true;\n }\n return false;\n }\n\n /**\n * Perform a calculated value operation.\n *\n * @param data - The global data object.\n *\n * @return {boolean} - If the value changed during calculation.\n */\n }, {\n key: \"convertNumberOrBoolToString\",\n value: function convertNumberOrBoolToString(value) {\n if (typeof value === 'number' || typeof value === 'boolean') {\n return value.toString();\n }\n return value;\n }\n }, {\n key: \"doValueCalculation\",\n value: function doValueCalculation(dataValue, data, row) {\n var _this$root5;\n return this.evaluate(this.component.calculateValue, {\n value: dataValue,\n data: data,\n row: row || this.data,\n submission: ((_this$root5 = this.root) === null || _this$root5 === void 0 ? void 0 : _this$root5._submission) || {\n data: this.rootValue\n }\n }, 'value');\n }\n\n /* eslint-disable max-statements */\n }, {\n key: \"calculateComponentValue\",\n value: function calculateComponentValue(data, flags, row) {\n // Skip value calculation for the component if we don't have entire form data set\n if (_lodash[\"default\"].isUndefined(_lodash[\"default\"].get(this, 'root.data'))) {\n return false;\n }\n // If no calculated value or\n // hidden and set to clearOnHide (Don't calculate a value for a hidden field set to clear when hidden)\n var clearOnHide = this.component.clearOnHide;\n var shouldBeCleared = !this.visible && clearOnHide;\n var allowOverride = _lodash[\"default\"].get(this.component, 'allowCalculateOverride', false);\n if (shouldBeCleared) {\n // remove calculated value so that the value is recalculated once component becomes visible\n if (this.hasOwnProperty('calculatedValue') && allowOverride) {\n _lodash[\"default\"].unset(this, 'calculatedValue');\n }\n return false;\n }\n\n // Handle all cases when calculated values should not fire.\n if (this.options.readOnly && !this.options.pdf && !this.component.calculateValue || !(this.component.calculateValue || this.component.calculateValueVariable) || this.options.server && !this.component.calculateServer || flags.dataSourceInitialLoading && allowOverride) {\n return false;\n }\n var dataValue = this.dataValue;\n // Calculate the new value.\n var calculatedValue = this.doValueCalculation(dataValue, data, row, flags);\n if (this.options.readOnly && dataValue && !calculatedValue) {\n return false;\n }\n if (_lodash[\"default\"].isNil(calculatedValue)) {\n calculatedValue = this.emptyValue;\n }\n var changed = !_lodash[\"default\"].isEqual(dataValue, calculatedValue);\n\n // Do not override calculations on server if they have calculateServer set.\n if (allowOverride) {\n // The value is considered locked if it is not empty and comes from a submission value.\n var fromSubmission = flags.fromSubmission && this.component.persistent === true;\n if (this.isEmpty(dataValue)) {\n // Reset the calculation lock if ever the data is cleared.\n this.calculationLocked = false;\n } else if (this.calculationLocked || fromSubmission) {\n this.calculationLocked = true;\n return false;\n }\n var firstPass = this.calculatedValue === undefined || flags.resetValue;\n if (firstPass) {\n this.calculatedValue = null;\n }\n var newCalculatedValue = this.normalizeValue(this.convertNumberOrBoolToString(calculatedValue));\n var previousCalculatedValue = this.normalizeValue(this.convertNumberOrBoolToString(this.calculatedValue));\n var normalizedDataValue = this.normalizeValue(this.convertNumberOrBoolToString(dataValue));\n var calculationChanged = !_lodash[\"default\"].isEqual(previousCalculatedValue, newCalculatedValue);\n var previousChanged = !_lodash[\"default\"].isEqual(normalizedDataValue, previousCalculatedValue);\n if (calculationChanged && previousChanged && !firstPass) {\n return false;\n }\n\n // Check to ensure that the calculated value is different than the previously calculated value.\n if (previousCalculatedValue && previousChanged && !calculationChanged) {\n return false;\n }\n if (flags.isReordered || !calculationChanged) {\n return false;\n }\n if (fromSubmission) {\n // If we set value from submission and it differs from calculated one, set the calculated value to prevent overriding dataValue in the next pass\n this.calculatedValue = (0, FormioUtils.fastCloneDeep)(calculatedValue);\n return false;\n }\n\n // If this is the firstPass, and the dataValue is different than to the calculatedValue.\n if (firstPass && !this.isEmpty(dataValue) && changed && calculationChanged) {\n // Return that we have a change so it will perform another pass.\n return true;\n }\n }\n this.calculatedValue = (0, FormioUtils.fastCloneDeep)(calculatedValue);\n if (changed) {\n if (!flags.noPristineChangeOnModified) {\n this.pristine = false;\n }\n flags.triggeredComponentId = this.id;\n return this.setValue(calculatedValue, flags);\n }\n return false;\n }\n /* eslint-enable max-statements */\n\n /**\n * Performs calculations in this component plus any child components.\n *\n * @param args\n * @return {boolean}\n */\n }, {\n key: \"calculateValue\",\n value: function calculateValue(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n return this.calculateComponentValue(data, flags, row);\n }\n\n /**\n * Get this component's label text.\n *\n */\n }, {\n key: \"label\",\n get: function get() {\n return this.component.label;\n }\n\n /**\n * Set this component's label text and render it.\n *\n * @param value - The new label text.\n */,\n set: function set(value) {\n this.component.label = value;\n if (this.labelElement) {\n this.labelElement.innerText = value;\n }\n }\n\n /**\n * Get FormioForm element at the root of this component tree.\n *\n */\n }, {\n key: \"getRoot\",\n value: function getRoot() {\n return this.root;\n }\n\n /**\n * Returns the invalid message, or empty string if the component is valid.\n *\n * @param data\n * @param dirty\n * @return {*}\n */\n }, {\n key: \"invalidMessage\",\n value: function invalidMessage(data, dirty, ignoreCondition, row) {\n if (!ignoreCondition && !this.checkCondition(row, data)) {\n return '';\n }\n\n // See if this is forced invalid.\n if (this.invalid) {\n return this.invalid;\n }\n\n // No need to check for errors if there is no input or if it is pristine.\n if (!this.hasInput || !dirty && this.pristine) {\n return '';\n }\n return _lodash[\"default\"].map(_Validator[\"default\"].checkComponent(this, data), 'message').join('\\n\\n');\n }\n\n /**\n * Returns if the component is valid or not.\n *\n * @param data\n * @param dirty\n * @return {boolean}\n */\n }, {\n key: \"isValid\",\n value: function isValid(data, dirty) {\n return !this.invalidMessage(data, dirty);\n }\n }, {\n key: \"setComponentValidity\",\n value: function setComponentValidity(messages, dirty, silentCheck) {\n var hasErrors = !!messages.filter(function (message) {\n return message.level === 'error' && !message.fromServer;\n }).length;\n if (messages.length && (!silentCheck || this.error) && (!this.isEmpty(this.defaultValue) || dirty || !this.pristine)) {\n this.setCustomValidity(messages, dirty);\n } else if (!silentCheck) {\n this.setCustomValidity('');\n }\n return !hasErrors;\n }\n\n /**\n * Checks the validity of this component and sets the error message if it is invalid.\n *\n * @param data\n * @param dirty\n * @param row\n * @return {boolean}\n */\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, row) {\n var _this$serverErrors,\n _this17 = this;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n data = data || this.rootValue;\n row = row || this.data;\n var _options$async = options.async,\n async = _options$async === void 0 ? false : _options$async,\n _options$silentCheck = options.silentCheck,\n silentCheck = _options$silentCheck === void 0 ? false : _options$silentCheck;\n if (this.shouldSkipValidation(data, dirty, row)) {\n this.setCustomValidity('');\n return async ? _nativePromiseOnly[\"default\"].resolve(true) : true;\n }\n var check = _Validator[\"default\"].checkComponent(this, data, row, true, async);\n var validations = check;\n if ((_this$serverErrors = this.serverErrors) !== null && _this$serverErrors !== void 0 && _this$serverErrors.length) {\n validations = check.concat(this.serverErrors);\n }\n return async ? validations.then(function (messages) {\n return _this17.setComponentValidity(messages, dirty, silentCheck);\n }) : this.setComponentValidity(validations, dirty, silentCheck);\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n data = data || this.rootValue;\n row = row || this.data;\n var isValid = this.checkComponentValidity(data, dirty, row, {\n silentCheck: silentCheck\n });\n this.checkModal();\n return isValid;\n }\n }, {\n key: \"checkAsyncValidity\",\n value: function checkAsyncValidity(data, dirty, row, silentCheck) {\n return _nativePromiseOnly[\"default\"].resolve(this.checkComponentValidity(data, dirty, row, {\n async: true,\n silentCheck: silentCheck\n }));\n }\n\n /**\n * Check the conditions, calculations, and validity of a single component and triggers an update if\n * something changed.\n *\n * @param data - The root data of the change event.\n * @param flags - The flags from this change event.\n *\n * @return boolean - If component is valid or not.\n */\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n\n // Needs for Nextgen Rules Engine\n this.resetCaches();\n\n // Do not trigger refresh if change was triggered on blur event since components with Refresh on Blur have their own listeners\n if (!flags.fromBlur) {\n this.checkRefreshOn(flags.changes, flags);\n }\n if (flags.noCheck) {\n return true;\n }\n this.checkComponentConditions(data, flags, row);\n if (this.id !== flags.triggeredComponentId) {\n this.calculateComponentValue(data, flags, row);\n }\n if (flags.noValidate && !flags.validateOnInit && !flags.fromIframe) {\n if (flags.fromSubmission && this.rootPristine && this.pristine && this.error && flags.changed) {\n this.checkComponentValidity(data, !!this.options.alwaysDirty, row, true);\n }\n return true;\n }\n var isDirty = false;\n\n // We need to set dirty if they explicitly set noValidate to false.\n if (this.options.alwaysDirty || flags.dirty) {\n isDirty = true;\n }\n\n // See if they explicitely set the values with setSubmission.\n if (flags.fromSubmission && this.hasValue(data)) {\n isDirty = true;\n }\n this.setDirty(isDirty);\n if (this.component.validateOn === 'blur' && flags.fromSubmission) {\n return true;\n }\n var isValid = this.checkComponentValidity(data, isDirty, row, flags);\n this.checkModal();\n return isValid;\n }\n }, {\n key: \"checkModal\",\n value: function checkModal() {\n var isValid = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var dirty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (!this.component.modalEdit || !this.componentModal) {\n return;\n }\n if (dirty && !isValid) {\n this.setErrorClasses([this.refs.openModal], dirty, !isValid, !!this.errors.length, this.refs.openModalWrapper);\n } else {\n this.clearErrorClasses(this.refs.openModalWrapper);\n }\n }\n }, {\n key: \"validationValue\",\n get: function get() {\n return this.dataValue;\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n var isEmptyArray = _lodash[\"default\"].isArray(value) && value.length === 1 ? _lodash[\"default\"].isEqual(value[0], this.emptyValue) : false;\n return value == null || value.length === 0 || _lodash[\"default\"].isEqual(value, this.emptyValue) || isEmptyArray;\n }\n }, {\n key: \"isEqual\",\n value: function isEqual(valueA) {\n var valueB = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dataValue;\n return this.isEmpty(valueA) && this.isEmpty(valueB) || _lodash[\"default\"].isEqual(valueA, valueB);\n }\n\n /**\n * Check if a component is eligible for multiple validation\n *\n * @return {boolean}\n */\n }, {\n key: \"validateMultiple\",\n value: function validateMultiple() {\n return true;\n }\n }, {\n key: \"errors\",\n get: function get() {\n return this.error ? [this.error] : [];\n }\n }, {\n key: \"clearErrorClasses\",\n value: function clearErrorClasses() {\n var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.element;\n this.removeClass(element, this.options.componentErrorClass);\n this.removeClass(element, 'alert alert-danger');\n this.removeClass(element, 'has-error');\n this.removeClass(element, 'has-message');\n }\n }, {\n key: \"setInputWidgetErrorClasses\",\n value: function setInputWidgetErrorClasses(inputRefs, hasErrors) {\n if (!this.isInputComponent || !this.component.widget || !(inputRefs !== null && inputRefs !== void 0 && inputRefs.length)) {\n return;\n }\n inputRefs.forEach(function (input) {\n if (input !== null && input !== void 0 && input.widget && input.widget.setErrorClasses) {\n input.widget.setErrorClasses(hasErrors);\n }\n });\n }\n }, {\n key: \"addFocusBlurEvents\",\n value: function addFocusBlurEvents(element) {\n var _this18 = this;\n this.addEventListener(element, 'focus', function () {\n if (_this18.root.focusedComponent !== _this18) {\n if (_this18.root.pendingBlur) {\n _this18.root.pendingBlur();\n }\n _this18.root.focusedComponent = _this18;\n _this18.emit('focus', _this18);\n } else if (_this18.root.focusedComponent === _this18 && _this18.root.pendingBlur) {\n _this18.root.pendingBlur.cancel();\n _this18.root.pendingBlur = null;\n }\n });\n this.addEventListener(element, 'blur', function () {\n _this18.root.pendingBlur = FormioUtils.delay(function () {\n _this18.emit('blur', _this18);\n if (_this18.component.validateOn === 'blur') {\n _this18.root.triggerChange({\n fromBlur: true\n }, {\n instance: _this18,\n component: _this18.component,\n value: _this18.dataValue,\n flags: {\n fromBlur: true\n }\n });\n }\n _this18.root.focusedComponent = null;\n _this18.root.pendingBlur = null;\n });\n });\n }\n }, {\n key: \"setCustomValidity\",\n value: function setCustomValidity(messages, dirty, external) {\n var _this19 = this;\n var inputRefs = this.isInputComponent ? this.refs.input || [] : null;\n if (typeof messages === 'string' && messages) {\n messages = {\n level: 'error',\n message: messages\n };\n }\n if (!Array.isArray(messages)) {\n if (messages) {\n messages = [messages];\n } else {\n messages = [];\n }\n }\n var hasErrors = !!messages.filter(function (message) {\n return message.level === 'error';\n }).length;\n var invalidInputRefs = inputRefs;\n if (this.component.multiple) {\n var inputRefsArray = Array.from(inputRefs);\n inputRefsArray.forEach(function (input) {\n _this19.setElementInvalid(_this19.performInputMapping(input), false);\n });\n this.setInputWidgetErrorClasses(inputRefsArray, false);\n invalidInputRefs = inputRefsArray.filter(function (ref) {\n var _messages$some, _messages;\n return (_messages$some = (_messages = messages).some) === null || _messages$some === void 0 ? void 0 : _messages$some.call(_messages, function (msg) {\n var _msg$context;\n return (msg === null || msg === void 0 ? void 0 : (_msg$context = msg.context) === null || _msg$context === void 0 ? void 0 : _msg$context.input) === ref;\n });\n });\n }\n if (messages.length) {\n if (this.refs.messageContainer) {\n this.empty(this.refs.messageContainer);\n }\n this.error = {\n component: this.component,\n message: messages[0].message,\n messages: messages,\n external: !!external\n };\n this.emit('componentError', this.error);\n this.addMessages(messages, dirty, invalidInputRefs);\n if (invalidInputRefs) {\n this.setErrorClasses(invalidInputRefs, dirty, hasErrors, !!messages.length);\n }\n } else if (!this.error || this.error && this.error.external === !!external) {\n if (this.refs.messageContainer) {\n this.empty(this.refs.messageContainer);\n }\n if (this.refs.modalMessageContainer) {\n this.empty(this.refs.modalMessageContainer);\n }\n this.error = null;\n if (invalidInputRefs) {\n this.setErrorClasses(invalidInputRefs, dirty, hasErrors, !!messages.length);\n }\n this.clearErrorClasses();\n }\n\n // if (!this.refs.input) {\n // return;\n // }\n // this.refs.input.forEach(input => {\n // input = this.performInputMapping(input);\n // if (typeof input.setCustomValidity === 'function') {\n // input.setCustomValidity(message, dirty);\n // }\n // });\n }\n\n /**\n * Determines if the value of this component is hidden from the user as if it is coming from the server, but is\n * protected.\n *\n * @return {boolean|*}\n */\n }, {\n key: \"isValueHidden\",\n value: function isValueHidden() {\n if (this.component[\"protected\"] && this.root.editing) {\n return false;\n }\n if (!this.root || !this.root.hasOwnProperty('editing')) {\n return false;\n }\n if (!this.root || !this.root.editing) {\n return false;\n }\n return this.component[\"protected\"] || !this.component.persistent || this.component.persistent === 'client-only';\n }\n }, {\n key: \"shouldSkipValidation\",\n value: function shouldSkipValidation(data, dirty, row) {\n var _this20 = this;\n var rules = [\n // Force valid if component is read-only\n function () {\n return _this20.options.readOnly;\n },\n // Do not check validations if component is not an input component.\n function () {\n return !_this20.hasInput;\n },\n // Check to see if we are editing and if so, check component persistence.\n function () {\n return _this20.isValueHidden();\n },\n // Force valid if component is hidden.\n function () {\n return !_this20.visible;\n },\n // Force valid if component is conditionally hidden.\n function () {\n return !_this20.checkCondition(row, data);\n }];\n return rules.some(function (pred) {\n return pred();\n });\n }\n\n // Maintain reverse compatibility.\n }, {\n key: \"whenReady\",\n value: function whenReady() {\n console.warn('The whenReady() method has been deprecated. Please use the dataReady property instead.');\n return this.dataReady;\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n\n /**\n * Prints out the value of this component as a string value.\n */\n }, {\n key: \"asString\",\n value: function asString(value) {\n value = value || this.getValue();\n return (Array.isArray(value) ? value : [value]).map(_lodash[\"default\"].toString).join(', ');\n }\n\n /**\n * Return if the component is disabled.\n * @return {boolean}\n */\n }, {\n key: \"disabled\",\n get: function get() {\n return this._disabled || this.parentDisabled;\n }\n\n /**\n * Disable this component.\n *\n * @param {boolean} disabled\n */,\n set: function set(disabled) {\n this._disabled = disabled;\n }\n }, {\n key: \"setDisabled\",\n value: function setDisabled(element, disabled) {\n if (!element) {\n return;\n }\n element.disabled = disabled;\n if (disabled) {\n element.setAttribute('disabled', 'disabled');\n } else {\n element.removeAttribute('disabled');\n }\n }\n }, {\n key: \"setLoading\",\n value: function setLoading(element, loading) {\n if (!element || element.loading === loading) {\n return;\n }\n element.loading = loading;\n if (!element.loader && loading) {\n element.loader = this.ce('i', {\n \"class\": \"\".concat(this.iconClass('refresh', true), \" button-icon-right\")\n });\n }\n if (element.loader) {\n if (loading) {\n this.appendTo(element.loader, element);\n } else {\n this.removeChildFrom(element.loader, element);\n }\n }\n }\n }, {\n key: \"selectOptions\",\n value: function selectOptions(select, tag, options, defaultValue) {\n var _this21 = this;\n _lodash[\"default\"].each(options, function (option) {\n var attrs = {\n value: option.value\n };\n if (defaultValue !== undefined && option.value === defaultValue) {\n attrs.selected = 'selected';\n }\n var optionElement = _this21.ce('option', attrs);\n optionElement.appendChild(_this21.text(option.label));\n select.appendChild(optionElement);\n });\n }\n }, {\n key: \"setSelectValue\",\n value: function setSelectValue(select, value) {\n var options = select.querySelectorAll('option');\n _lodash[\"default\"].each(options, function (option) {\n if (option.value === value) {\n option.setAttribute('selected', 'selected');\n } else {\n option.removeAttribute('selected');\n }\n });\n if (select.onchange) {\n select.onchange();\n }\n if (select.onselect) {\n select.onselect();\n }\n }\n }, {\n key: \"getRelativePath\",\n value: function getRelativePath(path) {\n var keyPart = \".\".concat(this.key);\n var thisPath = this.isInputComponent ? this.path : this.path.slice(0).replace(keyPart, '');\n return path.replace(thisPath, '');\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.detach();\n this.empty(this.getElement());\n }\n }, {\n key: \"append\",\n value: function append(element) {\n this.appendTo(element, this.element);\n }\n }, {\n key: \"prepend\",\n value: function prepend(element) {\n this.prependTo(element, this.element);\n }\n }, {\n key: \"removeChild\",\n value: function removeChild(element) {\n this.removeChildFrom(element, this.element);\n }\n }, {\n key: \"detachLogic\",\n value: function detachLogic() {\n var _this22 = this;\n this.logic.forEach(function (logic) {\n if (logic.trigger.type === 'event') {\n var event = _this22.interpolate(logic.trigger.event);\n _this22.off(event); // only applies to callbacks on this component\n }\n });\n }\n }, {\n key: \"attachLogic\",\n value: function attachLogic() {\n var _this23 = this;\n // Do not attach logic during builder mode.\n if (this.builderMode) {\n return;\n }\n this.logic.forEach(function (logic) {\n if (logic.trigger.type === 'event') {\n var event = _this23.interpolate(logic.trigger.event);\n _this23.on(event, function () {\n var newComponent = (0, FormioUtils.fastCloneDeep)(_this23.originalComponent);\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n if (_this23.applyActions(newComponent, logic.actions, args)) {\n // If component definition changed, replace it.\n if (!_lodash[\"default\"].isEqual(_this23.component, newComponent)) {\n _this23.component = newComponent;\n var visible = _this23.conditionallyVisible(null, null);\n var disabled = _this23.shouldDisabled;\n\n // Change states which won't be recalculated during redrawing\n if (_this23.visible !== visible) {\n _this23.visible = visible;\n }\n if (_this23.disabled !== disabled) {\n _this23.disabled = disabled;\n }\n _this23.redraw();\n }\n }\n }, true);\n }\n });\n }\n\n /**\n * Get the element information.\n */\n }, {\n key: \"elementInfo\",\n value: function elementInfo() {\n var attributes = {\n name: this.options.name,\n type: this.component.inputType || 'text',\n \"class\": 'form-control',\n lang: this.options.language\n };\n if (this.component.placeholder) {\n attributes.placeholder = this.t(this.component.placeholder, {\n _userInput: true\n });\n }\n if (this.component.tabindex) {\n attributes.tabindex = this.component.tabindex;\n }\n if (this.disabled) {\n attributes.disabled = 'disabled';\n }\n _lodash[\"default\"].defaults(attributes, this.component.attributes);\n return {\n type: 'input',\n component: this.component,\n changeEvent: 'change',\n attr: attributes\n };\n }\n }, {\n key: \"autofocus\",\n value: function autofocus() {\n var _this24 = this;\n var hasAutofocus = this.component.autofocus && !this.builderMode && !this.options.preview;\n if (hasAutofocus) {\n this.on('render', function () {\n return _this24.focus();\n }, true);\n }\n }\n }, {\n key: \"scrollIntoView\",\n value: function scrollIntoView() {\n var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.element;\n if (!element) {\n return;\n }\n var _element$getBoundingC = element.getBoundingClientRect(),\n left = _element$getBoundingC.left,\n top = _element$getBoundingC.top;\n window.scrollTo(left + window.scrollX, top + window.scrollY);\n }\n }, {\n key: \"focus\",\n value: function focus(index) {\n var _this$refs$input2;\n if ('beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n if ((_this$refs$input2 = this.refs.input) !== null && _this$refs$input2 !== void 0 && _this$refs$input2.length) {\n var _this$component$widge;\n var focusingInput = typeof index === 'number' && this.refs.input[index] ? this.refs.input[index] : this.refs.input[this.refs.input.length - 1];\n if (((_this$component$widge = this.component.widget) === null || _this$component$widge === void 0 ? void 0 : _this$component$widge.type) === 'calendar') {\n var sibling = focusingInput.nextSibling;\n if (sibling) {\n sibling.focus();\n }\n } else {\n focusingInput.focus();\n }\n }\n if (this.refs.openModal) {\n this.refs.openModal.focus();\n }\n if (this.parent.refs.openModal) {\n this.parent.refs.openModal.focus();\n }\n }\n\n /**\n * Get `Formio` instance for working with files\n */\n }, {\n key: \"fileService\",\n get: function get() {\n if (this.options.fileService) {\n return this.options.fileService;\n }\n if (this.options.formio) {\n return this.options.formio;\n }\n if (this.root && this.root.formio) {\n return this.root.formio;\n }\n var formio = new _Formio.GlobalFormio();\n // If a form is loaded, then make sure to set the correct formUrl.\n if (this.root && this.root._form && this.root._form._id) {\n formio.formUrl = \"\".concat(formio.projectUrl, \"/form/\").concat(this.root._form._id);\n }\n return formio;\n }\n }, {\n key: \"resetCaches\",\n value: function resetCaches() {}\n }, {\n key: \"previewMode\",\n get: function get() {\n return false;\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len5 = arguments.length, sources = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n sources[_key5] = arguments[_key5];\n }\n return _lodash[\"default\"].merge.apply(_lodash[\"default\"], [{\n /**\n * Determines if this component provides an input.\n */\n input: true,\n /**\n * The data key for this component (how the data is stored in the database).\n */\n key: '',\n /**\n * The input placeholder for this component.\n */\n placeholder: '',\n /**\n * The input prefix\n */\n prefix: '',\n /**\n * The custom CSS class to provide to this component.\n */\n customClass: '',\n /**\n * The input suffix.\n */\n suffix: '',\n /**\n * If this component should allow an array of values to be captured.\n */\n multiple: false,\n /**\n * The default value of this component.\n */\n defaultValue: null,\n /**\n * If the data of this component should be protected (no GET api requests can see the data)\n */\n \"protected\": false,\n /**\n * Validate if the value of this component should be unique within the form.\n */\n unique: false,\n /**\n * If the value of this component should be persisted within the backend api database.\n */\n persistent: true,\n /**\n * Determines if the component should be within the form, but not visible.\n */\n hidden: false,\n /**\n * If the component should be cleared when hidden.\n */\n clearOnHide: true,\n /**\n * This will refresh this component options when this field changes.\n */\n refreshOn: '',\n /**\n * This will redraw the component when this field changes.\n */\n redrawOn: '',\n /**\n * If this component should be included as a column within a submission table.\n */\n tableView: false,\n /**\n * If this component should be rendering in modal.\n */\n modalEdit: false,\n /**\n * The input label provided to this component.\n */\n label: '',\n dataGridLabel: false,\n labelPosition: 'top',\n description: '',\n errorLabel: '',\n tooltip: '',\n hideLabel: false,\n tabindex: '',\n disabled: false,\n autofocus: false,\n dbIndex: false,\n customDefaultValue: '',\n calculateValue: '',\n calculateServer: false,\n widget: null,\n /**\n * Attributes that will be assigned to the input elements of this component.\n */\n attributes: {},\n /**\n * This will perform the validation on either \"change\" or \"blur\" of the input element.\n */\n validateOn: 'change',\n /**\n * The validation criteria for this component.\n */\n validate: {\n /**\n * If this component is required.\n */\n required: false,\n /**\n * Custom JavaScript validation.\n */\n custom: '',\n /**\n * If the custom validation should remain private (only the backend will see it and execute it).\n */\n customPrivate: false,\n /**\n * If this component should implement a strict date validation if the Calendar widget is implemented.\n */\n strictDateValidation: false,\n multiple: false,\n unique: false\n },\n /**\n * The simple conditional settings for a component.\n */\n conditional: {\n show: null,\n when: null,\n eq: ''\n },\n overlay: {\n style: '',\n left: '',\n top: '',\n width: '',\n height: ''\n },\n allowCalculateOverride: false,\n encrypted: false,\n showCharCount: false,\n showWordCount: false,\n properties: {},\n allowMultipleMasks: false,\n addons: []\n }].concat(sources));\n }\n\n /**\n * Return the validator as part of the component.\n *\n * @return {ValidationChecker}\n * @constructor\n */\n }, {\n key: \"Validator\",\n get: function get() {\n return _Validator[\"default\"];\n }\n /**\n * Return the simple condition settings as part of the component.\n *\n * @return {Object}\n *\n */\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return {\n operators: ['isEqual', 'isNotEqual', 'isEmpty', 'isNotEmpty'],\n valueComponent: function valueComponent() {\n return {\n type: 'textfield'\n };\n }\n };\n }\n /**\n * Return the array of possible types of component value absed on its schema.\n *\n * @param schema\n * @return {Array}\n *\n */\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n schema = schema || {};\n return FormioUtils.getComponentSavedTypes(schema) || [FormioUtils.componentValueTypes.any];\n }\n /**\n * Provides a table view for this component. Override if you wish to do something different than using getView\n * method of your instance.\n *\n * @param value\n * @param options\n */\n /* eslint-disable no-unused-vars */\n }, {\n key: \"tableView\",\n value: function tableView(value, options) {}\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return Component.conditionOperatorsSettings;\n }\n }]);\n return Component;\n}(_Element2[\"default\"]);\nexports[\"default\"] = Component;\nComponent.externalLibraries = {};\nComponent.requireLibrary = function (name, property, src, polling) {\n if (!Component.externalLibraries.hasOwnProperty(name)) {\n Component.externalLibraries[name] = {};\n Component.externalLibraries[name].ready = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n Component.externalLibraries[name].resolve = resolve;\n Component.externalLibraries[name].reject = reject;\n });\n var callbackName = \"\".concat(name, \"Callback\");\n if (!polling && !window[callbackName]) {\n window[callbackName] = function () {\n this.resolve();\n }.bind(Component.externalLibraries[name]);\n }\n // See if the plugin already exists.\n var plugin = _lodash[\"default\"].get(window, property);\n if (plugin) {\n Component.externalLibraries[name].resolve(plugin);\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 };\n break;\n case 'styles':\n elementType = 'link';\n attrs = {\n href: lib.src,\n rel: 'stylesheet'\n };\n break;\n }\n\n // Add the script to the top page.\n var script = document.createElement(elementType);\n for (var attr in attrs) {\n script.setAttribute(attr, attrs[attr]);\n }\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n\n // if no callback is provided, then check periodically for the script.\n if (polling) {\n setTimeout(function checkLibrary() {\n var plugin = _lodash[\"default\"].get(window, property);\n if (plugin) {\n Component.externalLibraries[name].resolve(plugin);\n } else {\n // check again after 200 ms.\n setTimeout(checkLibrary, 200);\n }\n }, 200);\n }\n }\n }\n return Component.externalLibraries[name].ready;\n};\nComponent.libraryReady = function (name) {\n if (Component.externalLibraries.hasOwnProperty(name) && Component.externalLibraries[name].ready) {\n return Component.externalLibraries[name].ready;\n }\n return _nativePromiseOnly[\"default\"].reject(\"\".concat(name, \" library was not required.\"));\n};\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/component/Component.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.weak-map.js */ \"./node_modules/core-js/modules/es.weak-map.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.flags.js */ \"./node_modules/core-js/modules/es.regexp.flags.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.string.starts-with.js */ \"./node_modules/core-js/modules/es.string.starts-with.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/esnext.string.replace-all.js */ \"./node_modules/core-js/modules/esnext.string.replace-all.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.some.js */ \"./node_modules/core-js/modules/es.array.some.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\nvar _vanillaTextMask = __webpack_require__(/*! @formio/vanilla-text-mask */ \"./node_modules/@formio/vanilla-text-mask/dist/vanillaTextMask.js\");\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _tippy = _interopRequireDefault(__webpack_require__(/*! tippy.js */ \"./node_modules/tippy.js/dist/tippy.esm.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _ismobilejs = _interopRequireDefault(__webpack_require__(/*! ismobilejs */ \"./node_modules/ismobilejs/esm/index.js\"));\nvar _Formio = __webpack_require__(/*! ../../../Formio */ \"./lib/Formio.js\");\nvar FormioUtils = _interopRequireWildcard(__webpack_require__(/*! ../../../utils/utils */ \"./lib/utils/utils.js\"));\nvar _Validator = _interopRequireDefault(__webpack_require__(/*! ../../../validator/Validator */ \"./lib/validator/Validator.js\"));\nvar _Element2 = _interopRequireDefault(__webpack_require__(/*! ../../../Element */ \"./lib/Element.js\"));\nvar _ComponentModal = _interopRequireDefault(__webpack_require__(/*! ../componentModal/ComponentModal */ \"./lib/components/_classes/componentModal/ComponentModal.js\"));\nvar _widgets = _interopRequireDefault(__webpack_require__(/*! ../../../widgets */ \"./lib/widgets/index.js\"));\nvar _addons = _interopRequireDefault(__webpack_require__(/*! ../../../addons */ \"./lib/addons/index.js\"));\nvar _uploadAdapter = __webpack_require__(/*! ../../../providers/storage/uploadAdapter */ \"./lib/providers/storage/uploadAdapter.js\");\nvar _en = _interopRequireDefault(__webpack_require__(/*! ../../../translations/en */ \"./lib/translations/en.js\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar isIEBrowser = FormioUtils.getBrowserInfo().ie;\nvar Templates = _Formio.GlobalFormio.Templates;\nif (!Templates) {\n Templates = (__webpack_require__(/*! ../../../templates/Templates */ \"./lib/templates/Templates.js\")[\"default\"]);\n}\n\n/**\n * This is the Component class\n which all elements within the FormioForm derive from.\n */\nvar Component = /*#__PURE__*/function (_Element) {\n _inherits(Component, _Element);\n var _super = _createSuper(Component);\n /* eslint-enable no-unused-vars */\n\n /**\n * Initialize a new Component.\n *\n * @param {Object} component - The component JSON you wish to initialize.\n * @param {Object} options - The options for this component.\n * @param {Object} data - The global data submission object this component will belong.\n */\n /* eslint-disable max-statements */\n function Component(component, options, data) {\n var _this;\n _classCallCheck(this, Component);\n _this = _super.call(this, Object.assign({\n renderMode: 'form',\n attachMode: 'full',\n noDefaults: false\n }, options || {}));\n\n // Restore the component id.\n if (component && component.id) {\n _this.id = component.id;\n }\n\n /**\n * Determines if this component has a condition assigned to it.\n * @type {null}\n * @private\n */\n _this._hasCondition = null;\n\n /**\n * References to dom elements\n */\n _this.refs = {};\n\n // Allow global override for any component JSON.\n if (component && _this.options.components && _this.options.components[component.type]) {\n _lodash[\"default\"].merge(component, _this.options.components[component.type]);\n }\n\n /**\n * Set the validator instance.\n */\n _this.validator = _Validator[\"default\"];\n\n /**\n * The data path to this specific component instance.\n *\n * @type {string}\n */\n _this.path = '';\n\n /**\n * The Form.io component JSON schema.\n * @type {*}\n */\n _this.component = _this.mergeSchema(component || {});\n\n // Add the id to the component.\n _this.component.id = _this.id;\n _this.afterComponentAssign();\n\n // Save off the original component to be used in logic.\n _this.originalComponent = (0, FormioUtils.fastCloneDeep)(_this.component);\n\n /**\n * If the component has been attached\n */\n _this.attached = false;\n\n /**\n * If the component has been rendered\n */\n _this.rendered = false;\n\n /**\n * The data object in which this component resides.\n * @type {*}\n */\n _this._data = data || {};\n\n /**\n * The existing error that this component has.\n * @type {string}\n */\n _this.error = '';\n\n /**\n * Tool tip text after processing\n * @type {string}\n */\n _this.tooltip = '';\n\n /**\n * The row path of this component.\n * @type {number}\n */\n _this.row = _this.options.row;\n\n /**\n * Determines if this component is disabled, or not.\n *\n * @type {boolean}\n */\n _this._disabled = (0, FormioUtils.boolValue)(_this.component.disabled) ? _this.component.disabled : false;\n\n /**\n * Points to the root component, usually the FormComponent.\n *\n * @type {Component}\n */\n _this.root = _this.options.root;\n _this.localRoot = _this.options.localRoot;\n\n /**\n * If this input has been input and provided value.\n *\n * @type {boolean}\n */\n _this.pristine = true;\n\n /**\n * Points to the parent component.\n *\n * @type {Component}\n */\n _this.parent = _this.options.parent;\n _this.options.name = _this.options.name || 'data';\n\n /**\n * The validators that are assigned to this component.\n * @type {[string]}\n */\n _this.validators = ['required', 'minLength', 'maxLength', 'minWords', 'maxWords', 'custom', 'pattern', 'json', 'mask'];\n _this._path = '';\n // Nested forms don't have parents so we need to pass their path in.\n _this._parentPath = _this.options.parentPath || '';\n\n // Needs for Nextgen Rules Engine\n _this.resetCaches();\n\n /**\n * Determines if this component is visible, or not.\n */\n _this._parentVisible = _this.options.hasOwnProperty('parentVisible') ? _this.options.parentVisible : true;\n _this._visible = _this._parentVisible && _this.conditionallyVisible(null, data);\n _this._parentDisabled = false;\n\n /**\n * Used to trigger a new change in this component.\n * @type {function} - Call to trigger a change in this component.\n */\n var changes = [];\n var lastChanged = null;\n var triggerArgs = [];\n var _triggerChange = _lodash[\"default\"].debounce(function () {\n var _this2;\n if (_this.root) {\n _this.root.changing = false;\n }\n triggerArgs = [];\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (!args[1] && lastChanged) {\n // Set the changed component if one isn't provided.\n args[1] = lastChanged;\n }\n if (_lodash[\"default\"].isEmpty(args[0]) && lastChanged) {\n // Set the flags if it is empty and lastChanged exists.\n args[0] = lastChanged.flags;\n }\n lastChanged = null;\n args[3] = changes;\n var retVal = (_this2 = _this).onChange.apply(_this2, args);\n changes = [];\n return retVal;\n }, 100);\n _this.triggerChange = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (args[1]) {\n // Make sure that during the debounce that we always track lastChanged component, even if they\n // don't provide one later.\n lastChanged = args[1];\n changes.push(lastChanged);\n }\n if (_this.root) {\n _this.root.changing = true;\n }\n if (args.length) {\n triggerArgs = args;\n }\n return _triggerChange.apply(void 0, _toConsumableArray(triggerArgs));\n };\n\n /**\n * Used to trigger a redraw event within this component.\n *\n * @type {Function}\n */\n _this.triggerRedraw = _lodash[\"default\"].debounce(_this.redraw.bind(_assertThisInitialized(_this)), 100);\n\n /**\n * list of attached tooltips\n * @type {Array}\n */\n _this.tooltips = [];\n\n /**\n * List of attached addons\n * @type {Array}\n */\n _this.addons = [];\n\n // To force this component to be invalid.\n _this.invalid = false;\n if (_this.component) {\n _this.type = _this.component.type;\n if (_this.allowData && _this.key) {\n _this.options.name += \"[\".concat(_this.key, \"]\");\n // If component is visible or not set to clear on hide, set the default value.\n if (_this.visible || !_this.component.clearOnHide) {\n if (!_this.hasValue()) {\n if (_this.shouldAddDefaultValue) {\n _this.dataValue = _this.defaultValue;\n }\n } else {\n // Ensure the dataValue is set.\n /* eslint-disable no-self-assign */\n _this.dataValue = _this.dataValue;\n /* eslint-enable no-self-assign */\n }\n }\n }\n\n /**\n * The element information for creating the input element.\n * @type {*}\n */\n _this.info = _this.elementInfo();\n }\n\n // Allow anyone to hook into the component creation.\n _this.hook('component');\n if (!_this.options.skipInit) {\n _this.init();\n }\n return _this;\n }\n /* eslint-enable max-statements */\n _createClass(Component, [{\n key: \"data\",\n get: function get() {\n return this._data;\n },\n set: function set(value) {\n this._data = value;\n }\n }, {\n key: \"mergeSchema\",\n value: function mergeSchema() {\n var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _lodash[\"default\"].defaultsDeep(component, this.defaultSchema);\n }\n\n // Allow componets to notify when ready.\n }, {\n key: \"ready\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].resolve(this);\n }\n }, {\n key: \"isPDFReadOnlyMode\",\n get: function get() {\n return this.parent && this.parent.form && this.parent.form.display === 'pdf' && this.options.readOnly;\n }\n }, {\n key: \"labelInfo\",\n get: function get() {\n var label = {};\n label.hidden = this.labelIsHidden();\n label.className = '';\n label.labelPosition = this.component.labelPosition;\n label.tooltipClass = \"\".concat(this.iconClass('question-sign'), \" text-muted\");\n var isPDFReadOnlyMode = this.isPDFReadOnlyMode;\n if (this.hasInput && this.component.validate && (0, FormioUtils.boolValue)(this.component.validate.required) && !isPDFReadOnlyMode) {\n label.className += ' field-required';\n }\n if (label.hidden) {\n label.className += ' control-label--hidden';\n }\n if (this.info.attr.id) {\n label[\"for\"] = this.info.attr.id;\n }\n return label;\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this$component$addon,\n _this3 = this;\n this.disabled = this.shouldDisabled;\n this._visible = this.conditionallyVisible(null, null);\n if ((_this$component$addon = this.component.addons) !== null && _this$component$addon !== void 0 && _this$component$addon.length) {\n this.component.addons.forEach(function (addon) {\n return _this3.createAddon(addon);\n });\n }\n }\n }, {\n key: \"afterComponentAssign\",\n value: function afterComponentAssign() {\n //implement in extended classes\n }\n }, {\n key: \"createAddon\",\n value: function createAddon(addonConfiguration) {\n var _addonConfiguration$s;\n var name = addonConfiguration.name;\n if (!name) {\n return;\n }\n var settings = ((_addonConfiguration$s = addonConfiguration.settings) === null || _addonConfiguration$s === void 0 ? void 0 : _addonConfiguration$s.data) || {};\n var Addon = _addons[\"default\"][name.value];\n var addon = null;\n if (Addon) {\n var supportedComponents = Addon.info.supportedComponents;\n var supportsThisComponentType = !(supportedComponents !== null && supportedComponents !== void 0 && supportedComponents.length) || supportedComponents.indexOf(this.component.type) !== -1;\n if (supportsThisComponentType) {\n addon = new Addon(settings, this);\n this.addons.push(addon);\n } else {\n console.warn(\"Addon \".concat(name.label, \" does not support component of type \").concat(this.component.type, \".\"));\n }\n }\n return addon;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(Component.prototype), \"destroy\", this).call(this);\n this.detach();\n this.addons.forEach(function (addon) {\n return addon.destroy();\n });\n }\n }, {\n key: \"shouldDisabled\",\n get: function get() {\n return this.options.readOnly || this.component.disabled || this.options.hasOwnProperty('disabled') && this.options.disabled[this.key];\n }\n }, {\n key: \"isInputComponent\",\n get: function get() {\n return !this.component.hasOwnProperty('input') || this.component.input;\n }\n }, {\n key: \"allowData\",\n get: function get() {\n return this.hasInput;\n }\n }, {\n key: \"hasInput\",\n get: function get() {\n return this.isInputComponent || this.refs.input && this.refs.input.length;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return Component.schema();\n }\n }, {\n key: \"key\",\n get: function get() {\n return _lodash[\"default\"].get(this.component, 'key', '');\n }\n }, {\n key: \"parentVisible\",\n get: function get() {\n return this._parentVisible;\n },\n set: function set(value) {\n this._parentVisible = value;\n }\n }, {\n key: \"parentDisabled\",\n get: function get() {\n return this._parentDisabled;\n },\n set: function set(value) {\n this._parentDisabled = value;\n }\n }, {\n key: \"shouldForceVisibility\",\n value: function shouldForceVisibility(component, visibility) {\n if (!this.options[visibility]) {\n return false;\n }\n if (!component) {\n component = this.component;\n }\n if (_lodash[\"default\"].isArray(this.options[visibility])) {\n return this.options[visibility].includes(component.key);\n }\n return this.options[visibility][component.key];\n }\n }, {\n key: \"shouldForceHide\",\n value: function shouldForceHide(component) {\n return this.shouldForceVisibility(component, 'hide');\n }\n }, {\n key: \"shouldForceShow\",\n value: function shouldForceShow(component) {\n return this.shouldForceVisibility(component, 'show');\n }\n\n /**\n *\n * @param value {boolean}\n */\n }, {\n key: \"visible\",\n get:\n /**\n *\n * @returns {boolean}\n */\n function get() {\n // Show only if visibility changes or if we are in builder mode or if hidden fields should be shown.\n if (this.builderMode || this.previewMode || this.options.showHiddenFields) {\n return true;\n }\n if (this.shouldForceHide()) {\n return false;\n }\n if (this.shouldForceShow()) {\n return true;\n }\n return this._visible && this._parentVisible;\n },\n set: function set(value) {\n if (this._visible !== value) {\n // Skip if this component is set to visible and is supposed to be hidden.\n if (value && this.shouldForceHide()) {\n return;\n }\n // Skip if this component is set to hidden and is supposed to be shown.\n if (!value && this.shouldForceShow()) {\n return;\n }\n this._visible = value;\n this.clearOnHide();\n this.redraw();\n }\n }\n }, {\n key: \"currentForm\",\n get: function get() {\n return this._currentForm;\n },\n set: function set(instance) {\n this._currentForm = instance;\n }\n }, {\n key: \"fullMode\",\n get: function get() {\n return this.options.attachMode === 'full';\n }\n }, {\n key: \"builderMode\",\n get: function get() {\n return this.options.attachMode === 'builder';\n }\n }, {\n key: \"calculatedPath\",\n get: function get() {\n console.error('component.calculatedPath was deprecated, use component.path instead.');\n return this.path;\n }\n }, {\n key: \"labelPosition\",\n get: function get() {\n return this.component.labelPosition;\n }\n }, {\n key: \"labelWidth\",\n get: function get() {\n var width = this.component.labelWidth;\n return width >= 0 ? width : 30;\n }\n }, {\n key: \"labelMargin\",\n get: function get() {\n var margin = this.component.labelMargin;\n return margin >= 0 ? margin : 3;\n }\n }, {\n key: \"isAdvancedLabel\",\n get: function get() {\n return ['left-left', 'left-right', 'right-left', 'right-right'].includes(this.labelPosition);\n }\n }, {\n key: \"labelPositions\",\n get: function get() {\n return this.labelPosition.split('-');\n }\n }, {\n key: \"skipInEmail\",\n get: function get() {\n return false;\n }\n }, {\n key: \"rightDirection\",\n value: function rightDirection(direction) {\n if (this.options.condensedMode) {\n return false;\n }\n return direction === 'right';\n }\n }, {\n key: \"getLabelInfo\",\n value: function getLabelInfo() {\n var isCondensed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var isRightPosition = this.rightDirection(this.labelPositions[0]);\n var isLeftPosition = this.labelPositions[0] === 'left' || isCondensed;\n var isRightAlign = this.rightDirection(this.labelPositions[1]);\n var contentMargin = '';\n if (this.component.hideLabel) {\n var margin = isCondensed ? 0 : this.labelWidth + this.labelMargin;\n contentMargin = isRightPosition ? \"margin-right: \".concat(margin, \"%\") : '';\n contentMargin = isLeftPosition ? \"margin-left: \".concat(margin, \"%\") : '';\n }\n var labelStyles = \"\\n flex: \".concat(this.labelWidth, \";\\n \").concat(isRightPosition ? 'margin-left' : 'margin-right', \": \").concat(this.labelMargin, \"%;\\n \");\n var contentStyles = \"\\n flex: \".concat(100 - this.labelWidth - this.labelMargin, \";\\n \").concat(contentMargin, \";\\n \").concat(this.component.hideLabel ? \"max-width: \".concat(100 - this.labelWidth - this.labelMargin) : '', \";\\n \");\n return {\n isRightPosition: isRightPosition,\n isRightAlign: isRightAlign,\n labelStyles: labelStyles,\n contentStyles: contentStyles\n };\n }\n\n /**\n * Returns only the schema that is different from the default.\n *\n * @param schema\n * @param defaultSchema\n */\n }, {\n key: \"getModifiedSchema\",\n value: function getModifiedSchema(schema, defaultSchema, recursion) {\n var _this4 = this;\n var modified = {};\n if (!defaultSchema) {\n return schema;\n }\n _lodash[\"default\"].each(schema, function (val, key) {\n if (!_lodash[\"default\"].isArray(val) && _lodash[\"default\"].isObject(val) && defaultSchema.hasOwnProperty(key)) {\n var subModified = _this4.getModifiedSchema(val, defaultSchema[key], true);\n if (!_lodash[\"default\"].isEmpty(subModified)) {\n modified[key] = subModified;\n }\n } else if (_lodash[\"default\"].isArray(val)) {\n if (val.length !== 0 && !_lodash[\"default\"].isEqual(val, defaultSchema[key])) {\n modified[key] = val;\n }\n } else if (!recursion && key === 'type' || !recursion && key === 'key' || !recursion && key === 'label' || !recursion && key === 'input' || !recursion && key === 'tableView' || val !== '' && !defaultSchema.hasOwnProperty(key) || val !== '' && val !== defaultSchema[key] || defaultSchema[key] && val !== defaultSchema[key]) {\n modified[key] = val;\n }\n });\n return modified;\n }\n\n /**\n * Returns the JSON schema for this component.\n */\n }, {\n key: \"schema\",\n get: function get() {\n return (0, FormioUtils.fastCloneDeep)(this.getModifiedSchema(_lodash[\"default\"].omit(this.component, 'id'), this.defaultSchema));\n }\n\n /**\n * Returns true if component is inside DataGrid\n */\n }, {\n key: \"isInDataGrid\",\n get: function get() {\n return this.inDataGrid;\n }\n\n /**\n * Translate a text using the i18n system.\n *\n * @param {string} text - The i18n identifier.\n * @param {Object} params - The i18n parameters to use for translation.\n */\n }, {\n key: \"t\",\n value: function t(text) {\n var _get2;\n var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!text) {\n return '';\n }\n // Use _userInput: true to ignore translations from defaults\n if (text in _en[\"default\"] && params._userInput) {\n return text;\n }\n params.data = this.rootValue;\n params.row = this.data;\n params.component = this.component;\n for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n args[_key3 - 2] = arguments[_key3];\n }\n return (_get2 = _get(_getPrototypeOf(Component.prototype), \"t\", this)).call.apply(_get2, [this, text, params].concat(args));\n }\n }, {\n key: \"labelIsHidden\",\n value: function labelIsHidden() {\n return !this.component.label || (!this.isInDataGrid && this.component.hideLabel || this.isInDataGrid && !this.component.dataGridLabel || this.options.inputsOnly) && !this.builderMode;\n }\n }, {\n key: \"transform\",\n value: function transform(type, value) {\n var frameworkTemplates = this.options.template ? Templates.templates[this.options.template] : Templates.current;\n return frameworkTemplates.hasOwnProperty('transform') ? frameworkTemplates.transform(type, value) : function (type, value) {\n return value;\n };\n }\n }, {\n key: \"getTemplate\",\n value: function getTemplate(names, modes) {\n modes = Array.isArray(modes) ? modes : [modes];\n names = Array.isArray(names) ? names : [names];\n if (!modes.includes('form')) {\n modes.push('form');\n }\n var result = null;\n if (this.options.templates) {\n result = this.checkTemplate(this.options.templates, names, modes);\n if (result) {\n return result;\n }\n }\n var frameworkTemplates = this.options.template ? Templates.templates[this.options.template] : Templates.current;\n result = this.checkTemplate(frameworkTemplates, names, modes);\n if (result) {\n return result;\n }\n\n // Default back to bootstrap if not defined.\n var name = names[names.length - 1];\n var templatesByName = Templates.defaultTemplates[name];\n if (!templatesByName) {\n return \"Unknown template: \".concat(name);\n }\n var templateByMode = this.checkTemplateMode(templatesByName, modes);\n if (templateByMode) {\n return templateByMode;\n }\n return templatesByName.form;\n }\n }, {\n key: \"checkTemplate\",\n value: function checkTemplate(templates, names, modes) {\n var _iterator = _createForOfIteratorHelper(names),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var name = _step.value;\n var templatesByName = templates[name];\n if (templatesByName) {\n var templateByMode = this.checkTemplateMode(templatesByName, modes);\n if (templateByMode) {\n return templateByMode;\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return null;\n }\n }, {\n key: \"checkTemplateMode\",\n value: function checkTemplateMode(templatesByName, modes) {\n var _iterator2 = _createForOfIteratorHelper(modes),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var mode = _step2.value;\n var templateByMode = templatesByName[mode];\n if (templateByMode) {\n return templateByMode;\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n return null;\n }\n }, {\n key: \"getFormattedAttribute\",\n value: function getFormattedAttribute(attr) {\n return attr ? this.t(attr, {\n _userInput: true\n }).replace(/\"/g, '"') : '';\n }\n }, {\n key: \"getFormattedTooltip\",\n value: function getFormattedTooltip(tooltipValue) {\n var tooltip = this.interpolate(tooltipValue || '').replace(/(?:\\r\\n|\\r|\\n)/g, '
');\n return this.getFormattedAttribute(tooltip);\n }\n }, {\n key: \"isHtmlRenderMode\",\n value: function isHtmlRenderMode() {\n return this.options.renderMode === 'html';\n }\n }, {\n key: \"renderTemplate\",\n value: function renderTemplate(name) {\n var _this5 = this;\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var modeOption = arguments.length > 2 ? arguments[2] : undefined;\n // Need to make this fall back to form if renderMode is not found similar to how we search templates.\n var mode = modeOption || this.options.renderMode || 'form';\n data.component = this.component;\n data.self = this;\n data.options = this.options;\n data.readOnly = this.options.readOnly;\n data.iconClass = this.iconClass.bind(this);\n data.size = this.size.bind(this);\n data.t = this.t.bind(this);\n data.transform = this.transform.bind(this);\n data.id = data.id || this.id;\n data.key = data.key || this.key;\n data.value = data.value || this.dataValue;\n data.disabled = this.disabled;\n data.builder = this.builderMode;\n data.render = function () {\n console.warn(\"Form.io 'render' template function is deprecated.\\n If you need to render template (template A) inside of another template (template B),\\n pass pre-compiled template A (use this.renderTemplate('template_A_name') as template context variable for template B\");\n return _this5.renderTemplate.apply(_this5, arguments);\n };\n data.label = data.labelInfo || this.labelInfo;\n data.tooltip = this.getFormattedTooltip(this.component.tooltip);\n\n // Allow more specific template names\n var names = [\"\".concat(name, \"-\").concat(this.component.type, \"-\").concat(this.key), \"\".concat(name, \"-\").concat(this.component.type), \"\".concat(name, \"-\").concat(this.key), \"\".concat(name)];\n\n // Allow template alters.\n return this.hook(\"render\".concat(name.charAt(0).toUpperCase() + name.substring(1, name.length)), this.interpolate(this.getTemplate(names, mode), data), data, mode);\n }\n\n /**\n * Sanitize an html string.\n *\n * @param string\n * @returns {*}\n */\n }, {\n key: \"sanitize\",\n value: function sanitize(dirty, forceSanitize, options) {\n var _this$options;\n if (!this.shouldSanitizeValue && !forceSanitize) {\n return dirty;\n }\n return FormioUtils.sanitize(dirty, {\n sanitizeConfig: _lodash[\"default\"].merge(((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.sanitizeConfig) || {}, options || {})\n });\n }\n\n /**\n * Render a template string into html.\n *\n * @param template\n * @param data\n * @param actions\n *\n * @return {HTMLElement|String} - The created element or an empty string if template is not specified.\n */\n }, {\n key: \"renderString\",\n value: function renderString(template, data) {\n if (!template) {\n return '';\n }\n // Interpolate the template and populate\n return this.interpolate(template, data);\n }\n }, {\n key: \"performInputMapping\",\n value: function performInputMapping(input) {\n return input;\n }\n }, {\n key: \"widget\",\n get: function get() {\n var _this$root;\n var settings = this.component.widget;\n if (settings && (_this$root = this.root) !== null && _this$root !== void 0 && _this$root.shadowRoot) {\n settings.shadowRoot = this.root.shadowRoot;\n }\n var widget = settings && _widgets[\"default\"][settings.type] ? new _widgets[\"default\"][settings.type](settings, this.component, this) : null;\n return widget;\n }\n }, {\n key: \"getBrowserLanguage\",\n value: function getBrowserLanguage() {\n var nav = window.navigator;\n var browserLanguagePropertyKeys = ['language', 'browserLanguage', 'systemLanguage', 'userLanguage'];\n var language;\n\n // support for HTML 5.1 \"navigator.languages\"\n if (Array.isArray(nav.languages)) {\n for (var i = 0; i < nav.languages.length; i++) {\n language = nav.languages[i];\n if (language && language.length) {\n return language.split(';')[0];\n }\n }\n }\n\n // support for other well known properties in browsers\n for (var _i = 0; _i < browserLanguagePropertyKeys.length; _i++) {\n language = nav[browserLanguagePropertyKeys[_i]];\n if (language && language.length) {\n return language.split(';')[0];\n }\n }\n return null;\n }\n\n /**\n * Called before a next and previous page is triggered allowing the components\n * to perform special functions.\n *\n * @return {*}\n */\n }, {\n key: \"beforePage\",\n value: function beforePage() {\n return _nativePromiseOnly[\"default\"].resolve(true);\n }\n }, {\n key: \"beforeNext\",\n value: function beforeNext() {\n return this.beforePage(true);\n }\n\n /**\n * Called before a submission is triggered allowing the components\n * to perform special async functions.\n *\n * @return {*}\n */\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n return _nativePromiseOnly[\"default\"].resolve(true);\n }\n\n /**\n * Return the submission timezone.\n *\n * @return {*}\n */\n }, {\n key: \"submissionTimezone\",\n get: function get() {\n this.options.submissionTimezone = this.options.submissionTimezone || _lodash[\"default\"].get(this.root, 'options.submissionTimezone');\n return this.options.submissionTimezone;\n }\n }, {\n key: \"timezone\",\n get: function get() {\n return this.getTimezone(this.component);\n }\n }, {\n key: \"getTimezone\",\n value: function getTimezone(settings) {\n if (settings.timezone) {\n return settings.timezone;\n }\n if (settings.displayInTimezone === 'utc') {\n return 'UTC';\n }\n var submissionTimezone = this.submissionTimezone;\n if (submissionTimezone && (settings.displayInTimezone === 'submission' || (this.options.pdf || this.options.server) && settings.displayInTimezone === 'viewer')) {\n return submissionTimezone;\n }\n\n // Return current timezone if none are provided.\n return (0, FormioUtils.currentTimezone)();\n }\n }, {\n key: \"loadRefs\",\n value: function loadRefs(element, refs) {\n for (var ref in refs) {\n var refType = refs[ref];\n var isString = typeof refType === 'string';\n var selector = isString && refType.includes('scope') ? \":scope > [ref=\\\"\".concat(ref, \"\\\"]\") : \"[ref=\\\"\".concat(ref, \"\\\"]\");\n if (isString && refType.startsWith('single')) {\n this.refs[ref] = element.querySelector(selector);\n } else {\n this.refs[ref] = element.querySelectorAll(selector);\n }\n }\n }\n }, {\n key: \"setOpenModalElement\",\n value: function setOpenModalElement(template) {\n this.componentModal.setOpenModalElement(template || this.getModalPreviewTemplate());\n }\n }, {\n key: \"getModalPreviewTemplate\",\n value: function getModalPreviewTemplate() {\n var _this$component$valid;\n var dataValue = this.component.type === 'password' ? this.dataValue.replace(/./g, '•') : this.dataValue;\n var message = this.error ? {\n level: 'error',\n message: this.error.message\n } : '';\n var modalLabel;\n if (this.hasInput && (_this$component$valid = this.component.validate) !== null && _this$component$valid !== void 0 && _this$component$valid.required && !this.isPDFReadOnlyMode) {\n modalLabel = {\n className: 'field-required'\n };\n }\n return this.renderTemplate('modalPreview', {\n previewText: this.getValueAsString(dataValue, {\n modalPreview: true\n }) || this.t('Click to set value'),\n messages: message && this.renderTemplate('message', message),\n labelInfo: modalLabel\n });\n }\n }, {\n key: \"build\",\n value: function build(element) {\n element = element || this.element;\n this.empty(element);\n this.setContent(element, this.render());\n return this.attach(element);\n }\n }, {\n key: \"hasModalSaveButton\",\n get: function get() {\n return true;\n }\n }, {\n key: \"render\",\n value: function render() {\n var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"Unknown component: \".concat(this.component.type);\n var topLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var isVisible = this.visible;\n this.rendered = true;\n if (!this.builderMode && !this.previewMode && this.component.modalEdit) {\n return _ComponentModal[\"default\"].render(this, {\n visible: isVisible,\n showSaveButton: this.hasModalSaveButton,\n id: this.id,\n classes: this.className,\n styles: this.customStyle,\n children: children\n }, topLevel);\n } else {\n return this.renderTemplate('component', {\n visible: isVisible,\n id: this.id,\n classes: this.className,\n styles: this.customStyle,\n children: children\n }, topLevel);\n }\n }\n }, {\n key: \"attachTooltips\",\n value: function attachTooltips(toolTipsRefs) {\n var _this6 = this;\n toolTipsRefs === null || toolTipsRefs === void 0 ? void 0 : toolTipsRefs.forEach(function (tooltip, index) {\n if (tooltip) {\n var tooltipAttribute = tooltip.getAttribute('data-tooltip');\n var tooltipDataTitle = tooltip.getAttribute('data-title');\n var tooltipText = _this6.interpolate(tooltipDataTitle || tooltipAttribute).replace(/(?:\\r\\n|\\r|\\n)/g, '
');\n _this6.tooltips[index] = (0, _tippy[\"default\"])(tooltip, {\n allowHTML: true,\n trigger: 'mouseenter click focus',\n placement: 'right',\n zIndex: 10000,\n interactive: true,\n content: _this6.t(_this6.sanitize(tooltipText), {\n _userInput: true\n })\n });\n }\n });\n }\n }, {\n key: \"createComponentModal\",\n value: function createComponentModal(element, modalShouldBeOpened, currentValue) {\n return new _ComponentModal[\"default\"](this, element, modalShouldBeOpened, currentValue);\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n if (!this.builderMode && !this.previewMode && this.component.modalEdit) {\n var modalShouldBeOpened = this.componentModal ? this.componentModal.isOpened : false;\n var currentValue = modalShouldBeOpened ? this.componentModal.currentValue : this.dataValue;\n var openModalTemplate = this.componentModal && modalShouldBeOpened ? this.componentModal.openModalTemplate : null;\n this.componentModal = this.createComponentModal(element, modalShouldBeOpened, currentValue);\n this.setOpenModalElement(openModalTemplate);\n }\n this.attached = true;\n this.element = element;\n element.component = this;\n\n // If this already has an id, get it from the dom. If SSR, it could be different from the initiated id.\n if (this.element.id) {\n this.id = this.element.id;\n this.component.id = this.id;\n }\n this.loadRefs(element, {\n messageContainer: 'single',\n tooltip: 'multiple'\n });\n this.attachTooltips(this.refs.tooltip);\n\n // Attach logic.\n this.attachLogic();\n this.autofocus();\n\n // Allow global attach.\n this.hook('attachComponent', element, this);\n // Allow attach per component type.\n var type = this.component.type;\n if (type) {\n this.hook(\"attach\".concat(type.charAt(0).toUpperCase() + type.substring(1, type.length)), element, this);\n }\n this.restoreFocus();\n this.addons.forEach(function (addon) {\n return addon.attach(element);\n });\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"restoreFocus\",\n value: function restoreFocus() {\n var _this$root2, _this$root2$focusedCo;\n var isFocused = ((_this$root2 = this.root) === null || _this$root2 === void 0 ? void 0 : (_this$root2$focusedCo = _this$root2.focusedComponent) === null || _this$root2$focusedCo === void 0 ? void 0 : _this$root2$focusedCo.path) === this.path;\n if (isFocused) {\n var _this$root$currentSel;\n this.loadRefs(this.element, {\n input: 'multiple'\n });\n this.focus((_this$root$currentSel = this.root.currentSelection) === null || _this$root$currentSel === void 0 ? void 0 : _this$root$currentSel.index);\n this.restoreCaretPosition();\n }\n }\n }, {\n key: \"addShortcut\",\n value: function addShortcut(element, shortcut) {\n // Avoid infinite recursion.\n if (!element || !this.root || this.root === this) {\n return;\n }\n if (!shortcut) {\n shortcut = this.component.shortcut;\n }\n this.root.addShortcut(element, shortcut);\n }\n }, {\n key: \"removeShortcut\",\n value: function removeShortcut(element, shortcut) {\n // Avoid infinite recursion.\n if (!element || this.root === this) {\n return;\n }\n if (!shortcut) {\n shortcut = this.component.shortcut;\n }\n this.root.removeShortcut(element, shortcut);\n }\n\n /**\n * Remove all event handlers.\n */\n }, {\n key: \"detach\",\n value: function detach() {\n this.refs = {};\n this.removeEventListeners();\n this.detachLogic();\n if (this.tooltip) {\n this.tooltip.destroy();\n }\n }\n }, {\n key: \"checkRefresh\",\n value: function checkRefresh(refreshData, changed, flags) {\n var changePath = _lodash[\"default\"].get(changed, 'instance.path', false);\n // Don't let components change themselves.\n if (changePath && this.path === changePath) {\n return;\n }\n if (refreshData === 'data') {\n this.refresh(this.data, changed, flags);\n } else if (changePath && (0, FormioUtils.getComponentPath)(changed.instance) === refreshData && changed && changed.instance &&\n // Make sure the changed component is not in a different \"context\". Solves issues where refreshOn being set\n // in fields inside EditGrids could alter their state from other rows (which is bad).\n this.inContext(changed.instance)) {\n this.refresh(changed.value, changed, flags);\n }\n }\n }, {\n key: \"checkRefreshOn\",\n value: function checkRefreshOn(changes) {\n var _this7 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n changes = changes || [];\n if (flags.noRefresh) {\n return;\n }\n if (!changes.length && flags.changed) {\n changes = [flags.changed];\n }\n var refreshOn = flags.fromBlur ? this.component.refreshOnBlur : this.component.refreshOn || this.component.redrawOn;\n // If they wish to refresh on a value, then add that here.\n if (refreshOn) {\n if (Array.isArray(refreshOn)) {\n refreshOn.forEach(function (refreshData) {\n return changes.forEach(function (changed) {\n return _this7.checkRefresh(refreshData, changed, flags);\n });\n });\n } else {\n changes.forEach(function (changed) {\n return _this7.checkRefresh(refreshOn, changed, flags);\n });\n }\n }\n }\n\n /**\n * Refreshes the component with a new value.\n *\n * @param value\n */\n }, {\n key: \"refresh\",\n value: function refresh(value) {\n if (this.hasOwnProperty('refreshOnValue')) {\n this.refreshOnChanged = !_lodash[\"default\"].isEqual(value, this.refreshOnValue);\n } else {\n this.refreshOnChanged = true;\n }\n this.refreshOnValue = (0, FormioUtils.fastCloneDeep)(value);\n if (this.refreshOnChanged) {\n if (this.component.clearOnRefresh) {\n this.setValue(null);\n }\n this.triggerRedraw();\n }\n }\n\n /**\n * Checks to see if a separate component is in the \"context\" of this component. This is determined by first checking\n * if they share the same \"data\" object. It will then walk up the parent tree and compare its parents data objects\n * with the components data and returns true if they are in the same context.\n *\n * Different rows of the same EditGrid, for example, are in different contexts.\n *\n * @param component\n */\n }, {\n key: \"inContext\",\n value: function inContext(component) {\n if (component.data === this.data) {\n return true;\n }\n var parent = this.parent;\n while (parent) {\n if (parent.data === component.data) {\n return true;\n }\n parent = parent.parent;\n }\n return false;\n }\n }, {\n key: \"viewOnly\",\n get: function get() {\n return this.options.readOnly && this.options.viewAsHtml;\n }\n }, {\n key: \"createViewOnlyElement\",\n value: function createViewOnlyElement() {\n this.element = this.ce('dl', {\n id: this.id\n });\n if (this.element) {\n // Ensure you can get the component info from the element.\n this.element.component = this;\n }\n return this.element;\n }\n }, {\n key: \"defaultViewOnlyValue\",\n get: function get() {\n return '-';\n }\n\n /**\n * Uses the widget to determine the output string.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"getWidgetValueAsString\",\n value: function getWidgetValueAsString(value, options) {\n var _this8 = this;\n var noInputWidget = !this.refs.input || !this.refs.input[0] || !this.refs.input[0].widget;\n if (!value || noInputWidget) {\n if (!this.widget || !value) {\n return value;\n } else {\n return this.widget.getValueAsString(value);\n }\n }\n if (Array.isArray(value)) {\n var values = [];\n value.forEach(function (val, index) {\n var widget = _this8.refs.input[index] && _this8.refs.input[index].widget;\n if (widget) {\n values.push(widget.getValueAsString(val, options));\n }\n });\n return values;\n }\n var widget = this.refs.input[0].widget;\n return widget.getValueAsString(value, options);\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (!value) {\n return '';\n }\n value = this.getWidgetValueAsString(value, options);\n if (Array.isArray(value)) {\n return value.join(', ');\n }\n if (_lodash[\"default\"].isPlainObject(value)) {\n return JSON.stringify(value);\n }\n if (value === null || value === undefined) {\n return '';\n }\n var stringValue = value.toString();\n return this.sanitize(stringValue);\n }\n }, {\n key: \"getView\",\n value: function getView(value, options) {\n if (this.component[\"protected\"]) {\n return '--- PROTECTED ---';\n }\n return this.getValueAsString(value, options);\n }\n }, {\n key: \"updateItems\",\n value: function updateItems() {\n this.restoreValue();\n this.onChange.apply(this, arguments);\n }\n\n /**\n * @param {*} data\n * @param {boolean} [forceUseValue=false] - if true, return 'value' property of the data\n * @return {*}\n */\n }, {\n key: \"itemValue\",\n value: function itemValue(data) {\n var forceUseValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (_lodash[\"default\"].isObject(data) && !_lodash[\"default\"].isArray(data)) {\n if (this.valueProperty) {\n return _lodash[\"default\"].get(data, this.valueProperty);\n }\n if (forceUseValue) {\n return data.value;\n }\n }\n return data;\n }\n }, {\n key: \"itemValueForHTMLMode\",\n value: function itemValueForHTMLMode(value) {\n var _this9 = this;\n if (Array.isArray(value)) {\n var values = value.map(function (item) {\n return Array.isArray(item) ? _this9.itemValueForHTMLMode(item) : _this9.itemValue(item);\n });\n return values.join(', ');\n }\n return this.itemValue(value);\n }\n }, {\n key: \"createModal\",\n value: function createModal(element, attr, confirm) {\n var _this10 = this;\n var dialog = this.ce('div', attr || {});\n this.setContent(dialog, this.renderTemplate('dialog'));\n\n // Add refs to dialog, not \"this\".\n dialog.refs = {};\n this.loadRefs.call(dialog, dialog, {\n dialogOverlay: 'single',\n dialogContents: 'single',\n dialogClose: 'single'\n });\n dialog.refs.dialogContents.appendChild(element);\n document.body.appendChild(dialog);\n document.body.classList.add('modal-open');\n dialog.close = function () {\n document.body.classList.remove('modal-open');\n dialog.dispatchEvent(new CustomEvent('close'));\n };\n this.addEventListener(dialog, 'close', function () {\n return _this10.removeChildFrom(dialog, document.body);\n });\n var close = function close(event) {\n event.preventDefault();\n dialog.close();\n };\n var handleCloseClick = function handleCloseClick(e) {\n if (confirm) {\n confirm().then(function () {\n return close(e);\n })[\"catch\"](function () {});\n } else {\n close(e);\n }\n };\n this.addEventListener(dialog.refs.dialogOverlay, 'click', handleCloseClick);\n this.addEventListener(dialog.refs.dialogClose, 'click', handleCloseClick);\n return dialog;\n }\n }, {\n key: \"optimizeRedraw\",\n get: function get() {\n if (this.options.optimizeRedraw && this.element && !this.visible) {\n this.addClass(this.element, 'formio-removed');\n return true;\n }\n return false;\n }\n\n /**\n * Retrieves the CSS class name of this component.\n * @returns {string} - The class name of this component.\n */\n }, {\n key: \"className\",\n get: function get() {\n var className = this.hasInput ? \"\".concat(this.transform('class', 'form-group'), \" has-feedback \") : '';\n className += \"formio-component formio-component-\".concat(this.component.type, \" \");\n // TODO: find proper way to avoid overriding of default type-based component styles\n if (this.key && this.key !== 'form') {\n className += \"formio-component-\".concat(this.key, \" \");\n }\n if (this.component.multiple) {\n className += 'formio-component-multiple ';\n }\n if (this.component.customClass) {\n className += this.component.customClass;\n }\n if (this.hasInput && this.component.validate && (0, FormioUtils.boolValue)(this.component.validate.required)) {\n className += ' required';\n }\n if (this.labelIsHidden()) {\n className += ' formio-component-label-hidden';\n }\n if (!this.visible) {\n className += ' formio-hidden';\n }\n return className;\n }\n\n /**\n * Build the custom style from the layout values\n * @return {string} - The custom style\n */\n }, {\n key: \"customStyle\",\n get: function get() {\n var customCSS = '';\n _lodash[\"default\"].each(this.component.style, function (value, key) {\n if (value !== '') {\n customCSS += \"\".concat(key, \":\").concat(value, \";\");\n }\n });\n return customCSS;\n }\n }, {\n key: \"isMobile\",\n get: function get() {\n return (0, _ismobilejs[\"default\"])();\n }\n\n /**\n * Returns the outside wrapping element of this component.\n * @returns {HTMLElement}\n */\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n\n /**\n * Create an evaluation context for all script executions and interpolations.\n *\n * @param additional\n * @return {*}\n */\n }, {\n key: \"evalContext\",\n value: function evalContext(additional) {\n return _get(_getPrototypeOf(Component.prototype), \"evalContext\", this).call(this, Object.assign({\n component: this.component,\n row: this.data,\n rowIndex: this.rowIndex,\n data: this.rootValue,\n iconClass: this.iconClass.bind(this),\n // Bind the translate function to the data context of any interpolated string.\n // It is useful to translate strings in different scenarions (eg: custom edit grid templates, custom error messages etc.)\n // and desirable to be publicly available rather than calling the internal {instance.t} function in the template string.\n t: this.t.bind(this),\n submission: this.root ? this.root._submission : {\n data: this.rootValue\n },\n form: this.root ? this.root._form : {},\n options: this.options\n }, additional));\n }\n\n /**\n * Sets the pristine flag for this component.\n *\n * @param pristine {boolean} - TRUE to make pristine, FALSE not pristine.\n */\n }, {\n key: \"setPristine\",\n value: function setPristine(pristine) {\n this.pristine = pristine;\n }\n }, {\n key: \"isPristine\",\n get: function get() {\n return this.pristine;\n }\n }, {\n key: \"setDirty\",\n value: function setDirty(dirty) {\n this.dirty = dirty;\n }\n }, {\n key: \"isDirty\",\n get: function get() {\n return this.dirty;\n }\n\n /**\n * Removes a value out of the data array and rebuild the rows.\n * @param {number} index - The index of the data element to remove.\n */\n }, {\n key: \"removeValue\",\n value: function removeValue(index) {\n this.splice(index);\n this.redraw();\n this.restoreValue();\n this.triggerRootChange();\n }\n }, {\n key: \"iconClass\",\n value: function iconClass(name, spinning) {\n var iconset = this.options.iconset || Templates.current.defaultIconset || 'fa';\n return Templates.current.hasOwnProperty('iconClass') ? Templates.current.iconClass(iconset, name, spinning) : this.options.iconset === 'fa' ? Templates.defaultTemplates.iconClass(iconset, name, spinning) : name;\n }\n }, {\n key: \"size\",\n value: function size(_size) {\n return Templates.current.hasOwnProperty('size') ? Templates.current.size(_size) : _size;\n }\n\n /**\n * The readible name for this component.\n * @returns {string} - The name of the component.\n */\n }, {\n key: \"name\",\n get: function get() {\n return this.t(this.component.label || this.component.placeholder || this.key, {\n _userInput: true\n });\n }\n\n /**\n * Returns the error label for this component.\n * @return {*}\n */\n }, {\n key: \"errorLabel\",\n get: function get() {\n return this.t(this.component.errorLabel || this.component.label || this.component.placeholder || this.key);\n }\n\n /**\n * Get the error message provided a certain type of error.\n * @param type\n * @return {*}\n */\n }, {\n key: \"errorMessage\",\n value: function errorMessage(type) {\n return this.component.errors && this.component.errors[type] ? this.component.errors[type] : type;\n }\n }, {\n key: \"setContent\",\n value: function setContent(element, content, forceSanitize, sanitizeOptions) {\n if (element instanceof HTMLElement) {\n element.innerHTML = this.sanitize(content, forceSanitize, sanitizeOptions);\n return true;\n }\n return false;\n }\n }, {\n key: \"restoreCaretPosition\",\n value: function restoreCaretPosition() {\n var _this$root3;\n if ((_this$root3 = this.root) !== null && _this$root3 !== void 0 && _this$root3.currentSelection) {\n var _this$refs$input;\n if ((_this$refs$input = this.refs.input) !== null && _this$refs$input !== void 0 && _this$refs$input.length) {\n var _this$root$currentSel2 = this.root.currentSelection,\n selection = _this$root$currentSel2.selection,\n index = _this$root$currentSel2.index;\n var input = this.refs.input[index];\n var isInputRangeSelectable = function isInputRangeSelectable(i) {\n return /text|search|password|tel|url/i.test((i === null || i === void 0 ? void 0 : i.type) || '');\n };\n if (input) {\n if (isInputRangeSelectable(input)) {\n var _input;\n (_input = input).setSelectionRange.apply(_input, _toConsumableArray(selection));\n }\n } else {\n var _input$value;\n input = this.refs.input[this.refs.input.length];\n var lastCharacter = ((_input$value = input.value) === null || _input$value === void 0 ? void 0 : _input$value.length) || 0;\n if (isInputRangeSelectable(input)) {\n input.setSelectionRange(lastCharacter, lastCharacter);\n }\n }\n }\n }\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n // Don't bother if we have not built yet.\n if (!this.element || !this.element.parentNode || this.optimizeRedraw) {\n // Return a non-resolving promise.\n return _nativePromiseOnly[\"default\"].resolve();\n }\n this.detach();\n this.emit('redraw');\n // Since we are going to replace the element, we need to know it's position so we can find it in the parent's children.\n var parent = this.element.parentNode;\n var index = Array.prototype.indexOf.call(parent.children, this.element);\n this.element.outerHTML = this.sanitize(this.render());\n this.element = parent.children[index];\n return this.attach(this.element);\n }\n }, {\n key: \"rebuild\",\n value: function rebuild() {\n this.destroy();\n this.init();\n this.visible = this.conditionallyVisible(null, null);\n return this.redraw();\n }\n }, {\n key: \"removeEventListeners\",\n value: function removeEventListeners() {\n _get(_getPrototypeOf(Component.prototype), \"removeEventListeners\", this).call(this);\n this.tooltips.forEach(function (tooltip) {\n return tooltip.destroy();\n });\n this.tooltips = [];\n }\n }, {\n key: \"hasClass\",\n value: function hasClass(element, className) {\n if (!element) {\n return;\n }\n return _get(_getPrototypeOf(Component.prototype), \"hasClass\", this).call(this, element, this.transform('class', className));\n }\n }, {\n key: \"addClass\",\n value: function addClass(element, className) {\n if (!element) {\n return;\n }\n return _get(_getPrototypeOf(Component.prototype), \"addClass\", this).call(this, element, this.transform('class', className));\n }\n }, {\n key: \"removeClass\",\n value: function removeClass(element, className) {\n if (!element) {\n return;\n }\n return _get(_getPrototypeOf(Component.prototype), \"removeClass\", this).call(this, element, this.transform('class', className));\n }\n\n /**\n * Determines if this component has a condition defined.\n *\n * @return {null}\n */\n }, {\n key: \"hasCondition\",\n value: function hasCondition() {\n if (this._hasCondition !== null) {\n return this._hasCondition;\n }\n this._hasCondition = FormioUtils.hasCondition(this.component);\n return this._hasCondition;\n }\n\n /**\n * Check if this component is conditionally visible.\n *\n * @param data\n * @return {boolean}\n */\n }, {\n key: \"conditionallyVisible\",\n value: function conditionallyVisible(data, row) {\n data = data || this.rootValue;\n row = row || this.data;\n if (this.builderMode || this.previewMode || !this.hasCondition()) {\n return !this.component.hidden;\n }\n data = data || (this.root ? this.root.data : {});\n return this.checkCondition(row, data);\n }\n\n /**\n * Checks the condition of this component.\n *\n * TODO: Switch row and data parameters to be consistent with other methods.\n *\n * @param row - The row contextual data.\n * @param data - The global data object.\n * @return {boolean} - True if the condition applies to this component.\n */\n }, {\n key: \"checkCondition\",\n value: function checkCondition(row, data) {\n return FormioUtils.checkCondition(this.component, row || this.data, data || this.rootValue, this.root ? this.root._form : {}, this);\n }\n\n /**\n * Check for conditionals and hide/show the element based on those conditions.\n */\n }, {\n key: \"checkComponentConditions\",\n value: function checkComponentConditions(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n if (!this.builderMode & !this.previewMode && this.fieldLogic(data, row)) {\n this.redraw();\n }\n\n // Check advanced conditions\n var visible = this.conditionallyVisible(data, row);\n if (this.visible !== visible) {\n this.visible = visible;\n }\n return visible;\n }\n\n /**\n * Checks conditions for this component and any sub components.\n * @param args\n * @return {boolean}\n */\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n return this.checkComponentConditions(data, flags, row);\n }\n }, {\n key: \"logic\",\n get: function get() {\n return this.component.logic || [];\n }\n\n /**\n * Check all triggers and apply necessary actions.\n *\n * @param data\n */\n }, {\n key: \"fieldLogic\",\n value: function fieldLogic(data, row) {\n var _this11 = this;\n data = data || this.rootValue;\n row = row || this.data;\n var logics = this.logic;\n\n // If there aren't logic, don't go further.\n if (logics.length === 0) {\n return;\n }\n var newComponent = (0, FormioUtils.fastCloneDeep)(this.originalComponent);\n var changed = logics.reduce(function (changed, logic) {\n var result = FormioUtils.checkTrigger(newComponent, logic.trigger, row, data, _this11.root ? _this11.root._form : {}, _this11);\n return (result ? _this11.applyActions(newComponent, logic.actions, result, row, data) : false) || changed;\n }, false);\n\n // If component definition changed, replace and mark as changed.\n if (!_lodash[\"default\"].isEqual(this.component, newComponent)) {\n this.component = newComponent;\n changed = true;\n var disabled = this.shouldDisabled;\n // Change disabled state if it has changed\n if (this.disabled !== disabled) {\n this.disabled = disabled;\n }\n }\n return changed;\n }\n }, {\n key: \"isIE\",\n value: function isIE() {\n if (typeof window === 'undefined') {\n return false;\n }\n var userAgent = window.navigator.userAgent;\n var msie = userAgent.indexOf('MSIE ');\n if (msie > 0) {\n // IE 10 or older => return version number\n return parseInt(userAgent.substring(msie + 5, userAgent.indexOf('.', msie)), 10);\n }\n var trident = userAgent.indexOf('Trident/');\n if (trident > 0) {\n // IE 11 => return version number\n var rv = userAgent.indexOf('rv:');\n return parseInt(userAgent.substring(rv + 3, userAgent.indexOf('.', rv)), 10);\n }\n var edge = userAgent.indexOf('Edge/');\n if (edge > 0) {\n // IE 12 (aka Edge) => return version number\n return parseInt(userAgent.substring(edge + 5, userAgent.indexOf('.', edge)), 10);\n }\n\n // other browser\n return false;\n }\n }, {\n key: \"defineActionValue\",\n value: function defineActionValue(action, argsObject) {\n return this.evaluate(action.value, argsObject, 'value');\n }\n }, {\n key: \"applyActions\",\n value: function applyActions(newComponent, actions, result, row, data) {\n var _this12 = this;\n data = data || this.rootValue;\n row = row || this.data;\n return actions.reduce(function (changed, action) {\n switch (action.type) {\n case 'property':\n {\n FormioUtils.setActionProperty(newComponent, action, result, row, data, _this12);\n var property = action.property.value;\n if (!_lodash[\"default\"].isEqual(_lodash[\"default\"].get(_this12.component, property), _lodash[\"default\"].get(newComponent, property))) {\n changed = true;\n }\n break;\n }\n case 'value':\n {\n var oldValue = _this12.getValue();\n var newValue = _this12.defineActionValue(action, {\n value: _lodash[\"default\"].clone(oldValue),\n data: data,\n row: row,\n component: newComponent,\n result: result\n });\n if (!_lodash[\"default\"].isEqual(oldValue, newValue) && !(_this12.component.clearOnHide && !_this12.visible)) {\n _this12.setValue(newValue);\n if (_this12.viewOnly) {\n _this12.dataValue = newValue;\n }\n changed = true;\n }\n break;\n }\n case 'mergeComponentSchema':\n {\n var schema = _this12.evaluate(action.schemaDefinition, {\n value: _lodash[\"default\"].clone(_this12.getValue()),\n data: data,\n row: row,\n component: newComponent,\n result: result\n }, 'schema');\n _lodash[\"default\"].assign(newComponent, schema);\n if (!_lodash[\"default\"].isEqual(_this12.component, newComponent)) {\n changed = true;\n }\n break;\n }\n case 'customAction':\n {\n var _oldValue = _this12.getValue();\n var _newValue = _this12.evaluate(action.customAction, {\n value: _lodash[\"default\"].clone(_oldValue),\n data: data,\n row: row,\n input: _oldValue,\n component: newComponent,\n result: result\n }, 'value');\n if (!_lodash[\"default\"].isEqual(_oldValue, _newValue) && !(_this12.component.clearOnHide && !_this12.visible)) {\n _this12.setValue(_newValue);\n if (_this12.viewOnly) {\n _this12.dataValue = _newValue;\n }\n changed = true;\n }\n break;\n }\n }\n return changed;\n }, false);\n }\n\n // Deprecated\n }, {\n key: \"addInputError\",\n value: function addInputError(message, dirty, elements) {\n this.addMessages(message);\n this.setErrorClasses(elements, dirty, !!message);\n }\n\n // Deprecated\n }, {\n key: \"removeInputError\",\n value: function removeInputError(elements) {\n this.setErrorClasses(elements, true, false);\n }\n\n /**\n * Add a new input error to this element.\n *\n * @param message\n * @param dirty\n */\n }, {\n key: \"addMessages\",\n value: function addMessages(messages) {\n var _this13 = this;\n if (!messages) {\n return;\n }\n\n // Standardize on array of objects for message.\n if (typeof messages === 'string') {\n messages = {\n messages: messages,\n level: 'error'\n };\n }\n if (!Array.isArray(messages)) {\n messages = [messages];\n }\n messages = _lodash[\"default\"].uniqBy(messages, function (message) {\n return message.message;\n });\n if (this.refs.messageContainer) {\n this.setContent(this.refs.messageContainer, messages.map(function (message) {\n if (message.message && typeof message.message === 'string') {\n message.message = message.message.replaceAll('<', '<').replaceAll('>', '>');\n }\n return _this13.renderTemplate('message', message);\n }).join(''));\n }\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(elements, dirty, hasErrors, hasMessages) {\n var _this14 = this;\n var element = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.element;\n this.clearErrorClasses();\n elements.forEach(function (element) {\n _this14.setElementInvalid(_this14.performInputMapping(element), false);\n });\n this.setInputWidgetErrorClasses(elements, hasErrors);\n if (hasErrors) {\n // Add error classes\n elements.forEach(function (input) {\n _this14.setElementInvalid(_this14.performInputMapping(input), true);\n });\n if (dirty && this.options.highlightErrors) {\n this.addClass(element, this.options.componentErrorClass);\n } else {\n this.addClass(element, 'has-error');\n }\n }\n if (hasMessages) {\n this.addClass(element, 'has-message');\n }\n }\n }, {\n key: \"setElementInvalid\",\n value: function setElementInvalid(element, invalid) {\n if (!element) return;\n if (invalid) {\n this.addClass(element, 'is-invalid');\n } else {\n this.removeClass(element, 'is-invalid');\n }\n element.setAttribute('aria-invalid', invalid ? 'true' : 'false');\n }\n }, {\n key: \"clearOnHide\",\n value: function clearOnHide() {\n // clearOnHide defaults to true for old forms (without the value set) so only trigger if the value is false.\n if (\n // if change happens inside EditGrid's row, it doesn't trigger change on the root level, so rootPristine will be true\n (!this.rootPristine || this.options.server || (0, FormioUtils.isInsideScopingComponent)(this)) && this.component.clearOnHide !== false && !this.options.readOnly && !this.options.showHiddenFields) {\n if (!this.visible) {\n this.deleteValue();\n } else if (!this.hasValue() && this.shouldAddDefaultValue) {\n // If shown, ensure the default is set.\n this.setValue(this.defaultValue, {\n noUpdateEvent: true\n });\n }\n }\n }\n }, {\n key: \"triggerRootChange\",\n value: function triggerRootChange() {\n if (this.options.onChange) {\n var _this$options2;\n (_this$options2 = this.options).onChange.apply(_this$options2, arguments);\n } else if (this.root) {\n var _this$root4;\n (_this$root4 = this.root).triggerChange.apply(_this$root4, arguments);\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(flags, fromRoot) {\n flags = flags || {};\n if (flags.modified) {\n if (!flags.noPristineChangeOnModified) {\n this.pristine = false;\n }\n this.addClass(this.getElement(), 'formio-modified');\n }\n\n // If we are supposed to validate on blur, then don't trigger validation yet.\n if (this.component.validateOn === 'blur' && !this.errors.length) {\n flags.noValidate = true;\n }\n if (this.component.onChange) {\n this.evaluate(this.component.onChange, {\n flags: flags\n });\n }\n\n // Set the changed variable.\n var changed = {\n instance: this,\n component: this.component,\n value: this.dataValue,\n flags: flags\n };\n\n // Emit the change.\n this.emit('componentChange', changed);\n\n // Do not propogate the modified flag.\n var modified = false;\n if (flags.modified) {\n modified = true;\n delete flags.modified;\n }\n\n // Bubble this change up to the top.\n if (!fromRoot) {\n this.triggerRootChange(flags, changed, modified);\n }\n return changed;\n }\n }, {\n key: \"wysiwygDefault\",\n get: function get() {\n return {\n quill: {\n theme: 'snow',\n placeholder: this.t(this.component.placeholder, {\n _userInput: true\n }),\n modules: {\n toolbar: [[{\n 'size': ['small', false, 'large', 'huge']\n }],\n // custom dropdown\n [{\n 'header': [1, 2, 3, 4, 5, 6, false]\n }], [{\n 'font': []\n }], ['bold', 'italic', 'underline', 'strike', {\n 'script': 'sub'\n }, {\n 'script': 'super'\n }, 'clean'], [{\n 'color': []\n }, {\n 'background': []\n }], [{\n 'list': 'ordered'\n }, {\n 'list': 'bullet'\n }, {\n 'indent': '-1'\n }, {\n 'indent': '+1'\n }, {\n 'align': []\n }], ['blockquote', 'code-block'], ['link', 'image', 'video', 'formula', 'source']]\n }\n },\n ace: {\n theme: 'ace/theme/xcode',\n maxLines: 12,\n minLines: 12,\n tabSize: 2,\n mode: 'ace/mode/javascript',\n placeholder: this.t(this.component.placeholder, {\n _userInput: true\n })\n },\n ckeditor: {\n image: {\n toolbar: ['imageTextAlternative', '|', 'imageStyle:full', 'imageStyle:alignLeft', 'imageStyle:alignCenter', 'imageStyle:alignRight'],\n styles: ['full', 'alignLeft', 'alignCenter', 'alignRight']\n },\n extraPlugins: []\n },\n \"default\": {}\n };\n }\n }, {\n key: \"addCKE\",\n value: function addCKE(element, settings, onChange) {\n settings = _lodash[\"default\"].isEmpty(settings) ? {} : settings;\n settings.base64Upload = this.component.isUploadEnabled ? false : true;\n settings.mediaEmbed = {\n previewsInData: true\n };\n settings = _lodash[\"default\"].merge(this.wysiwygDefault.ckeditor, _lodash[\"default\"].get(this.options, 'editors.ckeditor.settings', {}), settings);\n if (this.component.isUploadEnabled) {\n settings.extraPlugins.push((0, _uploadAdapter.getFormioUploadAdapterPlugin)(this.fileService, this));\n }\n return _Formio.GlobalFormio.requireLibrary('ckeditor', isIEBrowser ? 'CKEDITOR' : 'ClassicEditor', _lodash[\"default\"].get(this.options, 'editors.ckeditor.src', \"\".concat(_Formio.GlobalFormio.cdn.ckeditor, \"/ckeditor.js\")), true).then(function () {\n if (!element.parentNode) {\n return _nativePromiseOnly[\"default\"].reject();\n }\n if (isIEBrowser) {\n var editor = CKEDITOR.replace(element);\n editor.on('change', function () {\n return onChange(editor.getData());\n });\n return _nativePromiseOnly[\"default\"].resolve(editor);\n } else {\n return ClassicEditor.create(element, settings).then(function (editor) {\n editor.model.document.on('change', function () {\n return onChange(editor.data.get());\n });\n return editor;\n });\n }\n });\n }\n }, {\n key: \"addQuill\",\n value: function addQuill(element, settings, onChange) {\n var _this15 = this;\n settings = _lodash[\"default\"].isEmpty(settings) ? this.wysiwygDefault.quill : settings;\n settings = _lodash[\"default\"].merge(this.wysiwygDefault.quill, _lodash[\"default\"].get(this.options, 'editors.quill.settings', {}), settings);\n settings = _objectSpread(_objectSpread({}, settings), {}, {\n modules: _objectSpread({\n table: true\n }, settings.modules)\n });\n // Lazy load the quill css.\n _Formio.GlobalFormio.requireLibrary(\"quill-css-\".concat(settings.theme), 'Quill', [{\n type: 'styles',\n src: \"\".concat(_Formio.GlobalFormio.cdn.quill, \"/quill.\").concat(settings.theme, \".css\")\n }], true);\n\n // Lazy load the quill library.\n return _Formio.GlobalFormio.requireLibrary('quill', 'Quill', _lodash[\"default\"].get(this.options, 'editors.quill.src', \"\".concat(_Formio.GlobalFormio.cdn.quill, \"/quill.min.js\")), true).then(function () {\n return _Formio.GlobalFormio.requireLibrary('quill-table', 'Quill', \"\".concat(_Formio.GlobalFormio.cdn.baseUrl, \"/quill/quill-table.js\"), true).then(function () {\n if (!element.parentNode) {\n return _nativePromiseOnly[\"default\"].reject();\n }\n _this15.quill = new Quill(element, isIEBrowser ? _objectSpread(_objectSpread({}, settings), {}, {\n modules: {}\n }) : settings);\n\n /** This block of code adds the [source] capabilities. See https://codepen.io/anon/pen/ZyEjrQ **/\n var txtArea = document.createElement('textarea');\n txtArea.setAttribute('class', 'quill-source-code');\n _this15.quill.addContainer('ql-custom').appendChild(txtArea);\n var qlSource = element.parentNode.querySelector('.ql-source');\n if (qlSource) {\n _this15.addEventListener(qlSource, 'click', function (event) {\n event.preventDefault();\n if (txtArea.style.display === 'inherit') {\n _this15.quill.setContents(_this15.quill.clipboard.convert({\n html: txtArea.value\n }));\n }\n txtArea.style.display = txtArea.style.display === 'none' ? 'inherit' : 'none';\n });\n }\n /** END CODEBLOCK **/\n\n // Make sure to select cursor when they click on the element.\n _this15.addEventListener(element, 'click', function () {\n return _this15.quill.focus();\n });\n\n // Allows users to skip toolbar items when tabbing though form\n var elm = document.querySelectorAll('.ql-formats > button');\n for (var i = 0; i < elm.length; i++) {\n elm[i].setAttribute('tabindex', '-1');\n }\n _this15.quill.on('text-change', function () {\n txtArea.value = _this15.quill.root.innerHTML;\n onChange(txtArea);\n });\n return _this15.quill;\n });\n });\n }\n }, {\n key: \"shouldSanitizeValue\",\n get: function get() {\n var _this$options3;\n // Sanitize value if sanitizing for thw whole content is turned off\n return ((_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.sanitize) !== false;\n }\n }, {\n key: \"addAce\",\n value: function addAce(element, settings, onChange) {\n if (!settings || settings.theme === 'snow') {\n var mode = settings ? settings.mode : '';\n settings = {};\n if (mode) {\n settings.mode = mode;\n }\n }\n settings = _lodash[\"default\"].merge(this.wysiwygDefault.ace, _lodash[\"default\"].get(this.options, 'editors.ace.settings', {}), settings || {});\n return _Formio.GlobalFormio.requireLibrary('ace', 'ace', _lodash[\"default\"].get(this.options, 'editors.ace.src', \"\".concat(_Formio.GlobalFormio.cdn.ace, \"/ace.js\")), true).then(function (editor) {\n editor = editor.edit(element);\n editor.removeAllListeners('change');\n editor.setOptions(settings);\n editor.getSession().setMode(settings.mode);\n editor.on('change', function () {\n return onChange(editor.getValue());\n });\n if (settings.isUseWorkerDisabled) {\n editor.session.setUseWorker(false);\n }\n return editor;\n });\n }\n }, {\n key: \"tree\",\n get: function get() {\n return this.component.tree || false;\n }\n\n /**\n * The empty value for this component.\n *\n * @return {null}\n */\n }, {\n key: \"emptyValue\",\n get: function get() {\n return null;\n }\n\n /**\n * Returns if this component has a value set.\n *\n */\n }, {\n key: \"hasValue\",\n value: function hasValue(data) {\n return !_lodash[\"default\"].isUndefined(_lodash[\"default\"].get(data || this.data, this.key));\n }\n\n /**\n * Get the data value at the root level.\n *\n * @return {*}\n */\n }, {\n key: \"rootValue\",\n get: function get() {\n return this.root ? this.root.data : this.data;\n }\n }, {\n key: \"rootPristine\",\n get: function get() {\n return _lodash[\"default\"].get(this, 'root.pristine', false);\n }\n\n /**\n * Get the static value of this component.\n * @return {*}\n */\n }, {\n key: \"dataValue\",\n get: function get() {\n if (!this.key || !this.visible && this.component.clearOnHide && !this.rootPristine) {\n return this.emptyValue;\n }\n if (!this.hasValue() && this.shouldAddDefaultValue) {\n var empty = this.component.multiple ? [] : this.emptyValue;\n if (!this.rootPristine) {\n this.dataValue = empty;\n }\n return empty;\n }\n return _lodash[\"default\"].get(this._data, this.key);\n }\n\n /**\n * Sets the static value of this component.\n *\n * @param value\n */,\n set: function set(value) {\n if (!this.allowData || !this.key || !this.visible && this.component.clearOnHide && !this.rootPristine) {\n return;\n }\n if (value !== null && value !== undefined) {\n value = this.hook('setDataValue', value, this.key, this._data);\n }\n if (value === null || value === undefined) {\n this.unset();\n return;\n }\n _lodash[\"default\"].set(this._data, this.key, value);\n return;\n }\n\n /**\n * Splice a value from the dataValue.\n *\n * @param index\n */\n }, {\n key: \"splice\",\n value: function splice(index) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (this.hasValue()) {\n var dataValue = this.dataValue || [];\n if (_lodash[\"default\"].isArray(dataValue) && dataValue.hasOwnProperty(index)) {\n dataValue.splice(index, 1);\n this.dataValue = dataValue;\n this.triggerChange(flags);\n }\n }\n }\n }, {\n key: \"unset\",\n value: function unset() {\n _lodash[\"default\"].unset(this._data, this.key);\n }\n\n /**\n * Deletes the value of the component.\n */\n }, {\n key: \"deleteValue\",\n value: function deleteValue() {\n this.setValue(null, {\n noUpdateEvent: true,\n noDefault: true\n });\n this.unset();\n }\n }, {\n key: \"getCustomDefaultValue\",\n value: function getCustomDefaultValue(defaultValue) {\n if (this.component.customDefaultValue && !this.options.preview) {\n defaultValue = this.evaluate(this.component.customDefaultValue, {\n value: ''\n }, 'value');\n }\n return defaultValue;\n }\n }, {\n key: \"shouldAddDefaultValue\",\n get: function get() {\n return !this.options.noDefaults || this.component.defaultValue && !this.isEmpty(this.component.defaultValue) || this.component.customDefaultValue;\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var _this16 = this;\n var defaultValue = this.emptyValue;\n if (this.component.defaultValue) {\n defaultValue = this.component.defaultValue;\n }\n defaultValue = this.getCustomDefaultValue(defaultValue);\n var checkMask = function checkMask(value) {\n if (typeof value === 'string') {\n var placeholderChar = _this16.placeholderChar;\n value = (0, _vanillaTextMask.conformToMask)(value, _this16.defaultMask, {\n placeholderChar: placeholderChar\n }).conformedValue;\n if (!FormioUtils.matchInputMask(value, _this16.defaultMask)) {\n value = '';\n }\n } else {\n value = '';\n }\n return value;\n };\n if (this.defaultMask) {\n if (Array.isArray(defaultValue)) {\n defaultValue = defaultValue.map(checkMask);\n } else {\n defaultValue = checkMask(defaultValue);\n }\n }\n\n // Clone so that it creates a new instance.\n return _lodash[\"default\"].cloneDeep(defaultValue);\n }\n\n /**\n * Get the input value of this component.\n *\n * @return {*}\n */\n }, {\n key: \"getValue\",\n value: function getValue() {\n if (!this.hasInput || this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var values = [];\n for (var i in this.refs.input) {\n if (this.refs.input.hasOwnProperty(i)) {\n if (!this.component.multiple) {\n return this.getValueAt(i);\n }\n values.push(this.getValueAt(i));\n }\n }\n if (values.length === 0 && !this.component.multiple) {\n return '';\n }\n return values;\n }\n\n /**\n * Get the value at a specific index.\n *\n * @param index\n * @returns {*}\n */\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n var input = this.performInputMapping(this.refs.input[index]);\n return input ? input.value : undefined;\n }\n\n /**\n * Set the value of this component.\n *\n * @param value\n * @param flags\n *\n * @return {boolean} - If the value changed.\n */\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = this.updateValue(value, flags);\n value = this.dataValue;\n if (!this.hasInput) {\n return changed;\n }\n var isArray = Array.isArray(value);\n var valueInput = this.refs.fileLink || this.refs.input;\n if (isArray && Array.isArray(this.defaultValue) && this.refs.hasOwnProperty('input') && valueInput && valueInput.length !== value.length && this.visible) {\n this.redraw();\n }\n if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {\n this.redraw();\n return changed;\n }\n for (var i in this.refs.input) {\n if (this.refs.input.hasOwnProperty(i)) {\n this.setValueAt(i, isArray ? value[i] : value, flags);\n }\n }\n return changed;\n }\n\n /**\n * Set the value at a specific index.\n *\n * @param index\n * @param value\n */\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!flags.noDefault && (value === null || value === undefined) && !this.component.multiple) {\n value = this.defaultValue;\n }\n var input = this.performInputMapping(this.refs.input[index]);\n var valueMaskInput = this.refs.valueMaskInput;\n if (valueMaskInput !== null && valueMaskInput !== void 0 && valueMaskInput.mask) {\n valueMaskInput.mask.textMaskInputElement.update(value);\n }\n if (input.mask) {\n input.mask.textMaskInputElement.update(value);\n } else if (input.widget && input.widget.setValue) {\n input.widget.setValue(value);\n } else {\n input.value = value;\n }\n }\n }, {\n key: \"hasSetValue\",\n get: function get() {\n return this.hasValue() && !this.isEmpty(this.dataValue);\n }\n }, {\n key: \"setDefaultValue\",\n value: function setDefaultValue() {\n if (this.defaultValue && this.shouldAddDefaultValue) {\n var defaultValue = this.component.multiple && !this.dataValue.length ? [] : this.defaultValue;\n this.setValue(defaultValue, {\n noUpdateEvent: true\n });\n }\n }\n\n /**\n * Restore the value of a control.\n */\n }, {\n key: \"restoreValue\",\n value: function restoreValue() {\n if (this.hasSetValue) {\n this.setValue(this.dataValue, {\n noUpdateEvent: true\n });\n } else {\n this.setDefaultValue();\n }\n }\n\n /**\n * Normalize values coming into updateValue.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n if (this.component.multiple && !Array.isArray(value)) {\n value = value ? [value] : [];\n }\n return value;\n }\n\n /**\n * Update a value of this component.\n *\n * @param flags\n */\n }, {\n key: \"updateComponentValue\",\n value: function updateComponentValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var newValue = !flags.resetValue && (value === undefined || value === null) ? this.getValue() : value;\n newValue = this.normalizeValue(newValue, flags);\n var oldValue = this.dataValue;\n var changed = newValue !== undefined ? this.hasChanged(newValue, oldValue) : false;\n if (changed) {\n this.dataValue = newValue;\n changed = this.dataValue !== oldValue;\n this.updateOnChange(flags, changed);\n }\n if (this.componentModal && flags && flags.fromSubmission) {\n this.componentModal.setValue(value);\n }\n return changed;\n }\n\n /**\n * Updates the value of this component plus all sub-components.\n *\n * @param args\n * @return {boolean}\n */\n }, {\n key: \"updateValue\",\n value: function updateValue() {\n return this.updateComponentValue.apply(this, arguments);\n }\n }, {\n key: \"getIcon\",\n value: function getIcon(name, content, styles) {\n var ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'icon';\n return this.renderTemplate('icon', {\n className: this.iconClass(name),\n ref: ref,\n styles: styles,\n content: content\n });\n }\n\n /**\n * Resets the value of this component.\n */\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n this.unset();\n this.setValue(this.emptyValue, {\n noUpdateEvent: true,\n noValidate: true,\n resetValue: true\n });\n }\n\n /**\n * Determine if the value of this component has changed.\n *\n * @param newValue\n * @param oldValue\n * @return {boolean}\n */\n }, {\n key: \"hasChanged\",\n value: function hasChanged(newValue, oldValue) {\n if ((newValue === undefined || newValue === null) && (oldValue === undefined || oldValue === null || this.isEmpty(oldValue))) {\n return false;\n }\n // If we do not have a value and are getting set to anything other than undefined or null, then we changed.\n if (newValue !== undefined && newValue !== null && this.allowData && !this.hasValue()) {\n return true;\n }\n return !_lodash[\"default\"].isEqual(newValue, oldValue);\n }\n\n /**\n * Update the value on change.\n *\n * @param flags\n */\n }, {\n key: \"updateOnChange\",\n value: function updateOnChange() {\n var flags = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var changed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (!flags.noUpdateEvent && changed) {\n this.triggerChange(flags);\n return true;\n }\n return false;\n }\n\n /**\n * Perform a calculated value operation.\n *\n * @param data - The global data object.\n *\n * @return {boolean} - If the value changed during calculation.\n */\n }, {\n key: \"convertNumberOrBoolToString\",\n value: function convertNumberOrBoolToString(value) {\n if (typeof value === 'number' || typeof value === 'boolean') {\n return value.toString();\n }\n return value;\n }\n }, {\n key: \"doValueCalculation\",\n value: function doValueCalculation(dataValue, data, row) {\n var _this$root5;\n return this.evaluate(this.component.calculateValue, {\n value: dataValue,\n data: data,\n row: row || this.data,\n submission: ((_this$root5 = this.root) === null || _this$root5 === void 0 ? void 0 : _this$root5._submission) || {\n data: this.rootValue\n }\n }, 'value');\n }\n\n /* eslint-disable max-statements */\n }, {\n key: \"calculateComponentValue\",\n value: function calculateComponentValue(data, flags, row) {\n // Skip value calculation for the component if we don't have entire form data set or in builder mode\n if (this.builderMode || _lodash[\"default\"].isUndefined(_lodash[\"default\"].get(this, 'root.data'))) {\n return false;\n }\n // If no calculated value or\n // hidden and set to clearOnHide (Don't calculate a value for a hidden field set to clear when hidden)\n var clearOnHide = this.component.clearOnHide;\n var shouldBeCleared = !this.visible && clearOnHide;\n var allowOverride = _lodash[\"default\"].get(this.component, 'allowCalculateOverride', false);\n if (shouldBeCleared) {\n // remove calculated value so that the value is recalculated once component becomes visible\n if (this.hasOwnProperty('calculatedValue') && allowOverride) {\n _lodash[\"default\"].unset(this, 'calculatedValue');\n }\n return false;\n }\n\n // Handle all cases when calculated values should not fire.\n if (this.options.readOnly && !this.options.pdf && !this.component.calculateValue || !(this.component.calculateValue || this.component.calculateValueVariable) || this.options.server && !this.component.calculateServer || flags.dataSourceInitialLoading && allowOverride) {\n return false;\n }\n var dataValue = this.dataValue;\n // Calculate the new value.\n var calculatedValue = this.doValueCalculation(dataValue, data, row, flags);\n if (this.options.readOnly && dataValue && !calculatedValue) {\n return false;\n }\n if (_lodash[\"default\"].isNil(calculatedValue)) {\n calculatedValue = this.emptyValue;\n }\n var changed = !_lodash[\"default\"].isEqual(dataValue, calculatedValue);\n\n // Do not override calculations on server if they have calculateServer set.\n if (allowOverride) {\n // The value is considered locked if it is not empty and comes from a submission value.\n var fromSubmission = flags.fromSubmission && this.component.persistent === true;\n if (this.isEmpty(dataValue)) {\n // Reset the calculation lock if ever the data is cleared.\n this.calculationLocked = false;\n } else if (this.calculationLocked || fromSubmission) {\n this.calculationLocked = true;\n return false;\n }\n var firstPass = this.calculatedValue === undefined || flags.resetValue;\n if (firstPass) {\n this.calculatedValue = null;\n }\n var newCalculatedValue = this.normalizeValue(this.convertNumberOrBoolToString(calculatedValue));\n var previousCalculatedValue = this.normalizeValue(this.convertNumberOrBoolToString(this.calculatedValue));\n var normalizedDataValue = this.normalizeValue(this.convertNumberOrBoolToString(dataValue));\n var calculationChanged = !_lodash[\"default\"].isEqual(previousCalculatedValue, newCalculatedValue);\n var previousChanged = !_lodash[\"default\"].isEqual(normalizedDataValue, previousCalculatedValue);\n if (calculationChanged && previousChanged && !firstPass) {\n return false;\n }\n\n // Check to ensure that the calculated value is different than the previously calculated value.\n if (previousCalculatedValue && previousChanged && !calculationChanged) {\n this.calculatedValue = null;\n return false;\n }\n if (flags.isReordered || !calculationChanged) {\n return false;\n }\n if (fromSubmission) {\n // If we set value from submission and it differs from calculated one, set the calculated value to prevent overriding dataValue in the next pass\n this.calculatedValue = (0, FormioUtils.fastCloneDeep)(calculatedValue);\n return false;\n }\n\n // If this is the firstPass, and the dataValue is different than to the calculatedValue.\n if (firstPass && !this.isEmpty(dataValue) && changed && calculationChanged) {\n // Return that we have a change so it will perform another pass.\n return true;\n }\n }\n this.calculatedValue = (0, FormioUtils.fastCloneDeep)(calculatedValue);\n if (changed) {\n if (!flags.noPristineChangeOnModified && this.root.initialized) {\n this.pristine = false;\n }\n flags.triggeredComponentId = this.id;\n return this.setValue(calculatedValue, flags);\n }\n return false;\n }\n /* eslint-enable max-statements */\n\n /**\n * Performs calculations in this component plus any child components.\n *\n * @param args\n * @return {boolean}\n */\n }, {\n key: \"calculateValue\",\n value: function calculateValue(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n return this.calculateComponentValue(data, flags, row);\n }\n\n /**\n * Get this component's label text.\n *\n */\n }, {\n key: \"label\",\n get: function get() {\n return this.component.label;\n }\n\n /**\n * Set this component's label text and render it.\n *\n * @param value - The new label text.\n */,\n set: function set(value) {\n this.component.label = value;\n if (this.labelElement) {\n this.labelElement.innerText = value;\n }\n }\n\n /**\n * Get FormioForm element at the root of this component tree.\n *\n */\n }, {\n key: \"getRoot\",\n value: function getRoot() {\n return this.root;\n }\n\n /**\n * Returns the invalid message, or empty string if the component is valid.\n *\n * @param data\n * @param dirty\n * @return {*}\n */\n }, {\n key: \"invalidMessage\",\n value: function invalidMessage(data, dirty, ignoreCondition, row) {\n if (!ignoreCondition && !this.checkCondition(row, data)) {\n return '';\n }\n\n // See if this is forced invalid.\n if (this.invalid) {\n return this.invalid;\n }\n\n // No need to check for errors if there is no input or if it is pristine.\n if (!this.hasInput || !dirty && this.pristine) {\n return '';\n }\n return _lodash[\"default\"].map(_Validator[\"default\"].checkComponent(this, data), 'message').join('\\n\\n');\n }\n\n /**\n * Returns if the component is valid or not.\n *\n * @param data\n * @param dirty\n * @return {boolean}\n */\n }, {\n key: \"isValid\",\n value: function isValid(data, dirty) {\n return !this.invalidMessage(data, dirty);\n }\n }, {\n key: \"setComponentValidity\",\n value: function setComponentValidity(messages, dirty, silentCheck) {\n var hasErrors = !!messages.filter(function (message) {\n return message.level === 'error' && !message.fromServer;\n }).length;\n if (messages.length && (!silentCheck || this.error) && (!this.isEmpty(this.defaultValue) || dirty || !this.pristine)) {\n this.setCustomValidity(messages, dirty);\n } else if (!silentCheck) {\n this.setCustomValidity('');\n }\n return !hasErrors;\n }\n\n /**\n * Checks the validity of this component and sets the error message if it is invalid.\n *\n * @param data\n * @param dirty\n * @param row\n * @return {boolean}\n */\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, row) {\n var _this$serverErrors,\n _this17 = this;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n data = data || this.rootValue;\n row = row || this.data;\n var _options$async = options.async,\n async = _options$async === void 0 ? false : _options$async,\n _options$silentCheck = options.silentCheck,\n silentCheck = _options$silentCheck === void 0 ? false : _options$silentCheck;\n if (this.shouldSkipValidation(data, dirty, row)) {\n this.setCustomValidity('');\n return async ? _nativePromiseOnly[\"default\"].resolve(true) : true;\n }\n var check = _Validator[\"default\"].checkComponent(this, data, row, true, async);\n var validations = check;\n if ((_this$serverErrors = this.serverErrors) !== null && _this$serverErrors !== void 0 && _this$serverErrors.length) {\n validations = check.concat(this.serverErrors);\n }\n return async ? validations.then(function (messages) {\n return _this17.setComponentValidity(messages, dirty, silentCheck);\n }) : this.setComponentValidity(validations, dirty, silentCheck);\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n data = data || this.rootValue;\n row = row || this.data;\n var isValid = this.checkComponentValidity(data, dirty, row, {\n silentCheck: silentCheck\n });\n this.checkModal();\n return isValid;\n }\n }, {\n key: \"checkAsyncValidity\",\n value: function checkAsyncValidity(data, dirty, row, silentCheck) {\n return _nativePromiseOnly[\"default\"].resolve(this.checkComponentValidity(data, dirty, row, {\n async: true,\n silentCheck: silentCheck\n }));\n }\n\n /**\n * Check the conditions, calculations, and validity of a single component and triggers an update if\n * something changed.\n *\n * @param data - The root data of the change event.\n * @param flags - The flags from this change event.\n *\n * @return boolean - If component is valid or not.\n */\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row) {\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n\n // Needs for Nextgen Rules Engine\n this.resetCaches();\n\n // Do not trigger refresh if change was triggered on blur event since components with Refresh on Blur have their own listeners\n if (!flags.fromBlur) {\n this.checkRefreshOn(flags.changes, flags);\n }\n if (flags.noCheck) {\n return true;\n }\n this.checkComponentConditions(data, flags, row);\n if (this.id !== flags.triggeredComponentId) {\n this.calculateComponentValue(data, flags, row);\n }\n if (flags.noValidate && !flags.validateOnInit && !flags.fromIframe) {\n if (flags.fromSubmission && this.rootPristine && this.pristine && this.error && flags.changed) {\n this.checkComponentValidity(data, !!this.options.alwaysDirty, row, true);\n }\n return true;\n }\n var isDirty = false;\n\n // We need to set dirty if they explicitly set noValidate to false.\n if (this.options.alwaysDirty || flags.dirty) {\n isDirty = true;\n }\n\n // See if they explicitely set the values with setSubmission.\n if (flags.fromSubmission && this.hasValue(data)) {\n isDirty = true;\n }\n this.setDirty(isDirty);\n if (this.component.validateOn === 'blur' && flags.fromSubmission) {\n return true;\n }\n var isValid = this.checkComponentValidity(data, isDirty, row, flags);\n this.checkModal();\n return isValid;\n }\n }, {\n key: \"checkModal\",\n value: function checkModal() {\n var isValid = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var dirty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (!this.component.modalEdit || !this.componentModal) {\n return;\n }\n if (dirty && !isValid) {\n this.setErrorClasses([this.refs.openModal], dirty, !isValid, !!this.errors.length, this.refs.openModalWrapper);\n } else {\n this.clearErrorClasses(this.refs.openModalWrapper);\n }\n }\n }, {\n key: \"validationValue\",\n get: function get() {\n return this.dataValue;\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n var isEmptyArray = _lodash[\"default\"].isArray(value) && value.length === 1 ? _lodash[\"default\"].isEqual(value[0], this.emptyValue) : false;\n return value == null || value.length === 0 || _lodash[\"default\"].isEqual(value, this.emptyValue) || isEmptyArray;\n }\n }, {\n key: \"isEqual\",\n value: function isEqual(valueA) {\n var valueB = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dataValue;\n return this.isEmpty(valueA) && this.isEmpty(valueB) || _lodash[\"default\"].isEqual(valueA, valueB);\n }\n\n /**\n * Check if a component is eligible for multiple validation\n *\n * @return {boolean}\n */\n }, {\n key: \"validateMultiple\",\n value: function validateMultiple() {\n return true;\n }\n }, {\n key: \"errors\",\n get: function get() {\n return this.error ? [this.error] : [];\n }\n }, {\n key: \"clearErrorClasses\",\n value: function clearErrorClasses() {\n var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.element;\n this.removeClass(element, this.options.componentErrorClass);\n this.removeClass(element, 'alert alert-danger');\n this.removeClass(element, 'has-error');\n this.removeClass(element, 'has-message');\n }\n }, {\n key: \"setInputWidgetErrorClasses\",\n value: function setInputWidgetErrorClasses(inputRefs, hasErrors) {\n if (!this.isInputComponent || !this.component.widget || !(inputRefs !== null && inputRefs !== void 0 && inputRefs.length)) {\n return;\n }\n inputRefs.forEach(function (input) {\n if (input !== null && input !== void 0 && input.widget && input.widget.setErrorClasses) {\n input.widget.setErrorClasses(hasErrors);\n }\n });\n }\n }, {\n key: \"addFocusBlurEvents\",\n value: function addFocusBlurEvents(element) {\n var _this18 = this;\n this.addEventListener(element, 'focus', function () {\n if (_this18.root.focusedComponent !== _this18) {\n if (_this18.root.pendingBlur) {\n _this18.root.pendingBlur();\n }\n _this18.root.focusedComponent = _this18;\n _this18.emit('focus', _this18);\n } else if (_this18.root.focusedComponent === _this18 && _this18.root.pendingBlur) {\n _this18.root.pendingBlur.cancel();\n _this18.root.pendingBlur = null;\n }\n });\n this.addEventListener(element, 'blur', function () {\n _this18.root.pendingBlur = FormioUtils.delay(function () {\n _this18.emit('blur', _this18);\n if (_this18.component.validateOn === 'blur') {\n _this18.root.triggerChange({\n fromBlur: true\n }, {\n instance: _this18,\n component: _this18.component,\n value: _this18.dataValue,\n flags: {\n fromBlur: true\n }\n });\n }\n _this18.root.focusedComponent = null;\n _this18.root.pendingBlur = null;\n });\n });\n }\n }, {\n key: \"setCustomValidity\",\n value: function setCustomValidity(messages, dirty, external) {\n var _this19 = this;\n var inputRefs = this.isInputComponent ? this.refs.input || [] : null;\n if (typeof messages === 'string' && messages) {\n messages = {\n level: 'error',\n message: messages\n };\n }\n if (!Array.isArray(messages)) {\n if (messages) {\n messages = [messages];\n } else {\n messages = [];\n }\n }\n var hasErrors = !!messages.filter(function (message) {\n return message.level === 'error';\n }).length;\n var invalidInputRefs = inputRefs;\n if (this.component.multiple) {\n var inputRefsArray = Array.from(inputRefs);\n inputRefsArray.forEach(function (input) {\n _this19.setElementInvalid(_this19.performInputMapping(input), false);\n });\n this.setInputWidgetErrorClasses(inputRefsArray, false);\n invalidInputRefs = inputRefsArray.filter(function (ref) {\n var _messages$some, _messages;\n return (_messages$some = (_messages = messages).some) === null || _messages$some === void 0 ? void 0 : _messages$some.call(_messages, function (msg) {\n var _msg$context;\n return (msg === null || msg === void 0 ? void 0 : (_msg$context = msg.context) === null || _msg$context === void 0 ? void 0 : _msg$context.input) === ref;\n });\n });\n }\n if (messages.length) {\n if (this.refs.messageContainer) {\n this.empty(this.refs.messageContainer);\n }\n this.error = {\n component: this.component,\n message: messages[0].message,\n messages: messages,\n external: !!external\n };\n this.emit('componentError', this.error);\n this.addMessages(messages, dirty, invalidInputRefs);\n if (invalidInputRefs) {\n this.setErrorClasses(invalidInputRefs, dirty, hasErrors, !!messages.length);\n }\n } else if (!this.error || this.error && this.error.external === !!external) {\n if (this.refs.messageContainer) {\n this.empty(this.refs.messageContainer);\n }\n if (this.refs.modalMessageContainer) {\n this.empty(this.refs.modalMessageContainer);\n }\n this.error = null;\n if (invalidInputRefs) {\n this.setErrorClasses(invalidInputRefs, dirty, hasErrors, !!messages.length);\n }\n this.clearErrorClasses();\n }\n\n // if (!this.refs.input) {\n // return;\n // }\n // this.refs.input.forEach(input => {\n // input = this.performInputMapping(input);\n // if (typeof input.setCustomValidity === 'function') {\n // input.setCustomValidity(message, dirty);\n // }\n // });\n }\n\n /**\n * Determines if the value of this component is hidden from the user as if it is coming from the server, but is\n * protected.\n *\n * @return {boolean|*}\n */\n }, {\n key: \"isValueHidden\",\n value: function isValueHidden() {\n if (this.component[\"protected\"] && this.root.editing) {\n return false;\n }\n if (!this.root || !this.root.hasOwnProperty('editing')) {\n return false;\n }\n if (!this.root || !this.root.editing) {\n return false;\n }\n return this.component[\"protected\"] || !this.component.persistent || this.component.persistent === 'client-only';\n }\n }, {\n key: \"shouldSkipValidation\",\n value: function shouldSkipValidation(data, dirty, row) {\n var _this20 = this;\n var rules = [\n // Force valid if component is read-only\n function () {\n return _this20.options.readOnly;\n },\n // Do not check validations if component is not an input component.\n function () {\n return !_this20.hasInput;\n },\n // Check to see if we are editing and if so, check component persistence.\n function () {\n return _this20.isValueHidden();\n },\n // Force valid if component is hidden.\n function () {\n return !_this20.visible;\n },\n // Force valid if component is conditionally hidden.\n function () {\n return !_this20.checkCondition(row, data);\n }];\n return rules.some(function (pred) {\n return pred();\n });\n }\n\n // Maintain reverse compatibility.\n }, {\n key: \"whenReady\",\n value: function whenReady() {\n console.warn('The whenReady() method has been deprecated. Please use the dataReady property instead.');\n return this.dataReady;\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n\n /**\n * Prints out the value of this component as a string value.\n */\n }, {\n key: \"asString\",\n value: function asString(value) {\n value = value || this.getValue();\n return (Array.isArray(value) ? value : [value]).map(_lodash[\"default\"].toString).join(', ');\n }\n\n /**\n * Return if the component is disabled.\n * @return {boolean}\n */\n }, {\n key: \"disabled\",\n get: function get() {\n return this._disabled || this.parentDisabled;\n }\n\n /**\n * Disable this component.\n *\n * @param {boolean} disabled\n */,\n set: function set(disabled) {\n this._disabled = disabled;\n }\n }, {\n key: \"setDisabled\",\n value: function setDisabled(element, disabled) {\n if (!element) {\n return;\n }\n element.disabled = disabled;\n if (disabled) {\n element.setAttribute('disabled', 'disabled');\n } else {\n element.removeAttribute('disabled');\n }\n }\n }, {\n key: \"setLoading\",\n value: function setLoading(element, loading) {\n if (!element || element.loading === loading) {\n return;\n }\n element.loading = loading;\n if (!element.loader && loading) {\n element.loader = this.ce('i', {\n \"class\": \"\".concat(this.iconClass('refresh', true), \" button-icon-right\")\n });\n }\n if (element.loader) {\n if (loading) {\n this.appendTo(element.loader, element);\n } else {\n this.removeChildFrom(element.loader, element);\n }\n }\n }\n }, {\n key: \"selectOptions\",\n value: function selectOptions(select, tag, options, defaultValue) {\n var _this21 = this;\n _lodash[\"default\"].each(options, function (option) {\n var attrs = {\n value: option.value\n };\n if (defaultValue !== undefined && option.value === defaultValue) {\n attrs.selected = 'selected';\n }\n var optionElement = _this21.ce('option', attrs);\n optionElement.appendChild(_this21.text(option.label));\n select.appendChild(optionElement);\n });\n }\n }, {\n key: \"setSelectValue\",\n value: function setSelectValue(select, value) {\n var options = select.querySelectorAll('option');\n _lodash[\"default\"].each(options, function (option) {\n if (option.value === value) {\n option.setAttribute('selected', 'selected');\n } else {\n option.removeAttribute('selected');\n }\n });\n if (select.onchange) {\n select.onchange();\n }\n if (select.onselect) {\n select.onselect();\n }\n }\n }, {\n key: \"getRelativePath\",\n value: function getRelativePath(path) {\n var keyPart = \".\".concat(this.key);\n var thisPath = this.isInputComponent ? this.path : this.path.slice(0).replace(keyPart, '');\n return path.replace(thisPath, '');\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.detach();\n this.empty(this.getElement());\n }\n }, {\n key: \"append\",\n value: function append(element) {\n this.appendTo(element, this.element);\n }\n }, {\n key: \"prepend\",\n value: function prepend(element) {\n this.prependTo(element, this.element);\n }\n }, {\n key: \"removeChild\",\n value: function removeChild(element) {\n this.removeChildFrom(element, this.element);\n }\n }, {\n key: \"detachLogic\",\n value: function detachLogic() {\n var _this22 = this;\n this.logic.forEach(function (logic) {\n if (logic.trigger.type === 'event') {\n var event = _this22.interpolate(logic.trigger.event);\n _this22.off(event); // only applies to callbacks on this component\n }\n });\n }\n }, {\n key: \"attachLogic\",\n value: function attachLogic() {\n var _this23 = this;\n // Do not attach logic during builder mode.\n if (this.builderMode) {\n return;\n }\n this.logic.forEach(function (logic) {\n if (logic.trigger.type === 'event') {\n var event = _this23.interpolate(logic.trigger.event);\n _this23.on(event, function () {\n var newComponent = (0, FormioUtils.fastCloneDeep)(_this23.originalComponent);\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n if (_this23.applyActions(newComponent, logic.actions, args)) {\n // If component definition changed, replace it.\n if (!_lodash[\"default\"].isEqual(_this23.component, newComponent)) {\n _this23.component = newComponent;\n var visible = _this23.conditionallyVisible(null, null);\n var disabled = _this23.shouldDisabled;\n\n // Change states which won't be recalculated during redrawing\n if (_this23.visible !== visible) {\n _this23.visible = visible;\n }\n if (_this23.disabled !== disabled) {\n _this23.disabled = disabled;\n }\n _this23.redraw();\n }\n }\n }, true);\n }\n });\n }\n\n /**\n * Get the element information.\n */\n }, {\n key: \"elementInfo\",\n value: function elementInfo() {\n var attributes = {\n name: this.options.name,\n type: this.component.inputType || 'text',\n \"class\": 'form-control',\n lang: this.options.language\n };\n if (this.component.placeholder) {\n attributes.placeholder = this.t(this.component.placeholder, {\n _userInput: true\n });\n }\n if (this.component.tabindex) {\n attributes.tabindex = this.component.tabindex;\n }\n if (this.disabled) {\n attributes.disabled = 'disabled';\n }\n _lodash[\"default\"].defaults(attributes, this.component.attributes);\n return {\n type: 'input',\n component: this.component,\n changeEvent: 'change',\n attr: attributes\n };\n }\n }, {\n key: \"autofocus\",\n value: function autofocus() {\n var _this24 = this;\n var hasAutofocus = this.component.autofocus && !this.builderMode && !this.options.preview;\n if (hasAutofocus) {\n this.on('render', function () {\n return _this24.focus();\n }, true);\n }\n }\n }, {\n key: \"scrollIntoView\",\n value: function scrollIntoView() {\n var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.element;\n if (!element) {\n return;\n }\n var _element$getBoundingC = element.getBoundingClientRect(),\n left = _element$getBoundingC.left,\n top = _element$getBoundingC.top;\n window.scrollTo(left + window.scrollX, top + window.scrollY);\n }\n }, {\n key: \"focus\",\n value: function focus(index) {\n var _this$refs$input2;\n if ('beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n if ((_this$refs$input2 = this.refs.input) !== null && _this$refs$input2 !== void 0 && _this$refs$input2.length) {\n var _this$component$widge;\n var focusingInput = typeof index === 'number' && this.refs.input[index] ? this.refs.input[index] : this.refs.input[this.refs.input.length - 1];\n if (((_this$component$widge = this.component.widget) === null || _this$component$widge === void 0 ? void 0 : _this$component$widge.type) === 'calendar') {\n var sibling = focusingInput.nextSibling;\n if (sibling) {\n sibling.focus();\n }\n } else {\n focusingInput.focus();\n }\n }\n if (this.refs.openModal) {\n this.refs.openModal.focus();\n }\n if (this.parent.refs.openModal) {\n this.parent.refs.openModal.focus();\n }\n }\n\n /**\n * Get `Formio` instance for working with files\n */\n }, {\n key: \"fileService\",\n get: function get() {\n if (this.options.fileService) {\n return this.options.fileService;\n }\n if (this.options.formio) {\n return this.options.formio;\n }\n if (this.root && this.root.formio) {\n return this.root.formio;\n }\n var formio = new _Formio.GlobalFormio();\n // If a form is loaded, then make sure to set the correct formUrl.\n if (this.root && this.root._form && this.root._form._id) {\n formio.formUrl = \"\".concat(formio.projectUrl, \"/form/\").concat(this.root._form._id);\n }\n return formio;\n }\n }, {\n key: \"resetCaches\",\n value: function resetCaches() {}\n }, {\n key: \"previewMode\",\n get: function get() {\n return false;\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len5 = arguments.length, sources = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n sources[_key5] = arguments[_key5];\n }\n return _lodash[\"default\"].merge.apply(_lodash[\"default\"], [{\n /**\n * Determines if this component provides an input.\n */\n input: true,\n /**\n * The data key for this component (how the data is stored in the database).\n */\n key: '',\n /**\n * The input placeholder for this component.\n */\n placeholder: '',\n /**\n * The input prefix\n */\n prefix: '',\n /**\n * The custom CSS class to provide to this component.\n */\n customClass: '',\n /**\n * The input suffix.\n */\n suffix: '',\n /**\n * If this component should allow an array of values to be captured.\n */\n multiple: false,\n /**\n * The default value of this component.\n */\n defaultValue: null,\n /**\n * If the data of this component should be protected (no GET api requests can see the data)\n */\n \"protected\": false,\n /**\n * Validate if the value of this component should be unique within the form.\n */\n unique: false,\n /**\n * If the value of this component should be persisted within the backend api database.\n */\n persistent: true,\n /**\n * Determines if the component should be within the form, but not visible.\n */\n hidden: false,\n /**\n * If the component should be cleared when hidden.\n */\n clearOnHide: true,\n /**\n * This will refresh this component options when this field changes.\n */\n refreshOn: '',\n /**\n * This will redraw the component when this field changes.\n */\n redrawOn: '',\n /**\n * If this component should be included as a column within a submission table.\n */\n tableView: false,\n /**\n * If this component should be rendering in modal.\n */\n modalEdit: false,\n /**\n * The input label provided to this component.\n */\n label: '',\n dataGridLabel: false,\n labelPosition: 'top',\n description: '',\n errorLabel: '',\n tooltip: '',\n hideLabel: false,\n tabindex: '',\n disabled: false,\n autofocus: false,\n dbIndex: false,\n customDefaultValue: '',\n calculateValue: '',\n calculateServer: false,\n widget: null,\n /**\n * Attributes that will be assigned to the input elements of this component.\n */\n attributes: {},\n /**\n * This will perform the validation on either \"change\" or \"blur\" of the input element.\n */\n validateOn: 'change',\n /**\n * The validation criteria for this component.\n */\n validate: {\n /**\n * If this component is required.\n */\n required: false,\n /**\n * Custom JavaScript validation.\n */\n custom: '',\n /**\n * If the custom validation should remain private (only the backend will see it and execute it).\n */\n customPrivate: false,\n /**\n * If this component should implement a strict date validation if the Calendar widget is implemented.\n */\n strictDateValidation: false,\n multiple: false,\n unique: false\n },\n /**\n * The simple conditional settings for a component.\n */\n conditional: {\n show: null,\n when: null,\n eq: ''\n },\n overlay: {\n style: '',\n left: '',\n top: '',\n width: '',\n height: ''\n },\n allowCalculateOverride: false,\n encrypted: false,\n showCharCount: false,\n showWordCount: false,\n properties: {},\n allowMultipleMasks: false,\n addons: []\n }].concat(sources));\n }\n\n /**\n * Return the validator as part of the component.\n *\n * @return {ValidationChecker}\n * @constructor\n */\n }, {\n key: \"Validator\",\n get: function get() {\n return _Validator[\"default\"];\n }\n /**\n * Return the simple condition settings as part of the component.\n *\n * @return {Object}\n *\n */\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return {\n operators: ['isEqual', 'isNotEqual', 'isEmpty', 'isNotEmpty'],\n valueComponent: function valueComponent() {\n return {\n type: 'textfield'\n };\n }\n };\n }\n /**\n * Return the array of possible types of component value absed on its schema.\n *\n * @param schema\n * @return {Array}\n *\n */\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n schema = schema || {};\n return FormioUtils.getComponentSavedTypes(schema) || [FormioUtils.componentValueTypes.any];\n }\n /**\n * Provides a table view for this component. Override if you wish to do something different than using getView\n * method of your instance.\n *\n * @param value\n * @param options\n */\n /* eslint-disable no-unused-vars */\n }, {\n key: \"tableView\",\n value: function tableView(value, options) {}\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return Component.conditionOperatorsSettings;\n }\n }]);\n return Component;\n}(_Element2[\"default\"]);\nexports[\"default\"] = Component;\nComponent.externalLibraries = {};\nComponent.requireLibrary = function (name, property, src, polling) {\n if (!Component.externalLibraries.hasOwnProperty(name)) {\n Component.externalLibraries[name] = {};\n Component.externalLibraries[name].ready = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n Component.externalLibraries[name].resolve = resolve;\n Component.externalLibraries[name].reject = reject;\n });\n var callbackName = \"\".concat(name, \"Callback\");\n if (!polling && !window[callbackName]) {\n window[callbackName] = function () {\n this.resolve();\n }.bind(Component.externalLibraries[name]);\n }\n // See if the plugin already exists.\n var plugin = _lodash[\"default\"].get(window, property);\n if (plugin) {\n Component.externalLibraries[name].resolve(plugin);\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 };\n break;\n case 'styles':\n elementType = 'link';\n attrs = {\n href: lib.src,\n rel: 'stylesheet'\n };\n break;\n }\n\n // Add the script to the top page.\n var script = document.createElement(elementType);\n for (var attr in attrs) {\n script.setAttribute(attr, attrs[attr]);\n }\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n\n // if no callback is provided, then check periodically for the script.\n if (polling) {\n setTimeout(function checkLibrary() {\n var plugin = _lodash[\"default\"].get(window, property);\n if (plugin) {\n Component.externalLibraries[name].resolve(plugin);\n } else {\n // check again after 200 ms.\n setTimeout(checkLibrary, 200);\n }\n }, 200);\n }\n }\n }\n return Component.externalLibraries[name].ready;\n};\nComponent.libraryReady = function (name) {\n if (Component.externalLibraries.hasOwnProperty(name) && Component.externalLibraries[name].ready) {\n return Component.externalLibraries[name].ready;\n }\n return _nativePromiseOnly[\"default\"].reject(\"\".concat(name, \" library was not required.\"));\n};\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/component/Component.js?"); /***/ }), @@ -433,7 +433,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.number.parse-int.js */ \"./node_modules/core-js/modules/es.number.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.array.every.js */ \"./node_modules/core-js/modules/es.array.every.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _Components = _interopRequireDefault(__webpack_require__(/*! ../../Components */ \"./lib/components/Components.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _utils = __webpack_require__(/*! ../../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar NestedComponent = /*#__PURE__*/function (_Field) {\n _inherits(NestedComponent, _Field);\n var _super = _createSuper(NestedComponent);\n function NestedComponent(component, options, data) {\n var _this;\n _classCallCheck(this, NestedComponent);\n _this = _super.call(this, component, options, data);\n _this.type = 'components';\n _this._collapsed = !!_this.component.collapsed;\n return _this;\n }\n _createClass(NestedComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return NestedComponent.schema();\n }\n }, {\n key: \"schema\",\n get: function get() {\n var schema = _get(_getPrototypeOf(NestedComponent.prototype), \"schema\", this);\n var components = _lodash[\"default\"].uniqBy(this.getComponents(), 'component.key');\n schema.components = _lodash[\"default\"].map(components, 'schema');\n return schema;\n }\n }, {\n key: \"collapsed\",\n get: function get() {\n return this._collapsed;\n },\n set: function set(value) {\n this._collapsed = value;\n this.collapse(value);\n }\n }, {\n key: \"collapse\",\n value: function collapse(value) {\n var promise = this.redraw();\n if (!value) {\n this.checkValidity(this.data, !this.pristine, null, this.pristine);\n }\n return promise;\n }\n }, {\n key: \"visible\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"visible\", this);\n },\n set: function set(value) {\n // DO NOT CALL super here. There is an issue where clearOnHide was getting triggered with\n // subcomponents because the \"parentVisible\" flag was set to false when it should really be\n // set to true.\n var visibilityChanged = this._visible !== value;\n this._visible = value;\n var isVisible = this.visible;\n var forceShow = this.shouldForceShow();\n var forceHide = this.shouldForceHide();\n this.components.forEach(function (component) {\n // Set the parent visibility first since we may have nested components within nested components\n // and they need to be able to determine their visibility based on the parent visibility.\n component.parentVisible = isVisible;\n var conditionallyVisible = component.conditionallyVisible();\n if (forceShow || conditionallyVisible) {\n component.visible = true;\n } else if (forceHide || !isVisible || !conditionallyVisible) {\n component.visible = false;\n }\n // If hiding a nested component, clear all errors below.\n if (!component.visible) {\n component.error = '';\n }\n });\n if (visibilityChanged) {\n this.clearOnHide();\n this.redraw();\n }\n }\n }, {\n key: \"parentVisible\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"parentVisible\", this);\n },\n set: function set(value) {\n var _this2 = this;\n _set(_getPrototypeOf(NestedComponent.prototype), \"parentVisible\", value, this, true);\n this.components.forEach(function (component) {\n return component.parentVisible = _this2.visible;\n });\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(NestedComponent.prototype), \"disabled\", disabled, this, true);\n this.components.forEach(function (component) {\n return component.parentDisabled = disabled;\n });\n }\n }, {\n key: \"parentDisabled\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"parentDisabled\", this);\n },\n set: function set(value) {\n var _this3 = this;\n _set(_getPrototypeOf(NestedComponent.prototype), \"parentDisabled\", value, this, true);\n this.components.forEach(function (component) {\n component.parentDisabled = _this3.disabled;\n });\n }\n }, {\n key: \"ready\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (component) {\n return component.ready;\n }));\n }\n }, {\n key: \"currentForm\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"currentForm\", this);\n },\n set: function set(instance) {\n _set(_getPrototypeOf(NestedComponent.prototype), \"currentForm\", instance, this, true);\n this.getComponents().forEach(function (component) {\n component.currentForm = instance;\n });\n }\n }, {\n key: \"rowIndex\",\n get: function get() {\n return this._rowIndex;\n },\n set: function set(value) {\n this._rowIndex = value;\n this.eachComponent(function (component) {\n component.rowIndex = value;\n });\n }\n }, {\n key: \"componentContext\",\n value: function componentContext() {\n return this._data;\n }\n }, {\n key: \"data\",\n get: function get() {\n return this._data;\n },\n set: function set(value) {\n var _this4 = this;\n this._data = value;\n this.eachComponent(function (component) {\n component.data = _this4.componentContext(component);\n });\n }\n }, {\n key: \"getComponents\",\n value: function getComponents() {\n return this.components || [];\n }\n\n /**\n * Perform a deep iteration over every component, including those\n * within other container based components.\n *\n * @param {function} fn - Called for every component.\n */\n }, {\n key: \"everyComponent\",\n value: function everyComponent(fn, options) {\n var components = this.getComponents();\n _lodash[\"default\"].each(components, function (component, index) {\n if (fn(component, components, index) === false) {\n return false;\n }\n if (typeof component.everyComponent === 'function') {\n if (component.everyComponent(fn, options) === false) {\n return false;\n }\n }\n });\n }\n }, {\n key: \"hasComponent\",\n value: function hasComponent(component) {\n var result = false;\n this.everyComponent(function (comp) {\n if (comp === component) {\n result = true;\n return false;\n }\n });\n return result;\n }\n }, {\n key: \"flattenComponents\",\n value: function flattenComponents() {\n var result = {};\n this.everyComponent(function (component) {\n result[component.component.flattenAs || component.key] = component;\n });\n return result;\n }\n\n /**\n * Perform an iteration over each component within this container component.\n *\n * @param {function} fn - Called for each component\n */\n }, {\n key: \"eachComponent\",\n value: function eachComponent(fn) {\n _lodash[\"default\"].each(this.getComponents(), function (component, index) {\n if (fn(component, index) === false) {\n return false;\n }\n });\n }\n\n /**\n * Returns a component provided a key. This performs a deep search within the\n * component tree.\n *\n * @param {string} key - The key of the component to retrieve.\n * @param {function} fn - Called with the component once found.\n * @return {Object} - The component that is located.\n */\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn, originalPath) {\n originalPath = originalPath || (0, _utils.getStringFromComponentPath)(path);\n path = (0, _utils.getArrayFromComponentPath)(path);\n var pathStr = originalPath;\n var newPath = _lodash[\"default\"].clone(path);\n var key = newPath.shift();\n var remainingPath = newPath;\n var comp = null;\n var possibleComp = null;\n if (_lodash[\"default\"].isNumber(key)) {\n key = remainingPath.shift();\n }\n if (!_lodash[\"default\"].isString(key)) {\n return comp;\n }\n this.everyComponent(function (component, components) {\n var matchPath = component.hasInput && component.path ? pathStr.includes(component.path) : true;\n if (component.component.key === key) {\n possibleComp = component;\n if (matchPath) {\n comp = component;\n if (remainingPath.length > 0 && 'getComponent' in component) {\n comp = component.getComponent(remainingPath, fn, originalPath);\n } else if (fn) {\n fn(component, components);\n }\n return false;\n }\n }\n });\n if (!comp) {\n comp = possibleComp;\n }\n return comp;\n }\n\n /**\n * Return a component provided the Id of the component.\n *\n * @param {string} id - The Id of the component.\n * @param {function} fn - Called with the component once it is retrieved.\n * @return {Object} - The component retrieved.\n */\n }, {\n key: \"getComponentById\",\n value: function getComponentById(id, fn) {\n var comp = null;\n this.everyComponent(function (component, components) {\n if (component.id === id) {\n comp = component;\n if (fn) {\n fn(component, components);\n }\n return false;\n }\n });\n return comp;\n }\n\n /**\n * Return a path of component's value.\n *\n * @param {Object} component - The component instance.\n * @return {string} - The component's value path.\n */\n }, {\n key: \"calculateComponentPath\",\n value: function calculateComponentPath(component) {\n var path = '';\n if (component.component.key) {\n var thisPath = this;\n while (thisPath && !thisPath.allowData && thisPath.parent) {\n thisPath = thisPath.parent;\n }\n var rowIndex = component.row ? \"[\".concat(Number.parseInt(component.row), \"]\") : '';\n path = thisPath.path ? \"\".concat(thisPath.path).concat(rowIndex, \".\") : '';\n path += component._parentPath && component.component.shouldIncludeSubFormPath ? component._parentPath : '';\n path += component.component.key;\n return path;\n }\n }\n\n /**\n * Create a new component and add it to the components array.\n *\n * @param component\n * @param data\n */\n }, {\n key: \"createComponent\",\n value: function createComponent(component, options, data, before, replacedComp) {\n var _options;\n if (!component) {\n return;\n }\n options = options || this.options;\n data = data || this.data;\n options.parent = this;\n options.parentVisible = this.visible;\n options.root = ((_options = options) === null || _options === void 0 ? void 0 : _options.root) || this.root || this;\n options.localRoot = this.localRoot;\n options.skipInit = true;\n if (!(options.display === 'pdf' && this.builderMode)) {\n component.id = (0, _utils.getRandomComponentId)();\n }\n if (!this.isInputComponent && this.component.shouldIncludeSubFormPath) {\n component.shouldIncludeSubFormPath = true;\n }\n var comp = _Components[\"default\"].create(component, options, data, true);\n var path = this.calculateComponentPath(comp);\n if (path) {\n comp.path = path;\n }\n comp.init();\n if (component.internal) {\n return comp;\n }\n if (before) {\n var index = _lodash[\"default\"].findIndex(this.components, {\n id: before.id\n });\n if (index !== -1) {\n this.components.splice(index, 0, comp);\n } else {\n this.components.push(comp);\n }\n } else if (replacedComp) {\n var _index = _lodash[\"default\"].findIndex(this.components, {\n id: replacedComp.id\n });\n if (_index !== -1) {\n this.components[_index] = comp;\n } else {\n this.components.push(comp);\n }\n } else {\n this.components.push(comp);\n }\n return comp;\n }\n }, {\n key: \"getContainer\",\n value: function getContainer() {\n return this.element;\n }\n }, {\n key: \"componentComponents\",\n get: function get() {\n return this.component.components || [];\n }\n }, {\n key: \"nestedKey\",\n get: function get() {\n return \"nested-\".concat(this.key);\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'container';\n }\n }, {\n key: \"init\",\n value: function init() {\n this.components = this.components || [];\n this.addComponents();\n return _get(_getPrototypeOf(NestedComponent.prototype), \"init\", this).call(this);\n }\n\n /**\n *\n * @param element\n * @param data\n */\n }, {\n key: \"addComponents\",\n value: function addComponents(data, options) {\n var _this5 = this;\n data = data || this.data;\n options = options || this.options;\n if (options.components) {\n this.components = options.components;\n } else {\n var components = this.hook('addComponents', this.componentComponents, this) || [];\n components.forEach(function (component) {\n return _this5.addComponent(component, data);\n });\n }\n }\n\n /**\n * Add a new component to the components array.\n *\n * @param {Object} component - The component JSON schema to add.\n * @param {Object} data - The submission data object to house the data for this component.\n * @param {HTMLElement} before - A DOM element to insert this element before.\n * @return {Component} - The created component instance.\n */\n }, {\n key: \"addComponent\",\n value: function addComponent(component, data, before, noAdd) {\n data = data || this.data;\n if (this.options.parentPath) {\n component.shouldIncludeSubFormPath = true;\n }\n component = this.hook('addComponent', component, data, before, noAdd);\n var comp = this.createComponent(component, this.options, data, before ? before : null);\n if (noAdd) {\n return comp;\n }\n return comp;\n }\n }, {\n key: \"beforeFocus\",\n value: function beforeFocus() {\n if (this.parent && 'beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n }\n }, {\n key: \"render\",\n value: function render(children) {\n // If already rendering, don't re-render.\n return _get(_getPrototypeOf(NestedComponent.prototype), \"render\", this).call(this, children || this.renderTemplate(this.templateName, {\n children: !this.visible ? '' : this.renderComponents(),\n nestedKey: this.nestedKey,\n collapsed: this.options.pdf ? false : this.collapsed\n }));\n }\n }, {\n key: \"renderComponents\",\n value: function renderComponents(components) {\n components = components || this.getComponents();\n var children = components.map(function (component) {\n return component.render();\n });\n return this.renderTemplate('components', {\n children: children,\n components: components\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this6 = this;\n var superPromise = _get(_getPrototypeOf(NestedComponent.prototype), \"attach\", this).call(this, element);\n this.loadRefs(element, _defineProperty({\n header: 'single',\n collapsed: this.collapsed\n }, this.nestedKey, 'single'));\n var childPromise = _nativePromiseOnly[\"default\"].resolve();\n if (this.refs[this.nestedKey]) {\n childPromise = this.attachComponents(this.refs[this.nestedKey]);\n }\n if (!this.visible) {\n this.attachComponentsLogic();\n }\n if (this.component.collapsible && this.refs.header) {\n this.addEventListener(this.refs.header, 'click', function () {\n _this6.collapsed = !_this6.collapsed;\n });\n this.addEventListener(this.refs.header, 'keydown', function (e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n e.preventDefault();\n _this6.collapsed = !_this6.collapsed;\n }\n });\n }\n return _nativePromiseOnly[\"default\"].all([superPromise, childPromise]);\n }\n }, {\n key: \"attachComponentsLogic\",\n value: function attachComponentsLogic(components) {\n components = components || this.components;\n _lodash[\"default\"].each(components, function (comp) {\n comp.attachLogic();\n if (_lodash[\"default\"].isFunction(comp.attachComponentsLogic)) {\n comp.attachComponentsLogic();\n }\n });\n }\n }, {\n key: \"attachComponents\",\n value: function attachComponents(element, components, container) {\n components = components || this.components;\n container = container || this.component.components;\n element = this.hook('attachComponents', element, components, container, this);\n if (!element) {\n // Return a non-resolving promise.\n return new _nativePromiseOnly[\"default\"](function () {});\n }\n var index = 0;\n var promises = [];\n Array.prototype.slice.call(element.children).forEach(function (child) {\n if (!child.getAttribute('data-noattach') && components[index]) {\n promises.push(components[index].attach(child));\n index++;\n }\n });\n return _nativePromiseOnly[\"default\"].all(promises);\n }\n\n /**\n * Remove a component from the components array.\n *\n * @param {Component} component - The component to remove from the components.\n * @param {Array} components - An array of components to remove this component from.\n */\n }, {\n key: \"removeComponent\",\n value: function removeComponent(component, components) {\n components = components || this.components;\n component.destroy();\n _lodash[\"default\"].remove(components, {\n id: component.id\n });\n }\n\n /**\n * Removes a component provided the API key of that component.\n *\n * @param {string} key - The API key of the component to remove.\n * @param {function} fn - Called once the component is removed.\n * @return {null}\n */\n }, {\n key: \"removeComponentByKey\",\n value: function removeComponentByKey(key, fn) {\n var _this7 = this;\n var comp = this.getComponent(key, function (component, components) {\n _this7.removeComponent(component, components);\n if (fn) {\n fn(component, components);\n }\n });\n if (!comp) {\n if (fn) {\n fn(null);\n }\n return null;\n }\n }\n\n /**\n * Removes a component provided the Id of the component.\n *\n * @param {string} id - The Id of the component to remove.\n * @param {function} fn - Called when the component is removed.\n * @return {null}\n */\n }, {\n key: \"removeComponentById\",\n value: function removeComponentById(id, fn) {\n var _this8 = this;\n var comp = this.getComponentById(id, function (component, components) {\n _this8.removeComponent(component, components);\n if (fn) {\n fn(component, components);\n }\n });\n if (!comp) {\n if (fn) {\n fn(null);\n }\n return null;\n }\n }\n }, {\n key: \"updateValue\",\n value: function updateValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.components.reduce(function (changed, comp) {\n return comp.updateValue(null, flags) || changed;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"updateValue\", this).call(this, value, flags));\n }\n }, {\n key: \"shouldSkipValidation\",\n value: function shouldSkipValidation(data, dirty, row) {\n // Nested components with no input should not be validated.\n if (!this.component.input) {\n return true;\n } else {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"shouldSkipValidation\", this).call(this, data, dirty, row);\n }\n }\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row, components) {\n if (this.builderMode) {\n return true;\n }\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n components = components && _lodash[\"default\"].isArray(components) ? components : this.getComponents();\n var isValid = components.reduce(function (valid, comp) {\n return comp.checkData(data, flags, row) && valid;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"checkData\", this).call(this, data, flags, row));\n this.checkModal(isValid, this.isDirty);\n return isValid;\n }\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n // check conditions of parent component first, because it may influence on visibility of it's children\n var check = _get(_getPrototypeOf(NestedComponent.prototype), \"checkConditions\", this).call(this, data, flags, row);\n //row data of parent component not always corresponds to row of nested components, use comp.data as row data for children instead\n this.getComponents().forEach(function (comp) {\n return comp.checkConditions(data, flags, comp.data);\n });\n return check;\n }\n }, {\n key: \"clearOnHide\",\n value: function clearOnHide(show) {\n _get(_getPrototypeOf(NestedComponent.prototype), \"clearOnHide\", this).call(this, show);\n if (this.component.clearOnHide) {\n if (this.allowData && !this.hasValue() && !(this.options.server && !this.visible)) {\n this.dataValue = this.defaultValue;\n }\n if (this.hasValue()) {\n this.restoreComponentsContext();\n }\n }\n this.getComponents().forEach(function (component) {\n return component.clearOnHide(show);\n });\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this9 = this;\n this.getComponents().forEach(function (component) {\n return component.data = _this9.dataValue;\n });\n }\n\n /**\n * Allow components to hook into the next page trigger to perform their own logic.\n *\n * @return {*}\n */\n }, {\n key: \"beforePage\",\n value: function beforePage(next) {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (comp) {\n return comp.beforePage(next);\n }));\n }\n\n /**\n * Allow components to hook into the submission to provide their own async data.\n *\n * @return {*}\n */\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (comp) {\n return comp.beforeSubmit();\n }));\n }\n }, {\n key: \"calculateValue\",\n value: function calculateValue(data, flags, row) {\n // Do not iterate into children and calculateValues if this nested component is conditionally hidden.\n if (!this.conditionallyVisible()) {\n return false;\n }\n return this.getComponents().reduce(function (changed, comp) {\n return comp.calculateValue(data, flags, row) || changed;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"calculateValue\", this).call(this, data, flags, row));\n }\n }, {\n key: \"isLastPage\",\n value: function isLastPage() {\n return this.pages.length - 1 === this.page;\n }\n }, {\n key: \"isValid\",\n value: function isValid(data, dirty) {\n return this.getComponents().reduce(function (valid, comp) {\n return comp.isValid(data, dirty) && valid;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"isValid\", this).call(this, data, dirty));\n }\n }, {\n key: \"checkChildComponentsValidity\",\n value: function checkChildComponentsValidity(data, dirty, row, silentCheck, isParentValid) {\n return this.getComponents().reduce(function (check, comp) {\n return comp.checkValidity(data, dirty, row, silentCheck) && check;\n }, isParentValid);\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n var isValid = this.checkChildComponentsValidity(data, dirty, row, silentCheck, _get(_getPrototypeOf(NestedComponent.prototype), \"checkValidity\", this).call(this, data, dirty, row, silentCheck));\n this.checkModal(isValid, dirty);\n return isValid;\n }\n }, {\n key: \"checkAsyncValidity\",\n value: function checkAsyncValidity(data, dirty, row, silentCheck) {\n var _this10 = this;\n return this.ready.then(function () {\n var promises = [_get(_getPrototypeOf(NestedComponent.prototype), \"checkAsyncValidity\", _this10).call(_this10, data, dirty, row, silentCheck)];\n _this10.eachComponent(function (component) {\n return promises.push(component.checkAsyncValidity(data, dirty, row, silentCheck));\n });\n return _nativePromiseOnly[\"default\"].all(promises).then(function (results) {\n return results.reduce(function (valid, result) {\n return valid && result;\n }, true);\n });\n });\n }\n }, {\n key: \"setPristine\",\n value: function setPristine(pristine) {\n _get(_getPrototypeOf(NestedComponent.prototype), \"setPristine\", this).call(this, pristine);\n this.getComponents().forEach(function (comp) {\n return comp.setPristine(pristine);\n });\n }\n }, {\n key: \"isPristine\",\n get: function get() {\n return this.pristine && this.getComponents().every(function (c) {\n return c.isPristine;\n });\n }\n }, {\n key: \"isDirty\",\n get: function get() {\n return this.dirty && this.getComponents().every(function (c) {\n return c.isDirty;\n });\n }\n }, {\n key: \"detach\",\n value: function detach() {\n this.components.forEach(function (component) {\n component.detach();\n });\n _get(_getPrototypeOf(NestedComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.components.forEach(function (component) {\n component.clear();\n });\n _get(_getPrototypeOf(NestedComponent.prototype), \"clear\", this).call(this);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.destroyComponents();\n _get(_getPrototypeOf(NestedComponent.prototype), \"destroy\", this).call(this);\n }\n }, {\n key: \"destroyComponents\",\n value: function destroyComponents() {\n var _this11 = this;\n var components = this.getComponents().slice();\n components.forEach(function (comp) {\n return _this11.removeComponent(comp, _this11.components);\n });\n this.components = [];\n }\n }, {\n key: \"errors\",\n get: function get() {\n var thisErrors = this.error ? [this.error] : [];\n return this.getComponents().reduce(function (errors, comp) {\n return errors.concat(comp.errors || []);\n }, thisErrors).filter(function (err) {\n return err.level !== 'hidden';\n });\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.data;\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n _get(_getPrototypeOf(NestedComponent.prototype), \"resetValue\", this).call(this);\n this.getComponents().forEach(function (comp) {\n return comp.resetValue();\n });\n this.setPristine(true);\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (component) {\n return component.dataReady;\n }));\n }\n }, {\n key: \"setNestedValue\",\n value: function setNestedValue(component, value) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n component._data = this.componentContext(component);\n if (component.type === 'button') {\n return false;\n }\n if (component.type === 'components') {\n if (component.tree && component.hasValue(value)) {\n return component.setValue(_lodash[\"default\"].get(value, component.key), flags);\n }\n return component.setValue(value, flags);\n } else if (value && component.hasValue(value)) {\n return component.setValue(_lodash[\"default\"].get(value, component.key), flags);\n } else if ((!this.rootPristine || component.visible) && component.shouldAddDefaultValue) {\n flags.noValidate = !flags.dirty;\n flags.resetValue = true;\n return component.setValue(component.defaultValue, flags);\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this12 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n return false;\n }\n if (value.submitAsDraft && !value.submit) {\n flags.noValidate = true;\n }\n return this.getComponents().reduce(function (changed, component) {\n return _this12.setNestedValue(component, value, flags, changed) || changed;\n }, false);\n }\n }, {\n key: \"lazyLoad\",\n get: function get() {\n var _this$component$lazyL;\n return (_this$component$lazyL = this.component.lazyLoad) !== null && _this$component$lazyL !== void 0 ? _this$component$lazyL : false;\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Field2[\"default\"].schema.apply(_Field2[\"default\"], [{\n tree: false,\n lazyLoad: false\n }].concat(extend));\n }\n }]);\n return NestedComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = NestedComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/nested/NestedComponent.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.number.parse-int.js */ \"./node_modules/core-js/modules/es.number.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.array.every.js */ \"./node_modules/core-js/modules/es.array.every.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _Components = _interopRequireDefault(__webpack_require__(/*! ../../Components */ \"./lib/components/Components.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _utils = __webpack_require__(/*! ../../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar NestedComponent = /*#__PURE__*/function (_Field) {\n _inherits(NestedComponent, _Field);\n var _super = _createSuper(NestedComponent);\n function NestedComponent(component, options, data) {\n var _this;\n _classCallCheck(this, NestedComponent);\n _this = _super.call(this, component, options, data);\n _this.type = 'components';\n _this._collapsed = !!_this.component.collapsed;\n return _this;\n }\n _createClass(NestedComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return NestedComponent.schema();\n }\n }, {\n key: \"schema\",\n get: function get() {\n var schema = _get(_getPrototypeOf(NestedComponent.prototype), \"schema\", this);\n var components = _lodash[\"default\"].uniqBy(this.getComponents(), 'component.key');\n schema.components = _lodash[\"default\"].map(components, 'schema');\n return schema;\n }\n }, {\n key: \"collapsed\",\n get: function get() {\n return this._collapsed;\n },\n set: function set(value) {\n this._collapsed = value;\n this.collapse(value);\n }\n }, {\n key: \"collapse\",\n value: function collapse(value) {\n var promise = this.redraw();\n if (!value) {\n this.checkValidity(this.data, !this.pristine, null, this.pristine);\n }\n return promise;\n }\n }, {\n key: \"visible\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"visible\", this);\n },\n set: function set(value) {\n // DO NOT CALL super here. There is an issue where clearOnHide was getting triggered with\n // subcomponents because the \"parentVisible\" flag was set to false when it should really be\n // set to true.\n var visibilityChanged = this._visible !== value;\n this._visible = value;\n var isVisible = this.visible;\n var forceShow = this.shouldForceShow();\n var forceHide = this.shouldForceHide();\n this.components.forEach(function (component) {\n // Set the parent visibility first since we may have nested components within nested components\n // and they need to be able to determine their visibility based on the parent visibility.\n component.parentVisible = isVisible;\n var conditionallyVisible = component.conditionallyVisible();\n if (forceShow || conditionallyVisible) {\n component.visible = true;\n } else if (forceHide || !isVisible || !conditionallyVisible) {\n component.visible = false;\n }\n // If hiding a nested component, clear all errors below.\n if (!component.visible) {\n component.error = '';\n }\n });\n if (visibilityChanged) {\n this.clearOnHide();\n this.redraw();\n }\n }\n }, {\n key: \"parentVisible\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"parentVisible\", this);\n },\n set: function set(value) {\n var _this2 = this;\n _set(_getPrototypeOf(NestedComponent.prototype), \"parentVisible\", value, this, true);\n this.components.forEach(function (component) {\n return component.parentVisible = _this2.visible;\n });\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(NestedComponent.prototype), \"disabled\", disabled, this, true);\n this.components.forEach(function (component) {\n return component.parentDisabled = disabled;\n });\n }\n }, {\n key: \"parentDisabled\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"parentDisabled\", this);\n },\n set: function set(value) {\n var _this3 = this;\n _set(_getPrototypeOf(NestedComponent.prototype), \"parentDisabled\", value, this, true);\n this.components.forEach(function (component) {\n component.parentDisabled = _this3.disabled;\n });\n }\n }, {\n key: \"ready\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (component) {\n return component.ready;\n }));\n }\n }, {\n key: \"currentForm\",\n get: function get() {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"currentForm\", this);\n },\n set: function set(instance) {\n _set(_getPrototypeOf(NestedComponent.prototype), \"currentForm\", instance, this, true);\n this.getComponents().forEach(function (component) {\n component.currentForm = instance;\n });\n }\n }, {\n key: \"rowIndex\",\n get: function get() {\n return this._rowIndex;\n },\n set: function set(value) {\n this._rowIndex = value;\n this.eachComponent(function (component) {\n component.rowIndex = value;\n });\n }\n }, {\n key: \"componentContext\",\n value: function componentContext() {\n return this._data;\n }\n }, {\n key: \"data\",\n get: function get() {\n return this._data;\n },\n set: function set(value) {\n var _this4 = this;\n this._data = value;\n this.eachComponent(function (component) {\n component.data = _this4.componentContext(component);\n });\n }\n }, {\n key: \"getComponents\",\n value: function getComponents() {\n return this.components || [];\n }\n\n /**\n * Perform a deep iteration over every component, including those\n * within other container based components.\n *\n * @param {function} fn - Called for every component.\n */\n }, {\n key: \"everyComponent\",\n value: function everyComponent(fn, options) {\n var components = this.getComponents();\n _lodash[\"default\"].each(components, function (component, index) {\n if (fn(component, components, index) === false) {\n return false;\n }\n if (typeof component.everyComponent === 'function') {\n if (component.everyComponent(fn, options) === false) {\n return false;\n }\n }\n });\n }\n }, {\n key: \"hasComponent\",\n value: function hasComponent(component) {\n var result = false;\n this.everyComponent(function (comp) {\n if (comp === component) {\n result = true;\n return false;\n }\n });\n return result;\n }\n }, {\n key: \"flattenComponents\",\n value: function flattenComponents() {\n var result = {};\n this.everyComponent(function (component) {\n result[component.component.flattenAs || component.key] = component;\n });\n return result;\n }\n\n /**\n * Perform an iteration over each component within this container component.\n *\n * @param {function} fn - Called for each component\n */\n }, {\n key: \"eachComponent\",\n value: function eachComponent(fn) {\n _lodash[\"default\"].each(this.getComponents(), function (component, index) {\n if (fn(component, index) === false) {\n return false;\n }\n });\n }\n\n /**\n * Returns a component provided a key. This performs a deep search within the\n * component tree.\n *\n * @param {string} key - The key of the component to retrieve.\n * @param {function} fn - Called with the component once found.\n * @return {Object} - The component that is located.\n */\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn, originalPath) {\n originalPath = originalPath || (0, _utils.getStringFromComponentPath)(path);\n path = (0, _utils.getArrayFromComponentPath)(path);\n var pathStr = originalPath;\n var newPath = _lodash[\"default\"].clone(path);\n var key = newPath.shift();\n var remainingPath = newPath;\n var comp = null;\n var possibleComp = null;\n if (_lodash[\"default\"].isNumber(key)) {\n key = remainingPath.shift();\n }\n if (!_lodash[\"default\"].isString(key)) {\n return comp;\n }\n this.everyComponent(function (component, components) {\n var matchPath = component.hasInput && component.path ? pathStr.includes(component.path) : true;\n if (component.component.key === key) {\n possibleComp = component;\n if (matchPath) {\n comp = component;\n if (remainingPath.length > 0 && 'getComponent' in component) {\n comp = component.getComponent(remainingPath, fn, originalPath);\n } else if (fn) {\n fn(component, components);\n }\n return false;\n }\n }\n });\n if (!comp) {\n comp = possibleComp;\n }\n return comp;\n }\n\n /**\n * Return a component provided the Id of the component.\n *\n * @param {string} id - The Id of the component.\n * @param {function} fn - Called with the component once it is retrieved.\n * @return {Object} - The component retrieved.\n */\n }, {\n key: \"getComponentById\",\n value: function getComponentById(id, fn) {\n var comp = null;\n this.everyComponent(function (component, components) {\n if (component.id === id) {\n comp = component;\n if (fn) {\n fn(component, components);\n }\n return false;\n }\n });\n return comp;\n }\n\n /**\n * Return a path of component's value.\n *\n * @param {Object} component - The component instance.\n * @return {string} - The component's value path.\n */\n }, {\n key: \"calculateComponentPath\",\n value: function calculateComponentPath(component) {\n var path = '';\n if (component.component.key) {\n var thisPath = this;\n while (thisPath && !thisPath.allowData && thisPath.parent) {\n thisPath = thisPath.parent;\n }\n var rowIndex = component.row ? \"[\".concat(Number.parseInt(component.row), \"]\") : '';\n path = thisPath.path ? \"\".concat(thisPath.path).concat(rowIndex, \".\") : '';\n path += component._parentPath && component.component.shouldIncludeSubFormPath ? component._parentPath : '';\n path += component.component.key;\n return path;\n }\n }\n\n /**\n * Create a new component and add it to the components array.\n *\n * @param component\n * @param data\n */\n }, {\n key: \"createComponent\",\n value: function createComponent(component, options, data, before, replacedComp) {\n var _options;\n if (!component) {\n return;\n }\n options = options || this.options;\n data = data || this.data;\n options.parent = this;\n options.parentVisible = this.visible;\n options.root = ((_options = options) === null || _options === void 0 ? void 0 : _options.root) || this.root || this;\n options.localRoot = this.localRoot;\n options.skipInit = true;\n if (!(options.display === 'pdf' && this.builderMode)) {\n component.id = (0, _utils.getRandomComponentId)();\n }\n if (!this.isInputComponent && this.component.shouldIncludeSubFormPath) {\n component.shouldIncludeSubFormPath = true;\n }\n var comp = _Components[\"default\"].create(component, options, data, true);\n var path = this.calculateComponentPath(comp);\n if (path) {\n comp.path = path;\n }\n comp.init();\n if (component.internal) {\n return comp;\n }\n if (before) {\n var index = _lodash[\"default\"].findIndex(this.components, {\n id: before.id\n });\n if (index !== -1) {\n this.components.splice(index, 0, comp);\n } else {\n this.components.push(comp);\n }\n } else if (replacedComp) {\n var _index = _lodash[\"default\"].findIndex(this.components, {\n id: replacedComp.id\n });\n if (_index !== -1) {\n this.components[_index] = comp;\n } else {\n this.components.push(comp);\n }\n } else {\n this.components.push(comp);\n }\n return comp;\n }\n }, {\n key: \"getContainer\",\n value: function getContainer() {\n return this.element;\n }\n }, {\n key: \"componentComponents\",\n get: function get() {\n return this.component.components || [];\n }\n }, {\n key: \"nestedKey\",\n get: function get() {\n return \"nested-\".concat(this.key);\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'container';\n }\n }, {\n key: \"init\",\n value: function init() {\n this.components = this.components || [];\n this.addComponents();\n return _get(_getPrototypeOf(NestedComponent.prototype), \"init\", this).call(this);\n }\n\n /**\n *\n * @param element\n * @param data\n */\n }, {\n key: \"addComponents\",\n value: function addComponents(data, options) {\n var _this5 = this;\n data = data || this.data;\n options = options || this.options;\n if (options.components) {\n this.components = options.components;\n } else {\n var components = this.hook('addComponents', this.componentComponents, this) || [];\n components.forEach(function (component) {\n return _this5.addComponent(component, data);\n });\n }\n }\n\n /**\n * Add a new component to the components array.\n *\n * @param {Object} component - The component JSON schema to add.\n * @param {Object} data - The submission data object to house the data for this component.\n * @param {HTMLElement} before - A DOM element to insert this element before.\n * @return {Component} - The created component instance.\n */\n }, {\n key: \"addComponent\",\n value: function addComponent(component, data, before, noAdd) {\n data = data || this.data;\n if (this.options.parentPath) {\n component.shouldIncludeSubFormPath = true;\n }\n component = this.hook('addComponent', component, data, before, noAdd);\n var comp = this.createComponent(component, this.options, data, before ? before : null);\n if (noAdd) {\n return comp;\n }\n return comp;\n }\n }, {\n key: \"beforeFocus\",\n value: function beforeFocus() {\n if (this.parent && 'beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n }\n }, {\n key: \"render\",\n value: function render(children) {\n // If already rendering, don't re-render.\n return _get(_getPrototypeOf(NestedComponent.prototype), \"render\", this).call(this, children || this.renderTemplate(this.templateName, {\n children: !this.visible ? '' : this.renderComponents(),\n nestedKey: this.nestedKey,\n collapsed: this.options.pdf ? false : this.collapsed\n }));\n }\n }, {\n key: \"renderComponents\",\n value: function renderComponents(components) {\n components = components || this.getComponents();\n var children = components.map(function (component) {\n return component.render();\n });\n return this.renderTemplate('components', {\n children: children,\n components: components\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this6 = this;\n var superPromise = _get(_getPrototypeOf(NestedComponent.prototype), \"attach\", this).call(this, element);\n this.loadRefs(element, _defineProperty({\n header: 'single',\n collapsed: this.collapsed\n }, this.nestedKey, 'single'));\n var childPromise = _nativePromiseOnly[\"default\"].resolve();\n if (this.refs[this.nestedKey]) {\n childPromise = this.attachComponents(this.refs[this.nestedKey]);\n }\n if (!this.visible) {\n this.attachComponentsLogic();\n }\n if (this.component.collapsible && this.refs.header) {\n this.addEventListener(this.refs.header, 'click', function () {\n _this6.collapsed = !_this6.collapsed;\n });\n this.addEventListener(this.refs.header, 'keydown', function (e) {\n if (e.keyCode === 13 || e.keyCode === 32) {\n e.preventDefault();\n _this6.collapsed = !_this6.collapsed;\n }\n });\n }\n return _nativePromiseOnly[\"default\"].all([superPromise, childPromise]);\n }\n }, {\n key: \"attachComponentsLogic\",\n value: function attachComponentsLogic(components) {\n components = components || this.components;\n _lodash[\"default\"].each(components, function (comp) {\n comp.attachLogic();\n if (_lodash[\"default\"].isFunction(comp.attachComponentsLogic)) {\n comp.attachComponentsLogic();\n }\n });\n }\n }, {\n key: \"attachComponents\",\n value: function attachComponents(element, components, container) {\n components = components || this.components;\n container = container || this.component.components;\n element = this.hook('attachComponents', element, components, container, this);\n if (!element) {\n // Return a non-resolving promise.\n return new _nativePromiseOnly[\"default\"](function () {});\n }\n var index = 0;\n var promises = [];\n Array.prototype.slice.call(element.children).forEach(function (child) {\n if (!child.getAttribute('data-noattach') && components[index]) {\n promises.push(components[index].attach(child));\n index++;\n }\n });\n return _nativePromiseOnly[\"default\"].all(promises);\n }\n\n /**\n * Remove a component from the components array.\n *\n * @param {Component} component - The component to remove from the components.\n * @param {Array} components - An array of components to remove this component from.\n */\n }, {\n key: \"removeComponent\",\n value: function removeComponent(component, components) {\n components = components || this.components;\n component.destroy();\n _lodash[\"default\"].remove(components, {\n id: component.id\n });\n }\n\n /**\n * Removes a component provided the API key of that component.\n *\n * @param {string} key - The API key of the component to remove.\n * @param {function} fn - Called once the component is removed.\n * @return {null}\n */\n }, {\n key: \"removeComponentByKey\",\n value: function removeComponentByKey(key, fn) {\n var _this7 = this;\n var comp = this.getComponent(key, function (component, components) {\n _this7.removeComponent(component, components);\n if (fn) {\n fn(component, components);\n }\n });\n if (!comp) {\n if (fn) {\n fn(null);\n }\n return null;\n }\n }\n\n /**\n * Removes a component provided the Id of the component.\n *\n * @param {string} id - The Id of the component to remove.\n * @param {function} fn - Called when the component is removed.\n * @return {null}\n */\n }, {\n key: \"removeComponentById\",\n value: function removeComponentById(id, fn) {\n var _this8 = this;\n var comp = this.getComponentById(id, function (component, components) {\n _this8.removeComponent(component, components);\n if (fn) {\n fn(component, components);\n }\n });\n if (!comp) {\n if (fn) {\n fn(null);\n }\n return null;\n }\n }\n }, {\n key: \"updateValue\",\n value: function updateValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.components.reduce(function (changed, comp) {\n return comp.updateValue(null, flags) || changed;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"updateValue\", this).call(this, value, flags));\n }\n }, {\n key: \"shouldSkipValidation\",\n value: function shouldSkipValidation(data, dirty, row) {\n // Nested components with no input should not be validated.\n if (!this.component.input) {\n return true;\n } else {\n return _get(_getPrototypeOf(NestedComponent.prototype), \"shouldSkipValidation\", this).call(this, data, dirty, row);\n }\n }\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row, components) {\n if (this.builderMode) {\n return true;\n }\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n components = components && _lodash[\"default\"].isArray(components) ? components : this.getComponents();\n var isValid = components.reduce(function (valid, comp) {\n return comp.checkData(data, _objectSpread({}, flags), row) && valid;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"checkData\", this).call(this, data, _objectSpread({}, flags), row));\n this.checkModal(isValid, this.isDirty);\n return isValid;\n }\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n // check conditions of parent component first, because it may influence on visibility of it's children\n var check = _get(_getPrototypeOf(NestedComponent.prototype), \"checkConditions\", this).call(this, data, flags, row);\n //row data of parent component not always corresponds to row of nested components, use comp.data as row data for children instead\n this.getComponents().forEach(function (comp) {\n return comp.checkConditions(data, flags, comp.data);\n });\n return check;\n }\n }, {\n key: \"clearOnHide\",\n value: function clearOnHide(show) {\n _get(_getPrototypeOf(NestedComponent.prototype), \"clearOnHide\", this).call(this, show);\n if (this.component.clearOnHide) {\n if (this.allowData && !this.hasValue() && !(this.options.server && !this.visible)) {\n this.dataValue = this.defaultValue;\n }\n if (this.hasValue()) {\n this.restoreComponentsContext();\n }\n }\n this.getComponents().forEach(function (component) {\n return component.clearOnHide(show);\n });\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this9 = this;\n this.getComponents().forEach(function (component) {\n return component.data = _this9.dataValue;\n });\n }\n\n /**\n * Allow components to hook into the next page trigger to perform their own logic.\n *\n * @return {*}\n */\n }, {\n key: \"beforePage\",\n value: function beforePage(next) {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (comp) {\n return comp.beforePage(next);\n }));\n }\n\n /**\n * Allow components to hook into the submission to provide their own async data.\n *\n * @return {*}\n */\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (comp) {\n return comp.beforeSubmit();\n }));\n }\n }, {\n key: \"calculateValue\",\n value: function calculateValue(data, flags, row) {\n // Do not iterate into children and calculateValues if this nested component is conditionally hidden.\n if (!this.conditionallyVisible()) {\n return false;\n }\n return this.getComponents().reduce(function (changed, comp) {\n return comp.calculateValue(data, flags, row) || changed;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"calculateValue\", this).call(this, data, flags, row));\n }\n }, {\n key: \"isLastPage\",\n value: function isLastPage() {\n return this.pages.length - 1 === this.page;\n }\n }, {\n key: \"isValid\",\n value: function isValid(data, dirty) {\n return this.getComponents().reduce(function (valid, comp) {\n return comp.isValid(data, dirty) && valid;\n }, _get(_getPrototypeOf(NestedComponent.prototype), \"isValid\", this).call(this, data, dirty));\n }\n }, {\n key: \"checkChildComponentsValidity\",\n value: function checkChildComponentsValidity(data, dirty, row, silentCheck, isParentValid) {\n return this.getComponents().reduce(function (check, comp) {\n return comp.checkValidity(data, dirty, row, silentCheck) && check;\n }, isParentValid);\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n var isValid = this.checkChildComponentsValidity(data, dirty, row, silentCheck, _get(_getPrototypeOf(NestedComponent.prototype), \"checkValidity\", this).call(this, data, dirty, row, silentCheck));\n this.checkModal(isValid, dirty);\n return isValid;\n }\n }, {\n key: \"checkAsyncValidity\",\n value: function checkAsyncValidity(data, dirty, row, silentCheck) {\n var _this10 = this;\n return this.ready.then(function () {\n var promises = [_get(_getPrototypeOf(NestedComponent.prototype), \"checkAsyncValidity\", _this10).call(_this10, data, dirty, row, silentCheck)];\n _this10.eachComponent(function (component) {\n return promises.push(component.checkAsyncValidity(data, dirty, row, silentCheck));\n });\n return _nativePromiseOnly[\"default\"].all(promises).then(function (results) {\n return results.reduce(function (valid, result) {\n return valid && result;\n }, true);\n });\n });\n }\n }, {\n key: \"setPristine\",\n value: function setPristine(pristine) {\n _get(_getPrototypeOf(NestedComponent.prototype), \"setPristine\", this).call(this, pristine);\n this.getComponents().forEach(function (comp) {\n return comp.setPristine(pristine);\n });\n }\n }, {\n key: \"isPristine\",\n get: function get() {\n return this.pristine && this.getComponents().every(function (c) {\n return c.isPristine;\n });\n }\n }, {\n key: \"isDirty\",\n get: function get() {\n return this.dirty && this.getComponents().every(function (c) {\n return c.isDirty;\n });\n }\n }, {\n key: \"detach\",\n value: function detach() {\n this.components.forEach(function (component) {\n component.detach();\n });\n _get(_getPrototypeOf(NestedComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.components.forEach(function (component) {\n component.clear();\n });\n _get(_getPrototypeOf(NestedComponent.prototype), \"clear\", this).call(this);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.destroyComponents();\n _get(_getPrototypeOf(NestedComponent.prototype), \"destroy\", this).call(this);\n }\n }, {\n key: \"destroyComponents\",\n value: function destroyComponents() {\n var _this11 = this;\n var components = this.getComponents().slice();\n components.forEach(function (comp) {\n return _this11.removeComponent(comp, _this11.components);\n });\n this.components = [];\n }\n }, {\n key: \"errors\",\n get: function get() {\n var thisErrors = this.error ? [this.error] : [];\n return this.getComponents().reduce(function (errors, comp) {\n return errors.concat(comp.errors || []);\n }, thisErrors).filter(function (err) {\n return err.level !== 'hidden';\n });\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.data;\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n _get(_getPrototypeOf(NestedComponent.prototype), \"resetValue\", this).call(this);\n this.getComponents().forEach(function (comp) {\n return comp.resetValue();\n });\n this.setPristine(true);\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n return _nativePromiseOnly[\"default\"].all(this.getComponents().map(function (component) {\n return component.dataReady;\n }));\n }\n }, {\n key: \"setNestedValue\",\n value: function setNestedValue(component, value) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n component._data = this.componentContext(component);\n if (component.type === 'button') {\n return false;\n }\n if (component.type === 'components') {\n if (component.tree && component.hasValue(value)) {\n return component.setValue(_lodash[\"default\"].get(value, component.key), flags);\n }\n return component.setValue(value, flags);\n } else if (value && component.hasValue(value)) {\n return component.setValue(_lodash[\"default\"].get(value, component.key), flags);\n } else if ((!this.rootPristine || component.visible) && component.shouldAddDefaultValue) {\n flags.noValidate = !flags.dirty;\n flags.resetValue = true;\n return component.setValue(component.defaultValue, flags);\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this12 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n return false;\n }\n if (value.submitAsDraft && !value.submit) {\n flags.noValidate = true;\n }\n return this.getComponents().reduce(function (changed, component) {\n return _this12.setNestedValue(component, value, flags, changed) || changed;\n }, false);\n }\n }, {\n key: \"lazyLoad\",\n get: function get() {\n var _this$component$lazyL;\n return (_this$component$lazyL = this.component.lazyLoad) !== null && _this$component$lazyL !== void 0 ? _this$component$lazyL : false;\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Field2[\"default\"].schema.apply(_Field2[\"default\"], [{\n tree: false,\n lazyLoad: false\n }].concat(extend));\n }\n }]);\n return NestedComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = NestedComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/nested/NestedComponent.js?"); /***/ }), @@ -587,7 +587,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar CheckBoxComponent = /*#__PURE__*/function (_Field) {\n _inherits(CheckBoxComponent, _Field);\n var _super = _createSuper(CheckBoxComponent);\n function CheckBoxComponent() {\n _classCallCheck(this, CheckBoxComponent);\n return _super.apply(this, arguments);\n }\n _createClass(CheckBoxComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return CheckBoxComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var name = this.component.name;\n var defaultValue = _get(_getPrototypeOf(CheckBoxComponent.prototype), \"defaultValue\", this);\n return name ? this.component[name] || this.emptyValue : (defaultValue || this.component.defaultValue || false).toString() === 'true';\n }\n }, {\n key: \"labelClass\",\n get: function get() {\n var className = '';\n if (this.isInputComponent && !this.options.inputsOnly && this.component.validate && this.component.validate.required) {\n className += ' field-required';\n }\n return \"\".concat(className);\n }\n }, {\n key: \"hasSetValue\",\n get: function get() {\n return this.hasValue();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(CheckBoxComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'input';\n info.changeEvent = 'click';\n info.attr.type = this.component.inputType || 'checkbox';\n info.attr[\"class\"] = 'form-check-input';\n if (this.component.name) {\n info.attr.name = \"data[\".concat(this.component.name, \"]\");\n }\n info.attr.value = this.component.value ? this.component.value : 0;\n info.label = this.t(this.component.label, {\n _userInput: true\n });\n info.labelClass = this.labelClass;\n return info;\n }\n }, {\n key: \"labelInfo\",\n get: function get() {\n return {\n hidden: true\n };\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(CheckBoxComponent.prototype), \"render\", this).call(this, this.renderTemplate('checkbox', {\n input: this.inputInfo,\n checked: this.checked,\n tooltip: this.interpolate(this.t(this.component.tooltip) || '', {\n _userInput: true\n }).replace(/(?:\\r\\n|\\r|\\n)/g, '
')\n }));\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this = this;\n this.loadRefs(element, {\n input: 'multiple'\n });\n this.input = this.refs.input[0];\n if (this.refs.input) {\n this.addEventListener(this.input, this.inputInfo.changeEvent, function () {\n return _this.updateValue(null, {\n modified: true\n });\n });\n this.addShortcut(this.input);\n }\n return _get(_getPrototypeOf(CheckBoxComponent.prototype), \"attach\", this).call(this, element);\n }\n }, {\n key: \"detach\",\n value: function detach(element) {\n if (element && this.input) {\n this.removeShortcut(this.input);\n }\n _get(_getPrototypeOf(CheckBoxComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.component.inputType === 'radio' ? null : false;\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n return _get(_getPrototypeOf(CheckBoxComponent.prototype), \"isEmpty\", this).call(this, value) || value === false;\n }\n }, {\n key: \"key\",\n get: function get() {\n return this.component.name ? this.component.name : _get(_getPrototypeOf(CheckBoxComponent.prototype), \"key\", this);\n }\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n if (this.component.name) {\n return this.refs.input[index].checked ? this.component.value : '';\n }\n return !!this.refs.input[index].checked;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n var value = _get(_getPrototypeOf(CheckBoxComponent.prototype), \"getValue\", this).call(this);\n if (this.component.name) {\n return value ? this.setCheckedState(value) : this.setCheckedState(this.dataValue);\n } else {\n return value === '' ? this.dataValue : !!value;\n }\n }\n }, {\n key: \"checked\",\n get: function get() {\n if (this.component.name) {\n return this.dataValue === this.component.value;\n }\n return !!this.dataValue;\n }\n }, {\n key: \"setCheckedState\",\n value: function setCheckedState(value) {\n if (!this.input) {\n return;\n }\n if (this.component.name) {\n this.input.value = value === this.component.value ? this.component.value : 0;\n this.input.checked = value === this.component.value ? 1 : 0;\n } else if (value === 'on') {\n this.input.value = 1;\n this.input.checked = 1;\n } else if (value === 'off') {\n this.input.value = 0;\n this.input.checked = 0;\n } else if (value) {\n this.input.value = 1;\n this.input.checked = 1;\n } else {\n this.input.value = 0;\n this.input.checked = 0;\n }\n if (this.input.checked) {\n this.input.setAttribute('checked', true);\n } else {\n this.input.removeAttribute('checked');\n }\n return value;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (this.setCheckedState(value) !== undefined || !this.input && value !== undefined && (this.visible || this.conditionallyVisible() || !this.component.clearOnHide)) {\n var changed = this.updateValue(value, flags);\n if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {\n this.redraw();\n }\n return changed;\n }\n return false;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n var _this$component = this.component,\n componentName = _this$component.name,\n componentValue = _this$component.value;\n var hasValue = componentName ? _lodash[\"default\"].isEqual(value, componentValue) : value;\n return this.t(hasValue ? 'Yes' : 'No');\n }\n }, {\n key: \"updateValue\",\n value: function updateValue(value, flags) {\n // If this is a radio and is alredy checked, uncheck it.\n if (this.component.name && flags.modified && this.dataValue === this.component.value) {\n this.input.checked = 0;\n this.input.value = 0;\n this.dataValue = '';\n this.updateOnChange(flags, true);\n }\n var changed = _get(_getPrototypeOf(CheckBoxComponent.prototype), \"updateValue\", this).call(this, value, flags);\n\n // Update attributes of the input element\n if (changed && this.input) {\n if (this.input.checked) {\n this.input.setAttribute('checked', 'true');\n } else {\n this.input.removeAttribute('checked');\n }\n }\n return changed;\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Field2[\"default\"].schema.apply(_Field2[\"default\"], [{\n type: 'checkbox',\n inputType: 'checkbox',\n label: 'Checkbox',\n key: 'checkbox',\n dataGridLabel: true,\n labelPosition: 'right',\n value: '',\n name: ''\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Checkbox',\n group: 'basic',\n icon: 'check-square',\n documentation: '/userguide/form-building/form-components#check-box',\n weight: 50,\n schema: CheckBoxComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return CheckBoxComponent.conditionOperatorsSettings;\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(CheckBoxComponent), \"conditionOperatorsSettings\", this)), {}, {\n operators: ['isEqual'],\n valueComponent: function valueComponent() {\n return {\n valueType: 'boolean',\n data: {\n values: [{\n label: 'Checked',\n value: 'true'\n }, {\n label: 'Not Checked',\n value: 'false'\n }]\n },\n type: 'select'\n };\n }\n });\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n schema = schema || {};\n var types = (0, _utils.getComponentSavedTypes)(schema);\n if (_lodash[\"default\"].isArray(types)) {\n return types;\n }\n if (schema.inputType === 'radio') {\n return [_utils.componentValueTypes.string];\n }\n return [_utils.componentValueTypes[\"boolean\"]];\n }\n }]);\n return CheckBoxComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = CheckBoxComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/checkbox/Checkbox.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar CheckBoxComponent = /*#__PURE__*/function (_Field) {\n _inherits(CheckBoxComponent, _Field);\n var _super = _createSuper(CheckBoxComponent);\n function CheckBoxComponent() {\n _classCallCheck(this, CheckBoxComponent);\n return _super.apply(this, arguments);\n }\n _createClass(CheckBoxComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return CheckBoxComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var name = this.component.name;\n var defaultValue = _get(_getPrototypeOf(CheckBoxComponent.prototype), \"defaultValue\", this);\n return name ? this.component[name] || this.emptyValue : (defaultValue || this.component.defaultValue || false).toString() === 'true';\n }\n }, {\n key: \"labelClass\",\n get: function get() {\n var className = '';\n if (this.isInputComponent && !this.options.inputsOnly && this.component.validate && this.component.validate.required) {\n className += ' field-required';\n }\n return \"\".concat(className);\n }\n }, {\n key: \"hasSetValue\",\n get: function get() {\n return this.hasValue();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(CheckBoxComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'input';\n info.changeEvent = 'click';\n info.attr.type = this.component.inputType || 'checkbox';\n info.attr[\"class\"] = 'form-check-input';\n if (this.component.name) {\n info.attr.name = \"data[\".concat(this.component.name, \"]\");\n }\n info.attr.value = this.component.value ? this.component.value : 0;\n info.label = this.t(this.component.label, {\n _userInput: true\n });\n info.labelClass = this.labelClass;\n return info;\n }\n }, {\n key: \"labelInfo\",\n get: function get() {\n return {\n hidden: true\n };\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(CheckBoxComponent.prototype), \"render\", this).call(this, this.renderTemplate('checkbox', {\n input: this.inputInfo,\n checked: this.checked,\n tooltip: this.interpolate(this.t(this.component.tooltip) || '', {\n _userInput: true\n }).replace(/(?:\\r\\n|\\r|\\n)/g, '
')\n }));\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this = this;\n this.loadRefs(element, {\n input: 'multiple'\n });\n this.input = this.refs.input[0];\n if (this.refs.input) {\n this.addEventListener(this.input, this.inputInfo.changeEvent, function () {\n return _this.updateValue(null, {\n modified: true\n });\n });\n this.addShortcut(this.input);\n }\n return _get(_getPrototypeOf(CheckBoxComponent.prototype), \"attach\", this).call(this, element);\n }\n }, {\n key: \"detach\",\n value: function detach(element) {\n if (element && this.input) {\n this.removeShortcut(this.input);\n }\n _get(_getPrototypeOf(CheckBoxComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.component.inputType === 'radio' ? null : false;\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n return _get(_getPrototypeOf(CheckBoxComponent.prototype), \"isEmpty\", this).call(this, value) || value === false;\n }\n }, {\n key: \"key\",\n get: function get() {\n return this.component.name ? this.component.name : _get(_getPrototypeOf(CheckBoxComponent.prototype), \"key\", this);\n }\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n if (this.component.name) {\n return this.refs.input[index].checked ? this.component.value : '';\n }\n return !!this.refs.input[index].checked;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n var value = _get(_getPrototypeOf(CheckBoxComponent.prototype), \"getValue\", this).call(this);\n if (this.component.name) {\n return value ? this.setCheckedState(value) : this.setCheckedState(this.dataValue);\n } else {\n return value === '' ? this.dataValue : !!value;\n }\n }\n }, {\n key: \"checked\",\n get: function get() {\n if (this.component.name) {\n return this.dataValue === this.component.value;\n }\n return !!this.dataValue;\n }\n }, {\n key: \"setCheckedState\",\n value: function setCheckedState(value) {\n if (!this.input) {\n return;\n }\n if (this.component.name) {\n this.input.value = value === this.component.value ? this.component.value : 0;\n this.input.checked = value === this.component.value ? 1 : 0;\n } else if (value === 'on') {\n this.input.value = 1;\n this.input.checked = 1;\n } else if (value === 'off') {\n this.input.value = 0;\n this.input.checked = 0;\n } else if (value) {\n this.input.value = 1;\n this.input.checked = 1;\n } else {\n this.input.value = 0;\n this.input.checked = 0;\n }\n if (this.input.checked) {\n this.input.setAttribute('checked', true);\n } else {\n this.input.removeAttribute('checked');\n }\n return value;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.setCheckedState(value);\n return _get(_getPrototypeOf(CheckBoxComponent.prototype), \"setValue\", this).call(this, value, flags);\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n var _this$component = this.component,\n componentName = _this$component.name,\n componentValue = _this$component.value;\n var hasValue = componentName ? _lodash[\"default\"].isEqual(value, componentValue) : value;\n return this.t(hasValue ? 'Yes' : 'No');\n }\n }, {\n key: \"updateValue\",\n value: function updateValue(value, flags) {\n // If this is a radio and is alredy checked, uncheck it.\n if (this.component.name && flags.modified && this.dataValue === this.component.value) {\n this.input.checked = 0;\n this.input.value = 0;\n this.dataValue = '';\n this.updateOnChange(flags, true);\n }\n var changed = _get(_getPrototypeOf(CheckBoxComponent.prototype), \"updateValue\", this).call(this, value, flags);\n\n // Update attributes of the input element\n if (changed && this.input) {\n if (this.input.checked) {\n this.input.setAttribute('checked', 'true');\n } else {\n this.input.removeAttribute('checked');\n }\n }\n return changed;\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Field2[\"default\"].schema.apply(_Field2[\"default\"], [{\n type: 'checkbox',\n inputType: 'checkbox',\n label: 'Checkbox',\n key: 'checkbox',\n dataGridLabel: true,\n labelPosition: 'right',\n value: '',\n name: ''\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Checkbox',\n group: 'basic',\n icon: 'check-square',\n documentation: '/userguide/form-building/form-components#check-box',\n weight: 50,\n schema: CheckBoxComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return CheckBoxComponent.conditionOperatorsSettings;\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(CheckBoxComponent), \"conditionOperatorsSettings\", this)), {}, {\n operators: ['isEqual'],\n valueComponent: function valueComponent() {\n return {\n valueType: 'boolean',\n data: {\n values: [{\n label: 'Checked',\n value: 'true'\n }, {\n label: 'Not Checked',\n value: 'false'\n }]\n },\n type: 'select'\n };\n }\n });\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n schema = schema || {};\n var types = (0, _utils.getComponentSavedTypes)(schema);\n if (_lodash[\"default\"].isArray(types)) {\n return types;\n }\n if (schema.inputType === 'radio') {\n return [_utils.componentValueTypes.string];\n }\n return [_utils.componentValueTypes[\"boolean\"]];\n }\n }]);\n return CheckBoxComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = CheckBoxComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/checkbox/Checkbox.js?"); /***/ }), @@ -807,7 +807,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.values.js */ \"./node_modules/core-js/modules/es.object.values.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.object.entries.js */ \"./node_modules/core-js/modules/es.object.entries.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _NestedArrayComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nestedarray/NestedArrayComponent */ \"./lib/components/_classes/nestedarray/NestedArrayComponent.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar dragula;\nif (typeof window !== 'undefined') {\n // Import from \"dist\" because it would require and \"global\" would not be defined in Angular apps.\n dragula = __webpack_require__(/*! dragula/dist/dragula */ \"./node_modules/dragula/dist/dragula.js\");\n}\nvar DataGridComponent = /*#__PURE__*/function (_NestedArrayComponent) {\n _inherits(DataGridComponent, _NestedArrayComponent);\n var _super = _createSuper(DataGridComponent);\n function DataGridComponent() {\n var _this;\n _classCallCheck(this, DataGridComponent);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.type = 'datagrid';\n _this.tabIndex = 0;\n return _this;\n }\n _createClass(DataGridComponent, [{\n key: \"init\",\n value: function init() {\n this.components = this.components || [];\n\n // Add new values based on minLength.\n this.rows = [];\n this.columns = _toConsumableArray(this.component.components);\n if (this.initRows || !_lodash[\"default\"].isEqual(this.dataValue, this.emptyValue)) {\n this.createRows(true);\n }\n this.visibleColumns = {};\n this.prevHasAddButton = this.hasAddButton();\n this.checkColumns();\n }\n }, {\n key: \"dataValue\",\n get: function get() {\n var dataValue = _get(_getPrototypeOf(DataGridComponent.prototype), \"dataValue\", this);\n if (!dataValue || !Array.isArray(dataValue)) {\n return this.emptyValue;\n }\n return dataValue;\n },\n set: function set(value) {\n _set(_getPrototypeOf(DataGridComponent.prototype), \"dataValue\", value, this, true);\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return DataGridComponent.schema();\n }\n }, {\n key: \"initEmpty\",\n get: function get() {\n return this.component.initEmpty || this.component.noFirstRow;\n }\n }, {\n key: \"initRows\",\n get: function get() {\n return this.builderMode || this.path === 'defaultValue' || !this.initEmpty;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.initEmpty ? [] : [{}];\n }\n }, {\n key: \"addAnotherPosition\",\n get: function get() {\n return _lodash[\"default\"].get(this.component, 'addAnotherPosition', 'bottom');\n }\n }, {\n key: \"minLength\",\n get: function get() {\n if (this.hasRowGroups()) {\n return _lodash[\"default\"].sum(this.getGroupSizes());\n } else {\n return _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var isBuilderMode = this.builderMode;\n var isEmptyInit = this.initEmpty;\n // Ensure we have one and only one row in builder mode.\n if (isBuilderMode || isEmptyInit && !this.dataValue.length) {\n return isEmptyInit && !isBuilderMode ? [] : [{}];\n }\n var value = _get(_getPrototypeOf(DataGridComponent.prototype), \"defaultValue\", this);\n var defaultValue;\n if (Array.isArray(value)) {\n defaultValue = value;\n } else if (value && _typeof(value) === 'object') {\n defaultValue = [value];\n } else {\n defaultValue = this.emptyValue;\n }\n for (var dIndex = defaultValue.length; dIndex < this.minLength; dIndex++) {\n defaultValue.push({});\n }\n return defaultValue;\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(DataGridComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(DataGridComponent.prototype), \"disabled\", disabled, this, true);\n _lodash[\"default\"].each(this.refs[\"\".concat(this.datagridKey, \"-addRow\")], function (button) {\n button.disabled = disabled;\n });\n _lodash[\"default\"].each(this.refs[\"\".concat(this.datagridKey, \"-removeRow\")], function (button) {\n button.disabled = disabled;\n });\n }\n }, {\n key: \"datagridKey\",\n get: function get() {\n return \"datagrid-\".concat(this.key);\n }\n }, {\n key: \"allowReorder\",\n get: function get() {\n return !this.options.readOnly && _lodash[\"default\"].get(this.component, 'reorder', false);\n }\n }, {\n key: \"iteratableRows\",\n get: function get() {\n var _this2 = this;\n return this.rows.map(function (row, index) {\n return {\n components: row,\n data: _this2.dataValue[index]\n };\n });\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var _this$components;\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n var isEmpty = _get(_getPrototypeOf(DataGridComponent.prototype), \"isEmpty\", this).call(this, value);\n if ((_this$components = this.components) !== null && _this$components !== void 0 && _this$components.length) {\n return this.components.reduce(function (isEmpty, component) {\n return isEmpty && component.isEmpty();\n }, true);\n }\n return isEmpty;\n }\n\n /**\n * Split rows into chunks.\n * @param {Number[]} groups - array of numbers where each item is size of group\n * @param {Array} rows - rows collection\n * @return {Array}\n */\n }, {\n key: \"getRowChunks\",\n value: function getRowChunks(groups, rows) {\n var _groups$reduce = groups.reduce(function (_ref, size) {\n var _ref2 = _slicedToArray(_ref, 2),\n startIndex = _ref2[0],\n acc = _ref2[1];\n var endIndex = startIndex + size;\n return [endIndex, [].concat(_toConsumableArray(acc), [[startIndex, endIndex]])];\n }, [0, []]),\n _groups$reduce2 = _slicedToArray(_groups$reduce, 2),\n chunks = _groups$reduce2[1];\n return chunks.map(function (range) {\n return _lodash[\"default\"].slice.apply(_lodash[\"default\"], [rows].concat(_toConsumableArray(range)));\n });\n }\n\n /**\n * Create groups object.\n * Each key in object represents index of first row in group.\n * @return {Object}\n */\n }, {\n key: \"getGroups\",\n value: function getGroups() {\n var groups = _lodash[\"default\"].get(this.component, 'rowGroups', []);\n var sizes = _lodash[\"default\"].map(groups, 'numberOfRows').slice(0, -1);\n var indexes = sizes.reduce(function (groupIndexes, size) {\n var last = groupIndexes[groupIndexes.length - 1];\n return groupIndexes.concat(last + size);\n }, [0]);\n return groups.reduce(function (gidxs, group, idx) {\n return _objectSpread(_objectSpread({}, gidxs), {}, _defineProperty({}, indexes[idx], group));\n }, {});\n }\n\n /**\n * Retrun group sizes.\n * @return {Number[]}\n */\n }, {\n key: \"getGroupSizes\",\n value: function getGroupSizes() {\n return _lodash[\"default\"].map(_lodash[\"default\"].get(this.component, 'rowGroups', []), 'numberOfRows');\n }\n }, {\n key: \"hasRowGroups\",\n value: function hasRowGroups() {\n return _lodash[\"default\"].get(this, 'component.enableRowGroups', false) && !this.builderMode;\n }\n }, {\n key: \"totalRowsNumber\",\n value: function totalRowsNumber(groups) {\n return _lodash[\"default\"].sum(_lodash[\"default\"].map(groups, 'numberOfRows'));\n }\n }, {\n key: \"setStaticValue\",\n value: function setStaticValue(n) {\n this.dataValue = _lodash[\"default\"].range(n).map(function () {\n return {};\n });\n }\n }, {\n key: \"hasExtraColumn\",\n value: function hasExtraColumn() {\n return this.hasRemoveButtons() || this.canAddColumn;\n }\n }, {\n key: \"hasRemoveButtons\",\n value: function hasRemoveButtons() {\n return !this.builderMode && !this.component.disableAddingRemovingRows && !this.options.readOnly && !this.disabled && this.fullMode && this.dataValue.length > _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }, {\n key: \"hasTopSubmit\",\n value: function hasTopSubmit() {\n return this.hasAddButton() && ['top', 'both'].includes(this.addAnotherPosition);\n }\n }, {\n key: \"hasBottomSubmit\",\n value: function hasBottomSubmit() {\n return this.hasAddButton() && ['bottom', 'both'].includes(this.addAnotherPosition);\n }\n }, {\n key: \"canAddColumn\",\n get: function get() {\n return this.builderMode;\n }\n }, {\n key: \"render\",\n value: function render() {\n var columns = this.getColumns();\n var columnExtra = 0;\n var hasRemoveButtons = this.hasRemoveButtons();\n if (this.component.reorder) {\n columnExtra++;\n }\n if (hasRemoveButtons) {\n columnExtra++;\n }\n if (this.canAddColumn) {\n columnExtra++;\n }\n var colWidth = Math.floor(12 / (columns.length + columnExtra));\n return _get(_getPrototypeOf(DataGridComponent.prototype), \"render\", this).call(this, this.renderTemplate('datagrid', {\n rows: this.getRows(),\n columns: columns,\n groups: this.hasRowGroups() ? this.getGroups() : [],\n visibleColumns: this.visibleColumns,\n hasToggle: _lodash[\"default\"].get(this, 'component.groupToggle', false),\n hasHeader: this.hasHeader(),\n hasExtraColumn: this.hasExtraColumn(),\n hasAddButton: this.hasAddButton(),\n hasRemoveButtons: hasRemoveButtons,\n hasTopSubmit: this.hasTopSubmit(),\n hasBottomSubmit: this.hasBottomSubmit(),\n hasGroups: this.hasRowGroups(),\n numColumns: columns.length + (this.hasExtraColumn() ? 1 : 0),\n datagridKey: this.datagridKey,\n allowReorder: this.allowReorder,\n builder: this.builderMode,\n canAddColumn: this.canAddColumn,\n tabIndex: this.tabIndex,\n placeholder: this.renderTemplate('builderPlaceholder', {\n position: this.componentComponents.length\n }),\n colWidth: colWidth.toString()\n }));\n }\n }, {\n key: \"getRows\",\n value: function getRows() {\n return this.rows.map(function (row) {\n var components = {};\n _lodash[\"default\"].each(row, function (col, key) {\n components[key] = col.render();\n });\n return components;\n });\n }\n }, {\n key: \"getColumns\",\n value: function getColumns() {\n var _this3 = this;\n return this.columns.filter(function (comp) {\n return !_this3.visibleColumns.hasOwnProperty(comp.key) || _this3.visibleColumns[comp.key];\n });\n }\n }, {\n key: \"hasHeader\",\n value: function hasHeader() {\n return this.component.components.reduce(function (hasHeader, col) {\n // If any of the components has a title and it isn't hidden, display the header.\n return hasHeader || (col.label || col.title) && !col.hideLabel;\n }, false);\n }\n }, {\n key: \"loadRefs\",\n value: function loadRefs(element, refs) {\n _get(_getPrototypeOf(DataGridComponent.prototype), \"loadRefs\", this).call(this, element, refs);\n if (refs['messageContainer'] === 'single') {\n var container = _lodash[\"default\"].last(element.querySelectorAll('[ref=messageContainer]'));\n this.refs['messageContainer'] = container || this.refs['messageContainer'];\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs,\n _this4 = this;\n this.loadRefs(element, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-row\"), 'multiple'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-tbody\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-addRow\"), 'multiple'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-removeRow\"), 'multiple'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-group-header\"), 'multiple'), _defineProperty(_this$loadRefs, this.datagridKey, 'multiple'), _defineProperty(_this$loadRefs, 'messageContainer', 'single'), _this$loadRefs));\n if (this.allowReorder) {\n this.refs[\"\".concat(this.datagridKey, \"-row\")].forEach(function (row, index) {\n row.dragInfo = {\n index: index\n };\n });\n if (dragula) {\n this.dragula = dragula([this.refs[\"\".concat(this.datagridKey, \"-tbody\")]], {\n moves: function moves(_draggedElement, _oldParent, clickedElement) {\n var clickedElementKey = clickedElement.getAttribute('data-key');\n var oldParentKey = _oldParent.getAttribute('data-key');\n\n //Check if the clicked button belongs to that container, if false, it belongs to the nested container\n if (oldParentKey === clickedElementKey) {\n return clickedElement.classList.contains('formio-drag-button');\n }\n }\n }).on('drop', this.onReorder.bind(this));\n this.dragula.on('cloned', function (el, original) {\n if (el && el.children && original && original.children) {\n _lodash[\"default\"].each(original.children, function (child, index) {\n var styles = getComputedStyle(child, null);\n if (styles.cssText !== '') {\n el.children[index].style.cssText = styles.cssText;\n } else {\n var cssText = Object.values(styles).reduce(function (css, propertyName) {\n return \"\".concat(css).concat(propertyName, \":\").concat(styles.getPropertyValue(propertyName), \";\");\n }, '');\n el.children[index].style.cssText = cssText;\n }\n });\n }\n });\n }\n }\n this.refs[\"\".concat(this.datagridKey, \"-addRow\")].forEach(function (addButton) {\n _this4.addEventListener(addButton, 'click', _this4.addRow.bind(_this4));\n });\n this.refs[\"\".concat(this.datagridKey, \"-removeRow\")].forEach(function (removeButton, index) {\n _this4.addEventListener(removeButton, 'click', _this4.removeRow.bind(_this4, index));\n });\n if (this.hasRowGroups()) {\n this.refs.chunks = this.getRowChunks(this.getGroupSizes(), this.refs[\"\".concat(this.datagridKey, \"-row\")]);\n this.refs[\"\".concat(this.datagridKey, \"-group-header\")].forEach(function (header, index) {\n _this4.addEventListener(header, 'click', function () {\n return _this4.toggleGroup(header, index);\n });\n });\n }\n var columns = this.getColumns();\n var rowLength = columns.length;\n this.rows.forEach(function (row, rowIndex) {\n var columnIndex = 0;\n columns.forEach(function (col) {\n _this4.attachComponents(_this4.refs[_this4.datagridKey][rowIndex * rowLength + columnIndex], [_this4.rows[rowIndex][col.key]], _this4.getComponentsContainer());\n columnIndex++;\n });\n });\n return _get(_getPrototypeOf(DataGridComponent.prototype), \"attach\", this).call(this, element);\n }\n }, {\n key: \"getComponentsContainer\",\n value: function getComponentsContainer() {\n return this.component.components;\n }\n }, {\n key: \"onReorder\",\n value: function onReorder(element, _target, _source, sibling) {\n if (!element.dragInfo || sibling && !sibling.dragInfo) {\n console.warn('There is no Drag Info available for either dragged or sibling element');\n return;\n }\n var oldPosition = element.dragInfo.index;\n //should drop at next sibling position; no next sibling means drop to last position\n var newPosition = sibling ? sibling.dragInfo.index : this.dataValue.length;\n var movedBelow = newPosition > oldPosition;\n var dataValue = (0, _utils.fastCloneDeep)(this.dataValue);\n var draggedRowData = dataValue[oldPosition];\n\n //insert element at new position\n dataValue.splice(newPosition, 0, draggedRowData);\n //remove element from old position (if was moved above, after insertion it's at +1 index)\n dataValue.splice(movedBelow ? oldPosition : oldPosition + 1, 1);\n\n //need to re-build rows to re-calculate indexes and other indexed fields for component instance (like rows for ex.)\n this.setValue(dataValue, {\n isReordered: true\n });\n this.rebuild();\n }\n }, {\n key: \"focusOnNewRowElement\",\n value: function focusOnNewRowElement(row) {\n Object.keys(row).find(function (key) {\n var element = row[key].element;\n if (element) {\n var focusableElements = (0, _utils.getFocusableElements)(element);\n if (focusableElements && focusableElements[0]) {\n focusableElements[0].focus();\n return true;\n }\n }\n return false;\n });\n }\n }, {\n key: \"addRow\",\n value: function addRow() {\n var _this5 = this;\n var index = this.rows.length;\n\n // Handle length mismatch between rows and dataValue\n if (this.dataValue.length === index) {\n this.dataValue.push({});\n }\n var row;\n var dataValue = this.dataValue;\n var defaultValue = this.defaultValue;\n if (this.initEmpty && defaultValue[index]) {\n row = defaultValue[index];\n dataValue[index] = row;\n } else {\n row = dataValue[index];\n }\n this.rows[index] = this.createRowComponents(row, index);\n this.emit('dataGridAddRow', {\n component: this.component,\n row: row\n });\n this.checkConditions();\n this.triggerChange();\n this.redraw().then(function () {\n _this5.focusOnNewRowElement(_this5.rows[index]);\n });\n }\n }, {\n key: \"updateComponentsRowIndex\",\n value: function updateComponentsRowIndex(components, rowIndex) {\n var _this6 = this;\n components.forEach(function (component, colIndex) {\n var _component$options;\n if ((_component$options = component.options) !== null && _component$options !== void 0 && _component$options.name) {\n var newName = \"[\".concat(_this6.key, \"][\").concat(rowIndex, \"]\");\n component.options.name = component.options.name.replace(\"[\".concat(_this6.key, \"][\").concat(component.rowIndex, \"]\"), newName);\n }\n component.rowIndex = rowIndex;\n component.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n component.path = _this6.calculateComponentPath(component);\n });\n }\n }, {\n key: \"updateRowsComponents\",\n value: function updateRowsComponents(rowIndex) {\n var _this7 = this;\n this.rows.slice(rowIndex).forEach(function (row, index) {\n _this7.updateComponentsRowIndex(Object.values(row), rowIndex + index);\n });\n }\n }, {\n key: \"removeRow\",\n value: function removeRow(index) {\n var makeEmpty = index === 0 && this.rows.length === 1;\n var flags = {\n isReordered: !makeEmpty,\n resetValue: makeEmpty\n };\n this.splice(index, flags);\n this.emit('dataGridDeleteRow', {\n index: index\n });\n var _this$rows$splice = this.rows.splice(index, 1),\n _this$rows$splice2 = _slicedToArray(_this$rows$splice, 1),\n row = _this$rows$splice2[0];\n this.removeRowComponents(row);\n this.updateRowsComponents(index);\n this.setValue(this.dataValue, flags);\n this.redraw();\n }\n }, {\n key: \"removeRowComponents\",\n value: function removeRowComponents(row) {\n var _this8 = this;\n _lodash[\"default\"].each(row, function (component) {\n return _this8.removeComponent(component);\n });\n }\n }, {\n key: \"getRowValues\",\n value: function getRowValues() {\n return this.dataValue;\n }\n }, {\n key: \"setRowComponentsData\",\n value: function setRowComponentsData(rowIndex, rowData) {\n _lodash[\"default\"].each(this.rows[rowIndex], function (component) {\n component.data = rowData;\n });\n }\n }, {\n key: \"createRows\",\n value: function createRows(init, rebuild) {\n var _this9 = this;\n var added = false;\n var rowValues = this.getRowValues();\n // Create any missing rows.\n rowValues.forEach(function (row, index) {\n if (!rebuild && _this9.rows[index]) {\n _this9.setRowComponentsData(index, row);\n } else {\n if (_this9.rows[index]) {\n _this9.removeRowComponents(_this9.rows[index]);\n }\n _this9.rows[index] = _this9.createRowComponents(row, index);\n added = true;\n }\n });\n // Delete any extra rows.\n var removedRows = this.rows.splice(rowValues.length);\n var removed = !!removedRows.length;\n // Delete components of extra rows (to make sure that this.components contain only components of exisiting rows)\n if (removed) {\n removedRows.forEach(function (row) {\n return _this9.removeRowComponents(row);\n });\n }\n if (!init && (added || removed)) {\n this.redraw();\n }\n return added;\n }\n }, {\n key: \"createRowComponents\",\n value: function createRowComponents(row, rowIndex) {\n var _this10 = this;\n var components = {};\n this.tabIndex = 0;\n this.component.components.map(function (col, colIndex) {\n var options = _lodash[\"default\"].clone(_this10.options);\n options.name += \"[\".concat(rowIndex, \"]\");\n options.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n var columnComponent;\n if (_this10.builderMode) {\n col.id = col.id + rowIndex;\n columnComponent = col;\n } else {\n columnComponent = _objectSpread(_objectSpread({}, col), {}, {\n id: col.id + rowIndex\n });\n }\n var component = _this10.createComponent(columnComponent, options, row);\n component.parentDisabled = !!_this10.disabled;\n component.rowIndex = rowIndex;\n component.inDataGrid = true;\n if (columnComponent.tabindex && parseInt(columnComponent.tabindex) > _this10.tabIndex) {\n _this10.tabIndex = parseInt(columnComponent.tabindex);\n }\n components[col.key] = component;\n });\n return components;\n }\n\n /**\n * Checks the validity of this datagrid.\n *\n * @param data\n * @param dirty\n * @return {*}\n */\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n data = data || this.rootValue;\n row = row || this.data;\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n if (!this.checkComponentValidity(data, dirty, row, {\n silentCheck: silentCheck\n })) {\n return false;\n }\n var isValid = this.checkRows('checkValidity', data, dirty, true, silentCheck);\n this.checkModal(isValid, dirty);\n return isValid;\n }\n }, {\n key: \"checkColumns\",\n value: function checkColumns(data) {\n var _this11 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n data = data || this.rootValue;\n var show = false;\n if (!this.rows || !this.rows.length) {\n return {\n rebuild: false,\n show: false\n };\n }\n if (this.builderMode) {\n return {\n rebuild: false,\n show: true\n };\n }\n var visibility = {};\n var logicRebuild = false;\n var dataValue = this.dataValue;\n this.rows.forEach(function (row, rowIndex) {\n _lodash[\"default\"].each(row, function (col, key) {\n if (col && typeof col.checkConditions === 'function') {\n var firstRowCheck = visibility[key] === undefined;\n visibility[key] = !!visibility[key] || col.checkConditions(data, flags, dataValue[rowIndex]) && col.type !== 'hidden';\n if (col.component.logic && firstRowCheck) {\n var compIndex = _lodash[\"default\"].findIndex(_this11.columns, ['key', key]);\n if (!_lodash[\"default\"].isEqual(_this11.columns[compIndex], col.component)) {\n logicRebuild = true;\n _this11.columns[compIndex] = col.component;\n }\n }\n }\n });\n });\n var rebuild = !_lodash[\"default\"].isEqual(visibility, this.visibleColumns) || logicRebuild;\n _lodash[\"default\"].each(visibility, function (col) {\n show |= col;\n });\n this.visibleColumns = visibility;\n return {\n rebuild: rebuild,\n show: show\n };\n }\n }, {\n key: \"checkComponentConditions\",\n value: function checkComponentConditions(data, flags, row) {\n var isVisible = this.visible;\n // If table isn't visible, don't bother calculating columns.\n if (!_get(_getPrototypeOf(DataGridComponent.prototype), \"checkComponentConditions\", this).call(this, data, flags, row)) {\n return false;\n }\n var _this$checkColumns = this.checkColumns(data, flags),\n rebuild = _this$checkColumns.rebuild,\n show = _this$checkColumns.show;\n // Check if a rebuild is needed or the visibility changes.\n if (rebuild || !isVisible) {\n this.createRows(false, rebuild);\n }\n\n // Return if this table should show.\n return show;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this12 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n this.dataValue = this.defaultValue;\n this.createRows();\n return false;\n }\n if (!Array.isArray(value)) {\n if (_typeof(value) === 'object') {\n value = [value];\n } else {\n this.createRows();\n value = [{}];\n }\n }\n\n // Make sure we always have at least one row.\n // NOTE: Removing this will break \"Public Configurations\" in portal. ;)\n if (value && !value.length && !this.initEmpty) {\n value.push({});\n }\n var isSettingSubmission = flags.fromSubmission && !_lodash[\"default\"].isEqual(value, this.emptyValue);\n var changed = this.hasChanged(value, this.dataValue);\n this.dataValue = value;\n if (this.initRows || isSettingSubmission) {\n if (!this.createRows() && changed) {\n this.redraw();\n }\n }\n if (this.componentModal && isSettingSubmission) {\n this.componentModal.setValue(value);\n }\n this.rows.forEach(function (row, rowIndex) {\n if (value.length <= rowIndex) {\n return;\n }\n _lodash[\"default\"].each(row, function (col) {\n col.rowIndex = rowIndex;\n _this12.setNestedValue(col, value[rowIndex], flags);\n });\n });\n this.updateOnChange(flags, changed);\n return changed;\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this13 = this;\n this.rows.forEach(function (row, index) {\n return _lodash[\"default\"].forIn(row, function (component) {\n return component.data = _this13.dataValue[index];\n });\n });\n }\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn) {\n path = Array.isArray(path) ? path : [path];\n var _path = path,\n _path2 = _toArray(_path),\n key = _path2[0],\n remainingPath = _path2.slice(1);\n var result = [];\n if (_lodash[\"default\"].isNumber(key) && remainingPath.length) {\n var compKey = remainingPath.pop();\n result = this.rows[key][compKey];\n // If the component is inside a Layout Component, try to find it among all the row's components\n if (!result) {\n Object.entries(this.rows[key]).forEach(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n comp = _ref4[1];\n if ('getComponent' in comp) {\n var possibleResult = comp.getComponent([compKey], fn);\n if (possibleResult) {\n result = possibleResult;\n }\n }\n });\n }\n if (result && _lodash[\"default\"].isFunction(fn)) {\n fn(result, this.getComponents());\n }\n if (remainingPath.length && 'getComponent' in result) {\n return result.getComponent(remainingPath, fn);\n }\n return result;\n }\n if (!_lodash[\"default\"].isString(key)) {\n return result;\n }\n this.everyComponent(function (component, components) {\n if (component.component.key === key) {\n var comp = component;\n if (remainingPath.length > 0 && 'getComponent' in component) {\n comp = component.getComponent(remainingPath, fn);\n } else if (fn) {\n fn(component, components);\n }\n result = result.concat(comp);\n }\n });\n return result.length > 0 ? result : null;\n }\n }, {\n key: \"toggleGroup\",\n value: function toggleGroup(element, index) {\n element.classList.toggle('collapsed');\n _lodash[\"default\"].each(this.refs.chunks[index], function (row) {\n row.classList.toggle('hidden');\n });\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len2 = arguments.length, extend = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n extend[_key2] = arguments[_key2];\n }\n return _NestedArrayComponent2[\"default\"].schema.apply(_NestedArrayComponent2[\"default\"], [{\n label: 'Data Grid',\n key: 'dataGrid',\n type: 'datagrid',\n clearOnHide: true,\n input: true,\n tree: true,\n components: []\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Data Grid',\n icon: 'th',\n group: 'data',\n documentation: '/userguide/form-building/data-components#data-grid',\n showPreview: false,\n weight: 30,\n schema: DataGridComponent.schema()\n };\n }\n }]);\n return DataGridComponent;\n}(_NestedArrayComponent2[\"default\"]);\nexports[\"default\"] = DataGridComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/datagrid/DataGrid.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.values.js */ \"./node_modules/core-js/modules/es.object.values.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"./node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.object.entries.js */ \"./node_modules/core-js/modules/es.object.entries.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _NestedArrayComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nestedarray/NestedArrayComponent */ \"./lib/components/_classes/nestedarray/NestedArrayComponent.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar dragula;\nif (typeof window !== 'undefined') {\n // Import from \"dist\" because it would require and \"global\" would not be defined in Angular apps.\n dragula = __webpack_require__(/*! dragula/dist/dragula */ \"./node_modules/dragula/dist/dragula.js\");\n}\nvar DataGridComponent = /*#__PURE__*/function (_NestedArrayComponent) {\n _inherits(DataGridComponent, _NestedArrayComponent);\n var _super = _createSuper(DataGridComponent);\n function DataGridComponent() {\n var _this;\n _classCallCheck(this, DataGridComponent);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _this.type = 'datagrid';\n _this.tabIndex = 0;\n return _this;\n }\n _createClass(DataGridComponent, [{\n key: \"init\",\n value: function init() {\n this.components = this.components || [];\n\n // Add new values based on minLength.\n this.rows = [];\n this.columns = _toConsumableArray(this.component.components);\n if (this.initRows || !_lodash[\"default\"].isEqual(this.dataValue, this.emptyValue)) {\n this.createRows(true);\n }\n this.visibleColumns = {};\n this.prevHasAddButton = this.hasAddButton();\n this.checkColumns();\n }\n }, {\n key: \"dataValue\",\n get: function get() {\n var dataValue = _get(_getPrototypeOf(DataGridComponent.prototype), \"dataValue\", this);\n if (!dataValue || !Array.isArray(dataValue)) {\n return this.emptyValue;\n }\n return dataValue;\n },\n set: function set(value) {\n _set(_getPrototypeOf(DataGridComponent.prototype), \"dataValue\", value, this, true);\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return DataGridComponent.schema();\n }\n }, {\n key: \"initEmpty\",\n get: function get() {\n return this.component.initEmpty || this.component.noFirstRow;\n }\n }, {\n key: \"initRows\",\n get: function get() {\n return this.builderMode || this.path === 'defaultValue' || !this.initEmpty;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.initEmpty ? [] : [{}];\n }\n }, {\n key: \"addAnotherPosition\",\n get: function get() {\n return _lodash[\"default\"].get(this.component, 'addAnotherPosition', 'bottom');\n }\n }, {\n key: \"minLength\",\n get: function get() {\n if (this.hasRowGroups()) {\n return _lodash[\"default\"].sum(this.getGroupSizes());\n } else {\n return _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var isBuilderMode = this.builderMode;\n var isEmptyInit = this.initEmpty;\n // Ensure we have one and only one row in builder mode.\n if (isBuilderMode || isEmptyInit && !this.dataValue.length) {\n return isEmptyInit && !isBuilderMode ? [] : [{}];\n }\n var value = _get(_getPrototypeOf(DataGridComponent.prototype), \"defaultValue\", this);\n var defaultValue;\n if (Array.isArray(value)) {\n defaultValue = value;\n } else if (value && _typeof(value) === 'object') {\n defaultValue = [value];\n } else {\n defaultValue = this.emptyValue;\n }\n for (var dIndex = defaultValue.length; dIndex < this.minLength; dIndex++) {\n defaultValue.push({});\n }\n return defaultValue;\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(DataGridComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(DataGridComponent.prototype), \"disabled\", disabled, this, true);\n _lodash[\"default\"].each(this.refs[\"\".concat(this.datagridKey, \"-addRow\")], function (button) {\n button.disabled = disabled;\n });\n _lodash[\"default\"].each(this.refs[\"\".concat(this.datagridKey, \"-removeRow\")], function (button) {\n button.disabled = disabled;\n });\n }\n }, {\n key: \"datagridKey\",\n get: function get() {\n return \"datagrid-\".concat(this.key);\n }\n }, {\n key: \"allowReorder\",\n get: function get() {\n return !this.options.readOnly && _lodash[\"default\"].get(this.component, 'reorder', false);\n }\n }, {\n key: \"iteratableRows\",\n get: function get() {\n var _this2 = this;\n return this.rows.map(function (row, index) {\n return {\n components: row,\n data: _this2.dataValue[index]\n };\n });\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var _this$components;\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n var isEmpty = _get(_getPrototypeOf(DataGridComponent.prototype), \"isEmpty\", this).call(this, value);\n if ((_this$components = this.components) !== null && _this$components !== void 0 && _this$components.length) {\n return this.components.reduce(function (isEmpty, component) {\n return isEmpty && component.isEmpty();\n }, true);\n }\n return isEmpty;\n }\n\n /**\n * Split rows into chunks.\n * @param {Number[]} groups - array of numbers where each item is size of group\n * @param {Array} rows - rows collection\n * @return {Array}\n */\n }, {\n key: \"getRowChunks\",\n value: function getRowChunks(groups, rows) {\n var _groups$reduce = groups.reduce(function (_ref, size) {\n var _ref2 = _slicedToArray(_ref, 2),\n startIndex = _ref2[0],\n acc = _ref2[1];\n var endIndex = startIndex + size;\n return [endIndex, [].concat(_toConsumableArray(acc), [[startIndex, endIndex]])];\n }, [0, []]),\n _groups$reduce2 = _slicedToArray(_groups$reduce, 2),\n chunks = _groups$reduce2[1];\n return chunks.map(function (range) {\n return _lodash[\"default\"].slice.apply(_lodash[\"default\"], [rows].concat(_toConsumableArray(range)));\n });\n }\n\n /**\n * Create groups object.\n * Each key in object represents index of first row in group.\n * @return {Object}\n */\n }, {\n key: \"getGroups\",\n value: function getGroups() {\n var groups = _lodash[\"default\"].get(this.component, 'rowGroups', []);\n var sizes = _lodash[\"default\"].map(groups, 'numberOfRows').slice(0, -1);\n var indexes = sizes.reduce(function (groupIndexes, size) {\n var last = groupIndexes[groupIndexes.length - 1];\n return groupIndexes.concat(last + size);\n }, [0]);\n return groups.reduce(function (gidxs, group, idx) {\n return _objectSpread(_objectSpread({}, gidxs), {}, _defineProperty({}, indexes[idx], group));\n }, {});\n }\n\n /**\n * Retrun group sizes.\n * @return {Number[]}\n */\n }, {\n key: \"getGroupSizes\",\n value: function getGroupSizes() {\n return _lodash[\"default\"].map(_lodash[\"default\"].get(this.component, 'rowGroups', []), 'numberOfRows');\n }\n }, {\n key: \"hasRowGroups\",\n value: function hasRowGroups() {\n return _lodash[\"default\"].get(this, 'component.enableRowGroups', false) && !this.builderMode;\n }\n }, {\n key: \"totalRowsNumber\",\n value: function totalRowsNumber(groups) {\n return _lodash[\"default\"].sum(_lodash[\"default\"].map(groups, 'numberOfRows'));\n }\n }, {\n key: \"setStaticValue\",\n value: function setStaticValue(n) {\n this.dataValue = _lodash[\"default\"].range(n).map(function () {\n return {};\n });\n }\n }, {\n key: \"hasExtraColumn\",\n value: function hasExtraColumn() {\n return this.hasRemoveButtons() || this.canAddColumn;\n }\n }, {\n key: \"hasRemoveButtons\",\n value: function hasRemoveButtons() {\n return !this.builderMode && !this.component.disableAddingRemovingRows && !this.options.readOnly && !this.disabled && this.fullMode && this.dataValue.length > _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }, {\n key: \"hasTopSubmit\",\n value: function hasTopSubmit() {\n return this.hasAddButton() && ['top', 'both'].includes(this.addAnotherPosition);\n }\n }, {\n key: \"hasBottomSubmit\",\n value: function hasBottomSubmit() {\n return this.hasAddButton() && ['bottom', 'both'].includes(this.addAnotherPosition);\n }\n }, {\n key: \"canAddColumn\",\n get: function get() {\n return this.builderMode;\n }\n }, {\n key: \"render\",\n value: function render() {\n var columns = this.getColumns();\n var columnExtra = 0;\n var hasRemoveButtons = this.hasRemoveButtons();\n if (this.component.reorder) {\n columnExtra++;\n }\n if (hasRemoveButtons) {\n columnExtra++;\n }\n if (this.canAddColumn) {\n columnExtra++;\n }\n var colWidth = Math.floor(12 / (columns.length + columnExtra));\n return _get(_getPrototypeOf(DataGridComponent.prototype), \"render\", this).call(this, this.renderTemplate('datagrid', {\n rows: this.getRows(),\n columns: columns,\n groups: this.hasRowGroups() ? this.getGroups() : [],\n visibleColumns: this.visibleColumns,\n hasToggle: _lodash[\"default\"].get(this, 'component.groupToggle', false),\n hasHeader: this.hasHeader(),\n hasExtraColumn: this.hasExtraColumn(),\n hasAddButton: this.hasAddButton(),\n hasRemoveButtons: hasRemoveButtons,\n hasTopSubmit: this.hasTopSubmit(),\n hasBottomSubmit: this.hasBottomSubmit(),\n hasGroups: this.hasRowGroups(),\n numColumns: columns.length + (this.hasExtraColumn() ? 1 : 0),\n datagridKey: this.datagridKey,\n allowReorder: this.allowReorder,\n builder: this.builderMode,\n canAddColumn: this.canAddColumn,\n tabIndex: this.tabIndex,\n placeholder: this.renderTemplate('builderPlaceholder', {\n position: this.componentComponents.length\n }),\n colWidth: colWidth.toString()\n }));\n }\n }, {\n key: \"getRows\",\n value: function getRows() {\n return this.rows.map(function (row) {\n var components = {};\n _lodash[\"default\"].each(row, function (col, key) {\n components[key] = col.render();\n });\n return components;\n });\n }\n }, {\n key: \"getColumns\",\n value: function getColumns() {\n var _this3 = this;\n return this.columns.filter(function (comp) {\n return !_this3.visibleColumns.hasOwnProperty(comp.key) || _this3.visibleColumns[comp.key];\n });\n }\n }, {\n key: \"hasHeader\",\n value: function hasHeader() {\n return this.component.components.reduce(function (hasHeader, col) {\n // If any of the components has a title and it isn't hidden, display the header.\n return hasHeader || (col.label || col.title) && !col.hideLabel;\n }, false);\n }\n }, {\n key: \"loadRefs\",\n value: function loadRefs(element, refs) {\n _get(_getPrototypeOf(DataGridComponent.prototype), \"loadRefs\", this).call(this, element, refs);\n if (refs['messageContainer'] === 'single') {\n var container = _lodash[\"default\"].last(element.querySelectorAll('[ref=messageContainer]'));\n this.refs['messageContainer'] = container || this.refs['messageContainer'];\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs,\n _this4 = this;\n this.loadRefs(element, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-row\"), 'multiple'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-tbody\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-addRow\"), 'multiple'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-removeRow\"), 'multiple'), _defineProperty(_this$loadRefs, \"\".concat(this.datagridKey, \"-group-header\"), 'multiple'), _defineProperty(_this$loadRefs, this.datagridKey, 'multiple'), _defineProperty(_this$loadRefs, 'messageContainer', 'single'), _this$loadRefs));\n if (this.allowReorder) {\n this.refs[\"\".concat(this.datagridKey, \"-row\")].forEach(function (row, index) {\n row.dragInfo = {\n index: index\n };\n });\n if (dragula) {\n this.dragula = dragula([this.refs[\"\".concat(this.datagridKey, \"-tbody\")]], {\n moves: function moves(_draggedElement, _oldParent, clickedElement) {\n var clickedElementKey = clickedElement.getAttribute('data-key');\n var oldParentKey = _oldParent.getAttribute('data-key');\n\n //Check if the clicked button belongs to that container, if false, it belongs to the nested container\n if (oldParentKey === clickedElementKey) {\n return clickedElement.classList.contains('formio-drag-button');\n }\n }\n }).on('drop', this.onReorder.bind(this));\n this.dragula.on('cloned', function (el, original) {\n if (el && el.children && original && original.children) {\n _lodash[\"default\"].each(original.children, function (child, index) {\n var styles = getComputedStyle(child, null);\n if (styles.cssText !== '') {\n el.children[index].style.cssText = styles.cssText;\n } else {\n var cssText = Object.values(styles).reduce(function (css, propertyName) {\n return \"\".concat(css).concat(propertyName, \":\").concat(styles.getPropertyValue(propertyName), \";\");\n }, '');\n el.children[index].style.cssText = cssText;\n }\n });\n }\n });\n }\n }\n this.refs[\"\".concat(this.datagridKey, \"-addRow\")].forEach(function (addButton) {\n _this4.addEventListener(addButton, 'click', _this4.addRow.bind(_this4));\n });\n this.refs[\"\".concat(this.datagridKey, \"-removeRow\")].forEach(function (removeButton, index) {\n _this4.addEventListener(removeButton, 'click', _this4.removeRow.bind(_this4, index));\n });\n if (this.hasRowGroups()) {\n this.refs.chunks = this.getRowChunks(this.getGroupSizes(), this.refs[\"\".concat(this.datagridKey, \"-row\")]);\n this.refs[\"\".concat(this.datagridKey, \"-group-header\")].forEach(function (header, index) {\n _this4.addEventListener(header, 'click', function () {\n return _this4.toggleGroup(header, index);\n });\n });\n }\n var columns = this.getColumns();\n var rowLength = columns.length;\n this.rows.forEach(function (row, rowIndex) {\n var columnIndex = 0;\n columns.forEach(function (col) {\n _this4.attachComponents(_this4.refs[_this4.datagridKey][rowIndex * rowLength + columnIndex], [_this4.rows[rowIndex][col.key]], _this4.getComponentsContainer());\n columnIndex++;\n });\n });\n return _get(_getPrototypeOf(DataGridComponent.prototype), \"attach\", this).call(this, element);\n }\n }, {\n key: \"getComponentsContainer\",\n value: function getComponentsContainer() {\n return this.component.components;\n }\n }, {\n key: \"onReorder\",\n value: function onReorder(element, _target, _source, sibling) {\n if (!element.dragInfo || sibling && !sibling.dragInfo) {\n console.warn('There is no Drag Info available for either dragged or sibling element');\n return;\n }\n var oldPosition = element.dragInfo.index;\n //should drop at next sibling position; no next sibling means drop to last position\n var newPosition = sibling ? sibling.dragInfo.index : this.dataValue.length;\n var movedBelow = newPosition > oldPosition;\n var dataValue = (0, _utils.fastCloneDeep)(this.dataValue);\n var draggedRowData = dataValue[oldPosition];\n\n //insert element at new position\n dataValue.splice(newPosition, 0, draggedRowData);\n //remove element from old position (if was moved above, after insertion it's at +1 index)\n dataValue.splice(movedBelow ? oldPosition : oldPosition + 1, 1);\n\n //need to re-build rows to re-calculate indexes and other indexed fields for component instance (like rows for ex.)\n this.setValue(dataValue, {\n isReordered: true\n });\n this.rebuild();\n }\n }, {\n key: \"focusOnNewRowElement\",\n value: function focusOnNewRowElement(row) {\n Object.keys(row).find(function (key) {\n var element = row[key].element;\n if (element) {\n var focusableElements = (0, _utils.getFocusableElements)(element);\n if (focusableElements && focusableElements[0]) {\n focusableElements[0].focus();\n return true;\n }\n }\n return false;\n });\n }\n }, {\n key: \"addRow\",\n value: function addRow() {\n var _this5 = this;\n var index = this.rows.length;\n\n // Handle length mismatch between rows and dataValue\n if (this.dataValue.length === index) {\n this.dataValue.push({});\n }\n var row;\n var dataValue = this.dataValue;\n var defaultValue = this.defaultValue;\n if (this.initEmpty && defaultValue[index]) {\n row = defaultValue[index];\n dataValue[index] = row;\n } else {\n row = dataValue[index];\n }\n this.rows[index] = this.createRowComponents(row, index);\n this.emit('dataGridAddRow', {\n component: this.component,\n row: row\n });\n this.checkConditions();\n this.triggerChange();\n this.redraw().then(function () {\n _this5.focusOnNewRowElement(_this5.rows[index]);\n });\n }\n }, {\n key: \"updateComponentsRowIndex\",\n value: function updateComponentsRowIndex(components, rowIndex) {\n var _this6 = this;\n components.forEach(function (component, colIndex) {\n var _component$options;\n if ((_component$options = component.options) !== null && _component$options !== void 0 && _component$options.name) {\n var newName = \"[\".concat(_this6.key, \"][\").concat(rowIndex, \"]\");\n component.options.name = component.options.name.replace(\"[\".concat(_this6.key, \"][\").concat(component.rowIndex, \"]\"), newName);\n }\n component.rowIndex = rowIndex;\n component.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n component.path = _this6.calculateComponentPath(component);\n });\n }\n }, {\n key: \"updateRowsComponents\",\n value: function updateRowsComponents(rowIndex) {\n var _this7 = this;\n this.rows.slice(rowIndex).forEach(function (row, index) {\n _this7.updateComponentsRowIndex(Object.values(row), rowIndex + index);\n });\n }\n }, {\n key: \"removeRow\",\n value: function removeRow(index) {\n var makeEmpty = index === 0 && this.rows.length === 1;\n var flags = {\n isReordered: !makeEmpty,\n resetValue: makeEmpty\n };\n this.splice(index, flags);\n this.emit('dataGridDeleteRow', {\n index: index\n });\n var _this$rows$splice = this.rows.splice(index, 1),\n _this$rows$splice2 = _slicedToArray(_this$rows$splice, 1),\n row = _this$rows$splice2[0];\n this.removeRowComponents(row);\n this.updateRowsComponents(index);\n this.setValue(this.dataValue, flags);\n this.redraw();\n }\n }, {\n key: \"removeRowComponents\",\n value: function removeRowComponents(row) {\n var _this8 = this;\n _lodash[\"default\"].each(row, function (component) {\n return _this8.removeComponent(component);\n });\n }\n }, {\n key: \"getRowValues\",\n value: function getRowValues() {\n return this.dataValue;\n }\n }, {\n key: \"setRowComponentsData\",\n value: function setRowComponentsData(rowIndex, rowData) {\n _lodash[\"default\"].each(this.rows[rowIndex], function (component) {\n component.data = rowData;\n });\n }\n }, {\n key: \"createRows\",\n value: function createRows(init, rebuild) {\n var _this9 = this;\n var added = false;\n var rowValues = this.getRowValues();\n // Create any missing rows.\n rowValues.forEach(function (row, index) {\n if (!rebuild && _this9.rows[index]) {\n _this9.setRowComponentsData(index, row);\n } else {\n if (_this9.rows[index]) {\n _this9.removeRowComponents(_this9.rows[index]);\n }\n _this9.rows[index] = _this9.createRowComponents(row, index);\n added = true;\n }\n });\n // Delete any extra rows.\n var removedRows = this.rows.splice(rowValues.length);\n var removed = !!removedRows.length;\n // Delete components of extra rows (to make sure that this.components contain only components of exisiting rows)\n if (removed) {\n removedRows.forEach(function (row) {\n return _this9.removeRowComponents(row);\n });\n }\n if (!init && (added || removed)) {\n this.redraw();\n }\n return added;\n }\n }, {\n key: \"createRowComponents\",\n value: function createRowComponents(row, rowIndex) {\n var _this10 = this;\n var components = {};\n this.tabIndex = 0;\n this.component.components.map(function (col, colIndex) {\n var options = _lodash[\"default\"].clone(_this10.options);\n options.name += \"[\".concat(rowIndex, \"]\");\n options.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n var columnComponent;\n if (_this10.builderMode) {\n col.id = col.id + rowIndex;\n columnComponent = col;\n } else {\n columnComponent = _objectSpread(_objectSpread({}, col), {}, {\n id: col.id + rowIndex\n });\n }\n var component = _this10.createComponent(columnComponent, options, row);\n component.parentDisabled = !!_this10.disabled;\n component.rowIndex = rowIndex;\n component.inDataGrid = true;\n if (columnComponent.tabindex && parseInt(columnComponent.tabindex) > _this10.tabIndex) {\n _this10.tabIndex = parseInt(columnComponent.tabindex);\n }\n components[col.key] = component;\n });\n return components;\n }\n\n /**\n * Checks the validity of this datagrid.\n *\n * @param data\n * @param dirty\n * @return {*}\n */\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, silentCheck) {\n data = data || this.rootValue;\n row = row || this.data;\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n if (!this.checkComponentValidity(data, dirty, row, {\n silentCheck: silentCheck\n })) {\n return false;\n }\n var isValid = this.checkRows('checkValidity', data, dirty, true, silentCheck);\n this.checkModal(isValid, dirty);\n return isValid;\n }\n }, {\n key: \"checkColumns\",\n value: function checkColumns(data) {\n var _this11 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n data = data || this.rootValue;\n var show = false;\n if (!this.rows || !this.rows.length) {\n return {\n rebuild: false,\n show: false\n };\n }\n if (this.builderMode) {\n return {\n rebuild: false,\n show: true\n };\n }\n var visibility = {};\n var logicRebuild = false;\n var dataValue = this.dataValue;\n this.rows.forEach(function (row, rowIndex) {\n _lodash[\"default\"].each(row, function (col, key) {\n if (col && typeof col.checkConditions === 'function') {\n var firstRowCheck = visibility[key] === undefined;\n visibility[key] = !!visibility[key] || col.checkConditions(data, flags, dataValue[rowIndex]) && col.type !== 'hidden';\n if (col.component.logic && firstRowCheck) {\n var compIndex = _lodash[\"default\"].findIndex(_this11.columns, ['key', key]);\n if (!_lodash[\"default\"].isEqual(_this11.columns[compIndex], col.component)) {\n logicRebuild = true;\n _this11.columns[compIndex] = col.component;\n }\n }\n }\n });\n });\n var rebuild = !_lodash[\"default\"].isEqual(visibility, this.visibleColumns) || logicRebuild;\n _lodash[\"default\"].each(visibility, function (col) {\n show |= col;\n });\n this.visibleColumns = visibility;\n return {\n rebuild: rebuild,\n show: show\n };\n }\n }, {\n key: \"checkComponentConditions\",\n value: function checkComponentConditions(data, flags, row) {\n var isVisible = this.visible;\n // If table isn't visible, don't bother calculating columns.\n if (!_get(_getPrototypeOf(DataGridComponent.prototype), \"checkComponentConditions\", this).call(this, data, flags, row)) {\n return false;\n }\n var _this$checkColumns = this.checkColumns(data, flags),\n rebuild = _this$checkColumns.rebuild,\n show = _this$checkColumns.show;\n // Check if a rebuild is needed or the visibility changes.\n if (rebuild || !isVisible) {\n this.createRows(false, rebuild);\n }\n\n // Return if this table should show.\n return show;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this12 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n this.dataValue = this.defaultValue;\n this.createRows();\n return false;\n }\n if (!Array.isArray(value)) {\n if (_typeof(value) === 'object') {\n value = [value];\n } else {\n this.createRows();\n value = [{}];\n }\n }\n\n // Make sure we always have at least one row.\n // NOTE: Removing this will break \"Public Configurations\" in portal. ;)\n if (value && !value.length && !this.initEmpty) {\n value.push({});\n }\n var isSettingSubmission = flags.fromSubmission && !_lodash[\"default\"].isEqual(value, this.emptyValue);\n var changed = this.hasChanged(value, this.dataValue);\n this.dataValue = value;\n if (this.initRows || isSettingSubmission || Array.isArray(this.dataValue) && this.dataValue.length !== this.rows.length) {\n if (!this.createRows() && changed) {\n this.redraw();\n }\n }\n if (this.componentModal && isSettingSubmission) {\n this.componentModal.setValue(value);\n }\n this.rows.forEach(function (row, rowIndex) {\n if (value.length <= rowIndex) {\n return;\n }\n _lodash[\"default\"].each(row, function (col) {\n col.rowIndex = rowIndex;\n _this12.setNestedValue(col, value[rowIndex], flags);\n });\n });\n this.updateOnChange(flags, changed);\n return changed;\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this13 = this;\n this.rows.forEach(function (row, index) {\n return _lodash[\"default\"].forIn(row, function (component) {\n return component.data = _this13.dataValue[index];\n });\n });\n }\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn) {\n path = Array.isArray(path) ? path : [path];\n var _path = path,\n _path2 = _toArray(_path),\n key = _path2[0],\n remainingPath = _path2.slice(1);\n var result = [];\n if (_lodash[\"default\"].isNumber(key) && remainingPath.length) {\n var compKey = remainingPath.pop();\n result = this.rows[key][compKey];\n // If the component is inside a Layout Component, try to find it among all the row's components\n if (!result) {\n Object.entries(this.rows[key]).forEach(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n comp = _ref4[1];\n if ('getComponent' in comp) {\n var possibleResult = comp.getComponent([compKey], fn);\n if (possibleResult) {\n result = possibleResult;\n }\n }\n });\n }\n if (result && _lodash[\"default\"].isFunction(fn)) {\n fn(result, this.getComponents());\n }\n if (remainingPath.length && 'getComponent' in result) {\n return result.getComponent(remainingPath, fn);\n }\n return result;\n }\n if (!_lodash[\"default\"].isString(key)) {\n return result;\n }\n this.everyComponent(function (component, components) {\n if (component.component.key === key) {\n var comp = component;\n if (remainingPath.length > 0 && 'getComponent' in component) {\n comp = component.getComponent(remainingPath, fn);\n } else if (fn) {\n fn(component, components);\n }\n result = result.concat(comp);\n }\n });\n return result.length > 0 ? result : null;\n }\n }, {\n key: \"toggleGroup\",\n value: function toggleGroup(element, index) {\n element.classList.toggle('collapsed');\n _lodash[\"default\"].each(this.refs.chunks[index], function (row) {\n row.classList.toggle('hidden');\n });\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len2 = arguments.length, extend = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n extend[_key2] = arguments[_key2];\n }\n return _NestedArrayComponent2[\"default\"].schema.apply(_NestedArrayComponent2[\"default\"], [{\n label: 'Data Grid',\n key: 'dataGrid',\n type: 'datagrid',\n clearOnHide: true,\n input: true,\n tree: true,\n components: []\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Data Grid',\n icon: 'th',\n group: 'data',\n documentation: '/userguide/form-building/data-components#data-grid',\n showPreview: false,\n weight: 30,\n schema: DataGridComponent.schema()\n };\n }\n }]);\n return DataGridComponent;\n}(_NestedArrayComponent2[\"default\"]);\nexports[\"default\"] = DataGridComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/datagrid/DataGrid.js?"); /***/ }), @@ -1311,7 +1311,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.number.parse-int.js */ \"./node_modules/core-js/modules/es.number.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Component2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _ComponentModal = _interopRequireDefault(__webpack_require__(/*! ../_classes/componentModal/ComponentModal */ \"./lib/components/_classes/componentModal/ComponentModal.js\"));\nvar _eventemitter = _interopRequireDefault(__webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _Formio = __webpack_require__(/*! ../../Formio */ \"./lib/Formio.js\");\nvar _Form = _interopRequireDefault(__webpack_require__(/*! ../../Form */ \"./lib/Form.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar FormComponent = /*#__PURE__*/function (_Component) {\n _inherits(FormComponent, _Component);\n var _super = _createSuper(FormComponent);\n function FormComponent() {\n _classCallCheck(this, FormComponent);\n return _super.apply(this, arguments);\n }\n _createClass(FormComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(FormComponent.prototype), \"init\", this).call(this);\n this.formObj = {\n display: this.component.display,\n settings: this.component.settings,\n components: this.component.components\n };\n this.valueChanged = false;\n this.subForm = null;\n this.formSrc = '';\n if (this.component.src) {\n this.formSrc = this.component.src;\n }\n if (!this.component.src && !this.options.formio && (this.component.form || this.component.path)) {\n if (this.component.project) {\n this.formSrc = _Formio.GlobalFormio.getBaseUrl();\n // Check to see if it is a MongoID.\n if ((0, _utils.isMongoId)(this.component.project)) {\n this.formSrc += '/project';\n }\n this.formSrc += \"/\".concat(this.component.project);\n this.options.project = this.formSrc;\n } else {\n this.formSrc = _Formio.GlobalFormio.getProjectUrl();\n this.options.project = this.formSrc;\n }\n if (this.component.form) {\n if ((0, _utils.isMongoId)(this.component.form)) {\n this.formSrc += \"/form/\".concat(this.component.form);\n } else {\n this.formSrc += \"/\".concat(this.component.form);\n }\n } else if (this.component.path) {\n this.formSrc += \"/\".concat(this.component.path);\n }\n }\n\n // Build the source based on the root src path.\n if (!this.formSrc && this.options.formio) {\n var rootSrc = this.options.formio.formsUrl;\n if (this.component.form && (0, _utils.isMongoId)(this.component.form)) {\n this.formSrc = \"\".concat(rootSrc, \"/\").concat(this.component.form);\n } else {\n var formPath = this.component.path || this.component.form;\n this.formSrc = \"\".concat(rootSrc.replace(/\\/form$/, ''), \"/\").concat(formPath);\n }\n }\n if (this.builderMode && this.component.hasOwnProperty('formRevision')) {\n this.component.revision = this.component.formRevision;\n delete this.component.formRevision;\n }\n\n // Add revision version if set.\n if (this.component.revision || this.component.revision === 0 || this.component.formRevision || this.component.formRevision === 0 || this.component.revisionId) {\n this.setFormRevision(this.component.revisionId || this.component.revision || this.component.formRevision);\n }\n return this.createSubForm();\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n return this.subFormReady || _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n // Not not provide a default value unless the subform is ready so that it will initialize correctly.\n return this.subForm ? _get(_getPrototypeOf(FormComponent.prototype), \"defaultValue\", this) : null;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return FormComponent.schema();\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return {\n data: {}\n };\n }\n }, {\n key: \"ready\",\n get: function get() {\n return this.subFormReady || _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"useOriginalRevision\",\n get: function get() {\n var _this$component, _this$formObj;\n return ((_this$component = this.component) === null || _this$component === void 0 ? void 0 : _this$component.useOriginalRevision) && !!((_this$formObj = this.formObj) !== null && _this$formObj !== void 0 && _this$formObj.revisions);\n }\n }, {\n key: \"setFormRevision\",\n value: function setFormRevision(rev) {\n // Remove current revisions from src if it is\n this.formSrc = this.formSrc.replace(/\\/v\\/[0-9a-z]+/, '');\n var revNumber = Number.parseInt(rev);\n if (!isNaN(revNumber)) {\n this.subFormRevision = rev;\n this.formSrc += \"/v/\".concat(rev);\n } else {\n this.subFormRevision = undefined;\n }\n }\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn) {\n path = (0, _utils.getArrayFromComponentPath)(path);\n if (path[0] === 'data') {\n path.shift();\n }\n var originalPathStr = \"\".concat(this.path, \".data.\").concat((0, _utils.getStringFromComponentPath)(path));\n if (this.subForm) {\n return this.subForm.getComponent(path, fn, originalPathStr);\n }\n }\n }, {\n key: \"getSubOptions\",\n value: function getSubOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n options.parentPath = \"\".concat(this.path, \".data.\");\n options.events = this.createEmitter();\n\n // Make sure to not show the submit button in wizards in the nested forms.\n _lodash[\"default\"].set(options, 'buttonSettings.showSubmit', false);\n if (!this.options) {\n return options;\n }\n if (this.options.base) {\n options.base = this.options.base;\n }\n if (this.options.project) {\n options.project = this.options.project;\n }\n if (this.options.readOnly || this.component.disabled) {\n options.readOnly = this.options.readOnly || this.component.disabled;\n }\n if (this.options.breadcrumbSettings) {\n options.breadcrumbSettings = this.options.breadcrumbSettings;\n }\n if (this.options.buttonSettings) {\n options.buttonSettings = _lodash[\"default\"].clone(this.options.buttonSettings);\n }\n if (this.options.viewAsHtml) {\n options.viewAsHtml = this.options.viewAsHtml;\n }\n if (this.options.language) {\n options.language = this.options.language;\n }\n if (this.options.template) {\n options.template = this.options.template;\n }\n if (this.options.templates) {\n options.templates = this.options.templates;\n }\n if (this.options.renderMode) {\n options.renderMode = this.options.renderMode;\n }\n if (this.options.attachMode) {\n options.attachMode = this.options.attachMode;\n }\n if (this.options.iconset) {\n options.iconset = this.options.iconset;\n }\n if (this.options.fileService) {\n options.fileService = this.options.fileService;\n }\n if (this.options.onChange) {\n options.onChange = this.options.onChange;\n }\n if (this.options.preview) {\n options.preview = this.options.preview;\n }\n if (this.options.saveDraft) {\n options.saveDraft = this.options.saveDraft;\n }\n if (this.options.saveDraftThrottle) {\n options.saveDraftThrottle = this.options.saveDraftThrottle;\n }\n return options;\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.builderMode) {\n return _get(_getPrototypeOf(FormComponent.prototype), \"render\", this).call(this, this.component.label || 'Nested form');\n }\n var subform = this.subForm ? this.subForm.render() : this.renderTemplate('loading');\n return _get(_getPrototypeOf(FormComponent.prototype), \"render\", this).call(this, subform);\n }\n }, {\n key: \"asString\",\n value: function asString(value) {\n return this.getValueAsString(value);\n }\n\n /**\n * Prints out the value of form components as a datagrid value.\n */\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (!value) {\n return 'No data provided';\n }\n if (!value.data && value._id) {\n return value._id;\n }\n if (!value.data || !Object.keys(value.data).length) {\n return 'No data provided';\n }\n if (options !== null && options !== void 0 && options.email) {\n var result = \"\\n \\n \\n \";\n this.everyComponent(function (component) {\n if (component.isInputComponent && component.visible && !component.skipInEmail) {\n result += \"\\n \\n \\n \\n \\n \");\n }\n }, _objectSpread(_objectSpread({}, options), {}, {\n fromRoot: true\n }));\n result += \"\\n \\n
\".concat(component.label, \"\").concat(component.getView(component.dataValue, options), \"
\\n \";\n return result;\n }\n if (_lodash[\"default\"].isEmpty(value)) {\n return '';\n }\n return '[Complex Data]';\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this = this;\n // Don't attach in builder.\n if (this.builderMode) {\n return _get(_getPrototypeOf(FormComponent.prototype), \"attach\", this).call(this, element);\n }\n return _get(_getPrototypeOf(FormComponent.prototype), \"attach\", this).call(this, element).then(function () {\n if (_this.isSubFormLazyLoad() && !_this.hasLoadedForm && !_this.subFormLoading) {\n _this.createSubForm(true);\n }\n return _this.subFormReady.then(function () {\n _this.empty(element);\n if (_this.options.builder) {\n _this.setContent(element, _this.ce('div', {\n \"class\": 'text-muted text-center p-2'\n }, _this.text(_this.formObj.title)));\n return;\n }\n _this.setContent(element, _this.render());\n if (_this.subForm) {\n if (_this.isNestedWizard) {\n element = _this.root.element;\n }\n _this.subForm.attach(element);\n _this.valueChanged = _this.hasSetValue;\n if (!_this.valueChanged && _this.dataValue.state !== 'submitted') {\n _this.setDefaultValue();\n } else {\n _this.restoreValue();\n }\n }\n if (!_this.builderMode && _this.component.modalEdit) {\n var modalShouldBeOpened = _this.componentModal ? _this.componentModal.isOpened : false;\n var currentValue = modalShouldBeOpened ? _this.componentModal.currentValue : _this.dataValue;\n _this.componentModal = new _ComponentModal[\"default\"](_this, element, modalShouldBeOpened, currentValue);\n _this.setOpenModalElement();\n }\n _this.calculateValue();\n });\n });\n }\n }, {\n key: \"detach\",\n value: function detach() {\n if (this.subForm) {\n this.subForm.detach();\n }\n _get(_getPrototypeOf(FormComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"currentForm\",\n get: function get() {\n return this._currentForm;\n },\n set: function set(instance) {\n var _this2 = this;\n this._currentForm = instance;\n if (!this.subForm) {\n return;\n }\n this.subForm.getComponents().forEach(function (component) {\n component.currentForm = _this2;\n });\n }\n }, {\n key: \"hasLoadedForm\",\n get: function get() {\n return this.formObj && this.formObj.components && Array.isArray(this.formObj.components) && this.formObj.components.length;\n }\n }, {\n key: \"isRevisionChanged\",\n get: function get() {\n return _lodash[\"default\"].isNumber(this.subFormRevision) && _lodash[\"default\"].isNumber(this.formObj._vid) && this.formObj._vid !== this.subFormRevision;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n if (this.subForm) {\n this.subForm.destroy();\n this.subForm = null;\n this.subFormReady = null;\n }\n _get(_getPrototypeOf(FormComponent.prototype), \"destroy\", this).call(this);\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n if (this.subForm) {\n this.subForm.form = this.formObj;\n this.setSubFormDisabled(this.subForm);\n }\n return _get(_getPrototypeOf(FormComponent.prototype), \"redraw\", this).call(this);\n }\n\n /**\n * Pass everyComponent to subform.\n * @param args\n * @returns {*|void}\n */\n }, {\n key: \"everyComponent\",\n value: function everyComponent() {\n if (this.subForm) {\n var _this$subForm;\n (_this$subForm = this.subForm).everyComponent.apply(_this$subForm, arguments);\n }\n }\n }, {\n key: \"setSubFormDisabled\",\n value: function setSubFormDisabled(subForm) {\n subForm.disabled = this.disabled; // When the Nested Form is disabled make the subForm disabled\n }\n }, {\n key: \"updateSubWizards\",\n value: function updateSubWizards(subForm) {\n var _this$root,\n _subForm$_form,\n _this3 = this;\n if (this.isNestedWizard && (_this$root = this.root) !== null && _this$root !== void 0 && _this$root.subWizards && (subForm === null || subForm === void 0 ? void 0 : (_subForm$_form = subForm._form) === null || _subForm$_form === void 0 ? void 0 : _subForm$_form.display) === 'wizard') {\n var existedForm = this.root.subWizards.findIndex(function (form) {\n return form.component.form === _this3.component.form;\n });\n if (existedForm !== -1) {\n this.root.subWizards[existedForm] = this;\n } else {\n this.root.subWizards.push(this);\n }\n this.emit('subWizardsUpdated', subForm);\n }\n }\n\n /**\n * Create a subform instance.\n *\n * @return {*}\n */\n }, {\n key: \"createSubForm\",\n value: function createSubForm(fromAttach) {\n var _this4 = this;\n this.subFormReady = this.loadSubForm(fromAttach).then(function (form) {\n if (!form) {\n return;\n }\n\n // Iterate through every component and hide the submit button.\n (0, _utils.eachComponent)(form.components, function (component) {\n _this4.hideSubmitButton(component);\n });\n\n // If the subform is already created then destroy the old one.\n if (_this4.subForm) {\n _this4.subForm.destroy();\n }\n\n // Render the form.\n return new _Form[\"default\"](form, _this4.getSubOptions()).ready.then(function (instance) {\n _this4.subForm = instance;\n _this4.subForm.currentForm = _this4;\n _this4.subForm.parent = _this4;\n _this4.subForm.parentVisible = _this4.visible;\n _this4.subForm.on('change', function () {\n if (_this4.subForm) {\n _this4.dataValue = _this4.subForm.getValue();\n _this4.triggerChange({\n noEmit: true\n });\n }\n });\n _this4.subForm.url = _this4.formSrc;\n _this4.subForm.nosubmit = true;\n _this4.subForm.root = _this4.root;\n _this4.subForm.localRoot = _this4.isNestedWizard ? _this4.localRoot : _this4.subForm;\n if (_this4.parent) {\n _this4.subForm.draftEnabled = _this4.parent.draftEnabled;\n _this4.subForm.savingDraft = _this4.parent.savingDraft;\n }\n _this4.restoreValue();\n _this4.valueChanged = _this4.hasSetValue;\n _this4.onChange();\n return _this4.subForm;\n });\n }).then(function (subForm) {\n _this4.updateSubWizards(subForm);\n return subForm;\n });\n return this.subFormReady;\n }\n }, {\n key: \"hideSubmitButton\",\n value: function hideSubmitButton(component) {\n var isSubmitButton = component.type === 'button' && (component.action === 'submit' || !component.action);\n if (isSubmitButton) {\n component.hidden = true;\n }\n }\n\n /**\n * Load the subform.\n */\n }, {\n key: \"loadSubForm\",\n value: function loadSubForm(fromAttach) {\n var _this$component2,\n _this5 = this;\n if (this.builderMode || this.isHidden() || this.isSubFormLazyLoad() && !fromAttach) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n if (this.hasLoadedForm && !this.isRevisionChanged && !(this.options.pdf && (_this$component2 = this.component) !== null && _this$component2 !== void 0 && _this$component2.useOriginalRevision && _lodash[\"default\"].isNull(this.subForm) && !this.subFormLoading)) {\n // Pass config down to sub forms.\n if (this.root && this.root.form && this.root.form.config && !this.formObj.config) {\n this.formObj.config = this.root.form.config;\n }\n return _nativePromiseOnly[\"default\"].resolve(this.formObj);\n } else if (this.formSrc) {\n this.subFormLoading = true;\n return new _Formio.GlobalFormio(this.formSrc).loadForm({\n params: {\n live: 1\n }\n }).then(function (formObj) {\n _this5.formObj = formObj;\n if (_this5.options.pdf && _this5.component.useOriginalRevision) {\n _this5.formObj.display = 'form';\n }\n _this5.subFormLoading = false;\n return formObj;\n })[\"catch\"](function (err) {\n console.log(err);\n return null;\n });\n }\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"subFormData\",\n get: function get() {\n var _this$dataValue;\n return ((_this$dataValue = this.dataValue) === null || _this$dataValue === void 0 ? void 0 : _this$dataValue.data) || {};\n }\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, row, options) {\n options = options || {};\n var silentCheck = options.silentCheck || false;\n if (this.subForm) {\n return this.subForm.checkValidity(this.subFormData, dirty, null, silentCheck);\n }\n return _get(_getPrototypeOf(FormComponent.prototype), \"checkComponentValidity\", this).call(this, data, dirty, row, options);\n }\n }, {\n key: \"checkComponentConditions\",\n value: function checkComponentConditions(data, flags, row) {\n var _this6 = this;\n var visible = _get(_getPrototypeOf(FormComponent.prototype), \"checkComponentConditions\", this).call(this, data, flags, row);\n\n // Return if already hidden\n if (!visible) {\n return visible;\n }\n if (this.subForm) {\n return this.subForm.checkConditions(this.subFormData);\n }\n // There are few cases when subForm is not loaded when a change is triggered,\n // so we need to perform checkConditions after it is ready, or some conditional fields might be hidden in View mode\n else if (this.subFormReady) {\n this.subFormReady.then(function () {\n if (_this6.subForm) {\n return _this6.subForm.checkConditions(_this6.subFormData);\n }\n });\n }\n return visible;\n }\n }, {\n key: \"calculateValue\",\n value: function calculateValue(data, flags, row) {\n if (this.subForm) {\n return this.subForm.calculateValue(this.subFormData, flags);\n }\n return _get(_getPrototypeOf(FormComponent.prototype), \"calculateValue\", this).call(this, data, flags, row);\n }\n }, {\n key: \"setPristine\",\n value: function setPristine(pristine) {\n _get(_getPrototypeOf(FormComponent.prototype), \"setPristine\", this).call(this, pristine);\n if (this.subForm) {\n this.subForm.setPristine(pristine);\n }\n }\n\n /**\n * Determine if the subform should be submitted.\n * @return {*|boolean}\n */\n }, {\n key: \"shouldSubmit\",\n get: function get() {\n return this.subFormReady && (!this.component.hasOwnProperty('reference') || this.component.reference) && !this.isHidden();\n }\n\n /**\n * Returns the data for the subform.\n *\n * @return {*}\n */\n }, {\n key: \"getSubFormData\",\n value: function getSubFormData() {\n if (_lodash[\"default\"].get(this.subForm, 'form.display') === 'pdf') {\n return this.subForm.getSubmission();\n } else {\n return _nativePromiseOnly[\"default\"].resolve(this.dataValue);\n }\n }\n\n /**\n * Submit the subform if configured to do so.\n *\n * @return {*}\n */\n }, {\n key: \"submitSubForm\",\n value: function submitSubForm(rejectOnError) {\n var _this7 = this;\n // If we wish to submit the form on next page, then do that here.\n if (this.shouldSubmit) {\n return this.subFormReady.then(function () {\n if (!_this7.subForm) {\n return _this7.dataValue;\n }\n _this7.subForm.nosubmit = false;\n return _this7.subForm.submitForm().then(function (result) {\n _this7.subForm.loading = false;\n _this7.subForm.showAllErrors = false;\n _this7.dataValue = result.submission;\n return _this7.dataValue;\n })[\"catch\"](function (err) {\n _this7.subForm.showAllErrors = true;\n if (rejectOnError) {\n _this7.subForm.onSubmissionError(err);\n return _nativePromiseOnly[\"default\"].reject(err);\n } else {\n return {};\n }\n });\n });\n }\n return this.getSubFormData();\n }\n\n /**\n * Submit the form before the next page is triggered.\n */\n }, {\n key: \"beforePage\",\n value: function beforePage(next) {\n var _this8 = this;\n // Should not submit child forms if we are going to the previous page\n if (!next) {\n return _get(_getPrototypeOf(FormComponent.prototype), \"beforePage\", this).call(this, next);\n }\n return this.submitSubForm(true).then(function () {\n return _get(_getPrototypeOf(FormComponent.prototype), \"beforePage\", _this8).call(_this8, next);\n });\n }\n\n /**\n * Submit the form before the whole form is triggered.\n */\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n var _this$subForm2,\n _this9 = this;\n var submission = this.dataValue;\n var isAlreadySubmitted = submission && submission._id && submission.form;\n\n // This submission has already been submitted, so just return the reference data.\n if (isAlreadySubmitted && !((_this$subForm2 = this.subForm) !== null && _this$subForm2 !== void 0 && _this$subForm2.wizard)) {\n this.dataValue = submission;\n return _nativePromiseOnly[\"default\"].resolve(this.dataValue);\n }\n return this.submitSubForm(false).then(function () {\n return _this9.dataValue;\n }).then(function () {\n return _get(_getPrototypeOf(FormComponent.prototype), \"beforeSubmit\", _this9).call(_this9);\n });\n }\n }, {\n key: \"isSubFormLazyLoad\",\n value: function isSubFormLazyLoad() {\n var _this$root2, _this$root2$_form;\n return ((_this$root2 = this.root) === null || _this$root2 === void 0 ? void 0 : (_this$root2$_form = _this$root2._form) === null || _this$root2$_form === void 0 ? void 0 : _this$root2$_form.display) === 'wizard' && this.component.lazyLoad;\n }\n }, {\n key: \"isHidden\",\n value: function isHidden() {\n if (!this.visible) {\n return true;\n }\n return !_get(_getPrototypeOf(FormComponent.prototype), \"checkConditions\", this).call(this, this.rootValue);\n }\n }, {\n key: \"setValue\",\n value: function setValue(submission) {\n var _this10 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = _get(_getPrototypeOf(FormComponent.prototype), \"setValue\", this).call(this, submission, flags);\n this.valueChanged = true;\n if (this.subForm) {\n var _this$subForm$form;\n var revisionPath = submission._frid ? '_frid' : '_vid';\n var shouldLoadOriginalRevision = this.useOriginalRevision && (_lodash[\"default\"].isNumber(submission[revisionPath]) || _lodash[\"default\"].isNumber(submission._fvid)) && _lodash[\"default\"].isNumber((_this$subForm$form = this.subForm.form) === null || _this$subForm$form === void 0 ? void 0 : _this$subForm$form[revisionPath]) && submission._fvid !== this.subForm.form[revisionPath];\n if (shouldLoadOriginalRevision) {\n this.setFormRevision(submission._frid || submission._fvid);\n this.createSubForm().then(function () {\n _this10.attach(_this10.element);\n });\n } else {\n this.setSubFormValue(submission, flags);\n }\n }\n return changed;\n }\n }, {\n key: \"setSubFormValue\",\n value: function setSubFormValue(submission, flags) {\n var shouldLoadSubmissionById = submission && submission._id && this.subForm.formio && _lodash[\"default\"].isEmpty(submission.data);\n if (shouldLoadSubmissionById) {\n var formId = submission.form || this.formObj.form || this.component.form;\n var submissionUrl = \"\".concat(this.subForm.formio.formsUrl, \"/\").concat(formId, \"/submission/\").concat(submission._id);\n this.subForm.setUrl(submissionUrl, this.options);\n this.subForm.loadSubmission()[\"catch\"](function (err) {\n console.error(\"Unable to load subform submission \".concat(submission._id, \":\"), err);\n });\n } else {\n this.subForm.setValue(submission, flags);\n }\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n return value === null || _lodash[\"default\"].isEqual(value, this.emptyValue) || this.areAllComponentsEmpty(value === null || value === void 0 ? void 0 : value.data) && !(value !== null && value !== void 0 && value._id);\n }\n }, {\n key: \"areAllComponentsEmpty\",\n value: function areAllComponentsEmpty(data) {\n var res = true;\n if (this.subForm) {\n this.subForm.everyComponent(function (comp) {\n var componentValue = _lodash[\"default\"].get(data, comp.key);\n res &= comp.isEmpty(componentValue);\n });\n } else {\n res = false;\n }\n return res;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n if (this.subForm) {\n return this.subForm.getValue();\n }\n return this.dataValue;\n }\n }, {\n key: \"errors\",\n get: function get() {\n var errors = _get(_getPrototypeOf(FormComponent.prototype), \"errors\", this);\n if (this.subForm) {\n errors = errors.concat(this.subForm.errors);\n }\n return errors;\n }\n }, {\n key: \"updateSubFormVisibility\",\n value: function updateSubFormVisibility() {\n if (this.subForm) {\n this.subForm.parentVisible = this.visible;\n }\n }\n\n /**\n * Determines if this form is a Nested Wizard\n * which means it should be a Wizard itself and should be a direct child of a Wizard's page\n * @returns {boolean}\n */\n }, {\n key: \"isNestedWizard\",\n get: function get() {\n var _this$subForm3, _this$subForm3$_form, _this$parent, _this$parent$parent, _this$parent$parent$_;\n return ((_this$subForm3 = this.subForm) === null || _this$subForm3 === void 0 ? void 0 : (_this$subForm3$_form = _this$subForm3._form) === null || _this$subForm3$_form === void 0 ? void 0 : _this$subForm3$_form.display) === 'wizard' && ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : (_this$parent$parent = _this$parent.parent) === null || _this$parent$parent === void 0 ? void 0 : (_this$parent$parent$_ = _this$parent$parent._form) === null || _this$parent$parent$_ === void 0 ? void 0 : _this$parent$parent$_.display) === 'wizard';\n }\n }, {\n key: \"visible\",\n get: function get() {\n return _get(_getPrototypeOf(FormComponent.prototype), \"visible\", this);\n },\n set: function set(value) {\n var _this11 = this;\n var isNestedWizard = this.isNestedWizard;\n if (this._visible !== value) {\n this._visible = value;\n // Form doesn't load if hidden. If it becomes visible, create the form.\n if (!this.subForm && value) {\n this.createSubForm();\n this.subFormReady.then(function () {\n _this11.updateSubFormVisibility();\n _this11.clearOnHide();\n });\n this.redraw();\n return;\n }\n this.updateSubFormVisibility();\n this.clearOnHide();\n isNestedWizard ? this.rebuild() : this.redraw();\n }\n if (!value && isNestedWizard) {\n this.root.redraw();\n }\n }\n }, {\n key: \"parentVisible\",\n get: function get() {\n return _get(_getPrototypeOf(FormComponent.prototype), \"parentVisible\", this);\n },\n set: function set(value) {\n var _this12 = this;\n if (this._parentVisible !== value) {\n this._parentVisible = value;\n this.clearOnHide();\n // Form doesn't load if hidden. If it becomes visible, create the form.\n if (!this.subForm && value) {\n this.createSubForm();\n this.subFormReady.then(function () {\n _this12.updateSubFormVisibility();\n });\n this.redraw();\n return;\n }\n this.updateSubFormVisibility();\n this.redraw();\n }\n }\n }, {\n key: \"isInternalEvent\",\n value: function isInternalEvent(event) {\n switch (event) {\n case 'focus':\n case 'blur':\n case 'componentChange':\n case 'componentError':\n case 'error':\n case 'formLoad':\n case 'languageChanged':\n case 'render':\n case 'checkValidity':\n case 'initialized':\n case 'submit':\n case 'submitButton':\n case 'nosubmit':\n case 'updateComponent':\n case 'submitDone':\n case 'submissionDeleted':\n case 'requestDone':\n case 'nextPage':\n case 'prevPage':\n case 'wizardNavigationClicked':\n case 'updateWizardNav':\n case 'restoreDraft':\n case 'saveDraft':\n case 'saveComponent':\n case 'pdfUploaded':\n return true;\n default:\n return false;\n }\n }\n }, {\n key: \"createEmitter\",\n value: function createEmitter() {\n var emitter = new _eventemitter[\"default\"]();\n var nativeEmit = emitter.emit;\n var that = this;\n emitter.emit = function (event) {\n var eventType = event.replace(\"\".concat(that.options.namespace, \".\"), '');\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n nativeEmit.call.apply(nativeEmit, [this, event].concat(args));\n if (!that.isInternalEvent(eventType)) {\n that.emit.apply(that, [eventType].concat(args));\n }\n };\n return emitter;\n }\n }, {\n key: \"deleteValue\",\n value: function deleteValue() {\n _get(_getPrototypeOf(FormComponent.prototype), \"setValue\", this).call(this, null, {\n noUpdateEvent: true,\n noDefault: true\n });\n this.unset();\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len2 = arguments.length, extend = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n extend[_key2] = arguments[_key2];\n }\n return _Component2[\"default\"].schema.apply(_Component2[\"default\"], [{\n label: 'Form',\n type: 'form',\n key: 'form',\n src: '',\n reference: true,\n form: '',\n path: '',\n tableView: true\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Nested Form',\n icon: 'wpforms',\n group: 'premium',\n documentation: '/userguide/form-building/premium-components#nested-form',\n weight: 110,\n schema: FormComponent.schema()\n };\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes() {\n return [_utils.componentValueTypes.object];\n }\n }]);\n return FormComponent;\n}(_Component2[\"default\"]);\nexports[\"default\"] = FormComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/form/Form.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.number.parse-int.js */ \"./node_modules/core-js/modules/es.number.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Component2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _ComponentModal = _interopRequireDefault(__webpack_require__(/*! ../_classes/componentModal/ComponentModal */ \"./lib/components/_classes/componentModal/ComponentModal.js\"));\nvar _eventemitter = _interopRequireDefault(__webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _Formio = __webpack_require__(/*! ../../Formio */ \"./lib/Formio.js\");\nvar _Form = _interopRequireDefault(__webpack_require__(/*! ../../Form */ \"./lib/Form.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar FormComponent = /*#__PURE__*/function (_Component) {\n _inherits(FormComponent, _Component);\n var _super = _createSuper(FormComponent);\n function FormComponent() {\n _classCallCheck(this, FormComponent);\n return _super.apply(this, arguments);\n }\n _createClass(FormComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(FormComponent.prototype), \"init\", this).call(this);\n this.formObj = {\n display: this.component.display,\n settings: this.component.settings,\n components: this.component.components\n };\n this.valueChanged = false;\n this.subForm = null;\n this.formSrc = '';\n if (this.component.src) {\n this.formSrc = this.component.src;\n }\n if (!this.component.src && !this.options.formio && (this.component.form || this.component.path)) {\n if (this.component.project) {\n this.formSrc = _Formio.GlobalFormio.getBaseUrl();\n // Check to see if it is a MongoID.\n if ((0, _utils.isMongoId)(this.component.project)) {\n this.formSrc += '/project';\n }\n this.formSrc += \"/\".concat(this.component.project);\n this.options.project = this.formSrc;\n } else {\n this.formSrc = _Formio.GlobalFormio.getProjectUrl();\n this.options.project = this.formSrc;\n }\n if (this.component.form) {\n if ((0, _utils.isMongoId)(this.component.form)) {\n this.formSrc += \"/form/\".concat(this.component.form);\n } else {\n this.formSrc += \"/\".concat(this.component.form);\n }\n } else if (this.component.path) {\n this.formSrc += \"/\".concat(this.component.path);\n }\n }\n\n // Build the source based on the root src path.\n if (!this.formSrc && this.options.formio) {\n var rootSrc = this.options.formio.formsUrl;\n if (this.component.form && (0, _utils.isMongoId)(this.component.form)) {\n this.formSrc = \"\".concat(rootSrc, \"/\").concat(this.component.form);\n } else {\n var formPath = this.component.path || this.component.form;\n this.formSrc = \"\".concat(rootSrc.replace(/\\/form$/, ''), \"/\").concat(formPath);\n }\n }\n if (this.builderMode && this.component.hasOwnProperty('formRevision')) {\n this.component.revision = this.component.formRevision;\n delete this.component.formRevision;\n }\n\n // Add revision version if set.\n if (this.component.revision || this.component.revision === 0 || this.component.formRevision || this.component.formRevision === 0 || this.component.revisionId) {\n this.setFormRevision(this.component.revisionId || this.component.revision || this.component.formRevision);\n }\n return this.createSubForm();\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n return this.subFormReady || _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n // Not not provide a default value unless the subform is ready so that it will initialize correctly.\n return this.subForm ? _get(_getPrototypeOf(FormComponent.prototype), \"defaultValue\", this) : null;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return FormComponent.schema();\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return {\n data: {}\n };\n }\n }, {\n key: \"ready\",\n get: function get() {\n return this.subFormReady || _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"useOriginalRevision\",\n get: function get() {\n var _this$component, _this$formObj;\n return ((_this$component = this.component) === null || _this$component === void 0 ? void 0 : _this$component.useOriginalRevision) && !!((_this$formObj = this.formObj) !== null && _this$formObj !== void 0 && _this$formObj.revisions);\n }\n }, {\n key: \"setFormRevision\",\n value: function setFormRevision(rev) {\n // Remove current revisions from src if it is\n this.formSrc = this.formSrc.replace(/\\/v\\/[0-9a-z]+/, '');\n var revNumber = Number.parseInt(rev);\n if (!isNaN(revNumber)) {\n this.subFormRevision = rev;\n this.formSrc += \"/v/\".concat(rev);\n } else {\n this.subFormRevision = undefined;\n }\n }\n }, {\n key: \"getComponent\",\n value: function getComponent(path, fn) {\n path = (0, _utils.getArrayFromComponentPath)(path);\n if (path[0] === 'data') {\n path.shift();\n }\n var originalPathStr = \"\".concat(this.path, \".data.\").concat((0, _utils.getStringFromComponentPath)(path));\n if (this.subForm) {\n return this.subForm.getComponent(path, fn, originalPathStr);\n }\n }\n\n /* eslint-disable max-statements */\n }, {\n key: \"getSubOptions\",\n value: function getSubOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n options.parentPath = \"\".concat(this.path, \".data.\");\n options.events = this.createEmitter();\n\n // Make sure to not show the submit button in wizards in the nested forms.\n _lodash[\"default\"].set(options, 'buttonSettings.showSubmit', false);\n if (!this.options) {\n return options;\n }\n if (this.options.base) {\n options.base = this.options.base;\n }\n if (this.options.project) {\n options.project = this.options.project;\n }\n if (this.options.readOnly || this.component.disabled) {\n options.readOnly = this.options.readOnly || this.component.disabled;\n }\n if (this.options.breadcrumbSettings) {\n options.breadcrumbSettings = this.options.breadcrumbSettings;\n }\n if (this.options.buttonSettings) {\n options.buttonSettings = _lodash[\"default\"].clone(this.options.buttonSettings);\n }\n if (this.options.viewAsHtml) {\n options.viewAsHtml = this.options.viewAsHtml;\n }\n if (this.options.language) {\n options.language = this.options.language;\n }\n if (this.options.template) {\n options.template = this.options.template;\n }\n if (this.options.templates) {\n options.templates = this.options.templates;\n }\n if (this.options.renderMode) {\n options.renderMode = this.options.renderMode;\n }\n if (this.options.attachMode) {\n options.attachMode = this.options.attachMode;\n }\n if (this.options.iconset) {\n options.iconset = this.options.iconset;\n }\n if (this.options.fileService) {\n options.fileService = this.options.fileService;\n }\n if (this.options.onChange) {\n options.onChange = this.options.onChange;\n }\n if (this.options.preview) {\n options.preview = this.options.preview;\n }\n if (this.options.saveDraft) {\n options.saveDraft = this.options.saveDraft;\n options.formio = new _Formio.GlobalFormio(this.formSrc);\n }\n if (this.options.saveDraftThrottle) {\n options.saveDraftThrottle = this.options.saveDraftThrottle;\n }\n if (this.options.skipDraftRestore) {\n options.skipDraftRestore = this.options.skipDraftRestore;\n }\n return options;\n }\n /* eslint-enable max-statements */\n }, {\n key: \"render\",\n value: function render() {\n if (this.builderMode) {\n return _get(_getPrototypeOf(FormComponent.prototype), \"render\", this).call(this, this.component.label || 'Nested form');\n }\n var subform = this.subForm ? this.subForm.render() : this.renderTemplate('loading');\n return _get(_getPrototypeOf(FormComponent.prototype), \"render\", this).call(this, subform);\n }\n }, {\n key: \"asString\",\n value: function asString(value) {\n return this.getValueAsString(value);\n }\n\n /**\n * Prints out the value of form components as a datagrid value.\n */\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (!value) {\n return 'No data provided';\n }\n if (!value.data && value._id) {\n return value._id;\n }\n if (!value.data || !Object.keys(value.data).length) {\n return 'No data provided';\n }\n if (options !== null && options !== void 0 && options.email) {\n var result = \"\\n \\n \\n \";\n this.everyComponent(function (component) {\n if (component.isInputComponent && component.visible && !component.skipInEmail) {\n result += \"\\n \\n \\n \\n \\n \");\n }\n }, _objectSpread(_objectSpread({}, options), {}, {\n fromRoot: true\n }));\n result += \"\\n \\n
\".concat(component.label, \"\").concat(component.getView(component.dataValue, options), \"
\\n \";\n return result;\n }\n if (_lodash[\"default\"].isEmpty(value)) {\n return '';\n }\n return '[Complex Data]';\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this = this;\n // Don't attach in builder.\n if (this.builderMode) {\n return _get(_getPrototypeOf(FormComponent.prototype), \"attach\", this).call(this, element);\n }\n return _get(_getPrototypeOf(FormComponent.prototype), \"attach\", this).call(this, element).then(function () {\n if (_this.isSubFormLazyLoad() && !_this.hasLoadedForm && !_this.subFormLoading) {\n _this.createSubForm(true);\n }\n return _this.subFormReady.then(function () {\n _this.empty(element);\n if (_this.options.builder) {\n _this.setContent(element, _this.ce('div', {\n \"class\": 'text-muted text-center p-2'\n }, _this.text(_this.formObj.title)));\n return;\n }\n _this.setContent(element, _this.render());\n if (_this.subForm) {\n if (_this.isNestedWizard) {\n element = _this.root.element;\n }\n _this.subForm.attach(element);\n _this.valueChanged = _this.hasSetValue;\n if (!_this.valueChanged && _this.dataValue.state !== 'submitted') {\n _this.setDefaultValue();\n } else {\n _this.restoreValue();\n }\n }\n if (!_this.builderMode && _this.component.modalEdit) {\n var modalShouldBeOpened = _this.componentModal ? _this.componentModal.isOpened : false;\n var currentValue = modalShouldBeOpened ? _this.componentModal.currentValue : _this.dataValue;\n _this.componentModal = new _ComponentModal[\"default\"](_this, element, modalShouldBeOpened, currentValue);\n _this.setOpenModalElement();\n }\n _this.calculateValue();\n });\n });\n }\n }, {\n key: \"detach\",\n value: function detach() {\n if (this.subForm) {\n this.subForm.detach();\n }\n _get(_getPrototypeOf(FormComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"currentForm\",\n get: function get() {\n return this._currentForm;\n },\n set: function set(instance) {\n var _this2 = this;\n this._currentForm = instance;\n if (!this.subForm) {\n return;\n }\n this.subForm.getComponents().forEach(function (component) {\n component.currentForm = _this2;\n });\n }\n }, {\n key: \"hasLoadedForm\",\n get: function get() {\n return this.formObj && this.formObj.components && Array.isArray(this.formObj.components) && this.formObj.components.length;\n }\n }, {\n key: \"isRevisionChanged\",\n get: function get() {\n return _lodash[\"default\"].isNumber(this.subFormRevision) && _lodash[\"default\"].isNumber(this.formObj._vid) && this.formObj._vid !== this.subFormRevision;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n if (this.subForm) {\n this.subForm.destroy();\n this.subForm = null;\n this.subFormReady = null;\n }\n _get(_getPrototypeOf(FormComponent.prototype), \"destroy\", this).call(this);\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n if (this.subForm) {\n this.subForm.form = this.formObj;\n this.setSubFormDisabled(this.subForm);\n }\n return _get(_getPrototypeOf(FormComponent.prototype), \"redraw\", this).call(this);\n }\n\n /**\n * Pass everyComponent to subform.\n * @param args\n * @returns {*|void}\n */\n }, {\n key: \"everyComponent\",\n value: function everyComponent() {\n if (this.subForm) {\n var _this$subForm;\n (_this$subForm = this.subForm).everyComponent.apply(_this$subForm, arguments);\n }\n }\n }, {\n key: \"setSubFormDisabled\",\n value: function setSubFormDisabled(subForm) {\n subForm.disabled = this.disabled; // When the Nested Form is disabled make the subForm disabled\n }\n }, {\n key: \"updateSubWizards\",\n value: function updateSubWizards(subForm) {\n var _this$root,\n _subForm$_form,\n _this3 = this;\n if (this.isNestedWizard && (_this$root = this.root) !== null && _this$root !== void 0 && _this$root.subWizards && (subForm === null || subForm === void 0 ? void 0 : (_subForm$_form = subForm._form) === null || _subForm$_form === void 0 ? void 0 : _subForm$_form.display) === 'wizard') {\n var existedForm = this.root.subWizards.findIndex(function (form) {\n return form.component.form === _this3.component.form;\n });\n if (existedForm !== -1) {\n this.root.subWizards[existedForm] = this;\n } else {\n this.root.subWizards.push(this);\n }\n this.emit('subWizardsUpdated', subForm);\n }\n }\n\n /**\n * Create a subform instance.\n *\n * @return {*}\n */\n }, {\n key: \"createSubForm\",\n value: function createSubForm(fromAttach) {\n var _this4 = this;\n this.subFormReady = this.loadSubForm(fromAttach).then(function (form) {\n if (!form) {\n return;\n }\n\n // Iterate through every component and hide the submit button.\n (0, _utils.eachComponent)(form.components, function (component) {\n _this4.hideSubmitButton(component);\n });\n\n // If the subform is already created then destroy the old one.\n if (_this4.subForm) {\n _this4.subForm.destroy();\n }\n\n // Render the form.\n return new _Form[\"default\"](form, _this4.getSubOptions()).ready.then(function (instance) {\n _this4.subForm = instance;\n _this4.subForm.currentForm = _this4;\n _this4.subForm.parent = _this4;\n _this4.subForm.parentVisible = _this4.visible;\n _this4.subForm.on('change', function () {\n if (_this4.subForm) {\n _this4.dataValue = _this4.subForm.getValue();\n _this4.triggerChange({\n noEmit: true\n });\n }\n });\n _this4.subForm.url = _this4.formSrc;\n _this4.subForm.nosubmit = true;\n _this4.subForm.root = _this4.root;\n _this4.subForm.localRoot = _this4.isNestedWizard ? _this4.localRoot : _this4.subForm;\n _this4.restoreValue();\n _this4.valueChanged = _this4.hasSetValue;\n _this4.onChange();\n return _this4.subForm;\n });\n }).then(function (subForm) {\n _this4.updateSubWizards(subForm);\n return subForm;\n });\n return this.subFormReady;\n }\n }, {\n key: \"hideSubmitButton\",\n value: function hideSubmitButton(component) {\n var isSubmitButton = component.type === 'button' && (component.action === 'submit' || !component.action);\n if (isSubmitButton) {\n component.hidden = true;\n }\n }\n\n /**\n * Load the subform.\n */\n }, {\n key: \"loadSubForm\",\n value: function loadSubForm(fromAttach) {\n var _this$component2,\n _this5 = this;\n if (this.builderMode || this.isHidden() || this.isSubFormLazyLoad() && !fromAttach) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n if (this.hasLoadedForm && !this.isRevisionChanged && !(this.options.pdf && (_this$component2 = this.component) !== null && _this$component2 !== void 0 && _this$component2.useOriginalRevision && _lodash[\"default\"].isNull(this.subForm) && !this.subFormLoading)) {\n // Pass config down to sub forms.\n if (this.root && this.root.form && this.root.form.config && !this.formObj.config) {\n this.formObj.config = this.root.form.config;\n }\n return _nativePromiseOnly[\"default\"].resolve(this.formObj);\n } else if (this.formSrc) {\n var _this$root2, _this$root2$formio, _this$root3, _this$root3$formio;\n this.subFormLoading = true;\n var options = (_this$root2 = this.root) !== null && _this$root2 !== void 0 && (_this$root2$formio = _this$root2.formio) !== null && _this$root2$formio !== void 0 && _this$root2$formio.base && (_this$root3 = this.root) !== null && _this$root3 !== void 0 && (_this$root3$formio = _this$root3.formio) !== null && _this$root3$formio !== void 0 && _this$root3$formio.projectUrl ? {\n base: this.root.formio.base,\n project: this.root.formio.projectUrl\n } : {};\n return new _Formio.GlobalFormio(this.formSrc, options).loadForm({\n params: {\n live: 1\n }\n }).then(function (formObj) {\n _this5.formObj = formObj;\n if (_this5.options.pdf && _this5.component.useOriginalRevision) {\n _this5.formObj.display = 'form';\n }\n _this5.subFormLoading = false;\n return formObj;\n })[\"catch\"](function (err) {\n console.log(err);\n return null;\n });\n }\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"subFormData\",\n get: function get() {\n var _this$dataValue;\n return ((_this$dataValue = this.dataValue) === null || _this$dataValue === void 0 ? void 0 : _this$dataValue.data) || {};\n }\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, row, options) {\n options = options || {};\n var silentCheck = options.silentCheck || false;\n if (this.subForm) {\n return this.subForm.checkValidity(this.subFormData, dirty, null, silentCheck);\n }\n return _get(_getPrototypeOf(FormComponent.prototype), \"checkComponentValidity\", this).call(this, data, dirty, row, options);\n }\n }, {\n key: \"checkComponentConditions\",\n value: function checkComponentConditions(data, flags, row) {\n var _this6 = this;\n var visible = _get(_getPrototypeOf(FormComponent.prototype), \"checkComponentConditions\", this).call(this, data, flags, row);\n\n // Return if already hidden\n if (!visible) {\n return visible;\n }\n if (this.subForm) {\n return this.subForm.checkConditions(this.subFormData);\n }\n // There are few cases when subForm is not loaded when a change is triggered,\n // so we need to perform checkConditions after it is ready, or some conditional fields might be hidden in View mode\n else if (this.subFormReady) {\n this.subFormReady.then(function () {\n if (_this6.subForm) {\n return _this6.subForm.checkConditions(_this6.subFormData);\n }\n });\n }\n return visible;\n }\n }, {\n key: \"calculateValue\",\n value: function calculateValue(data, flags, row) {\n if (this.subForm) {\n return this.subForm.calculateValue(this.subFormData, flags);\n }\n return _get(_getPrototypeOf(FormComponent.prototype), \"calculateValue\", this).call(this, data, flags, row);\n }\n }, {\n key: \"setPristine\",\n value: function setPristine(pristine) {\n _get(_getPrototypeOf(FormComponent.prototype), \"setPristine\", this).call(this, pristine);\n if (this.subForm) {\n this.subForm.setPristine(pristine);\n }\n }\n\n /**\n * Determine if the subform should be submitted.\n * @return {*|boolean}\n */\n }, {\n key: \"shouldSubmit\",\n get: function get() {\n return this.subFormReady && (!this.component.hasOwnProperty('reference') || this.component.reference) && !this.isHidden();\n }\n\n /**\n * Returns the data for the subform.\n *\n * @return {*}\n */\n }, {\n key: \"getSubFormData\",\n value: function getSubFormData() {\n if (_lodash[\"default\"].get(this.subForm, 'form.display') === 'pdf') {\n return this.subForm.getSubmission();\n } else {\n return _nativePromiseOnly[\"default\"].resolve(this.dataValue);\n }\n }\n\n /**\n * Submit the subform if configured to do so.\n *\n * @return {*}\n */\n }, {\n key: \"submitSubForm\",\n value: function submitSubForm(rejectOnError) {\n var _this7 = this;\n // If we wish to submit the form on next page, then do that here.\n if (this.shouldSubmit) {\n return this.subFormReady.then(function () {\n if (!_this7.subForm) {\n return _this7.dataValue;\n }\n _this7.subForm.nosubmit = false;\n return _this7.subForm.submitForm().then(function (result) {\n _this7.subForm.loading = false;\n _this7.subForm.showAllErrors = false;\n _this7.dataValue = result.submission;\n return _this7.dataValue;\n })[\"catch\"](function (err) {\n _this7.subForm.showAllErrors = true;\n if (rejectOnError) {\n _this7.subForm.onSubmissionError(err);\n return _nativePromiseOnly[\"default\"].reject(err);\n } else {\n return {};\n }\n });\n });\n }\n return this.getSubFormData();\n }\n\n /**\n * Submit the form before the next page is triggered.\n */\n }, {\n key: \"beforePage\",\n value: function beforePage(next) {\n var _this8 = this;\n // Should not submit child forms if we are going to the previous page\n if (!next) {\n return _get(_getPrototypeOf(FormComponent.prototype), \"beforePage\", this).call(this, next);\n }\n return this.submitSubForm(true).then(function () {\n return _get(_getPrototypeOf(FormComponent.prototype), \"beforePage\", _this8).call(_this8, next);\n });\n }\n\n /**\n * Submit the form before the whole form is triggered.\n */\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n var _this$subForm2,\n _this$subForm$trigger,\n _this$subForm3,\n _this9 = this;\n var submission = this.dataValue;\n // Cancel triggered saveDraft\n if ((_this$subForm2 = this.subForm) !== null && _this$subForm2 !== void 0 && _this$subForm2.draftEnabled && (_this$subForm$trigger = this.subForm.triggerSaveDraft) !== null && _this$subForm$trigger !== void 0 && _this$subForm$trigger.cancel) {\n this.subForm.triggerSaveDraft.cancel();\n }\n var isAlreadySubmitted = submission && submission._id && submission.form;\n var isDraftSubmission = this.options.saveDraft && submission.state === 'draft';\n\n // This submission has already been submitted, so just return the reference data.\n if (isAlreadySubmitted && !((_this$subForm3 = this.subForm) !== null && _this$subForm3 !== void 0 && _this$subForm3.wizard) && !isDraftSubmission) {\n this.dataValue = submission;\n return _nativePromiseOnly[\"default\"].resolve(this.dataValue);\n }\n return this.submitSubForm(false).then(function () {\n return _this9.dataValue;\n }).then(function () {\n return _get(_getPrototypeOf(FormComponent.prototype), \"beforeSubmit\", _this9).call(_this9);\n });\n }\n }, {\n key: \"isSubFormLazyLoad\",\n value: function isSubFormLazyLoad() {\n var _this$root4, _this$root4$_form;\n return ((_this$root4 = this.root) === null || _this$root4 === void 0 ? void 0 : (_this$root4$_form = _this$root4._form) === null || _this$root4$_form === void 0 ? void 0 : _this$root4$_form.display) === 'wizard' && this.component.lazyLoad;\n }\n }, {\n key: \"isHidden\",\n value: function isHidden() {\n if (!this.visible) {\n return true;\n }\n return !_get(_getPrototypeOf(FormComponent.prototype), \"checkConditions\", this).call(this, this.rootValue);\n }\n }, {\n key: \"setValue\",\n value: function setValue(submission) {\n var _this10 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = _get(_getPrototypeOf(FormComponent.prototype), \"setValue\", this).call(this, submission, flags);\n this.valueChanged = true;\n if (this.subForm) {\n var _this$subForm$form;\n var revisionPath = submission._frid ? '_frid' : '_vid';\n var shouldLoadOriginalRevision = this.useOriginalRevision && (_lodash[\"default\"].isNumber(submission[revisionPath]) || _lodash[\"default\"].isNumber(submission._fvid)) && _lodash[\"default\"].isNumber((_this$subForm$form = this.subForm.form) === null || _this$subForm$form === void 0 ? void 0 : _this$subForm$form[revisionPath]) && submission._fvid !== this.subForm.form[revisionPath];\n if (shouldLoadOriginalRevision) {\n this.setFormRevision(submission._frid || submission._fvid);\n this.createSubForm().then(function () {\n _this10.attach(_this10.element);\n });\n } else {\n this.setSubFormValue(submission, flags);\n }\n }\n return changed;\n }\n }, {\n key: \"setSubFormValue\",\n value: function setSubFormValue(submission, flags) {\n var shouldLoadSubmissionById = submission && submission._id && this.subForm.formio && _lodash[\"default\"].isEmpty(submission.data);\n var shouldLoadDraftById = this.options.saveDraft && _lodash[\"default\"].isEmpty(submission.data) && _lodash[\"default\"].get(this.subForm, 'submission._id');\n if (shouldLoadSubmissionById || shouldLoadDraftById) {\n var _this$root5, _this$root5$formio, _this$root6, _this$root6$formio;\n var formId = submission.form || this.formObj.form || this.component.form;\n var submissionUrl = \"\".concat(this.subForm.formio.formsUrl, \"/\").concat(formId, \"/submission/\").concat(submission._id || this.subForm.submission._id);\n var options = (_this$root5 = this.root) !== null && _this$root5 !== void 0 && (_this$root5$formio = _this$root5.formio) !== null && _this$root5$formio !== void 0 && _this$root5$formio.base && (_this$root6 = this.root) !== null && _this$root6 !== void 0 && (_this$root6$formio = _this$root6.formio) !== null && _this$root6$formio !== void 0 && _this$root6$formio.projectUrl ? {\n base: this.root.formio.base,\n project: this.root.formio.projectUrl\n } : {};\n this.subForm.setUrl(submissionUrl, _objectSpread(_objectSpread({}, this.options), options));\n this.subForm.loadSubmission()[\"catch\"](function (err) {\n console.error(\"Unable to load subform submission \".concat(submission._id, \":\"), err);\n });\n } else {\n this.subForm.setValue(submission, flags);\n }\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n return value === null || _lodash[\"default\"].isEqual(value, this.emptyValue) || this.areAllComponentsEmpty(value === null || value === void 0 ? void 0 : value.data) && !(value !== null && value !== void 0 && value._id);\n }\n }, {\n key: \"areAllComponentsEmpty\",\n value: function areAllComponentsEmpty(data) {\n var res = true;\n if (this.subForm) {\n this.subForm.everyComponent(function (comp) {\n var componentValue = _lodash[\"default\"].get(data, comp.key);\n res &= comp.isEmpty(componentValue);\n });\n } else {\n res = false;\n }\n return res;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n if (this.subForm) {\n return this.subForm.getValue();\n }\n return this.dataValue;\n }\n }, {\n key: \"errors\",\n get: function get() {\n var errors = _get(_getPrototypeOf(FormComponent.prototype), \"errors\", this);\n if (this.subForm) {\n errors = errors.concat(this.subForm.errors);\n }\n return errors;\n }\n }, {\n key: \"updateSubFormVisibility\",\n value: function updateSubFormVisibility() {\n if (this.subForm) {\n this.subForm.parentVisible = this.visible;\n }\n }\n\n /**\n * Determines if this form is a Nested Wizard\n * which means it should be a Wizard itself and should be a direct child of a Wizard's page\n * @returns {boolean}\n */\n }, {\n key: \"isNestedWizard\",\n get: function get() {\n var _this$subForm4, _this$subForm4$_form, _this$parent, _this$parent$parent, _this$parent$parent$_;\n return ((_this$subForm4 = this.subForm) === null || _this$subForm4 === void 0 ? void 0 : (_this$subForm4$_form = _this$subForm4._form) === null || _this$subForm4$_form === void 0 ? void 0 : _this$subForm4$_form.display) === 'wizard' && ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : (_this$parent$parent = _this$parent.parent) === null || _this$parent$parent === void 0 ? void 0 : (_this$parent$parent$_ = _this$parent$parent._form) === null || _this$parent$parent$_ === void 0 ? void 0 : _this$parent$parent$_.display) === 'wizard';\n }\n }, {\n key: \"visible\",\n get: function get() {\n return _get(_getPrototypeOf(FormComponent.prototype), \"visible\", this);\n },\n set: function set(value) {\n var _this11 = this;\n var isNestedWizard = this.isNestedWizard;\n if (this._visible !== value) {\n this._visible = value;\n // Form doesn't load if hidden. If it becomes visible, create the form.\n if (!this.subForm && value) {\n this.createSubForm();\n this.subFormReady.then(function () {\n _this11.updateSubFormVisibility();\n _this11.clearOnHide();\n });\n this.redraw();\n return;\n }\n this.updateSubFormVisibility();\n this.clearOnHide();\n isNestedWizard ? this.rebuild() : this.redraw();\n }\n if (!value && isNestedWizard) {\n this.root.redraw();\n }\n }\n }, {\n key: \"parentVisible\",\n get: function get() {\n return _get(_getPrototypeOf(FormComponent.prototype), \"parentVisible\", this);\n },\n set: function set(value) {\n var _this12 = this;\n if (this._parentVisible !== value) {\n this._parentVisible = value;\n this.clearOnHide();\n // Form doesn't load if hidden. If it becomes visible, create the form.\n if (!this.subForm && value) {\n this.createSubForm();\n this.subFormReady.then(function () {\n _this12.updateSubFormVisibility();\n });\n this.redraw();\n return;\n }\n this.updateSubFormVisibility();\n this.redraw();\n }\n }\n }, {\n key: \"isInternalEvent\",\n value: function isInternalEvent(event) {\n switch (event) {\n case 'focus':\n case 'blur':\n case 'componentChange':\n case 'componentError':\n case 'error':\n case 'formLoad':\n case 'languageChanged':\n case 'render':\n case 'checkValidity':\n case 'initialized':\n case 'submit':\n case 'submitButton':\n case 'nosubmit':\n case 'updateComponent':\n case 'submitDone':\n case 'submissionDeleted':\n case 'requestDone':\n case 'nextPage':\n case 'prevPage':\n case 'wizardNavigationClicked':\n case 'updateWizardNav':\n case 'restoreDraft':\n case 'saveDraft':\n case 'saveComponent':\n case 'pdfUploaded':\n return true;\n default:\n return false;\n }\n }\n }, {\n key: \"createEmitter\",\n value: function createEmitter() {\n var emitter = new _eventemitter[\"default\"]();\n var nativeEmit = emitter.emit;\n var that = this;\n emitter.emit = function (event) {\n var eventType = event.replace(\"\".concat(that.options.namespace, \".\"), '');\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n nativeEmit.call.apply(nativeEmit, [this, event].concat(args));\n if (!that.isInternalEvent(eventType)) {\n that.emit.apply(that, [eventType].concat(args));\n }\n };\n return emitter;\n }\n }, {\n key: \"deleteValue\",\n value: function deleteValue() {\n _get(_getPrototypeOf(FormComponent.prototype), \"setValue\", this).call(this, null, {\n noUpdateEvent: true,\n noDefault: true\n });\n this.unset();\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len2 = arguments.length, extend = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n extend[_key2] = arguments[_key2];\n }\n return _Component2[\"default\"].schema.apply(_Component2[\"default\"], [{\n label: 'Form',\n type: 'form',\n key: 'form',\n src: '',\n reference: true,\n form: '',\n path: '',\n tableView: true\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Nested Form',\n icon: 'wpforms',\n group: 'premium',\n documentation: '/userguide/form-building/premium-components#nested-form',\n weight: 110,\n schema: FormComponent.schema()\n };\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes() {\n return [_utils.componentValueTypes.object];\n }\n }]);\n return FormComponent;\n}(_Component2[\"default\"]);\nexports[\"default\"] = FormComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/form/Form.js?"); /***/ }), @@ -1410,7 +1410,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.string.trim.js */ \"./node_modules/core-js/modules/es.string.trim.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _Component2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar HTMLComponent = /*#__PURE__*/function (_Component) {\n _inherits(HTMLComponent, _Component);\n var _super = _createSuper(HTMLComponent);\n function HTMLComponent() {\n _classCallCheck(this, HTMLComponent);\n return _super.apply(this, arguments);\n }\n _createClass(HTMLComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return HTMLComponent.schema();\n }\n }, {\n key: \"content\",\n get: function get() {\n if (this.builderMode) {\n return this.component.content;\n }\n\n // i18n returns error exactly with word 'select', spaces will be trimmed\n if (this.component.content.replace(/(<(\\/?[^>]+)>)/g, '').trim() === 'select') {\n return \" \".concat(this.component.content, \" \");\n }\n var submission = _lodash[\"default\"].get(this.root, 'submission', {});\n var content = this.component.content ? this.interpolate(this.component.content, {\n metadata: submission.metadata || {},\n submission: submission,\n data: this.rootValue,\n row: this.data\n }) : '';\n return this.sanitize(content, this.shouldSanitizeValue);\n }\n }, {\n key: \"singleTags\",\n get: function get() {\n return ['br', 'img', 'hr'];\n }\n }, {\n key: \"checkRefreshOn\",\n value: function checkRefreshOn(changed) {\n _get(_getPrototypeOf(HTMLComponent.prototype), \"checkRefreshOn\", this).call(this, changed);\n if (!this.builderMode && this.component.refreshOnChange && this.element && !_lodash[\"default\"].isUndefined(changed) && (_lodash[\"default\"].isBoolean(changed) && changed || !_lodash[\"default\"].isEmpty(changed)) && this.conditionallyVisible(this.data, this.row)) {\n this.setContent(this.element, this.renderContent());\n }\n }\n }, {\n key: \"renderContent\",\n value: function renderContent() {\n var _this = this;\n var submission = _lodash[\"default\"].get(this.root, 'submission', {});\n return this.renderTemplate('html', {\n component: this.component,\n tag: this.component.tag,\n attrs: (this.component.attrs || []).map(function (attr) {\n return {\n attr: attr.attr,\n value: _this.interpolate(attr.value, {\n metadata: submission.metadata || {},\n submission: submission,\n data: _this.rootValue,\n row: _this.data\n })\n };\n }),\n content: this.content,\n singleTags: this.singleTags\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(HTMLComponent.prototype), \"render\", this).call(this, this.renderContent());\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n this.loadRefs(element, {\n html: 'single'\n });\n return _get(_getPrototypeOf(HTMLComponent.prototype), \"attach\", this).call(this, element);\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Component2[\"default\"].schema.apply(_Component2[\"default\"], [{\n label: 'HTML',\n type: 'htmlelement',\n tag: 'p',\n attrs: [],\n content: '',\n input: false,\n persistent: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'HTML Element',\n group: 'layout',\n icon: 'code',\n weight: 0,\n documentation: '/userguide/form-building/layout-components#html-element',\n showPreview: false,\n schema: HTMLComponent.schema()\n };\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes() {\n return [];\n }\n }]);\n return HTMLComponent;\n}(_Component2[\"default\"]);\nexports[\"default\"] = HTMLComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/html/HTML.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.string.trim.js */ \"./node_modules/core-js/modules/es.string.trim.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.promise.js */ \"./node_modules/core-js/modules/es.promise.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _Component2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar HTMLComponent = /*#__PURE__*/function (_Component) {\n _inherits(HTMLComponent, _Component);\n var _super = _createSuper(HTMLComponent);\n function HTMLComponent() {\n _classCallCheck(this, HTMLComponent);\n return _super.apply(this, arguments);\n }\n _createClass(HTMLComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return HTMLComponent.schema();\n }\n }, {\n key: \"content\",\n get: function get() {\n if (this.builderMode) {\n return this.component.content;\n }\n\n // i18n returns error exactly with word 'select', spaces will be trimmed\n if (this.component.content.replace(/(<(\\/?[^>]+)>)/g, '').trim() === 'select') {\n return \" \".concat(this.component.content, \" \");\n }\n var submission = _lodash[\"default\"].get(this.root, 'submission', {});\n var content = this.component.content ? this.interpolate(this.component.content, {\n metadata: submission.metadata || {},\n submission: submission,\n data: this.rootValue,\n row: this.data\n }) : '';\n return this.sanitize(content, this.shouldSanitizeValue);\n }\n }, {\n key: \"singleTags\",\n get: function get() {\n return ['br', 'img', 'hr'];\n }\n }, {\n key: \"checkRefreshOn\",\n value: function checkRefreshOn(changed) {\n _get(_getPrototypeOf(HTMLComponent.prototype), \"checkRefreshOn\", this).call(this, changed);\n if (!this.builderMode && this.component.refreshOnChange && this.element && !_lodash[\"default\"].isUndefined(changed) && (_lodash[\"default\"].isBoolean(changed) && changed || !_lodash[\"default\"].isEmpty(changed)) && this.conditionallyVisible(this.data, this.row)) {\n this.setContent(this.element, this.renderContent());\n }\n }\n }, {\n key: \"renderContent\",\n value: function renderContent() {\n var _this = this;\n var submission = _lodash[\"default\"].get(this.root, 'submission', {});\n return this.renderTemplate('html', {\n component: this.component,\n tag: this.component.tag,\n attrs: (this.component.attrs || []).map(function (attr) {\n return {\n attr: attr.attr,\n value: _this.interpolate(attr.value, {\n metadata: submission.metadata || {},\n submission: submission,\n data: _this.rootValue,\n row: _this.data\n })\n };\n }),\n content: this.content,\n singleTags: this.singleTags\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(HTMLComponent.prototype), \"render\", this).call(this, this.renderContent());\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n var _this$root;\n return ((_this$root = this.root) === null || _this$root === void 0 ? void 0 : _this$root.submissionReady) || Promise.resolve();\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this2 = this;\n this.loadRefs(element, {\n html: 'single'\n });\n this.dataReady.then(function () {\n if (_this2.refs.html) {\n _this2.setContent(_this2.refs.html, _this2.content);\n }\n });\n return _get(_getPrototypeOf(HTMLComponent.prototype), \"attach\", this).call(this, element);\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Component2[\"default\"].schema.apply(_Component2[\"default\"], [{\n label: 'HTML',\n type: 'htmlelement',\n tag: 'p',\n attrs: [],\n content: '',\n input: false,\n persistent: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'HTML Element',\n group: 'layout',\n icon: 'code',\n weight: 0,\n documentation: '/userguide/form-building/layout-components#html-element',\n showPreview: false,\n schema: HTMLComponent.schema()\n };\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes() {\n return [];\n }\n }]);\n return HTMLComponent;\n}(_Component2[\"default\"]);\nexports[\"default\"] = HTMLComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/html/HTML.js?"); /***/ }), @@ -1652,7 +1652,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.some.js */ \"./node_modules/core-js/modules/es.array.some.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.parse-float.js */ \"./node_modules/core-js/modules/es.parse-float.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _ListComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/list/ListComponent */ \"./lib/components/_classes/list/ListComponent.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _Formio = __webpack_require__(/*! ../../Formio */ \"./lib/Formio.js\");\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar RadioComponent = /*#__PURE__*/function (_ListComponent) {\n _inherits(RadioComponent, _ListComponent);\n var _super = _createSuper(RadioComponent);\n function RadioComponent(component, options, data) {\n var _this;\n _classCallCheck(this, RadioComponent);\n _this = _super.call(this, component, options, data);\n _this.previousValue = _this.dataValue || null;\n return _this;\n }\n _createClass(RadioComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return RadioComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(RadioComponent.prototype), \"defaultValue\", this);\n if (!defaultValue && this.component.defaultValue === false) {\n defaultValue = this.component.defaultValue;\n }\n return defaultValue;\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var _this$root;\n var info = _get(_getPrototypeOf(RadioComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'input';\n info.changeEvent = 'click';\n info.attr[\"class\"] = 'form-check-input';\n info.attr.name = info.attr.name += \"[\".concat((_this$root = this.root) === null || _this$root === void 0 ? void 0 : _this$root.id, \"-\").concat(this.id, \"]\");\n return info;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return '';\n }\n }, {\n key: \"isRadio\",\n get: function get() {\n return this.component.inputType === 'radio';\n }\n }, {\n key: \"optionSelectedClass\",\n get: function get() {\n return 'radio-selected';\n }\n }, {\n key: \"listData\",\n get: function get() {\n var listData = _lodash[\"default\"].get(this.root, 'submission.metadata.listData', {});\n return _lodash[\"default\"].get(listData, this.path);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this2 = this;\n _get(_getPrototypeOf(RadioComponent.prototype), \"init\", this).call(this);\n this.templateData = {};\n this.validators = this.validators.concat(['select', 'onlyAvailableItems', 'availableValueProperty']);\n\n // Trigger an update.\n var updateArgs = [];\n var triggerUpdate = _lodash[\"default\"].debounce(function () {\n updateArgs = [];\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _this2.updateItems.apply(_this2, args);\n }, 100);\n this.triggerUpdate = function () {\n // Make sure we always resolve the previous promise before reassign it\n if (typeof _this2.itemsLoadedResolve === 'function') {\n _this2.itemsLoadedResolve();\n }\n _this2.itemsLoaded = new _nativePromiseOnly[\"default\"](function (resolve) {\n _this2.itemsLoadedResolve = resolve;\n });\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (args.length) {\n updateArgs = args;\n }\n return triggerUpdate.apply(void 0, _toConsumableArray(updateArgs));\n };\n this.itemsLoaded = new _nativePromiseOnly[\"default\"](function (resolve) {\n _this2.itemsLoadedResolve = resolve;\n });\n this.optionsLoaded = false;\n this.loadedOptions = [];\n\n // Get the template keys for this radio component.\n this.getTemplateKeys();\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(RadioComponent.prototype), \"render\", this).call(this, this.renderTemplate('radio', {\n input: this.inputInfo,\n inline: this.component.inline,\n values: this.component.dataSrc === 'values' ? this.component.values : this.loadedOptions,\n value: this.dataValue,\n row: this.row\n }));\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this3 = this;\n this.loadRefs(element, {\n input: 'multiple',\n wrapper: 'multiple'\n });\n this.refs.input.forEach(function (input, index) {\n _this3.addEventListener(input, _this3.inputInfo.changeEvent, function () {\n _this3.updateValue(null, {\n modified: true\n });\n });\n if (_this3.component.values[index]) {\n _this3.addShortcut(input, _this3.component.values[index].shortcut);\n }\n if (_this3.isRadio) {\n var dataValue = _this3.dataValue;\n if (!_lodash[\"default\"].isString(_this3.dataValue)) {\n dataValue = _lodash[\"default\"].toString(_this3.dataValue);\n }\n if (_this3.isSelectURL && _lodash[\"default\"].isObject(_this3.loadedOptions[index].value)) {\n input.checked = _lodash[\"default\"].isEqual(_this3.loadedOptions[index].value, _this3.dataValue);\n } else {\n input.checked = dataValue === input.value && (input.value || _this3.component.dataSrc !== 'url');\n }\n _this3.addEventListener(input, 'keyup', function (event) {\n if (event.key === ' ' && dataValue === input.value) {\n event.preventDefault();\n _this3.updateValue(null, {\n modified: true\n });\n }\n });\n }\n });\n this.triggerUpdate();\n this.setSelectedClasses();\n return _get(_getPrototypeOf(RadioComponent.prototype), \"attach\", this).call(this, element);\n }\n }, {\n key: \"detach\",\n value: function detach(element) {\n var _this4 = this;\n if (element && this.refs.input) {\n this.refs.input.forEach(function (input, index) {\n if (_this4.component.values[index]) {\n _this4.removeShortcut(input, _this4.component.values[index].shortcut);\n }\n });\n }\n _get(_getPrototypeOf(RadioComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n var _this5 = this;\n if (this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var value = this.dataValue;\n this.refs.input.forEach(function (input, index) {\n if (input.checked) {\n value = _this5.isSelectURL && _lodash[\"default\"].isObject(_this5.loadedOptions[index].value) ? _this5.loadedOptions[index].value : input.value;\n }\n });\n return value;\n }\n }, {\n key: \"validateValueProperty\",\n value: function validateValueProperty() {\n var _this6 = this;\n if (this.component.dataSrc === 'values') {\n return true;\n }\n return !_lodash[\"default\"].some(this.refs.wrapper, function (wrapper, index) {\n return _this6.refs.input[index].checked && _this6.loadedOptions[index].invalid;\n });\n }\n }, {\n key: \"validateValueAvailability\",\n value: function validateValueAvailability(setting, value) {\n var _this7 = this;\n if (!(0, _utils.boolValue)(setting) || !value) {\n return true;\n }\n var values = this.component.values;\n if (values) {\n return values.findIndex(function (_ref) {\n var optionValue = _ref.value;\n return _this7.normalizeValue(optionValue) === value;\n }) !== -1;\n }\n return false;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (_lodash[\"default\"].isObject(value)) {\n value = JSON.stringify(value);\n } else if (!_lodash[\"default\"].isString(value)) {\n value = _lodash[\"default\"].toString(value);\n }\n if (this.component.dataSrc !== 'values') {\n return value;\n }\n var option = _lodash[\"default\"].find(this.component.values, function (v) {\n return v.value === value;\n });\n if (!value) {\n return _lodash[\"default\"].get(option, 'label', '');\n }\n return _lodash[\"default\"].get(option, 'label', '');\n }\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n if (this.refs.input && this.refs.input[index] && value !== null && value !== undefined) {\n var inputValue = this.refs.input[index].value;\n this.refs.input[index].checked = inputValue === value.toString();\n }\n }\n }, {\n key: \"loadItems\",\n value: function loadItems(url, search, headers, options, method, body) {\n var _this8 = this;\n if (this.optionsLoaded) {\n return;\n }\n if (!this.shouldLoad && this.listData) {\n this.loadItemsFromMetadata();\n return;\n }\n\n // Ensure we have a method and remove any body if method is get\n method = method || 'GET';\n if (method.toUpperCase() === 'GET') {\n body = null;\n }\n\n // Set ignoreCache if it is\n options.ignoreCache = this.component.ignoreCache;\n // Make the request.\n options.header = headers;\n this.loading = true;\n _Formio.GlobalFormio.makeRequest(this.options.formio, 'select', url, method, body, options).then(function (response) {\n _this8.loading = false;\n _this8.error = null;\n _this8.setItems(response);\n _this8.optionsLoaded = true;\n _this8.redraw();\n })[\"catch\"](function (err) {\n _this8.handleLoadingError(err);\n });\n }\n }, {\n key: \"loadItemsFromMetadata\",\n value: function loadItemsFromMetadata() {\n var _this9 = this;\n this.listData.forEach(function (item, i) {\n _this9.loadedOptions[i] = {\n label: _this9.itemTemplate(item)\n };\n if (_lodash[\"default\"].isEqual(item, _this9.selectData || _lodash[\"default\"].pick(_this9.dataValue, _lodash[\"default\"].keys(item)))) {\n _this9.loadedOptions[i].value = _this9.dataValue;\n }\n });\n this.optionsLoaded = true;\n this.redraw();\n }\n }, {\n key: \"setItems\",\n value: function setItems(items) {\n var _this10 = this;\n var listData = [];\n items === null || items === void 0 ? void 0 : items.forEach(function (item, i) {\n _this10.loadedOptions[i] = {\n value: _this10.component.valueProperty ? item[_this10.component.valueProperty] : item,\n label: _this10.component.valueProperty ? _this10.itemTemplate(item, item[_this10.component.valueProperty]) : _this10.itemTemplate(item, item, i)\n };\n listData.push(_this10.templateData[_this10.component.valueProperty ? item[_this10.component.valueProperty] : i]);\n if ((_this10.component.valueProperty || !_this10.isRadio) && (_lodash[\"default\"].isUndefined(item[_this10.component.valueProperty]) || !_this10.isRadio && _lodash[\"default\"].isObject(item[_this10.component.valueProperty]) || !_this10.isRadio && _lodash[\"default\"].isBoolean(item[_this10.component.valueProperty]))) {\n _this10.loadedOptions[i].invalid = true;\n }\n });\n if (this.isSelectURL) {\n var submission = this.root.submission;\n if (!submission.metadata) {\n submission.metadata = {};\n }\n if (!submission.metadata.listData) {\n submission.metadata.listData = {};\n }\n _lodash[\"default\"].set(submission.metadata.listData, this.path, listData);\n }\n }\n }, {\n key: \"setSelectedClasses\",\n value: function setSelectedClasses() {\n var _this11 = this;\n if (this.refs.wrapper) {\n //add/remove selected option class\n var value = this.dataValue;\n this.refs.wrapper.forEach(function (wrapper, index) {\n var input = _this11.refs.input[index];\n var checked = input.type === 'checkbox' ? value[input.value] : input.value.toString() === value.toString();\n if (checked) {\n //add class to container when selected\n _this11.addClass(wrapper, _this11.optionSelectedClass);\n //change \"checked\" attribute\n input.setAttribute('checked', 'true');\n } else {\n _this11.removeClass(wrapper, _this11.optionSelectedClass);\n input.removeAttribute('checked');\n }\n });\n }\n }\n }, {\n key: \"updateValue\",\n value: function updateValue(value, flags) {\n var changed = _get(_getPrototypeOf(RadioComponent.prototype), \"updateValue\", this).call(this, value, flags);\n if (changed) {\n this.setSelectedClasses();\n }\n if (!flags || !flags.modified || !this.isRadio) {\n if (changed) {\n this.previousValue = this.dataValue;\n }\n return changed;\n }\n\n // If they clicked on the radio that is currently selected, it needs to reset the value.\n this.currentValue = this.dataValue;\n var shouldResetValue = flags && flags.modified && !flags.noUpdateEvent && this.previousValue === this.currentValue;\n if (shouldResetValue) {\n this.resetValue();\n this.triggerChange(flags);\n this.setSelectedClasses();\n }\n this.previousValue = this.dataValue;\n return changed;\n }\n\n /**\n * Normalize values coming into updateValue.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n if (value === this.emptyValue) {\n return value;\n }\n var isEquivalent = _lodash[\"default\"].toString(value) === Number(value).toString();\n if (!isNaN(parseFloat(value)) && isFinite(value) && isEquivalent) {\n value = +value;\n }\n if (value === 'true') {\n value = true;\n }\n if (value === 'false') {\n value = false;\n }\n if (this.isSelectURL && this.templateData && this.templateData[value]) {\n var submission = this.root.submission;\n if (!submission.metadata.selectData) {\n submission.metadata.selectData = {};\n }\n _lodash[\"default\"].set(submission.metadata.selectData, this.path, this.templateData[value]);\n }\n return _get(_getPrototypeOf(RadioComponent.prototype), \"normalizeValue\", this).call(this, value);\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len3 = arguments.length, extend = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n extend[_key3] = arguments[_key3];\n }\n return _ListComponent2[\"default\"].schema.apply(_ListComponent2[\"default\"], [{\n type: 'radio',\n inputType: 'radio',\n label: 'Radio',\n key: 'radio',\n values: [{\n label: '',\n value: ''\n }],\n data: {\n url: ''\n },\n fieldSet: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Radio',\n group: 'basic',\n icon: 'dot-circle-o',\n weight: 80,\n documentation: '/userguide/form-building/form-components#radio',\n schema: RadioComponent.schema()\n };\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(RadioComponent), \"conditionOperatorsSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n return {\n type: 'select',\n dataSrc: 'custom',\n valueProperty: 'value',\n dataType: classComp.dataType || '',\n data: {\n custom: function custom() {\n return classComp.values;\n }\n }\n };\n }\n });\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n var _boolean = _utils.componentValueTypes[\"boolean\"],\n string = _utils.componentValueTypes.string,\n number = _utils.componentValueTypes.number,\n object = _utils.componentValueTypes.object,\n array = _utils.componentValueTypes.array;\n var dataType = schema.dataType;\n var types = (0, _utils.getComponentSavedTypes)(schema);\n if (types) {\n return types;\n }\n if (dataType === 'object') {\n return [object, array];\n }\n if (_utils.componentValueTypes[dataType]) {\n return [_utils.componentValueTypes[dataType]];\n }\n return [_boolean, string, number, object, array];\n }\n }]);\n return RadioComponent;\n}(_ListComponent2[\"default\"]);\nexports[\"default\"] = RadioComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/radio/Radio.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.some.js */ \"./node_modules/core-js/modules/es.array.some.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.parse-float.js */ \"./node_modules/core-js/modules/es.parse-float.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _ListComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/list/ListComponent */ \"./lib/components/_classes/list/ListComponent.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _Formio = __webpack_require__(/*! ../../Formio */ \"./lib/Formio.js\");\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar RadioComponent = /*#__PURE__*/function (_ListComponent) {\n _inherits(RadioComponent, _ListComponent);\n var _super = _createSuper(RadioComponent);\n function RadioComponent(component, options, data) {\n var _this;\n _classCallCheck(this, RadioComponent);\n _this = _super.call(this, component, options, data);\n _this.previousValue = _this.dataValue || null;\n return _this;\n }\n _createClass(RadioComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return RadioComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(RadioComponent.prototype), \"defaultValue\", this);\n if (!defaultValue && this.component.defaultValue === false) {\n defaultValue = this.component.defaultValue;\n }\n return defaultValue;\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var _this$root;\n var info = _get(_getPrototypeOf(RadioComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'input';\n info.changeEvent = 'click';\n info.attr[\"class\"] = 'form-check-input';\n info.attr.name = info.attr.name += \"[\".concat((_this$root = this.root) === null || _this$root === void 0 ? void 0 : _this$root.id, \"-\").concat(this.id, \"]\");\n return info;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return '';\n }\n }, {\n key: \"isRadio\",\n get: function get() {\n return this.component.inputType === 'radio';\n }\n }, {\n key: \"optionSelectedClass\",\n get: function get() {\n return 'radio-selected';\n }\n }, {\n key: \"listData\",\n get: function get() {\n var listData = _lodash[\"default\"].get(this.root, 'submission.metadata.listData', {});\n return _lodash[\"default\"].get(listData, this.path);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this2 = this;\n _get(_getPrototypeOf(RadioComponent.prototype), \"init\", this).call(this);\n this.templateData = {};\n this.validators = this.validators.concat(['select', 'onlyAvailableItems', 'availableValueProperty']);\n\n // Trigger an update.\n var updateArgs = [];\n var triggerUpdate = _lodash[\"default\"].debounce(function () {\n updateArgs = [];\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _this2.updateItems.apply(_this2, args);\n }, 100);\n this.triggerUpdate = function () {\n // Make sure we always resolve the previous promise before reassign it\n if (typeof _this2.itemsLoadedResolve === 'function') {\n _this2.itemsLoadedResolve();\n }\n _this2.itemsLoaded = new _nativePromiseOnly[\"default\"](function (resolve) {\n _this2.itemsLoadedResolve = resolve;\n });\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (args.length) {\n updateArgs = args;\n }\n return triggerUpdate.apply(void 0, _toConsumableArray(updateArgs));\n };\n this.itemsLoaded = new _nativePromiseOnly[\"default\"](function (resolve) {\n _this2.itemsLoadedResolve = resolve;\n });\n this.optionsLoaded = false;\n this.loadedOptions = [];\n\n // Get the template keys for this radio component.\n this.getTemplateKeys();\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(RadioComponent.prototype), \"render\", this).call(this, this.renderTemplate('radio', {\n input: this.inputInfo,\n inline: this.component.inline,\n values: this.component.dataSrc === 'values' ? this.component.values : this.loadedOptions,\n value: this.dataValue,\n row: this.row\n }));\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this3 = this;\n this.loadRefs(element, {\n input: 'multiple',\n wrapper: 'multiple'\n });\n this.refs.input.forEach(function (input, index) {\n _this3.addEventListener(input, _this3.inputInfo.changeEvent, function () {\n _this3.updateValue(null, {\n modified: true\n });\n });\n if (_this3.component.values[index]) {\n _this3.addShortcut(input, _this3.component.values[index].shortcut);\n }\n if (_this3.isRadio) {\n var dataValue = _this3.dataValue;\n if (!_lodash[\"default\"].isString(_this3.dataValue)) {\n dataValue = _lodash[\"default\"].toString(_this3.dataValue);\n }\n if (_this3.isSelectURL && _lodash[\"default\"].isObject(_this3.loadedOptions[index].value)) {\n var optionValue = _this3.component.dataType === 'string' ? JSON.stringify(_this3.loadedOptions[index].value) : _this3.loadedOptions[index].value;\n input.checked = _lodash[\"default\"].isEqual(optionValue, _this3.dataValue);\n } else {\n input.checked = dataValue === input.value && (input.value || _this3.component.dataSrc !== 'url');\n }\n _this3.addEventListener(input, 'keyup', function (event) {\n if (event.key === ' ' && dataValue === input.value) {\n event.preventDefault();\n _this3.updateValue(null, {\n modified: true\n });\n }\n });\n }\n });\n this.triggerUpdate();\n this.setSelectedClasses();\n return _get(_getPrototypeOf(RadioComponent.prototype), \"attach\", this).call(this, element);\n }\n }, {\n key: \"detach\",\n value: function detach(element) {\n var _this4 = this;\n if (element && this.refs.input) {\n this.refs.input.forEach(function (input, index) {\n if (_this4.component.values[index]) {\n _this4.removeShortcut(input, _this4.component.values[index].shortcut);\n }\n });\n }\n _get(_getPrototypeOf(RadioComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n var _this5 = this;\n if (this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var value = this.dataValue;\n this.refs.input.forEach(function (input, index) {\n if (input.checked) {\n value = _this5.isSelectURL && _lodash[\"default\"].isObject(_this5.loadedOptions[index].value) ? _this5.loadedOptions[index].value : input.value;\n }\n });\n return value;\n }\n }, {\n key: \"validateValueProperty\",\n value: function validateValueProperty() {\n var _this6 = this;\n if (this.component.dataSrc === 'values') {\n return true;\n }\n return !_lodash[\"default\"].some(this.refs.wrapper, function (wrapper, index) {\n return _this6.refs.input[index].checked && _this6.loadedOptions[index].invalid;\n });\n }\n }, {\n key: \"validateValueAvailability\",\n value: function validateValueAvailability(setting, value) {\n var _this7 = this;\n if (!(0, _utils.boolValue)(setting) || !value) {\n return true;\n }\n var values = this.component.values;\n if (values) {\n return values.findIndex(function (_ref) {\n var optionValue = _ref.value;\n return _this7.normalizeValue(optionValue) === value;\n }) !== -1;\n }\n return false;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (_lodash[\"default\"].isObject(value)) {\n value = JSON.stringify(value);\n } else if (!_lodash[\"default\"].isString(value)) {\n value = _lodash[\"default\"].toString(value);\n }\n if (this.component.dataSrc !== 'values') {\n return value;\n }\n var option = _lodash[\"default\"].find(this.component.values, function (v) {\n return v.value === value;\n });\n if (!value) {\n return _lodash[\"default\"].get(option, 'label', '');\n }\n return _lodash[\"default\"].get(option, 'label', '');\n }\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n if (this.refs.input && this.refs.input[index] && value !== null && value !== undefined) {\n var inputValue = this.refs.input[index].value;\n this.refs.input[index].checked = inputValue === value.toString();\n }\n }\n }, {\n key: \"loadItems\",\n value: function loadItems(url, search, headers, options, method, body) {\n var _this8 = this;\n if (this.optionsLoaded) {\n return;\n }\n if (!this.shouldLoad && this.listData) {\n this.loadItemsFromMetadata();\n return;\n }\n\n // Ensure we have a method and remove any body if method is get\n method = method || 'GET';\n if (method.toUpperCase() === 'GET') {\n body = null;\n }\n\n // Set ignoreCache if it is\n options.ignoreCache = this.component.ignoreCache;\n // Make the request.\n options.header = headers;\n this.loading = true;\n _Formio.GlobalFormio.makeRequest(this.options.formio, 'select', url, method, body, options).then(function (response) {\n _this8.loading = false;\n _this8.error = null;\n _this8.setItems(response);\n _this8.optionsLoaded = true;\n _this8.redraw();\n })[\"catch\"](function (err) {\n _this8.handleLoadingError(err);\n });\n }\n }, {\n key: \"loadItemsFromMetadata\",\n value: function loadItemsFromMetadata() {\n var _this9 = this;\n this.listData.forEach(function (item, i) {\n _this9.loadedOptions[i] = {\n label: _this9.itemTemplate(item)\n };\n if (_lodash[\"default\"].isEqual(item, _this9.selectData || _lodash[\"default\"].pick(_this9.dataValue, _lodash[\"default\"].keys(item)))) {\n _this9.loadedOptions[i].value = _this9.dataValue;\n }\n });\n this.optionsLoaded = true;\n this.redraw();\n }\n }, {\n key: \"setItems\",\n value: function setItems(items) {\n var _this10 = this;\n var listData = [];\n items === null || items === void 0 ? void 0 : items.forEach(function (item, i) {\n _this10.loadedOptions[i] = {\n value: _this10.component.valueProperty ? item[_this10.component.valueProperty] : item,\n label: _this10.component.valueProperty ? _this10.itemTemplate(item, item[_this10.component.valueProperty]) : _this10.itemTemplate(item, item, i)\n };\n listData.push(_this10.templateData[_this10.component.valueProperty ? item[_this10.component.valueProperty] : i]);\n if ((_this10.component.valueProperty || !_this10.isRadio) && (_lodash[\"default\"].isUndefined(item[_this10.component.valueProperty]) || !_this10.isRadio && _lodash[\"default\"].isObject(item[_this10.component.valueProperty]) || !_this10.isRadio && _lodash[\"default\"].isBoolean(item[_this10.component.valueProperty]))) {\n _this10.loadedOptions[i].invalid = true;\n }\n });\n if (this.isSelectURL) {\n var submission = this.root.submission;\n if (!submission.metadata) {\n submission.metadata = {};\n }\n if (!submission.metadata.listData) {\n submission.metadata.listData = {};\n }\n _lodash[\"default\"].set(submission.metadata.listData, this.path, listData);\n }\n }\n }, {\n key: \"setSelectedClasses\",\n value: function setSelectedClasses() {\n var _this11 = this;\n if (this.refs.wrapper) {\n //add/remove selected option class\n var value = this.dataValue;\n this.refs.wrapper.forEach(function (wrapper, index) {\n var input = _this11.refs.input[index];\n var checked = input.type === 'checkbox' ? value[input.value] : input.value.toString() === value.toString();\n if (checked) {\n //add class to container when selected\n _this11.addClass(wrapper, _this11.optionSelectedClass);\n //change \"checked\" attribute\n input.setAttribute('checked', 'true');\n } else {\n _this11.removeClass(wrapper, _this11.optionSelectedClass);\n input.removeAttribute('checked');\n }\n });\n }\n }\n }, {\n key: \"updateValue\",\n value: function updateValue(value, flags) {\n var changed = _get(_getPrototypeOf(RadioComponent.prototype), \"updateValue\", this).call(this, value, flags);\n if (changed) {\n this.setSelectedClasses();\n }\n if (!flags || !flags.modified || !this.isRadio) {\n if (changed) {\n this.previousValue = this.dataValue;\n }\n return changed;\n }\n\n // If they clicked on the radio that is currently selected, it needs to reset the value.\n this.currentValue = this.dataValue;\n var shouldResetValue = flags && flags.modified && !flags.noUpdateEvent && this.previousValue === this.currentValue;\n if (shouldResetValue) {\n this.resetValue();\n this.triggerChange(flags);\n this.setSelectedClasses();\n }\n this.previousValue = this.dataValue;\n return changed;\n }\n\n /**\n * Normalize values coming into updateValue.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n var dataType = this.component.dataType || 'auto';\n if (value === this.emptyValue) {\n return value;\n }\n switch (dataType) {\n case 'auto':\n if (!isNaN(parseFloat(value)) && isFinite(value) && _lodash[\"default\"].toString(value) === Number(value).toString()) {\n value = +value;\n }\n if (value === 'true') {\n value = true;\n }\n if (value === 'false') {\n value = false;\n }\n break;\n case 'number':\n value = +value;\n break;\n case 'string':\n if (_typeof(value) === 'object') {\n value = JSON.stringify(value);\n } else {\n value = String(value);\n }\n break;\n case 'boolean':\n value = !(!value || value.toString() === 'false');\n break;\n }\n if (this.isSelectURL && this.templateData && this.templateData[value]) {\n var submission = this.root.submission;\n if (!submission.metadata.selectData) {\n submission.metadata.selectData = {};\n }\n _lodash[\"default\"].set(submission.metadata.selectData, this.path, this.templateData[value]);\n }\n return _get(_getPrototypeOf(RadioComponent.prototype), \"normalizeValue\", this).call(this, value);\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len3 = arguments.length, extend = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n extend[_key3] = arguments[_key3];\n }\n return _ListComponent2[\"default\"].schema.apply(_ListComponent2[\"default\"], [{\n type: 'radio',\n inputType: 'radio',\n label: 'Radio',\n key: 'radio',\n values: [{\n label: '',\n value: ''\n }],\n data: {\n url: ''\n },\n fieldSet: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Radio',\n group: 'basic',\n icon: 'dot-circle-o',\n weight: 80,\n documentation: '/userguide/form-building/form-components#radio',\n schema: RadioComponent.schema()\n };\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(RadioComponent), \"conditionOperatorsSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n return {\n type: 'select',\n dataSrc: 'custom',\n valueProperty: 'value',\n dataType: classComp.dataType || '',\n data: {\n custom: function custom() {\n return classComp.values;\n }\n }\n };\n }\n });\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n var _boolean = _utils.componentValueTypes[\"boolean\"],\n string = _utils.componentValueTypes.string,\n number = _utils.componentValueTypes.number,\n object = _utils.componentValueTypes.object,\n array = _utils.componentValueTypes.array;\n var dataType = schema.dataType;\n var types = (0, _utils.getComponentSavedTypes)(schema);\n if (types) {\n return types;\n }\n if (dataType === 'object') {\n return [object, array];\n }\n if (_utils.componentValueTypes[dataType]) {\n return [_utils.componentValueTypes[dataType]];\n }\n return [_boolean, string, number, object, array];\n }\n }]);\n return RadioComponent;\n}(_ListComponent2[\"default\"]);\nexports[\"default\"] = RadioComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/radio/Radio.js?"); /***/ }), @@ -1663,7 +1663,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.regexp.flags.js */ \"./node_modules/core-js/modules/es.regexp.flags.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nvar _builder = _interopRequireDefault(__webpack_require__(/*! ../../../utils/builder */ \"./lib/utils/builder.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nvar _default = [{\n key: 'multiple',\n ignore: true\n}, {\n key: 'dataSrc',\n data: {\n values: [{\n label: 'Values',\n value: 'values'\n }, {\n label: 'URL',\n value: 'url'\n }]\n },\n 'validate': {\n 'required': true\n },\n onChange: function onChange(context) {\n if (context && context.flags && context.flags && context.flags.modified) {\n context.data.values = [{\n label: '',\n value: ''\n }];\n }\n }\n}, {\n type: 'datagrid',\n input: true,\n label: 'Values',\n key: 'values',\n tooltip: 'The radio button values that can be picked for this field. Values are text submitted with the form data. Labels are text that appears next to the radio buttons on the form.',\n weight: 10,\n reorder: true,\n defaultValue: [{\n label: '',\n value: ''\n }],\n components: [{\n label: 'Label',\n key: 'label',\n input: true,\n type: 'textfield'\n }, {\n label: 'Value',\n key: 'value',\n input: true,\n type: 'textfield',\n allowCalculateOverride: true,\n calculateValue: 'value = _.camelCase(row.label);',\n validate: {\n required: true\n }\n }, {\n type: 'select',\n input: true,\n weight: 180,\n label: 'Shortcut',\n key: 'shortcut',\n tooltip: 'The shortcut key for this option.',\n dataSrc: 'custom',\n valueProperty: 'value',\n customDefaultValue: function customDefaultValue() {\n return '';\n },\n template: '{{ item.label }}',\n data: {\n custom: function custom(context) {\n return _builder[\"default\"].getAvailableShortcuts(_lodash[\"default\"].get(context, 'instance.options.editForm', {}), _lodash[\"default\"].get(context, 'instance.options.editComponent', {}));\n }\n }\n }],\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'values']\n }\n }\n}, {\n key: 'template',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'url']\n }\n }\n}];\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/components/radio/editForm/Radio.edit.data.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.regexp.flags.js */ \"./node_modules/core-js/modules/es.regexp.flags.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\nvar _builder = _interopRequireDefault(__webpack_require__(/*! ../../../utils/builder */ \"./lib/utils/builder.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nvar _default = [{\n key: 'multiple',\n ignore: true\n}, {\n key: 'dataSrc',\n data: {\n values: [{\n label: 'Values',\n value: 'values'\n }, {\n label: 'URL',\n value: 'url'\n }]\n },\n 'validate': {\n 'required': true\n },\n onChange: function onChange(context) {\n if (context && context.flags && context.flags && context.flags.modified) {\n context.data.values = [{\n label: '',\n value: ''\n }];\n }\n }\n}, {\n type: 'datagrid',\n input: true,\n label: 'Values',\n key: 'values',\n tooltip: 'The radio button values that can be picked for this field. Values are text submitted with the form data. Labels are text that appears next to the radio buttons on the form.',\n weight: 10,\n reorder: true,\n defaultValue: [{\n label: '',\n value: ''\n }],\n components: [{\n label: 'Label',\n key: 'label',\n input: true,\n type: 'textfield'\n }, {\n label: 'Value',\n key: 'value',\n input: true,\n type: 'textfield',\n allowCalculateOverride: true,\n calculateValue: 'value = _.camelCase(row.label);',\n validate: {\n required: true\n }\n }, {\n type: 'select',\n input: true,\n weight: 180,\n label: 'Shortcut',\n key: 'shortcut',\n tooltip: 'The shortcut key for this option.',\n dataSrc: 'custom',\n valueProperty: 'value',\n customDefaultValue: function customDefaultValue() {\n return '';\n },\n template: '{{ item.label }}',\n data: {\n custom: function custom(context) {\n return _builder[\"default\"].getAvailableShortcuts(_lodash[\"default\"].get(context, 'instance.options.editForm', {}), _lodash[\"default\"].get(context, 'instance.options.editComponent', {}));\n }\n }\n }],\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'values']\n }\n }\n}, {\n type: 'select',\n input: true,\n label: 'Storage Type',\n key: 'dataType',\n clearOnHide: true,\n tooltip: 'The type to store the data. If you select something other than autotype, it will force it to that type.',\n weight: 12,\n template: '{{ item.label }}',\n dataSrc: 'values',\n data: {\n values: [{\n label: 'Autotype',\n value: 'auto'\n }, {\n label: 'String',\n value: 'string'\n }, {\n label: 'Number',\n value: 'number'\n }, {\n label: 'Boolean',\n value: 'boolean'\n }, {\n label: 'Object',\n value: 'object'\n }]\n }\n}, {\n key: 'template',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'url']\n }\n }\n}];\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/components/radio/editForm/Radio.edit.data.js?"); /***/ }), @@ -1773,7 +1773,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce-right.js */ \"./node_modules/core-js/modules/es.array.reduce-right.js\");\n__webpack_require__(/*! core-js/modules/es.string.trim.js */ \"./node_modules/core-js/modules/es.string.trim.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.string.ends-with.js */ \"./node_modules/core-js/modules/es.string.ends-with.js\");\n__webpack_require__(/*! core-js/modules/es.array.sort.js */ \"./node_modules/core-js/modules/es.array.sort.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.number.is-nan.js */ \"./node_modules/core-js/modules/es.number.is-nan.js\");\n__webpack_require__(/*! core-js/modules/es.number.is-finite.js */ \"./node_modules/core-js/modules/es.number.is-finite.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.some.js */ \"./node_modules/core-js/modules/es.array.some.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Formio = __webpack_require__(/*! ../../Formio */ \"./lib/Formio.js\");\nvar _ListComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/list/ListComponent */ \"./lib/components/_classes/list/ListComponent.js\"));\nvar _Form = _interopRequireDefault(__webpack_require__(/*! ../../Form */ \"./lib/Form.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar Choices;\nif (typeof window !== 'undefined') {\n Choices = (__webpack_require__(/*! ../../utils/ChoicesWrapper */ \"./lib/utils/ChoicesWrapper.js\")[\"default\"]);\n}\nvar SelectComponent = /*#__PURE__*/function (_ListComponent) {\n _inherits(SelectComponent, _ListComponent);\n var _super = _createSuper(SelectComponent);\n function SelectComponent() {\n _classCallCheck(this, SelectComponent);\n return _super.apply(this, arguments);\n }\n _createClass(SelectComponent, [{\n key: \"init\",\n value: function init() {\n var _this = this;\n _get(_getPrototypeOf(SelectComponent.prototype), \"init\", this).call(this);\n this.templateData = {};\n this.validators = this.validators.concat(['select', 'onlyAvailableItems']);\n\n // Trigger an update.\n var updateArgs = [];\n var triggerUpdate = _lodash[\"default\"].debounce(function () {\n updateArgs = [];\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _this.updateItems.apply(_this, args);\n }, 100);\n this.triggerUpdate = function () {\n // Make sure we always resolve the previous promise before reassign it\n if (typeof _this.itemsLoadedResolve === 'function') {\n _this.itemsLoadedResolve();\n }\n _this.itemsLoaded = new _nativePromiseOnly[\"default\"](function (resolve) {\n _this.itemsLoadedResolve = resolve;\n });\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (args.length) {\n updateArgs = args;\n }\n return triggerUpdate.apply(void 0, _toConsumableArray(updateArgs));\n };\n\n // Keep track of the select options.\n this.selectOptions = [];\n if (this.itemsFromUrl) {\n this.isFromSearch = false;\n this.searchServerCount = null;\n this.defaultServerCount = null;\n this.isScrollLoading = false;\n this.searchDownloadedResources = [];\n this.defaultDownloadedResources = [];\n }\n\n // If this component has been activated.\n this.activated = false;\n this.itemsLoaded = new _nativePromiseOnly[\"default\"](function (resolve) {\n _this.itemsLoadedResolve = resolve;\n });\n this.shouldPositionDropdown = this.hasDataGridAncestor();\n if (this.isHtmlRenderMode()) {\n this.activate();\n }\n\n // Get the template keys for this select component.\n this.getTemplateKeys();\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n // If the root submission has been set, and we are still not attached, then assume\n // that our data is ready.\n if (this.root && this.root.submissionSet && !this.attached) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n return this.itemsLoaded;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return SelectComponent.schema();\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n if (this.component.multiple) {\n return [];\n }\n // if select has JSON data source type, we are defining if empty value would be an object or a string by checking JSON's first item\n if (this.component.dataSrc === 'json' && this.component.data.json) {\n var firstItem = this.component.data.json[0];\n var firstValue;\n if (this.valueProperty) {\n firstValue = _lodash[\"default\"].get(firstItem, this.valueProperty);\n } else {\n firstValue = firstItem;\n }\n if (firstValue && typeof firstValue === 'string') {\n return '';\n } else {\n return {};\n }\n }\n if (this.valueProperty) {\n return '';\n }\n return {};\n }\n }, {\n key: \"valueProperty\",\n get: function get() {\n if (this.component.valueProperty) {\n return this.component.valueProperty;\n }\n // Force values datasource to use values without actually setting it on the component settings.\n if (this.component.dataSrc === 'values') {\n return 'value';\n }\n return '';\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(SelectComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'select';\n info.changeEvent = 'change';\n return info;\n }\n }, {\n key: \"isSelectResource\",\n get: function get() {\n return this.component.dataSrc === 'resource';\n }\n }, {\n key: \"itemsFromUrl\",\n get: function get() {\n return this.isSelectResource || this.isSelectURL;\n }\n }, {\n key: \"isInfiniteScrollProvided\",\n get: function get() {\n return this.itemsFromUrl;\n }\n }, {\n key: \"shouldDisabled\",\n get: function get() {\n return _get(_getPrototypeOf(SelectComponent.prototype), \"shouldDisabled\", this) || this.parentDisabled;\n }\n }, {\n key: \"shouldInitialLoad\",\n get: function get() {\n if (this.component.widget === 'html5' && this.isEntireObjectDisplay() && this.component.searchField && this.dataValue) {\n return false;\n }\n return _get(_getPrototypeOf(SelectComponent.prototype), \"shouldLoad\", this);\n }\n }, {\n key: \"isEntireObjectDisplay\",\n value: function isEntireObjectDisplay() {\n return this.component.dataSrc === 'resource' && this.valueProperty === 'data';\n }\n }, {\n key: \"selectValueAndLabel\",\n value: function selectValueAndLabel(data) {\n var value = this.getOptionValue(this.isEntireObjectDisplay() && !this.itemValue(data) ? data : this.itemValue(data));\n return {\n value: value,\n label: this.itemTemplate(this.isEntireObjectDisplay() && !_lodash[\"default\"].isObject(data.data) ? {\n data: data\n } : data, value)\n };\n }\n }, {\n key: \"itemTemplate\",\n value: function itemTemplate(data, value) {\n var _this2 = this;\n if (!_lodash[\"default\"].isNumber(data) && _lodash[\"default\"].isEmpty(data)) {\n return '';\n }\n\n // If they wish to show the value in read only mode, then just return the itemValue here.\n if (this.options.readOnly && this.component.readOnlyValue) {\n return this.itemValue(data);\n }\n // Perform a fast interpretation if we should not use the template.\n if (data && !this.component.template) {\n var itemLabel = data.label || data;\n var _value = typeof itemLabel === 'string' ? this.t(itemLabel, {\n _userInput: true\n }) : itemLabel;\n return this.sanitize(_value, this.shouldSanitizeValue);\n }\n if (this.component.multiple && _lodash[\"default\"].isArray(this.dataValue) ? this.dataValue.find(function (val) {\n return value === val;\n }) : this.dataValue === value) {\n var selectData = this.selectData;\n if (selectData) {\n var templateValue = this.component.reference && value !== null && value !== void 0 && value._id ? value._id.toString() : value;\n if (!this.templateData || !this.templateData[templateValue]) {\n this.getOptionTemplate(data, value);\n }\n if (this.component.multiple) {\n if (selectData[templateValue]) {\n data = selectData[templateValue];\n }\n } else {\n data = selectData;\n }\n }\n }\n if (typeof data === 'string' || typeof data === 'number') {\n return this.sanitize(this.t(data, {\n _userInput: true\n }), this.shouldSanitizeValue);\n }\n if (Array.isArray(data)) {\n return data.map(function (val) {\n if (typeof val === 'string' || typeof val === 'number') {\n return _this2.sanitize(_this2.t(val, {\n _userInput: true\n }), _this2.shouldSanitizeValue);\n }\n return val;\n });\n }\n if (data.data) {\n // checking additional fields in the template for the selected Entire Object option\n var hasNestedFields = /item\\.data\\.\\w*/g.test(this.component.template);\n data.data = this.isEntireObjectDisplay() && _lodash[\"default\"].isObject(data.data) && !hasNestedFields ? JSON.stringify(data.data) : data.data;\n }\n return _get(_getPrototypeOf(SelectComponent.prototype), \"itemTemplate\", this).call(this, data, value);\n }\n\n /**\n * Adds an option to the select dropdown.\n *\n * @param value\n * @param label\n */\n }, {\n key: \"addOption\",\n value: function addOption(value, label) {\n var attrs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var id = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : (0, _utils.getRandomComponentId)();\n if (_lodash[\"default\"].isNil(label)) return;\n var idPath = this.component.idPath ? this.component.idPath.split('.').reduceRight(function (obj, key) {\n return _defineProperty({}, key, obj);\n }, id) : {};\n var option = _objectSpread({\n value: this.getOptionValue(value),\n label: label\n }, idPath);\n var skipOption = this.component.uniqueOptions ? !!this.selectOptions.find(function (selectOption) {\n return _lodash[\"default\"].isEqual(selectOption.value, option.value);\n }) : false;\n if (skipOption) {\n return;\n }\n if (value) {\n this.selectOptions.push(option);\n }\n if (this.refs.selectContainer && this.component.widget === 'html5') {\n // Replace an empty Object value to an empty String.\n if (option.value && _lodash[\"default\"].isObject(option.value) && _lodash[\"default\"].isEmpty(option.value)) {\n option.value = '';\n }\n // Add element to option so we can reference it later.\n var div = document.createElement('div');\n div.innerHTML = this.sanitize(this.renderTemplate('selectOption', {\n selected: _lodash[\"default\"].isEqual(this.getOptionValue(this.dataValue), option.value),\n option: option,\n attrs: attrs,\n id: id,\n useId: (this.valueProperty === '' || this.isEntireObjectDisplay()) && _lodash[\"default\"].isObject(value) && id\n }), this.shouldSanitizeValue).trim();\n option.element = div.firstChild;\n this.refs.selectContainer.appendChild(option.element);\n }\n }\n }, {\n key: \"addValueOptions\",\n value: function addValueOptions(items) {\n var _this3 = this;\n items = items || [];\n var added = false;\n var data = this.dataValue;\n\n // preset submission value with value property before request.\n if (this.options.pdf && !items.length && this.component.dataSrc === 'url' && this.valueProperty) {\n data = Array.isArray(data) ? data.map(function (item) {\n return _lodash[\"default\"].set({}, _this3.valueProperty, item);\n }) : _lodash[\"default\"].set({}, this.valueProperty, data);\n }\n if (!this.selectOptions.length) {\n // Add the currently selected choices if they don't already exist.\n var currentChoices = Array.isArray(data) && this.component.multiple ? data : [data];\n added = this.addCurrentChoices(currentChoices, items);\n if (!added && !this.component.multiple) {\n this.addPlaceholder();\n }\n }\n return added;\n }\n }, {\n key: \"disableInfiniteScroll\",\n value: function disableInfiniteScroll() {\n if (!this.downloadedResources) {\n return;\n }\n this.downloadedResources.serverCount = this.downloadedResources.length;\n this.serverCount = this.downloadedResources.length;\n }\n\n /* eslint-disable max-statements */\n }, {\n key: \"setItems\",\n value: function setItems(items, fromSearch) {\n var _this4 = this,\n _this$choices,\n _this$choices$input;\n this.selectItems = items;\n // If the items is a string, then parse as JSON.\n if (typeof items == 'string') {\n try {\n items = JSON.parse(items);\n } catch (err) {\n console.warn(err.message);\n items = [];\n }\n }\n\n // Allow js processing (needed for form builder)\n if (this.component.onSetItems) {\n var newItems = typeof this.component.onSetItems === 'function' ? this.component.onSetItems(this, items) : this.evaluate(this.component.onSetItems, {\n items: items\n }, 'items');\n if (newItems) {\n items = newItems;\n }\n }\n if (!this.choices && this.refs.selectContainer) {\n this.empty(this.refs.selectContainer);\n }\n\n // If they provided select values, then we need to get them instead.\n if (this.component.selectValues) {\n items = _lodash[\"default\"].get(items, this.component.selectValues, items) || [];\n }\n var areItemsEqual;\n if (this.itemsFromUrl) {\n areItemsEqual = this.isSelectURL ? _lodash[\"default\"].isEqual(items, this.downloadedResources) : false;\n var areItemsEnded = this.component.limit > items.length;\n var areItemsDownloaded = areItemsEqual && this.downloadedResources && this.downloadedResources.length === items.length;\n if (areItemsEnded) {\n this.disableInfiniteScroll();\n } else if (areItemsDownloaded) {\n this.selectOptions = [];\n } else {\n this.serverCount = items.serverCount;\n }\n }\n if (this.isScrollLoading && items) {\n if (!areItemsEqual) {\n this.downloadedResources = this.downloadedResources ? this.downloadedResources.concat(items) : items;\n }\n this.downloadedResources.serverCount = items.serverCount || this.downloadedResources.serverCount;\n } else {\n this.downloadedResources = items || [];\n this.selectOptions = [];\n // If there is new select option with same id as already selected, set the new one\n if (!_lodash[\"default\"].isEmpty(this.dataValue) && this.component.idPath) {\n var selectedOptionId = _lodash[\"default\"].get(this.dataValue, this.component.idPath, null);\n var newOptionWithSameId = !_lodash[\"default\"].isNil(selectedOptionId) && items.find(function (item) {\n var itemId = _lodash[\"default\"].get(item, _this4.component.idPath);\n return itemId === selectedOptionId;\n });\n if (newOptionWithSameId) {\n this.setValue(newOptionWithSameId);\n }\n }\n }\n\n // Add the value options.\n if (!fromSearch) {\n this.addValueOptions(items);\n }\n if (this.component.widget === 'html5' && !this.component.placeholder) {\n this.addOption(null, '');\n }\n\n // Iterate through each of the items.\n _lodash[\"default\"].each(items, function (item, index) {\n // preventing references of the components inside the form to the parent form when building forms\n if (_this4.root && _this4.root.options.editForm && _this4.root.options.editForm._id && _this4.root.options.editForm._id === item._id) return;\n var itemValueAndLabel = _this4.selectValueAndLabel(item);\n _this4.addOption(itemValueAndLabel.value, itemValueAndLabel.label, {}, _lodash[\"default\"].get(item, _this4.component.idPath, String(index)));\n });\n if (this.choices) {\n this.choices.setChoices(this.selectOptions, 'value', 'label', true);\n } else if (this.loading) {\n // Re-attach select input.\n // this.appendTo(this.refs.input[0], this.selectContainer);\n }\n\n // We are no longer loading.\n this.isScrollLoading = false;\n this.loading = false;\n var searching = fromSearch && ((_this$choices = this.choices) === null || _this$choices === void 0 ? void 0 : (_this$choices$input = _this$choices.input) === null || _this$choices$input === void 0 ? void 0 : _this$choices$input.isFocussed);\n if (!searching) {\n // If a value is provided, then select it.\n if (!this.isEmpty() || this.isRemoveButtonPressed) {\n this.setValue(this.dataValue, {\n noUpdateEvent: true\n });\n } else if (this.shouldAddDefaultValue && !this.options.readOnly) {\n // If a default value is provided then select it.\n var defaultValue = this.defaultValue;\n if (!this.isEmpty(defaultValue)) {\n this.setValue(defaultValue);\n }\n }\n }\n\n // Say we are done loading the items.\n this.itemsLoadedResolve();\n }\n }, {\n key: \"getSingleItemValueForHTMLMode\",\n value: function getSingleItemValueForHTMLMode(data) {\n var _this$selectOptions;\n var option = (_this$selectOptions = this.selectOptions) === null || _this$selectOptions === void 0 ? void 0 : _this$selectOptions.find(function (_ref2) {\n var value = _ref2.value;\n return _lodash[\"default\"].isEqual(value, data);\n });\n if (option) {\n return option.label || data;\n }\n return data;\n }\n }, {\n key: \"itemValueForHTMLMode\",\n value: function itemValueForHTMLMode(value) {\n var _this5 = this;\n if (!this.isHtmlRenderMode()) {\n return _get(_getPrototypeOf(SelectComponent.prototype), \"itemValueForHTMLMode\", this).call(this, value);\n }\n if (Array.isArray(value)) {\n var values = value.map(function (item) {\n return Array.isArray(item) ? _this5.itemValueForHTMLMode(item) : _this5.getSingleItemValueForHTMLMode(item);\n });\n return values.join(', ');\n }\n return this.getSingleItemValueForHTMLMode(value);\n }\n\n /* eslint-enable max-statements */\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(SelectComponent.prototype), \"defaultValue\", this);\n if (!defaultValue && (this.component.defaultValue === false || this.component.defaultValue === 0)) {\n defaultValue = this.component.defaultValue;\n }\n return defaultValue;\n }\n }, {\n key: \"loadingError\",\n get: function get() {\n return !this.component.refreshOn && !this.component.refreshOnBlur && this.networkError;\n }\n }, {\n key: \"loadItems\",\n value: function loadItems(url, search, headers, options, method, body) {\n var _this6 = this;\n options = options || {};\n\n // See if we should load items or not.\n if (!this.shouldLoad || !this.itemsFromUrl && this.options.readOnly) {\n this.isScrollLoading = false;\n this.loading = false;\n this.itemsLoadedResolve();\n return;\n }\n\n // See if they have not met the minimum search requirements.\n var minSearch = parseInt(this.component.minSearch, 10);\n if (this.component.searchField && minSearch > 0 && (!search || search.length < minSearch)) {\n // Set empty items.\n return this.setItems([]);\n }\n\n // Ensure we have a method and remove any body if method is get\n method = method || 'GET';\n if (method.toUpperCase() === 'GET') {\n body = null;\n }\n var limit = this.component.limit || 100;\n var skip = this.isScrollLoading ? this.selectOptions.length : 0;\n var query = this.component.disableLimit ? {} : {\n limit: limit,\n skip: skip\n };\n\n // Allow for url interpolation.\n url = this.interpolate(url, {\n formioBase: _Formio.GlobalFormio.getBaseUrl(),\n search: search,\n limit: limit,\n skip: skip,\n page: Math.abs(Math.floor(skip / limit))\n });\n\n // Add search capability.\n if (this.component.searchField && search) {\n var searchValue = Array.isArray(search) ? search.join(',') : _typeof(search) === 'object' ? JSON.stringify(search) : search;\n query[this.component.searchField] = this.component.searchField.endsWith('__regex') ? _lodash[\"default\"].escapeRegExp(searchValue) : searchValue;\n }\n\n // If they wish to return only some fields.\n if (this.component.selectFields) {\n query.select = this.component.selectFields;\n }\n\n // Add sort capability\n if (this.component.sort) {\n query.sort = this.component.sort;\n }\n if (!_lodash[\"default\"].isEmpty(query)) {\n // Add the query string.\n url += (!url.includes('?') ? '?' : '&') + _Formio.GlobalFormio.serialize(query, function (item) {\n return _this6.interpolate(item);\n });\n }\n\n // Add filter capability\n if (this.component.filter) {\n url += (!url.includes('?') ? '?' : '&') + this.interpolate(this.component.filter);\n }\n\n // Set ignoreCache if it is\n options.ignoreCache = this.component.ignoreCache;\n\n // Make the request.\n options.header = headers;\n this.loading = true;\n _Formio.GlobalFormio.makeRequest(this.options.formio, 'select', url, method, body, options).then(function (response) {\n _this6.loading = false;\n _this6.error = null;\n _this6.setItems(response, !!search);\n })[\"catch\"](function (err) {\n if (_this6.itemsFromUrl) {\n _this6.setItems([]);\n _this6.disableInfiniteScroll();\n }\n _this6.isScrollLoading = false;\n _this6.handleLoadingError(err);\n });\n }\n }, {\n key: \"handleLoadingError\",\n value: function handleLoadingError(err) {\n this.loading = false;\n if (err.networkError) {\n this.networkError = true;\n }\n this.itemsLoadedResolve();\n this.emit('componentError', {\n component: this.component,\n message: err.toString()\n });\n console.warn(\"Unable to load resources for \".concat(this.key));\n }\n /**\n * Get the request headers for this select dropdown.\n */\n }, {\n key: \"requestHeaders\",\n get: function get() {\n var _this7 = this;\n // Create the headers object.\n var headers = new _Formio.GlobalFormio.Headers();\n\n // Add custom headers to the url.\n if (this.component.data && this.component.data.headers) {\n try {\n _lodash[\"default\"].each(this.component.data.headers, function (header) {\n if (header.key) {\n headers.set(header.key, _this7.interpolate(header.value));\n }\n });\n } catch (err) {\n console.warn(err.message);\n }\n }\n return headers;\n }\n }, {\n key: \"getCustomItems\",\n value: function getCustomItems() {\n var customItems = this.evaluate(this.component.data.custom, {\n values: []\n }, 'values');\n this.asyncValues = (0, _utils.isPromise)(customItems);\n return customItems;\n }\n }, {\n key: \"asyncCustomValues\",\n value: function asyncCustomValues() {\n if (!_lodash[\"default\"].isBoolean(this.asyncValues)) {\n this.getCustomItems();\n }\n return this.asyncValues;\n }\n }, {\n key: \"updateCustomItems\",\n value: function updateCustomItems(forceUpdate) {\n var _this8 = this;\n if (this.asyncCustomValues()) {\n if (!forceUpdate && !this.active) {\n this.itemsLoadedResolve();\n return;\n }\n this.loading = true;\n this.getCustomItems().then(function (items) {\n _this8.loading = false;\n _this8.setItems(items || []);\n })[\"catch\"](function (err) {\n _this8.handleLoadingError(err);\n });\n } else {\n this.setItems(this.getCustomItems() || []);\n }\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n return _get(_getPrototypeOf(SelectComponent.prototype), \"isEmpty\", this).call(this, value) || value === undefined;\n }\n }, {\n key: \"refresh\",\n value: function refresh(value, _ref3) {\n var instance = _ref3.instance;\n if (this.component.clearOnRefresh && instance && !instance.pristine) {\n this.setValue(this.emptyValue);\n }\n this.updateItems(null, true);\n }\n }, {\n key: \"additionalResourcesAvailable\",\n get: function get() {\n return _lodash[\"default\"].isNil(this.serverCount) || this.serverCount > this.downloadedResources.length;\n }\n }, {\n key: \"serverCount\",\n get: function get() {\n if (this.isFromSearch) {\n return this.searchServerCount;\n }\n return this.defaultServerCount;\n },\n set: function set(value) {\n if (this.isFromSearch) {\n this.searchServerCount = value;\n } else {\n this.defaultServerCount = value;\n }\n }\n }, {\n key: \"downloadedResources\",\n get: function get() {\n if (this.isFromSearch) {\n return this.searchDownloadedResources;\n }\n return this.defaultDownloadedResources;\n },\n set: function set(value) {\n if (this.isFromSearch) {\n this.searchDownloadedResources = value;\n } else {\n this.defaultDownloadedResources = value;\n }\n }\n }, {\n key: \"addPlaceholder\",\n value: function addPlaceholder() {\n if (!this.component.placeholder) {\n return;\n }\n this.addOption('', this.component.placeholder, {\n placeholder: true\n });\n }\n\n /**\n * Activate this select control.\n */\n }, {\n key: \"activate\",\n value: function activate() {\n if (this.loading || !this.active) {\n this.setLoadingItem();\n }\n if (this.active) {\n return;\n }\n this.activated = true;\n this.triggerUpdate();\n }\n }, {\n key: \"setLoadingItem\",\n value: function setLoadingItem() {\n var addToCurrentList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n if (this.choices) {\n if (addToCurrentList) {\n this.choices.setChoices([{\n value: \"\".concat(this.id, \"-loading\"),\n label: 'Loading...',\n disabled: true\n }], 'value', 'label');\n } else {\n this.choices.setChoices([{\n value: '',\n label: \"\"),\n disabled: true\n }], 'value', 'label', true);\n }\n } else if (this.component.dataSrc === 'url' || this.component.dataSrc === 'resource') {\n this.addOption('', this.t('loading...'));\n }\n }\n }, {\n key: \"active\",\n get: function get() {\n return !this.component.lazyLoad || this.activated;\n }\n }, {\n key: \"render\",\n value: function render() {\n var info = this.inputInfo;\n info.attr = info.attr || {};\n info.multiple = this.component.multiple;\n return _get(_getPrototypeOf(SelectComponent.prototype), \"render\", this).call(this, this.wrapElement(this.renderTemplate('select', {\n input: info,\n selectOptions: '',\n index: null\n })));\n }\n }, {\n key: \"wrapElement\",\n value: function wrapElement(element) {\n return this.component.addResource && !this.options.readOnly ? this.renderTemplate('resourceAdd', {\n element: element\n }) : element;\n }\n }, {\n key: \"choicesOptions\",\n value: function choicesOptions() {\n var useSearch = this.component.hasOwnProperty('searchEnabled') ? this.component.searchEnabled : true;\n var placeholderValue = this.t(this.component.placeholder, {\n _userInput: true\n });\n var customOptions = this.component.customOptions || {};\n if (typeof customOptions == 'string') {\n try {\n customOptions = JSON.parse(customOptions);\n } catch (err) {\n console.warn(err.message);\n customOptions = {};\n }\n }\n var commonFuseOptions = {\n maxPatternLength: 1000,\n distance: 1000\n };\n return _objectSpread({\n removeItemButton: this.component.disabled ? false : _lodash[\"default\"].get(this.component, 'removeItemButton', true),\n itemSelectText: '',\n classNames: {\n containerOuter: 'choices form-group formio-choices',\n containerInner: this.transform('class', 'form-control ui fluid selection dropdown')\n },\n addItemText: false,\n allowHTML: true,\n placeholder: !!this.component.placeholder,\n placeholderValue: placeholderValue,\n noResultsText: this.t('No results found'),\n noChoicesText: this.t('No choices to choose from'),\n searchPlaceholderValue: this.t('Type to search'),\n shouldSort: false,\n position: this.component.dropdown || 'auto',\n searchEnabled: useSearch,\n searchChoices: !this.component.searchField,\n searchFields: _lodash[\"default\"].get(this, 'component.searchFields', ['label']),\n shadowRoot: this.root ? this.root.shadowRoot : null,\n fuseOptions: this.component.useExactSearch ? _objectSpread({\n tokenize: true,\n matchAllTokens: true\n }, commonFuseOptions) : Object.assign({}, _lodash[\"default\"].get(this, 'component.fuseOptions', {}), _objectSpread({\n include: 'score',\n threshold: _lodash[\"default\"].get(this, 'component.selectThreshold', 0.3)\n }, commonFuseOptions)),\n valueComparer: _lodash[\"default\"].isEqual,\n resetScrollPosition: false\n }, customOptions);\n }\n\n /* eslint-disable max-statements */\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this9 = this,\n _this$choices2,\n _this$choices2$contai,\n _this$choices2$contai2;\n var superAttach = _get(_getPrototypeOf(SelectComponent.prototype), \"attach\", this).call(this, element);\n this.loadRefs(element, {\n selectContainer: 'single',\n addResource: 'single',\n autocompleteInput: 'single'\n });\n //enable autocomplete for select\n var autocompleteInput = this.refs.autocompleteInput;\n if (autocompleteInput) {\n this.addEventListener(autocompleteInput, 'change', function (event) {\n _this9.setValue(event.target.value);\n });\n }\n var input = this.refs.selectContainer;\n if (!input) {\n return;\n }\n this.addEventListener(input, this.inputInfo.changeEvent, function () {\n return _this9.updateValue(null, {\n modified: true\n });\n });\n this.attachRefreshOnBlur();\n if (this.component.widget === 'html5') {\n this.addFocusBlurEvents(input);\n this.triggerUpdate(null, true);\n if (this.visible) {\n this.setItems(this.selectItems || []);\n }\n this.focusableElement = input;\n this.addEventListener(input, 'focus', function () {\n return _this9.update();\n });\n this.addEventListener(input, 'keydown', function (event) {\n var key = event.key;\n if (['Backspace', 'Delete'].includes(key)) {\n _this9.setValue(_this9.emptyValue);\n }\n });\n return;\n }\n var tabIndex = input.tabIndex;\n this.addPlaceholder();\n input.setAttribute('dir', this.i18next.dir());\n if ((_this$choices2 = this.choices) !== null && _this$choices2 !== void 0 && (_this$choices2$contai = _this$choices2.containerOuter) !== null && _this$choices2$contai !== void 0 && (_this$choices2$contai2 = _this$choices2$contai.element) !== null && _this$choices2$contai2 !== void 0 && _this$choices2$contai2.parentNode) {\n this.choices.destroy();\n }\n var choicesOptions = this.choicesOptions();\n if (Choices) {\n this.choices = new Choices(input, choicesOptions);\n if (this.selectOptions && this.selectOptions.length) {\n this.choices.setChoices(this.selectOptions, 'value', 'label', true);\n }\n if (this.component.multiple) {\n this.focusableElement = this.choices.input.element;\n } else {\n this.focusableElement = this.choices.containerInner.element;\n this.choices.containerOuter.element.setAttribute('tabIndex', '-1');\n this.addEventListener(this.choices.containerOuter.element, 'focus', function () {\n return _this9.focusableElement.focus();\n });\n }\n this.addFocusBlurEvents(this.focusableElement);\n if (this.itemsFromUrl && !this.component.noRefreshOnScroll) {\n this.scrollList = this.choices.choiceList.element;\n this.addEventListener(this.scrollList, 'scroll', function () {\n return _this9.onScroll();\n });\n }\n if (choicesOptions.removeItemButton) {\n this.addEventListener(input, 'removeItem', function () {\n _this9.isRemoveButtonPressed = true;\n });\n }\n }\n if (window && this.choices && this.shouldPositionDropdown) {\n this.addEventListener(window.document, 'scroll', function () {\n _this9.positionDropdown(true);\n }, false, true);\n }\n this.focusableElement.setAttribute('tabIndex', tabIndex);\n\n // If a search field is provided, then add an event listener to update items on search.\n if (this.component.searchField) {\n // Make sure to clear the search when no value is provided.\n if (this.choices && this.choices.input && this.choices.input.element) {\n this.addEventListener(this.choices.input.element, 'input', function (event) {\n _this9.isFromSearch = !!event.target.value;\n if (!event.target.value) {\n _this9.triggerUpdate();\n } else {\n _this9.serverCount = null;\n _this9.downloadedResources = [];\n }\n });\n }\n this.addEventListener(input, 'choice', function () {\n if (_this9.component.multiple && _this9.component.dataSrc === 'resource' && _this9.isFromSearch) {\n _this9.triggerUpdate();\n }\n _this9.isFromSearch = false;\n });\n // avoid spamming the resource/url endpoint when we have server side filtering enabled.\n var debounceTimeout = this.component.searchField && (this.isSelectResource || this.isSelectURL) ? (this.component.searchDebounce === 0 ? 0 : this.component.searchDebounce || this.defaultSchema.searchDebounce) * 1000 : 0;\n var updateComponent = function updateComponent(evt) {\n _this9.triggerUpdate(evt.detail.value);\n };\n this.addEventListener(input, 'search', _lodash[\"default\"].debounce(function (e) {\n updateComponent(e);\n _this9.positionDropdown();\n }, debounceTimeout));\n this.addEventListener(input, 'stopSearch', function () {\n return _this9.triggerUpdate();\n });\n this.addEventListener(input, 'hideDropdown', function () {\n if (_this9.choices && _this9.choices.input && _this9.choices.input.element) {\n _this9.choices.input.element.value = '';\n }\n _this9.updateItems(null, true);\n });\n }\n this.addEventListener(input, 'showDropdown', function () {\n _this9.update();\n _this9.positionDropdown();\n });\n if (this.shouldPositionDropdown) {\n this.addEventListener(input, 'highlightChoice', function () {\n _this9.positionDropdown();\n });\n }\n if (this.choices && choicesOptions.placeholderValue && this.choices._isSelectOneElement) {\n this.addPlaceholderItem(choicesOptions.placeholderValue);\n this.addEventListener(input, 'removeItem', function () {\n _this9.addPlaceholderItem(choicesOptions.placeholderValue);\n });\n }\n\n // Add value options.\n this.addValueOptions();\n this.setChoicesValue(this.dataValue);\n if (this.isSelectResource && this.refs.addResource) {\n this.addEventListener(this.refs.addResource, 'click', function (event) {\n event.preventDefault();\n var formioForm = _this9.ce('div');\n var dialog = _this9.createModal(formioForm);\n var projectUrl = _lodash[\"default\"].get(_this9.root, 'formio.projectUrl', _Formio.GlobalFormio.getProjectUrl());\n var formUrl = \"\".concat(projectUrl, \"/form/\").concat(_this9.component.data.resource);\n new _Form[\"default\"](formioForm, formUrl, {}).ready.then(function (form) {\n form.on('submit', function (submission) {\n // If valueProperty is set, replace the submission with the corresponding value\n var value = _this9.valueProperty ? _lodash[\"default\"].get(submission, _this9.valueProperty) : submission;\n if (_this9.component.multiple) {\n value = [].concat(_toConsumableArray(_this9.dataValue), [value]);\n }\n _this9.setValue(value);\n _this9.triggerUpdate();\n dialog.close();\n });\n });\n });\n }\n\n // Force the disabled state with getters and setters.\n this.disabled = this.shouldDisabled;\n this.triggerUpdate();\n return superAttach;\n }\n }, {\n key: \"setDropdownPosition\",\n value: function setDropdownPosition() {\n var _this$choices3, _this$choices3$dropdo, _this$choices4, _this$choices4$contai;\n var dropdown = (_this$choices3 = this.choices) === null || _this$choices3 === void 0 ? void 0 : (_this$choices3$dropdo = _this$choices3.dropdown) === null || _this$choices3$dropdo === void 0 ? void 0 : _this$choices3$dropdo.element;\n var container = (_this$choices4 = this.choices) === null || _this$choices4 === void 0 ? void 0 : (_this$choices4$contai = _this$choices4.containerOuter) === null || _this$choices4$contai === void 0 ? void 0 : _this$choices4$contai.element;\n if (!dropdown || !container) {\n return;\n }\n var containerPosition = container.getBoundingClientRect();\n var isFlipped = container.classList.contains('is-flipped');\n _lodash[\"default\"].assign(dropdown.style, {\n top: \"\".concat(isFlipped ? containerPosition.top - dropdown.offsetHeight : containerPosition.top + containerPosition.height, \"px\"),\n left: \"\".concat(containerPosition.left, \"px\"),\n width: \"\".concat(containerPosition.width, \"px\"),\n position: 'fixed',\n bottom: 'unset',\n right: 'unset'\n });\n }\n }, {\n key: \"hasDataGridAncestor\",\n value: function hasDataGridAncestor(comp) {\n comp = comp || this;\n if (comp.inDataGrid || comp.type === 'datagrid') {\n return true;\n } else if (comp.parent) {\n return this.hasDataGridAncestor(comp.parent);\n } else {\n return false;\n }\n }\n }, {\n key: \"positionDropdown\",\n value: function positionDropdown(scroll) {\n var _this$choices$dropdow,\n _this10 = this;\n if (!this.shouldPositionDropdown || !this.choices || !((_this$choices$dropdow = this.choices.dropdown) !== null && _this$choices$dropdow !== void 0 && _this$choices$dropdow.isActive) && scroll) {\n return;\n }\n this.setDropdownPosition();\n this.itemsLoaded.then(function () {\n _this10.setDropdownPosition();\n });\n }\n }, {\n key: \"isLoadingAvailable\",\n get: function get() {\n return !this.isScrollLoading && this.additionalResourcesAvailable;\n }\n }, {\n key: \"onScroll\",\n value: function onScroll() {\n if (this.isLoadingAvailable) {\n this.isScrollLoading = true;\n this.setLoadingItem(true);\n this.triggerUpdate(this.choices.input.element.value);\n }\n }\n }, {\n key: \"attachRefreshOnBlur\",\n value: function attachRefreshOnBlur() {\n var _this11 = this;\n if (this.component.refreshOnBlur) {\n this.on('blur', function (instance) {\n _this11.checkRefreshOn([{\n instance: instance,\n value: instance.dataValue\n }], {\n fromBlur: true\n });\n });\n }\n }\n }, {\n key: \"addPlaceholderItem\",\n value: function addPlaceholderItem(placeholderValue) {\n var items = this.choices._store.activeItems;\n if (!items.length) {\n this.choices._addItem({\n value: placeholderValue,\n label: placeholderValue,\n choiceId: 0,\n groupId: -1,\n customProperties: null,\n placeholder: true,\n keyCode: null\n });\n }\n }\n\n /* eslint-enable max-statements */\n }, {\n key: \"update\",\n value: function update() {\n if (this.component.dataSrc === 'custom') {\n this.updateCustomItems();\n }\n // Activate the control.\n this.activate();\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(SelectComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(SelectComponent.prototype), \"disabled\", disabled, this, true);\n if (!this.choices) {\n return;\n }\n if (disabled) {\n this.setDisabled(this.choices.containerInner.element, true);\n this.focusableElement.removeAttribute('tabIndex');\n this.choices.disable();\n } else {\n this.setDisabled(this.choices.containerInner.element, false);\n this.focusableElement.setAttribute('tabIndex', this.component.tabindex || 0);\n this.choices.enable();\n }\n }\n }, {\n key: \"visible\",\n get: function get() {\n return _get(_getPrototypeOf(SelectComponent.prototype), \"visible\", this);\n }\n\n /**\n * @param {*} value\n * @param {Array} items\n */,\n set: function set(value) {\n // If we go from hidden to visible, trigger a refresh.\n if (value && !this._visible !== !value) {\n this.triggerUpdate();\n }\n _set(_getPrototypeOf(SelectComponent.prototype), \"visible\", value, this, true);\n }\n }, {\n key: \"addCurrentChoices\",\n value: function addCurrentChoices(values, items, keyValue) {\n var _this12 = this;\n if (!values) {\n return false;\n }\n var notFoundValuesToAdd = [];\n var added = values.reduce(function (defaultAdded, value) {\n if (!value || _lodash[\"default\"].isEmpty(value)) {\n return defaultAdded;\n }\n var found = false;\n\n // Make sure that `items` and `this.selectOptions` points\n // to the same reference. Because `this.selectOptions` is\n // internal property and all items are populated by\n // `this.addOption` method, we assume that items has\n // 'label' and 'value' properties. This assumption allows\n // us to read correct value from the item.\n var isSelectOptions = items === _this12.selectOptions;\n if (items && items.length) {\n _lodash[\"default\"].each(items, function (choice) {\n if (choice._id && value._id && choice._id === value._id) {\n found = true;\n return false;\n }\n var itemValue = keyValue ? choice.value : _this12.itemValue(choice, isSelectOptions);\n found |= _lodash[\"default\"].isEqual(itemValue, value);\n return found ? false : true;\n });\n }\n\n // Add the default option if no item is found.\n if (!found) {\n notFoundValuesToAdd.push(_this12.selectValueAndLabel(value));\n return true;\n }\n return found || defaultAdded;\n }, false);\n if (notFoundValuesToAdd.length) {\n if (this.choices) {\n this.choices.setChoices(notFoundValuesToAdd, 'value', 'label');\n }\n notFoundValuesToAdd.map(function (notFoundValue) {\n _this12.addOption(notFoundValue.value, notFoundValue.label);\n });\n }\n return added;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(data, options) {\n var _this13 = this;\n return this.component.multiple && Array.isArray(data) ? data.map(function (v) {\n return _this13.asString(v, options);\n }).join(', ') : this.asString(data, options);\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n // If the widget isn't active.\n if (this.viewOnly || this.loading || !this.component.lazyLoad && !this.selectOptions.length || !this.element) {\n return this.dataValue;\n }\n var value = this.emptyValue;\n if (this.choices) {\n value = this.choices.getValue(true);\n\n // Make sure we don't get the placeholder\n if (!this.component.multiple && this.component.placeholder && value === this.t(this.component.placeholder, {\n _userInput: true\n })) {\n value = this.emptyValue;\n }\n } else if (this.refs.selectContainer) {\n value = this.refs.selectContainer.value;\n if (this.valueProperty === '' || this.isEntireObjectDisplay()) {\n if (value === '') {\n return {};\n }\n var option = this.selectOptions[value] || this.selectOptions.find(function (option) {\n return option.id === value;\n });\n if (option && _lodash[\"default\"].isObject(option.value)) {\n value = option.value;\n }\n }\n } else {\n value = this.dataValue;\n }\n // Choices will return undefined if nothing is selected. We really want '' to be empty.\n if (value === undefined || value === null) {\n value = '';\n }\n return value;\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n var done = _get(_getPrototypeOf(SelectComponent.prototype), \"redraw\", this).call(this);\n this.triggerUpdate();\n return done;\n }\n }, {\n key: \"normalizeSingleValue\",\n value: function normalizeSingleValue(value, retainObject) {\n var _this14 = this;\n if (_lodash[\"default\"].isNil(value)) {\n return;\n }\n var valueIsObject = _lodash[\"default\"].isObject(value);\n //check if value equals to default emptyValue\n if (valueIsObject && Object.keys(value).length === 0) {\n return value;\n }\n // Check to see if we need to save off the template data into our metadata.\n if (retainObject) {\n var _this$root;\n var templateValue = this.component.reference && value !== null && value !== void 0 && value._id ? value._id.toString() : value;\n var shouldSaveData = !valueIsObject || this.component.reference;\n if (templateValue && shouldSaveData && this.templateData && this.templateData[templateValue] && (_this$root = this.root) !== null && _this$root !== void 0 && _this$root.submission) {\n var submission = this.root.submission;\n if (!submission.metadata) {\n submission.metadata = {};\n }\n if (!submission.metadata.selectData) {\n submission.metadata.selectData = {};\n }\n var templateData = this.templateData[templateValue];\n if (this.component.multiple) {\n templateData = {};\n var dataValue = this.dataValue;\n if (dataValue && _lodash[\"default\"].isArray(dataValue) && dataValue.length) {\n dataValue.forEach(function (dataValueItem) {\n var dataValueItemValue = _this14.component.reference ? dataValueItem._id.toString() : dataValueItem;\n templateData[dataValueItemValue] = _this14.templateData[dataValueItemValue];\n });\n }\n templateData[value] = this.templateData[value];\n }\n _lodash[\"default\"].set(submission.metadata.selectData, this.path, templateData);\n }\n }\n var dataType = this.component.dataType || 'auto';\n var normalize = {\n value: value,\n number: function number() {\n var numberValue = Number(this.value);\n var isEquivalent = value.toString() === numberValue.toString();\n if (!Number.isNaN(numberValue) && Number.isFinite(numberValue) && value !== '' && isEquivalent) {\n this.value = numberValue;\n }\n return this;\n },\n \"boolean\": function boolean() {\n if (_lodash[\"default\"].isString(this.value) && (this.value.toLowerCase() === 'true' || this.value.toLowerCase() === 'false')) {\n this.value = this.value.toLowerCase() === 'true';\n }\n return this;\n },\n string: function string() {\n this.value = String(this.value);\n return this;\n },\n object: function object() {\n return this;\n },\n auto: function auto() {\n if (_lodash[\"default\"].isObject(this.value)) {\n this.value = this.object().value;\n } else {\n this.value = this.string().number()[\"boolean\"]().value;\n }\n return this;\n }\n };\n try {\n return normalize[dataType]().value;\n } catch (err) {\n console.warn('Failed to normalize value', err);\n return value;\n }\n }\n\n /**\n * Normalize values coming into updateValue.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n var _this15 = this;\n if (this.component.multiple && Array.isArray(value)) {\n return value.map(function (singleValue) {\n return _this15.normalizeSingleValue(singleValue, true);\n });\n }\n return _get(_getPrototypeOf(SelectComponent.prototype), \"normalizeValue\", this).call(this, this.normalizeSingleValue(value, true));\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this16 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var previousValue = this.dataValue;\n if (this.component.widget === 'html5' && (_lodash[\"default\"].isEqual(value, previousValue) || _lodash[\"default\"].isEqual(previousValue, {}) && _lodash[\"default\"].isEqual(flags, {})) && !flags.fromSubmission) {\n return false;\n }\n var changed = this.updateValue(value, flags);\n value = this.dataValue;\n var hasPreviousValue = !this.isEmpty(previousValue);\n var hasValue = !this.isEmpty(value);\n\n // Undo typing when searching to set the value.\n if (this.component.multiple && Array.isArray(value)) {\n value = value.map(function (value) {\n if (typeof value === 'boolean' || typeof value === 'number') {\n return value.toString();\n }\n return value;\n });\n } else {\n if (typeof value === 'boolean' || typeof value === 'number') {\n value = value.toString();\n }\n }\n if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {\n this.itemsLoaded.then(function () {\n _this16.redraw();\n });\n return changed;\n }\n\n // Do not set the value if we are loading... that will happen after it is done.\n if (this.loading) {\n return changed;\n }\n\n // Determine if we need to perform an initial lazyLoad api call if searchField is provided.\n if (this.isInitApiCallNeeded(hasValue)) {\n this.loading = true;\n this.lazyLoadInit = true;\n var searchProperty = this.component.searchField || this.component.valueProperty;\n this.triggerUpdate(_lodash[\"default\"].get(value.data || value, searchProperty, value), true);\n return changed;\n }\n\n // Add the value options.\n this.itemsLoaded.then(function () {\n _this16.addValueOptions();\n _this16.setChoicesValue(value, hasPreviousValue, flags);\n });\n return changed;\n }\n }, {\n key: \"isInitApiCallNeeded\",\n value: function isInitApiCallNeeded(hasValue) {\n return this.component.lazyLoad && !this.lazyLoadInit && !this.active && !this.selectOptions.length && hasValue && this.shouldInitialLoad && this.visible && (this.component.searchField || this.component.valueProperty);\n }\n }, {\n key: \"setChoicesValue\",\n value: function setChoicesValue(value, hasPreviousValue) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var hasValue = !this.isEmpty(value) || flags.fromSubmission;\n hasPreviousValue = hasPreviousValue === undefined ? true : hasPreviousValue;\n if (this.choices) {\n // Now set the value.\n if (hasValue) {\n this.choices.removeActiveItems();\n // Add the currently selected choices if they don't already exist.\n var currentChoices = Array.isArray(value) && this.component.multiple ? value : [value];\n if (!this.addCurrentChoices(currentChoices, this.selectOptions, true)) {\n this.choices.setChoices(this.selectOptions, 'value', 'label', true);\n }\n this.choices.setChoiceByValue(currentChoices);\n } else if (hasPreviousValue || flags.resetValue) {\n this.choices.removeActiveItems();\n }\n } else {\n if (hasValue) {\n var values = Array.isArray(value) ? value : [value];\n if (!_lodash[\"default\"].isEqual(this.dataValue, this.defaultValue) && this.selectOptions.length < 2 || this.selectData && flags.fromSubmission) {\n var _this$selectValueAndL = this.selectValueAndLabel(this.dataValue),\n _value2 = _this$selectValueAndL.value,\n label = _this$selectValueAndL.label;\n this.addOption(_value2, label);\n }\n _lodash[\"default\"].each(this.selectOptions, function (selectOption) {\n _lodash[\"default\"].each(values, function (val) {\n if (selectOption.value === '') {\n selectOption.value = {};\n }\n if (_lodash[\"default\"].isEqual(val, selectOption.value) && selectOption.element) {\n selectOption.element.selected = true;\n selectOption.element.setAttribute('selected', 'selected');\n return false;\n }\n });\n });\n } else {\n _lodash[\"default\"].each(this.selectOptions, function (selectOption) {\n if (selectOption.element) {\n selectOption.element.selected = false;\n selectOption.element.removeAttribute('selected');\n }\n });\n }\n }\n }\n }, {\n key: \"itemsLoaded\",\n get: function get() {\n return this._itemsLoaded || _nativePromiseOnly[\"default\"].resolve();\n },\n set: function set(promise) {\n this._itemsLoaded = promise;\n }\n }, {\n key: \"validateValueAvailability\",\n value: function validateValueAvailability(setting, value) {\n var _this17 = this;\n if (!(0, _utils.boolValue)(setting) || !value) {\n return true;\n }\n var values = this.getOptionsValues();\n if (values) {\n if (_lodash[\"default\"].isObject(value)) {\n var compareComplexValues = function compareComplexValues(optionValue) {\n var normalizedOptionValue = _this17.normalizeSingleValue(optionValue, true);\n if (!_lodash[\"default\"].isObject(normalizedOptionValue)) {\n return false;\n }\n try {\n return JSON.stringify(normalizedOptionValue) === JSON.stringify(value);\n } catch (err) {\n console.warn.error('Error while comparing items', err);\n return false;\n }\n };\n return values.findIndex(function (optionValue) {\n return compareComplexValues(optionValue);\n }) !== -1;\n }\n return values.findIndex(function (optionValue) {\n return _this17.normalizeSingleValue(optionValue) === value;\n }) !== -1;\n }\n return false;\n }\n\n /**\n * Performs required transformations on the initial value to use in selectOptions\n * @param {*} value\n */\n }, {\n key: \"getOptionValue\",\n value: function getOptionValue(value) {\n return _lodash[\"default\"].isObject(value) && this.isEntireObjectDisplay() ? this.normalizeSingleValue(value) : _lodash[\"default\"].isObject(value) && (this.valueProperty || this.component.key !== 'resource') ? value : _lodash[\"default\"].isObject(value) && !this.valueProperty ? this.interpolate(this.component.template, {\n item: value\n }).replace(/<\\/?[^>]+(>|$)/g, '') : _lodash[\"default\"].isNull(value) ? this.emptyValue : String(this.normalizeSingleValue(value));\n }\n\n /**\n * If component has static values (values, json) or custom values, returns an array of them\n * @returns {Array<*>|undefined}\n */\n }, {\n key: \"getOptionsValues\",\n value: function getOptionsValues() {\n var _this18 = this;\n var rawItems = [];\n switch (this.component.dataSrc) {\n case 'values':\n rawItems = this.component.data.values;\n break;\n case 'json':\n rawItems = this.component.data.json;\n break;\n case 'custom':\n rawItems = this.getCustomItems();\n break;\n }\n if (typeof rawItems === 'string') {\n try {\n rawItems = JSON.parse(rawItems);\n } catch (err) {\n console.warn(err.message);\n rawItems = [];\n }\n }\n if (!Array.isArray(rawItems)) {\n return;\n }\n return rawItems.map(function (item) {\n return _this18.getOptionValue(_this18.itemValue(item));\n });\n }\n\n /**\n * Deletes the value of the component.\n */\n }, {\n key: \"deleteValue\",\n value: function deleteValue() {\n this.setValue('', {\n noUpdateEvent: true\n });\n this.unset();\n }\n\n /**\n * Check if a component is eligible for multiple validation\n *\n * @return {boolean}\n */\n }, {\n key: \"validateMultiple\",\n value: function validateMultiple() {\n // Select component will contain one input when flagged as multiple.\n return false;\n }\n\n /**\n * Output this select dropdown as a string value.\n * @return {*}\n */\n }, {\n key: \"isBooleanOrNumber\",\n value: function isBooleanOrNumber(value) {\n return typeof value === 'number' || typeof value === 'boolean';\n }\n }, {\n key: \"getNormalizedValues\",\n value: function getNormalizedValues() {\n var _this19 = this;\n if (!this.component || !this.component.data || !this.component.data.values) {\n return;\n }\n return this.component.data.values.map(function (value) {\n return {\n label: value.label,\n value: String(_this19.normalizeSingleValue(value.value))\n };\n });\n }\n }, {\n key: \"asString\",\n value: function asString(value) {\n var _value3,\n _this20 = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n value = (_value3 = value) !== null && _value3 !== void 0 ? _value3 : this.getValue();\n //need to convert values to strings to be able to compare values with available options that are strings\n var convertToString = function convertToString(data, valueProperty) {\n if (valueProperty) {\n if (Array.isArray(data)) {\n data.forEach(function (item) {\n return item[valueProperty] = item[valueProperty].toString();\n });\n } else {\n data[valueProperty] = data[valueProperty].toString();\n }\n return data;\n }\n if (_this20.isBooleanOrNumber(data)) {\n data = data.toString();\n }\n if (Array.isArray(data) && data.some(function (item) {\n return _this20.isBooleanOrNumber(item);\n })) {\n data = data.map(function (item) {\n if (_this20.isBooleanOrNumber(item)) {\n item = item.toString();\n }\n });\n }\n return data;\n };\n value = convertToString(value);\n if (['values', 'custom'].includes(this.component.dataSrc) && !this.asyncCustomValues()) {\n var _getFromValues;\n var _ref4 = this.component.dataSrc === 'values' ? {\n items: convertToString(this.getNormalizedValues(), 'value'),\n valueProperty: 'value'\n } : {\n items: convertToString(this.getCustomItems(), this.valueProperty),\n valueProperty: this.valueProperty\n },\n items = _ref4.items,\n valueProperty = _ref4.valueProperty;\n var getFromValues = function getFromValues() {\n var initialValue = _lodash[\"default\"].find(items, [valueProperty, value]);\n var values = _this20.defaultSchema.data.values || [];\n return _lodash[\"default\"].isEqual(initialValue, values[0]) ? '-' : initialValue;\n };\n value = this.component.multiple && Array.isArray(value) ? _lodash[\"default\"].filter(items, function (item) {\n return value.includes(item.value);\n }) : valueProperty ? (_getFromValues = getFromValues()) !== null && _getFromValues !== void 0 ? _getFromValues : {\n value: value,\n label: value\n } : value;\n }\n if (_lodash[\"default\"].isString(value)) {\n return value;\n }\n var getTemplateValue = function getTemplateValue(v) {\n var itemTemplate = _this20.itemTemplate(v);\n return options.csv && itemTemplate ? (0, _utils.unescapeHTML)(itemTemplate) : itemTemplate;\n };\n if (Array.isArray(value)) {\n var _items = [];\n value.forEach(function (item) {\n return _items.push(getTemplateValue(item));\n });\n if (this.component.dataSrc === 'resource' && _items.length > 0) {\n return _items.join(', ');\n } else if (_items.length > 0) {\n return _items.join('
');\n } else {\n return '-';\n }\n }\n if (this.isEntireObjectDisplay() && _lodash[\"default\"].isObject(value)) {\n return JSON.stringify(value);\n }\n return !_lodash[\"default\"].isNil(value) ? getTemplateValue(value) : '-';\n }\n }, {\n key: \"detach\",\n value: function detach() {\n this.off('blur');\n if (this.choices) {\n var _this$choices$contain, _this$choices$contain2;\n if ((_this$choices$contain = this.choices.containerOuter) !== null && _this$choices$contain !== void 0 && (_this$choices$contain2 = _this$choices$contain.element) !== null && _this$choices$contain2 !== void 0 && _this$choices$contain2.parentNode) {\n this.choices.destroy();\n }\n this.choices = null;\n }\n _get(_getPrototypeOf(SelectComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"focus\",\n value: function focus() {\n if (this.focusableElement) {\n _get(_getPrototypeOf(SelectComponent.prototype), \"focus\", this).call(this);\n this.focusableElement.focus();\n }\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(elements, dirty, hasError, hasMessages) {\n var element = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.element;\n _get(_getPrototypeOf(SelectComponent.prototype), \"setErrorClasses\", this).call(this, elements, dirty, hasError, hasMessages, element);\n if (this.choices) {\n _get(_getPrototypeOf(SelectComponent.prototype), \"setErrorClasses\", this).call(this, [this.choices.containerInner.element], dirty, hasError, hasMessages, element);\n } else {\n _get(_getPrototypeOf(SelectComponent.prototype), \"setErrorClasses\", this).call(this, [this.refs.selectContainer], dirty, hasError, hasMessages, element);\n }\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len3 = arguments.length, extend = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n extend[_key3] = arguments[_key3];\n }\n return _ListComponent2[\"default\"].schema.apply(_ListComponent2[\"default\"], [{\n type: 'select',\n label: 'Select',\n key: 'select',\n idPath: 'id',\n data: {\n values: [{\n label: '',\n value: ''\n }],\n json: '',\n url: '',\n resource: '',\n custom: ''\n },\n clearOnRefresh: false,\n limit: 100,\n valueProperty: '',\n lazyLoad: true,\n filter: '',\n searchEnabled: true,\n searchDebounce: 0.3,\n searchField: '',\n minSearch: 0,\n readOnlyValue: false,\n selectFields: '',\n selectThreshold: 0.3,\n uniqueOptions: false,\n tableView: true,\n fuseOptions: {\n include: 'score',\n threshold: 0.3\n },\n indexeddb: {\n filter: {}\n },\n customOptions: {},\n useExactSearch: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Select',\n group: 'basic',\n icon: 'th-list',\n weight: 70,\n documentation: '/userguide/form-building/form-components#select',\n schema: SelectComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return SelectComponent.conditionOperatorsSettings;\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(SelectComponent), \"conditionOperatorsSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n var valueComp = _objectSpread(_objectSpread({}, classComp), {}, {\n type: 'select'\n });\n if ((0, _utils.isSelectResourceWithObjectValue)(classComp)) {\n valueComp.reference = false;\n valueComp.onSetItems = \"\\n var templateKeys = utils.getItemTemplateKeys(component.template) || [];\\n items = _.map(items || [], i => {\\n var item = {};\\n _.each(templateKeys, k => _.set(item, k, _.get(i, k)));\\n return item;\\n })\\n \";\n }\n return valueComp;\n }\n });\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n var _boolean = _utils.componentValueTypes[\"boolean\"],\n string = _utils.componentValueTypes.string,\n number = _utils.componentValueTypes.number,\n object = _utils.componentValueTypes.object,\n array = _utils.componentValueTypes.array;\n var dataType = schema.dataType,\n reference = schema.reference;\n var types = (0, _utils.getComponentSavedTypes)(schema);\n if (types) {\n return types;\n }\n if (reference) {\n return [object];\n }\n if (dataType === 'object') {\n return [object, array];\n }\n if (_utils.componentValueTypes[dataType]) {\n return [_utils.componentValueTypes[dataType]];\n }\n return [_boolean, string, number, object, array];\n }\n }]);\n return SelectComponent;\n}(_ListComponent2[\"default\"]);\nexports[\"default\"] = SelectComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/select/Select.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\n__webpack_require__(/*! core-js/modules/es.object.create.js */ \"./node_modules/core-js/modules/es.object.create.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.get.js */ \"./node_modules/core-js/modules/es.reflect.get.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"./node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"./node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"./node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"./node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"./node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"./node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"./node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"./node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"./node_modules/core-js/modules/es.object.define-properties.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce-right.js */ \"./node_modules/core-js/modules/es.array.reduce-right.js\");\n__webpack_require__(/*! core-js/modules/es.string.trim.js */ \"./node_modules/core-js/modules/es.string.trim.js\");\n__webpack_require__(/*! core-js/modules/es.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.js\");\n__webpack_require__(/*! core-js/modules/es.string.ends-with.js */ \"./node_modules/core-js/modules/es.string.ends-with.js\");\n__webpack_require__(/*! core-js/modules/es.array.sort.js */ \"./node_modules/core-js/modules/es.array.sort.js\");\n__webpack_require__(/*! core-js/modules/es.array.includes.js */ \"./node_modules/core-js/modules/es.array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.string.includes.js */ \"./node_modules/core-js/modules/es.string.includes.js\");\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"./node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.object.assign.js */ \"./node_modules/core-js/modules/es.object.assign.js\");\n__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.number.is-nan.js */ \"./node_modules/core-js/modules/es.number.is-nan.js\");\n__webpack_require__(/*! core-js/modules/es.number.is-finite.js */ \"./node_modules/core-js/modules/es.number.is-finite.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.some.js */ \"./node_modules/core-js/modules/es.array.some.js\");\n__webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ \"./node_modules/core-js/modules/es.object.set-prototype-of.js\");\n__webpack_require__(/*! core-js/modules/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Formio = __webpack_require__(/*! ../../Formio */ \"./lib/Formio.js\");\nvar _ListComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/list/ListComponent */ \"./lib/components/_classes/list/ListComponent.js\"));\nvar _Form = _interopRequireDefault(__webpack_require__(/*! ../../Form */ \"./lib/Form.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction set(target, property, value, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.set) { set = Reflect.set; } else { set = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return set(target, property, value, receiver); }\nfunction _set(target, property, value, receiver, isStrict) { var s = set(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar Choices;\nif (typeof window !== 'undefined') {\n Choices = (__webpack_require__(/*! ../../utils/ChoicesWrapper */ \"./lib/utils/ChoicesWrapper.js\")[\"default\"]);\n}\nvar SelectComponent = /*#__PURE__*/function (_ListComponent) {\n _inherits(SelectComponent, _ListComponent);\n var _super = _createSuper(SelectComponent);\n function SelectComponent() {\n _classCallCheck(this, SelectComponent);\n return _super.apply(this, arguments);\n }\n _createClass(SelectComponent, [{\n key: \"init\",\n value: function init() {\n var _this = this;\n _get(_getPrototypeOf(SelectComponent.prototype), \"init\", this).call(this);\n this.templateData = {};\n this.validators = this.validators.concat(['select', 'onlyAvailableItems']);\n\n // Trigger an update.\n var updateArgs = [];\n var triggerUpdate = _lodash[\"default\"].debounce(function () {\n updateArgs = [];\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _this.updateItems.apply(_this, args);\n }, 100);\n this.triggerUpdate = function () {\n // Make sure we always resolve the previous promise before reassign it\n if (typeof _this.itemsLoadedResolve === 'function') {\n _this.itemsLoadedResolve();\n }\n _this.itemsLoaded = new _nativePromiseOnly[\"default\"](function (resolve) {\n _this.itemsLoadedResolve = resolve;\n });\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (args.length) {\n updateArgs = args;\n }\n return triggerUpdate.apply(void 0, _toConsumableArray(updateArgs));\n };\n\n // Keep track of the select options.\n this.selectOptions = [];\n if (this.itemsFromUrl) {\n this.isFromSearch = false;\n this.searchServerCount = null;\n this.defaultServerCount = null;\n this.isScrollLoading = false;\n this.searchDownloadedResources = [];\n this.defaultDownloadedResources = [];\n }\n\n // If this component has been activated.\n this.activated = false;\n this.itemsLoaded = new _nativePromiseOnly[\"default\"](function (resolve) {\n _this.itemsLoadedResolve = resolve;\n });\n this.shouldPositionDropdown = this.hasDataGridAncestor();\n if (this.isHtmlRenderMode()) {\n this.activate();\n }\n\n // Get the template keys for this select component.\n this.getTemplateKeys();\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n // If the root submission has been set, and we are still not attached, then assume\n // that our data is ready.\n if (this.root && this.root.submissionSet && !this.attached) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n return this.itemsLoaded;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return SelectComponent.schema();\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n if (this.component.multiple) {\n return [];\n }\n // if select has JSON data source type, we are defining if empty value would be an object or a string by checking JSON's first item\n if (this.component.dataSrc === 'json' && this.component.data.json) {\n var firstItem = this.component.data.json[0];\n var firstValue;\n if (this.valueProperty) {\n firstValue = _lodash[\"default\"].get(firstItem, this.valueProperty);\n } else {\n firstValue = firstItem;\n }\n if (firstValue && typeof firstValue === 'string') {\n return '';\n } else {\n return {};\n }\n }\n if (this.valueProperty) {\n return '';\n }\n return {};\n }\n }, {\n key: \"valueProperty\",\n get: function get() {\n if (this.component.valueProperty) {\n return this.component.valueProperty;\n }\n // Force values datasource to use values without actually setting it on the component settings.\n if (this.component.dataSrc === 'values') {\n return 'value';\n }\n return '';\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(SelectComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'select';\n info.changeEvent = 'change';\n return info;\n }\n }, {\n key: \"isSelectResource\",\n get: function get() {\n return this.component.dataSrc === 'resource';\n }\n }, {\n key: \"itemsFromUrl\",\n get: function get() {\n return this.isSelectResource || this.isSelectURL;\n }\n }, {\n key: \"isInfiniteScrollProvided\",\n get: function get() {\n return this.itemsFromUrl;\n }\n }, {\n key: \"shouldDisabled\",\n get: function get() {\n return _get(_getPrototypeOf(SelectComponent.prototype), \"shouldDisabled\", this) || this.parentDisabled;\n }\n }, {\n key: \"shouldInitialLoad\",\n get: function get() {\n if (this.component.widget === 'html5' && this.isEntireObjectDisplay() && this.component.searchField && this.dataValue) {\n return false;\n }\n return _get(_getPrototypeOf(SelectComponent.prototype), \"shouldLoad\", this);\n }\n }, {\n key: \"selectMetadata\",\n get: function get() {\n return _get(_getPrototypeOf(SelectComponent.prototype), \"selectData\", this);\n }\n }, {\n key: \"selectData\",\n get: function get() {\n return this.selectMetadata || this.component.selectData;\n }\n }, {\n key: \"isEntireObjectDisplay\",\n value: function isEntireObjectDisplay() {\n return this.component.dataSrc === 'resource' && this.valueProperty === 'data';\n }\n }, {\n key: \"selectValueAndLabel\",\n value: function selectValueAndLabel(data) {\n var value = this.getOptionValue(this.isEntireObjectDisplay() && !this.itemValue(data) ? data : this.itemValue(data));\n return {\n value: value,\n label: this.itemTemplate(this.isEntireObjectDisplay() && !_lodash[\"default\"].isObject(data.data) ? {\n data: data\n } : data, value)\n };\n }\n }, {\n key: \"itemTemplate\",\n value: function itemTemplate(data, value) {\n var _this2 = this;\n if (!_lodash[\"default\"].isNumber(data) && _lodash[\"default\"].isEmpty(data)) {\n return '';\n }\n\n // If they wish to show the value in read only mode, then just return the itemValue here.\n if (this.options.readOnly && this.component.readOnlyValue) {\n return this.itemValue(data);\n }\n // Perform a fast interpretation if we should not use the template.\n if (data && !this.component.template) {\n var itemLabel = data.label || data;\n var _value = typeof itemLabel === 'string' ? this.t(itemLabel, {\n _userInput: true\n }) : itemLabel;\n return this.sanitize(_value, this.shouldSanitizeValue);\n }\n if (this.component.multiple && _lodash[\"default\"].isArray(this.dataValue) ? this.dataValue.find(function (val) {\n return value === val;\n }) : this.dataValue === value) {\n var selectData = this.selectData;\n if (selectData) {\n var templateValue = this.component.reference && value !== null && value !== void 0 && value._id ? value._id.toString() : value;\n if (!this.templateData || !this.templateData[templateValue]) {\n this.getOptionTemplate(data, value);\n }\n if (this.component.multiple) {\n if (selectData[templateValue]) {\n data = selectData[templateValue];\n }\n } else {\n data = selectData;\n }\n }\n }\n if (typeof data === 'string' || typeof data === 'number') {\n return this.sanitize(this.t(data, {\n _userInput: true\n }), this.shouldSanitizeValue);\n }\n if (Array.isArray(data)) {\n return data.map(function (val) {\n if (typeof val === 'string' || typeof val === 'number') {\n return _this2.sanitize(_this2.t(val, {\n _userInput: true\n }), _this2.shouldSanitizeValue);\n }\n return val;\n });\n }\n if (data.data) {\n // checking additional fields in the template for the selected Entire Object option\n var hasNestedFields = /item\\.data\\.\\w*/g.test(this.component.template);\n data.data = this.isEntireObjectDisplay() && _lodash[\"default\"].isObject(data.data) && !hasNestedFields ? JSON.stringify(data.data) : data.data;\n }\n return _get(_getPrototypeOf(SelectComponent.prototype), \"itemTemplate\", this).call(this, data, value);\n }\n\n /**\n * Adds an option to the select dropdown.\n *\n * @param value\n * @param label\n */\n }, {\n key: \"addOption\",\n value: function addOption(value, label) {\n var attrs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var id = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : (0, _utils.getRandomComponentId)();\n if (_lodash[\"default\"].isNil(label)) return;\n var idPath = this.component.idPath ? this.component.idPath.split('.').reduceRight(function (obj, key) {\n return _defineProperty({}, key, obj);\n }, id) : {};\n var option = _objectSpread({\n value: this.getOptionValue(value),\n label: label\n }, idPath);\n var skipOption = this.component.uniqueOptions ? !!this.selectOptions.find(function (selectOption) {\n return _lodash[\"default\"].isEqual(selectOption.value, option.value);\n }) : false;\n if (skipOption) {\n return;\n }\n if (value) {\n this.selectOptions.push(option);\n }\n if (this.refs.selectContainer && this.component.widget === 'html5') {\n // Replace an empty Object value to an empty String.\n if (option.value && _lodash[\"default\"].isObject(option.value) && _lodash[\"default\"].isEmpty(option.value)) {\n option.value = '';\n }\n // Add element to option so we can reference it later.\n var div = document.createElement('div');\n div.innerHTML = this.sanitize(this.renderTemplate('selectOption', {\n selected: _lodash[\"default\"].isEqual(this.getOptionValue(this.dataValue), option.value),\n option: option,\n attrs: attrs,\n id: id,\n useId: (this.valueProperty === '' || this.isEntireObjectDisplay()) && _lodash[\"default\"].isObject(value) && id\n }), this.shouldSanitizeValue).trim();\n option.element = div.firstChild;\n this.refs.selectContainer.appendChild(option.element);\n }\n }\n }, {\n key: \"addValueOptions\",\n value: function addValueOptions(items) {\n var _this3 = this;\n items = items || [];\n var added = false;\n var data = this.dataValue;\n\n // preset submission value with value property before request.\n if (this.options.pdf && !items.length && this.component.dataSrc === 'url' && this.valueProperty) {\n data = Array.isArray(data) ? data.map(function (item) {\n return _lodash[\"default\"].set({}, _this3.valueProperty, item);\n }) : _lodash[\"default\"].set({}, this.valueProperty, data);\n }\n if (!this.selectOptions.length) {\n // Add the currently selected choices if they don't already exist.\n var currentChoices = Array.isArray(data) && this.component.multiple ? data : [data];\n added = this.addCurrentChoices(currentChoices, items);\n if (!added && !this.component.multiple) {\n this.addPlaceholder();\n }\n }\n return added;\n }\n }, {\n key: \"disableInfiniteScroll\",\n value: function disableInfiniteScroll() {\n if (!this.downloadedResources) {\n return;\n }\n this.downloadedResources.serverCount = this.downloadedResources.length;\n this.serverCount = this.downloadedResources.length;\n }\n\n /* eslint-disable max-statements */\n }, {\n key: \"setItems\",\n value: function setItems(items, fromSearch) {\n var _this4 = this,\n _this$choices,\n _this$choices$input;\n this.selectItems = items;\n // If the items is a string, then parse as JSON.\n if (typeof items == 'string') {\n try {\n items = JSON.parse(items);\n } catch (err) {\n console.warn(err.message);\n items = [];\n }\n }\n\n // Allow js processing (needed for form builder)\n if (this.component.onSetItems) {\n var newItems = typeof this.component.onSetItems === 'function' ? this.component.onSetItems(this, items) : this.evaluate(this.component.onSetItems, {\n items: items\n }, 'items');\n if (newItems) {\n items = newItems;\n }\n }\n if (!this.choices && this.refs.selectContainer) {\n this.empty(this.refs.selectContainer);\n }\n\n // If they provided select values, then we need to get them instead.\n if (this.component.selectValues) {\n items = _lodash[\"default\"].get(items, this.component.selectValues, items) || [];\n }\n var areItemsEqual;\n if (this.itemsFromUrl) {\n areItemsEqual = this.isSelectURL ? _lodash[\"default\"].isEqual(items, this.downloadedResources) : false;\n var areItemsEnded = this.component.limit > items.length;\n var areItemsDownloaded = areItemsEqual && this.downloadedResources && this.downloadedResources.length === items.length;\n if (areItemsEnded) {\n this.disableInfiniteScroll();\n } else if (areItemsDownloaded) {\n this.selectOptions = [];\n } else {\n this.serverCount = items.serverCount;\n }\n }\n if (this.isScrollLoading && items) {\n if (!areItemsEqual) {\n this.downloadedResources = this.downloadedResources ? this.downloadedResources.concat(items) : items;\n }\n this.downloadedResources.serverCount = items.serverCount || this.downloadedResources.serverCount;\n } else {\n this.downloadedResources = items || [];\n this.selectOptions = [];\n // If there is new select option with same id as already selected, set the new one\n if (!_lodash[\"default\"].isEmpty(this.dataValue) && this.component.idPath) {\n var selectedOptionId = _lodash[\"default\"].get(this.dataValue, this.component.idPath, null);\n var newOptionWithSameId = !_lodash[\"default\"].isNil(selectedOptionId) && items.find(function (item) {\n var itemId = _lodash[\"default\"].get(item, _this4.component.idPath);\n return itemId === selectedOptionId;\n });\n if (newOptionWithSameId) {\n this.setValue(newOptionWithSameId);\n }\n }\n }\n\n // Add the value options.\n if (!fromSearch) {\n this.addValueOptions(items);\n }\n if (this.component.widget === 'html5' && !this.component.placeholder) {\n this.addOption(null, '');\n }\n\n // Iterate through each of the items.\n _lodash[\"default\"].each(items, function (item, index) {\n // preventing references of the components inside the form to the parent form when building forms\n if (_this4.root && _this4.root.options.editForm && _this4.root.options.editForm._id && _this4.root.options.editForm._id === item._id) return;\n var itemValueAndLabel = _this4.selectValueAndLabel(item);\n _this4.addOption(itemValueAndLabel.value, itemValueAndLabel.label, {}, _lodash[\"default\"].get(item, _this4.component.idPath, String(index)));\n });\n if (this.choices) {\n this.choices.setChoices(this.selectOptions, 'value', 'label', true);\n } else if (this.loading) {\n // Re-attach select input.\n // this.appendTo(this.refs.input[0], this.selectContainer);\n }\n\n // We are no longer loading.\n this.isScrollLoading = false;\n this.loading = false;\n var searching = fromSearch && ((_this$choices = this.choices) === null || _this$choices === void 0 ? void 0 : (_this$choices$input = _this$choices.input) === null || _this$choices$input === void 0 ? void 0 : _this$choices$input.isFocussed);\n if (!searching) {\n // If a value is provided, then select it.\n if (!this.isEmpty() || this.isRemoveButtonPressed) {\n this.setValue(this.dataValue, {\n noUpdateEvent: true\n });\n } else if (this.shouldAddDefaultValue && !this.options.readOnly) {\n // If a default value is provided then select it.\n var defaultValue = this.defaultValue;\n if (!this.isEmpty(defaultValue)) {\n this.setValue(defaultValue);\n }\n }\n }\n\n // Say we are done loading the items.\n this.itemsLoadedResolve();\n }\n }, {\n key: \"getSingleItemValueForHTMLMode\",\n value: function getSingleItemValueForHTMLMode(data) {\n var _this$selectOptions;\n var option = (_this$selectOptions = this.selectOptions) === null || _this$selectOptions === void 0 ? void 0 : _this$selectOptions.find(function (_ref2) {\n var value = _ref2.value;\n return _lodash[\"default\"].isEqual(value, data);\n });\n if (option) {\n return option.label || data;\n }\n return data;\n }\n }, {\n key: \"itemValueForHTMLMode\",\n value: function itemValueForHTMLMode(value) {\n var _this5 = this;\n if (!this.isHtmlRenderMode()) {\n return _get(_getPrototypeOf(SelectComponent.prototype), \"itemValueForHTMLMode\", this).call(this, value);\n }\n if (Array.isArray(value)) {\n var values = value.map(function (item) {\n return Array.isArray(item) ? _this5.itemValueForHTMLMode(item) : _this5.getSingleItemValueForHTMLMode(item);\n });\n return values.join(', ');\n }\n return this.getSingleItemValueForHTMLMode(value);\n }\n\n /* eslint-enable max-statements */\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(SelectComponent.prototype), \"defaultValue\", this);\n if (!defaultValue && (this.component.defaultValue === false || this.component.defaultValue === 0)) {\n defaultValue = this.component.defaultValue;\n }\n return defaultValue;\n }\n }, {\n key: \"loadingError\",\n get: function get() {\n return !this.component.refreshOn && !this.component.refreshOnBlur && this.networkError;\n }\n }, {\n key: \"loadItems\",\n value: function loadItems(url, search, headers, options, method, body) {\n var _this6 = this;\n options = options || {};\n\n // See if we should load items or not.\n if (!this.shouldLoad || !this.itemsFromUrl && this.options.readOnly) {\n this.isScrollLoading = false;\n this.loading = false;\n this.itemsLoadedResolve();\n return;\n }\n\n // See if they have not met the minimum search requirements.\n var minSearch = parseInt(this.component.minSearch, 10);\n if (this.component.searchField && minSearch > 0 && (!search || search.length < minSearch)) {\n // Set empty items.\n return this.setItems([]);\n }\n\n // Ensure we have a method and remove any body if method is get\n method = method || 'GET';\n if (method.toUpperCase() === 'GET') {\n body = null;\n }\n var limit = this.component.limit || 100;\n var skip = this.isScrollLoading ? this.selectOptions.length : 0;\n var query = this.component.disableLimit ? {} : {\n limit: limit,\n skip: skip\n };\n\n // Allow for url interpolation.\n url = this.interpolate(url, {\n formioBase: _Formio.GlobalFormio.getBaseUrl(),\n search: search,\n limit: limit,\n skip: skip,\n page: Math.abs(Math.floor(skip / limit))\n });\n\n // Add search capability.\n if (this.component.searchField && search) {\n var searchValue = Array.isArray(search) ? search.join(',') : _typeof(search) === 'object' ? JSON.stringify(search) : search;\n query[this.component.searchField] = this.component.searchField.endsWith('__regex') ? _lodash[\"default\"].escapeRegExp(searchValue) : searchValue;\n }\n\n // If they wish to return only some fields.\n if (this.component.selectFields) {\n query.select = this.component.selectFields;\n }\n\n // Add sort capability\n if (this.component.sort) {\n query.sort = this.component.sort;\n }\n if (!_lodash[\"default\"].isEmpty(query)) {\n // Add the query string.\n url += (!url.includes('?') ? '?' : '&') + _Formio.GlobalFormio.serialize(query, function (item) {\n return _this6.interpolate(item);\n });\n }\n\n // Add filter capability\n if (this.component.filter) {\n url += (!url.includes('?') ? '?' : '&') + this.interpolate(this.component.filter);\n }\n\n // Set ignoreCache if it is\n options.ignoreCache = this.component.ignoreCache;\n\n // Make the request.\n options.header = headers;\n this.loading = true;\n _Formio.GlobalFormio.makeRequest(this.options.formio, 'select', url, method, body, options).then(function (response) {\n _this6.loading = false;\n _this6.error = null;\n _this6.setItems(response, !!search);\n })[\"catch\"](function (err) {\n if (_this6.itemsFromUrl) {\n _this6.setItems([]);\n _this6.disableInfiniteScroll();\n }\n _this6.isScrollLoading = false;\n _this6.handleLoadingError(err);\n });\n }\n }, {\n key: \"handleLoadingError\",\n value: function handleLoadingError(err) {\n this.loading = false;\n if (err.networkError) {\n this.networkError = true;\n }\n this.itemsLoadedResolve();\n this.emit('componentError', {\n component: this.component,\n message: err.toString()\n });\n console.warn(\"Unable to load resources for \".concat(this.key));\n }\n /**\n * Get the request headers for this select dropdown.\n */\n }, {\n key: \"requestHeaders\",\n get: function get() {\n var _this7 = this;\n // Create the headers object.\n var headers = new _Formio.GlobalFormio.Headers();\n\n // Add custom headers to the url.\n if (this.component.data && this.component.data.headers) {\n try {\n _lodash[\"default\"].each(this.component.data.headers, function (header) {\n if (header.key) {\n headers.set(header.key, _this7.interpolate(header.value));\n }\n });\n } catch (err) {\n console.warn(err.message);\n }\n }\n return headers;\n }\n }, {\n key: \"getCustomItems\",\n value: function getCustomItems() {\n var customItems = this.evaluate(this.component.data.custom, {\n values: []\n }, 'values');\n this.asyncValues = (0, _utils.isPromise)(customItems);\n return customItems;\n }\n }, {\n key: \"asyncCustomValues\",\n value: function asyncCustomValues() {\n if (!_lodash[\"default\"].isBoolean(this.asyncValues)) {\n this.getCustomItems();\n }\n return this.asyncValues;\n }\n }, {\n key: \"updateCustomItems\",\n value: function updateCustomItems(forceUpdate) {\n var _this8 = this;\n if (this.asyncCustomValues()) {\n if (!forceUpdate && !this.active) {\n this.itemsLoadedResolve();\n return;\n }\n this.loading = true;\n this.getCustomItems().then(function (items) {\n _this8.loading = false;\n _this8.setItems(items || []);\n })[\"catch\"](function (err) {\n _this8.handleLoadingError(err);\n });\n } else {\n this.setItems(this.getCustomItems() || []);\n }\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n return _get(_getPrototypeOf(SelectComponent.prototype), \"isEmpty\", this).call(this, value) || value === undefined;\n }\n }, {\n key: \"refresh\",\n value: function refresh(value, _ref3) {\n var instance = _ref3.instance;\n if (this.component.clearOnRefresh && instance && !instance.pristine) {\n this.setValue(this.emptyValue);\n }\n this.updateItems(null, true);\n }\n }, {\n key: \"additionalResourcesAvailable\",\n get: function get() {\n return _lodash[\"default\"].isNil(this.serverCount) || this.serverCount > this.downloadedResources.length;\n }\n }, {\n key: \"serverCount\",\n get: function get() {\n if (this.isFromSearch) {\n return this.searchServerCount;\n }\n return this.defaultServerCount;\n },\n set: function set(value) {\n if (this.isFromSearch) {\n this.searchServerCount = value;\n } else {\n this.defaultServerCount = value;\n }\n }\n }, {\n key: \"downloadedResources\",\n get: function get() {\n if (this.isFromSearch) {\n return this.searchDownloadedResources;\n }\n return this.defaultDownloadedResources;\n },\n set: function set(value) {\n if (this.isFromSearch) {\n this.searchDownloadedResources = value;\n } else {\n this.defaultDownloadedResources = value;\n }\n }\n }, {\n key: \"addPlaceholder\",\n value: function addPlaceholder() {\n if (!this.component.placeholder) {\n return;\n }\n this.addOption('', this.component.placeholder, {\n placeholder: true\n });\n }\n\n /**\n * Activate this select control.\n */\n }, {\n key: \"activate\",\n value: function activate() {\n if (this.loading || !this.active) {\n this.setLoadingItem();\n }\n if (this.active) {\n return;\n }\n this.activated = true;\n this.triggerUpdate();\n }\n }, {\n key: \"setLoadingItem\",\n value: function setLoadingItem() {\n var addToCurrentList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n if (this.choices) {\n if (addToCurrentList) {\n this.choices.setChoices([{\n value: \"\".concat(this.id, \"-loading\"),\n label: 'Loading...',\n disabled: true\n }], 'value', 'label');\n } else {\n this.choices.setChoices([{\n value: '',\n label: \"\"),\n disabled: true\n }], 'value', 'label', true);\n }\n } else if (this.component.dataSrc === 'url' || this.component.dataSrc === 'resource') {\n this.addOption('', this.t('loading...'));\n }\n }\n }, {\n key: \"active\",\n get: function get() {\n return !this.component.lazyLoad || this.activated;\n }\n }, {\n key: \"render\",\n value: function render() {\n var info = this.inputInfo;\n info.attr = info.attr || {};\n info.multiple = this.component.multiple;\n return _get(_getPrototypeOf(SelectComponent.prototype), \"render\", this).call(this, this.wrapElement(this.renderTemplate('select', {\n input: info,\n selectOptions: '',\n index: null\n })));\n }\n }, {\n key: \"wrapElement\",\n value: function wrapElement(element) {\n return this.component.addResource && !this.options.readOnly ? this.renderTemplate('resourceAdd', {\n element: element\n }) : element;\n }\n }, {\n key: \"choicesOptions\",\n value: function choicesOptions() {\n var useSearch = this.component.hasOwnProperty('searchEnabled') ? this.component.searchEnabled : true;\n var placeholderValue = this.t(this.component.placeholder, {\n _userInput: true\n });\n var customOptions = this.component.customOptions || {};\n if (typeof customOptions == 'string') {\n try {\n customOptions = JSON.parse(customOptions);\n } catch (err) {\n console.warn(err.message);\n customOptions = {};\n }\n }\n var commonFuseOptions = {\n maxPatternLength: 1000,\n distance: 1000\n };\n return _objectSpread({\n removeItemButton: this.component.disabled ? false : _lodash[\"default\"].get(this.component, 'removeItemButton', true),\n itemSelectText: '',\n classNames: {\n containerOuter: 'choices form-group formio-choices',\n containerInner: this.transform('class', 'form-control ui fluid selection dropdown')\n },\n addItemText: false,\n allowHTML: true,\n placeholder: !!this.component.placeholder,\n placeholderValue: placeholderValue,\n noResultsText: this.t('No results found'),\n noChoicesText: this.t('No choices to choose from'),\n searchPlaceholderValue: this.t('Type to search'),\n shouldSort: false,\n position: this.component.dropdown || 'auto',\n searchEnabled: useSearch,\n searchChoices: !this.component.searchField,\n searchFields: _lodash[\"default\"].get(this, 'component.searchFields', ['label']),\n shadowRoot: this.root ? this.root.shadowRoot : null,\n fuseOptions: this.component.useExactSearch ? _objectSpread({\n tokenize: true,\n matchAllTokens: true\n }, commonFuseOptions) : Object.assign({}, _lodash[\"default\"].get(this, 'component.fuseOptions', {}), _objectSpread({\n include: 'score',\n threshold: _lodash[\"default\"].get(this, 'component.selectThreshold', 0.3)\n }, commonFuseOptions)),\n valueComparer: _lodash[\"default\"].isEqual,\n resetScrollPosition: false\n }, customOptions);\n }\n\n /* eslint-disable max-statements */\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this9 = this,\n _this$choices2,\n _this$choices2$contai,\n _this$choices2$contai2;\n var superAttach = _get(_getPrototypeOf(SelectComponent.prototype), \"attach\", this).call(this, element);\n this.loadRefs(element, {\n selectContainer: 'single',\n addResource: 'single',\n autocompleteInput: 'single'\n });\n //enable autocomplete for select\n var autocompleteInput = this.refs.autocompleteInput;\n if (autocompleteInput) {\n this.addEventListener(autocompleteInput, 'change', function (event) {\n _this9.setValue(event.target.value);\n });\n }\n var input = this.refs.selectContainer;\n if (!input) {\n return;\n }\n this.addEventListener(input, this.inputInfo.changeEvent, function () {\n return _this9.updateValue(null, {\n modified: true\n });\n });\n this.attachRefreshOnBlur();\n if (this.component.widget === 'html5') {\n this.addFocusBlurEvents(input);\n this.triggerUpdate(null, true);\n if (this.visible) {\n this.setItems(this.selectItems || []);\n }\n this.focusableElement = input;\n this.addEventListener(input, 'focus', function () {\n return _this9.update();\n });\n this.addEventListener(input, 'keydown', function (event) {\n var key = event.key;\n if (['Backspace', 'Delete'].includes(key)) {\n _this9.setValue(_this9.emptyValue);\n }\n });\n return;\n }\n var tabIndex = input.tabIndex;\n this.addPlaceholder();\n input.setAttribute('dir', this.i18next.dir());\n if ((_this$choices2 = this.choices) !== null && _this$choices2 !== void 0 && (_this$choices2$contai = _this$choices2.containerOuter) !== null && _this$choices2$contai !== void 0 && (_this$choices2$contai2 = _this$choices2$contai.element) !== null && _this$choices2$contai2 !== void 0 && _this$choices2$contai2.parentNode) {\n this.choices.destroy();\n }\n var choicesOptions = this.choicesOptions();\n if (Choices) {\n this.choices = new Choices(input, choicesOptions);\n if (this.selectOptions && this.selectOptions.length) {\n this.choices.setChoices(this.selectOptions, 'value', 'label', true);\n }\n if (this.component.multiple) {\n this.focusableElement = this.choices.input.element;\n } else {\n this.focusableElement = this.choices.containerInner.element;\n this.choices.containerOuter.element.setAttribute('tabIndex', '-1');\n this.addEventListener(this.choices.containerOuter.element, 'focus', function () {\n return _this9.focusableElement.focus();\n });\n }\n this.addFocusBlurEvents(this.focusableElement);\n if (this.itemsFromUrl && !this.component.noRefreshOnScroll) {\n this.scrollList = this.choices.choiceList.element;\n this.addEventListener(this.scrollList, 'scroll', function () {\n return _this9.onScroll();\n });\n }\n if (choicesOptions.removeItemButton) {\n this.addEventListener(input, 'removeItem', function () {\n _this9.isRemoveButtonPressed = true;\n });\n }\n }\n if (window && this.choices && this.shouldPositionDropdown) {\n this.addEventListener(window.document, 'scroll', function () {\n _this9.positionDropdown(true);\n }, false, true);\n }\n this.focusableElement.setAttribute('tabIndex', tabIndex);\n\n // If a search field is provided, then add an event listener to update items on search.\n if (this.component.searchField) {\n // Make sure to clear the search when no value is provided.\n if (this.choices && this.choices.input && this.choices.input.element) {\n this.addEventListener(this.choices.input.element, 'input', function (event) {\n _this9.isFromSearch = !!event.target.value;\n if (!event.target.value) {\n _this9.triggerUpdate();\n } else {\n _this9.serverCount = null;\n _this9.downloadedResources = [];\n }\n });\n }\n this.addEventListener(input, 'choice', function () {\n if (_this9.component.multiple && _this9.component.dataSrc === 'resource' && _this9.isFromSearch) {\n _this9.triggerUpdate();\n }\n _this9.isFromSearch = false;\n });\n // avoid spamming the resource/url endpoint when we have server side filtering enabled.\n var debounceTimeout = this.component.searchField && (this.isSelectResource || this.isSelectURL) ? (this.component.searchDebounce === 0 ? 0 : this.component.searchDebounce || this.defaultSchema.searchDebounce) * 1000 : 0;\n var updateComponent = function updateComponent(evt) {\n _this9.triggerUpdate(evt.detail.value);\n };\n this.addEventListener(input, 'search', _lodash[\"default\"].debounce(function (e) {\n updateComponent(e);\n _this9.positionDropdown();\n }, debounceTimeout));\n this.addEventListener(input, 'stopSearch', function () {\n return _this9.triggerUpdate();\n });\n this.addEventListener(input, 'hideDropdown', function () {\n if (_this9.choices && _this9.choices.input && _this9.choices.input.element) {\n _this9.choices.input.element.value = '';\n }\n _this9.updateItems(null, true);\n });\n }\n this.addEventListener(input, 'showDropdown', function () {\n _this9.update();\n _this9.positionDropdown();\n });\n if (this.shouldPositionDropdown) {\n this.addEventListener(input, 'highlightChoice', function () {\n _this9.positionDropdown();\n });\n }\n if (this.choices && choicesOptions.placeholderValue && this.choices._isSelectOneElement) {\n this.addPlaceholderItem(choicesOptions.placeholderValue);\n this.addEventListener(input, 'removeItem', function () {\n _this9.addPlaceholderItem(choicesOptions.placeholderValue);\n });\n }\n\n // Add value options.\n this.addValueOptions();\n this.setChoicesValue(this.dataValue);\n if (this.isSelectResource && this.refs.addResource) {\n this.addEventListener(this.refs.addResource, 'click', function (event) {\n event.preventDefault();\n var formioForm = _this9.ce('div');\n var dialog = _this9.createModal(formioForm);\n var projectUrl = _lodash[\"default\"].get(_this9.root, 'formio.projectUrl', _Formio.GlobalFormio.getProjectUrl());\n var formUrl = \"\".concat(projectUrl, \"/form/\").concat(_this9.component.data.resource);\n new _Form[\"default\"](formioForm, formUrl, {}).ready.then(function (form) {\n form.on('submit', function (submission) {\n // If valueProperty is set, replace the submission with the corresponding value\n var value = _this9.valueProperty ? _lodash[\"default\"].get(submission, _this9.valueProperty) : submission;\n if (_this9.component.multiple) {\n value = [].concat(_toConsumableArray(_this9.dataValue), [value]);\n }\n _this9.setValue(value);\n _this9.triggerUpdate();\n dialog.close();\n });\n });\n });\n }\n\n // Force the disabled state with getters and setters.\n this.disabled = this.shouldDisabled;\n this.triggerUpdate();\n return superAttach;\n }\n }, {\n key: \"setDropdownPosition\",\n value: function setDropdownPosition() {\n var _this$choices3, _this$choices3$dropdo, _this$choices4, _this$choices4$contai;\n var dropdown = (_this$choices3 = this.choices) === null || _this$choices3 === void 0 ? void 0 : (_this$choices3$dropdo = _this$choices3.dropdown) === null || _this$choices3$dropdo === void 0 ? void 0 : _this$choices3$dropdo.element;\n var container = (_this$choices4 = this.choices) === null || _this$choices4 === void 0 ? void 0 : (_this$choices4$contai = _this$choices4.containerOuter) === null || _this$choices4$contai === void 0 ? void 0 : _this$choices4$contai.element;\n if (!dropdown || !container) {\n return;\n }\n var containerPosition = container.getBoundingClientRect();\n var isFlipped = container.classList.contains('is-flipped');\n _lodash[\"default\"].assign(dropdown.style, {\n top: \"\".concat(isFlipped ? containerPosition.top - dropdown.offsetHeight : containerPosition.top + containerPosition.height, \"px\"),\n left: \"\".concat(containerPosition.left, \"px\"),\n width: \"\".concat(containerPosition.width, \"px\"),\n position: 'fixed',\n bottom: 'unset',\n right: 'unset'\n });\n }\n }, {\n key: \"hasDataGridAncestor\",\n value: function hasDataGridAncestor(comp) {\n comp = comp || this;\n if (comp.inDataGrid || comp.type === 'datagrid') {\n return true;\n } else if (comp.parent) {\n return this.hasDataGridAncestor(comp.parent);\n } else {\n return false;\n }\n }\n }, {\n key: \"positionDropdown\",\n value: function positionDropdown(scroll) {\n var _this$choices$dropdow,\n _this10 = this;\n if (!this.shouldPositionDropdown || !this.choices || !((_this$choices$dropdow = this.choices.dropdown) !== null && _this$choices$dropdow !== void 0 && _this$choices$dropdow.isActive) && scroll) {\n return;\n }\n this.setDropdownPosition();\n this.itemsLoaded.then(function () {\n _this10.setDropdownPosition();\n });\n }\n }, {\n key: \"isLoadingAvailable\",\n get: function get() {\n return !this.isScrollLoading && this.additionalResourcesAvailable;\n }\n }, {\n key: \"onScroll\",\n value: function onScroll() {\n if (this.isLoadingAvailable) {\n this.isScrollLoading = true;\n this.setLoadingItem(true);\n this.triggerUpdate(this.choices.input.element.value);\n }\n }\n }, {\n key: \"attachRefreshOnBlur\",\n value: function attachRefreshOnBlur() {\n var _this11 = this;\n if (this.component.refreshOnBlur) {\n this.on('blur', function (instance) {\n _this11.checkRefreshOn([{\n instance: instance,\n value: instance.dataValue\n }], {\n fromBlur: true\n });\n });\n }\n }\n }, {\n key: \"addPlaceholderItem\",\n value: function addPlaceholderItem(placeholderValue) {\n var items = this.choices._store.activeItems;\n if (!items.length) {\n this.choices._addItem({\n value: placeholderValue,\n label: placeholderValue,\n choiceId: 0,\n groupId: -1,\n customProperties: null,\n placeholder: true,\n keyCode: null\n });\n }\n }\n\n /* eslint-enable max-statements */\n }, {\n key: \"update\",\n value: function update() {\n if (this.component.dataSrc === 'custom') {\n this.updateCustomItems();\n }\n // Activate the control.\n this.activate();\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(SelectComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(SelectComponent.prototype), \"disabled\", disabled, this, true);\n if (!this.choices) {\n return;\n }\n if (disabled) {\n this.setDisabled(this.choices.containerInner.element, true);\n this.focusableElement.removeAttribute('tabIndex');\n this.choices.disable();\n } else {\n this.setDisabled(this.choices.containerInner.element, false);\n this.focusableElement.setAttribute('tabIndex', this.component.tabindex || 0);\n this.choices.enable();\n }\n }\n }, {\n key: \"visible\",\n get: function get() {\n return _get(_getPrototypeOf(SelectComponent.prototype), \"visible\", this);\n }\n\n /**\n * @param {*} value\n * @param {Array} items\n */,\n set: function set(value) {\n // If we go from hidden to visible, trigger a refresh.\n if (value && !this._visible !== !value) {\n this.triggerUpdate();\n }\n _set(_getPrototypeOf(SelectComponent.prototype), \"visible\", value, this, true);\n }\n }, {\n key: \"addCurrentChoices\",\n value: function addCurrentChoices(values, items, keyValue) {\n var _this12 = this;\n if (!values) {\n return false;\n }\n var notFoundValuesToAdd = [];\n var added = values.reduce(function (defaultAdded, value) {\n if (!value || _lodash[\"default\"].isEmpty(value)) {\n return defaultAdded;\n }\n var found = false;\n\n // Make sure that `items` and `this.selectOptions` points\n // to the same reference. Because `this.selectOptions` is\n // internal property and all items are populated by\n // `this.addOption` method, we assume that items has\n // 'label' and 'value' properties. This assumption allows\n // us to read correct value from the item.\n var isSelectOptions = items === _this12.selectOptions;\n if (items && items.length) {\n _lodash[\"default\"].each(items, function (choice) {\n if (choice._id && value._id && choice._id === value._id) {\n found = true;\n return false;\n }\n var itemValue = keyValue ? choice.value : _this12.itemValue(choice, isSelectOptions);\n found |= _lodash[\"default\"].isEqual(itemValue, value);\n return found ? false : true;\n });\n }\n\n // Add the default option if no item is found.\n if (!found) {\n notFoundValuesToAdd.push(_this12.selectValueAndLabel(value));\n return true;\n }\n return found || defaultAdded;\n }, false);\n if (notFoundValuesToAdd.length) {\n if (this.choices) {\n this.choices.setChoices(notFoundValuesToAdd, 'value', 'label');\n }\n notFoundValuesToAdd.map(function (notFoundValue) {\n _this12.addOption(notFoundValue.value, notFoundValue.label);\n });\n }\n return added;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(data, options) {\n var _this13 = this;\n return this.component.multiple && Array.isArray(data) ? data.map(function (v) {\n return _this13.asString(v, options);\n }).join(', ') : this.asString(data, options);\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n // If the widget isn't active.\n if (this.viewOnly || this.loading || !this.component.lazyLoad && !this.selectOptions.length || !this.element) {\n return this.dataValue;\n }\n var value = this.emptyValue;\n if (this.choices) {\n value = this.choices.getValue(true);\n\n // Make sure we don't get the placeholder\n if (!this.component.multiple && this.component.placeholder && value === this.t(this.component.placeholder, {\n _userInput: true\n })) {\n value = this.emptyValue;\n }\n } else if (this.refs.selectContainer) {\n value = this.refs.selectContainer.value;\n if (this.valueProperty === '' || this.isEntireObjectDisplay()) {\n if (value === '') {\n return {};\n }\n var option = this.selectOptions[value] || this.selectOptions.find(function (option) {\n return option.id === value;\n });\n if (option && _lodash[\"default\"].isObject(option.value)) {\n value = option.value;\n }\n }\n } else {\n value = this.dataValue;\n }\n // Choices will return undefined if nothing is selected. We really want '' to be empty.\n if (value === undefined || value === null) {\n value = '';\n }\n return value;\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n var done = _get(_getPrototypeOf(SelectComponent.prototype), \"redraw\", this).call(this);\n this.triggerUpdate();\n return done;\n }\n }, {\n key: \"normalizeSingleValue\",\n value: function normalizeSingleValue(value) {\n if (_lodash[\"default\"].isNil(value)) {\n return;\n }\n var valueIsObject = _lodash[\"default\"].isObject(value);\n //check if value equals to default emptyValue\n if (valueIsObject && Object.keys(value).length === 0) {\n return value;\n }\n var dataType = this.component.dataType || 'auto';\n var normalize = {\n value: value,\n number: function number() {\n var numberValue = Number(this.value);\n var isEquivalent = value.toString() === numberValue.toString();\n if (!Number.isNaN(numberValue) && Number.isFinite(numberValue) && value !== '' && isEquivalent) {\n this.value = numberValue;\n }\n return this;\n },\n \"boolean\": function boolean() {\n if (_lodash[\"default\"].isString(this.value) && (this.value.toLowerCase() === 'true' || this.value.toLowerCase() === 'false')) {\n this.value = this.value.toLowerCase() === 'true';\n }\n return this;\n },\n string: function string() {\n this.value = String(this.value);\n return this;\n },\n object: function object() {\n return this;\n },\n auto: function auto() {\n if (_lodash[\"default\"].isObject(this.value)) {\n this.value = this.object().value;\n } else {\n this.value = this.string().number()[\"boolean\"]().value;\n }\n return this;\n }\n };\n try {\n return normalize[dataType]().value;\n } catch (err) {\n console.warn('Failed to normalize value', err);\n return value;\n }\n }\n\n /**\n * Normalize values coming into updateValue.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n var _this14 = this;\n if (this.component.multiple && Array.isArray(value)) {\n return value.map(function (singleValue) {\n return _this14.normalizeSingleValue(singleValue);\n });\n }\n return _get(_getPrototypeOf(SelectComponent.prototype), \"normalizeValue\", this).call(this, this.normalizeSingleValue(value));\n }\n }, {\n key: \"setMetadata\",\n value: function setMetadata(value) {\n var _this$root,\n _this15 = this;\n if (_lodash[\"default\"].isNil(value)) {\n return;\n }\n var valueIsObject = _lodash[\"default\"].isObject(value);\n //check if value equals to default emptyValue\n if (valueIsObject && Object.keys(value).length === 0) {\n return value;\n }\n // Check to see if we need to save off the template data into our metadata.\n var templateValue = this.component.reference && value !== null && value !== void 0 && value._id ? value._id.toString() : value;\n var shouldSaveData = !valueIsObject || this.component.reference;\n if (templateValue && shouldSaveData && this.templateData && this.templateData[templateValue] && (_this$root = this.root) !== null && _this$root !== void 0 && _this$root.submission) {\n var submission = this.root.submission;\n if (!submission.metadata) {\n submission.metadata = {};\n }\n if (!submission.metadata.selectData) {\n submission.metadata.selectData = {};\n }\n var templateData = this.templateData[templateValue];\n if (this.component.multiple) {\n templateData = {};\n var dataValue = this.dataValue;\n if (dataValue && _lodash[\"default\"].isArray(dataValue) && dataValue.length) {\n dataValue.forEach(function (dataValueItem) {\n var dataValueItemValue = _this15.component.reference ? dataValueItem._id.toString() : dataValueItem;\n templateData[dataValueItemValue] = _this15.templateData[dataValueItemValue];\n });\n }\n templateData[value] = this.templateData[value];\n }\n _lodash[\"default\"].set(submission.metadata.selectData, this.path, templateData);\n }\n }\n }, {\n key: \"updateValue\",\n value: function updateValue(value, flags) {\n var _this16 = this;\n var changed = _get(_getPrototypeOf(SelectComponent.prototype), \"updateValue\", this).call(this, value, flags);\n if (changed || !this.selectMetadata) {\n if (this.component.multiple && Array.isArray(this.dataValue)) {\n this.dataValue.forEach(function (singleValue) {\n return _this16.setMetadata(singleValue);\n });\n } else {\n this.setMetadata(this.dataValue);\n }\n }\n return changed;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this17 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var previousValue = this.dataValue;\n var changed = this.updateValue(value, flags);\n if (this.component.widget === 'html5' && (_lodash[\"default\"].isEqual(value, previousValue) || _lodash[\"default\"].isEqual(previousValue, {}) && _lodash[\"default\"].isEqual(flags, {})) && !flags.fromSubmission) {\n return false;\n }\n value = this.dataValue;\n var hasPreviousValue = !this.isEmpty(previousValue);\n var hasValue = !this.isEmpty(value);\n\n // Undo typing when searching to set the value.\n if (this.component.multiple && Array.isArray(value)) {\n value = value.map(function (value) {\n if (typeof value === 'boolean' || typeof value === 'number') {\n return value.toString();\n }\n return value;\n });\n } else {\n if (typeof value === 'boolean' || typeof value === 'number') {\n value = value.toString();\n }\n }\n if (this.isHtmlRenderMode() && flags && flags.fromSubmission && changed) {\n this.itemsLoaded.then(function () {\n _this17.redraw();\n });\n return changed;\n }\n\n // Do not set the value if we are loading... that will happen after it is done.\n if (this.loading) {\n return changed;\n }\n\n // Determine if we need to perform an initial lazyLoad api call if searchField is provided.\n if (this.isInitApiCallNeeded(hasValue)) {\n this.loading = true;\n this.lazyLoadInit = true;\n var searchProperty = this.component.searchField || this.component.valueProperty;\n this.triggerUpdate(_lodash[\"default\"].get(value.data || value, searchProperty, value), true);\n return changed;\n }\n\n // Add the value options.\n this.itemsLoaded.then(function () {\n _this17.addValueOptions();\n _this17.setChoicesValue(value, hasPreviousValue, flags);\n });\n return changed;\n }\n }, {\n key: \"isInitApiCallNeeded\",\n value: function isInitApiCallNeeded(hasValue) {\n return this.component.lazyLoad && !this.lazyLoadInit && !this.active && !this.selectOptions.length && hasValue && this.shouldInitialLoad && this.visible && (this.component.searchField || this.component.valueProperty);\n }\n }, {\n key: \"setChoicesValue\",\n value: function setChoicesValue(value, hasPreviousValue) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var hasValue = !this.isEmpty(value) || flags.fromSubmission;\n hasPreviousValue = hasPreviousValue === undefined ? true : hasPreviousValue;\n if (this.choices) {\n // Now set the value.\n if (hasValue) {\n this.choices.removeActiveItems();\n // Add the currently selected choices if they don't already exist.\n var currentChoices = Array.isArray(value) && this.component.multiple ? value : [value];\n if (!this.addCurrentChoices(currentChoices, this.selectOptions, true)) {\n this.choices.setChoices(this.selectOptions, 'value', 'label', true);\n }\n this.choices.setChoiceByValue(currentChoices);\n } else if (hasPreviousValue || flags.resetValue) {\n this.choices.removeActiveItems();\n }\n } else {\n if (hasValue) {\n var values = Array.isArray(value) ? value : [value];\n if (!_lodash[\"default\"].isEqual(this.dataValue, this.defaultValue) && this.selectOptions.length < 2 || this.selectData && flags.fromSubmission) {\n var _this$selectValueAndL = this.selectValueAndLabel(this.dataValue),\n _value2 = _this$selectValueAndL.value,\n label = _this$selectValueAndL.label;\n this.addOption(_value2, label);\n }\n _lodash[\"default\"].each(this.selectOptions, function (selectOption) {\n _lodash[\"default\"].each(values, function (val) {\n if (selectOption.value === '') {\n selectOption.value = {};\n }\n if (_lodash[\"default\"].isEqual(val, selectOption.value) && selectOption.element) {\n selectOption.element.selected = true;\n selectOption.element.setAttribute('selected', 'selected');\n return false;\n }\n });\n });\n } else {\n _lodash[\"default\"].each(this.selectOptions, function (selectOption) {\n if (selectOption.element) {\n selectOption.element.selected = false;\n selectOption.element.removeAttribute('selected');\n }\n });\n }\n }\n }\n }, {\n key: \"itemsLoaded\",\n get: function get() {\n return this._itemsLoaded || _nativePromiseOnly[\"default\"].resolve();\n },\n set: function set(promise) {\n this._itemsLoaded = promise;\n }\n }, {\n key: \"validateValueAvailability\",\n value: function validateValueAvailability(setting, value) {\n var _this18 = this;\n if (!(0, _utils.boolValue)(setting) || !value) {\n return true;\n }\n var values = this.getOptionsValues();\n if (values) {\n if (_lodash[\"default\"].isObject(value)) {\n var compareComplexValues = function compareComplexValues(optionValue) {\n var normalizedOptionValue = _this18.normalizeSingleValue(optionValue);\n if (!_lodash[\"default\"].isObject(normalizedOptionValue)) {\n return false;\n }\n try {\n return JSON.stringify(normalizedOptionValue) === JSON.stringify(value);\n } catch (err) {\n console.warn.error('Error while comparing items', err);\n return false;\n }\n };\n return values.findIndex(function (optionValue) {\n return compareComplexValues(optionValue);\n }) !== -1;\n }\n return values.findIndex(function (optionValue) {\n return _this18.normalizeSingleValue(optionValue) === value;\n }) !== -1;\n }\n return false;\n }\n\n /**\n * Performs required transformations on the initial value to use in selectOptions\n * @param {*} value\n */\n }, {\n key: \"getOptionValue\",\n value: function getOptionValue(value) {\n return _lodash[\"default\"].isObject(value) && this.isEntireObjectDisplay() ? this.normalizeSingleValue(value) : _lodash[\"default\"].isObject(value) && (this.valueProperty || this.component.key !== 'resource') ? value : _lodash[\"default\"].isObject(value) && !this.valueProperty ? this.interpolate(this.component.template, {\n item: value\n }).replace(/<\\/?[^>]+(>|$)/g, '') : _lodash[\"default\"].isNull(value) ? this.emptyValue : String(this.normalizeSingleValue(value));\n }\n\n /**\n * If component has static values (values, json) or custom values, returns an array of them\n * @returns {Array<*>|undefined}\n */\n }, {\n key: \"getOptionsValues\",\n value: function getOptionsValues() {\n var _this19 = this;\n var rawItems = [];\n switch (this.component.dataSrc) {\n case 'values':\n rawItems = this.component.data.values;\n break;\n case 'json':\n rawItems = this.component.data.json;\n break;\n case 'custom':\n rawItems = this.getCustomItems();\n break;\n }\n if (typeof rawItems === 'string') {\n try {\n rawItems = JSON.parse(rawItems);\n } catch (err) {\n console.warn(err.message);\n rawItems = [];\n }\n }\n if (!Array.isArray(rawItems)) {\n return;\n }\n return rawItems.map(function (item) {\n return _this19.getOptionValue(_this19.itemValue(item));\n });\n }\n\n /**\n * Deletes the value of the component.\n */\n }, {\n key: \"deleteValue\",\n value: function deleteValue() {\n this.setValue('', {\n noUpdateEvent: true\n });\n this.unset();\n }\n\n /**\n * Check if a component is eligible for multiple validation\n *\n * @return {boolean}\n */\n }, {\n key: \"validateMultiple\",\n value: function validateMultiple() {\n // Select component will contain one input when flagged as multiple.\n return false;\n }\n\n /**\n * Output this select dropdown as a string value.\n * @return {*}\n */\n }, {\n key: \"isBooleanOrNumber\",\n value: function isBooleanOrNumber(value) {\n return typeof value === 'number' || typeof value === 'boolean';\n }\n }, {\n key: \"getNormalizedValues\",\n value: function getNormalizedValues() {\n var _this20 = this;\n if (!this.component || !this.component.data || !this.component.data.values) {\n return;\n }\n return this.component.data.values.map(function (value) {\n return {\n label: value.label,\n value: String(_this20.normalizeSingleValue(value.value))\n };\n });\n }\n }, {\n key: \"asString\",\n value: function asString(value) {\n var _value3,\n _this21 = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n value = (_value3 = value) !== null && _value3 !== void 0 ? _value3 : this.getValue();\n //need to convert values to strings to be able to compare values with available options that are strings\n var convertToString = function convertToString(data, valueProperty) {\n if (valueProperty) {\n if (Array.isArray(data)) {\n data.forEach(function (item) {\n return item[valueProperty] = item[valueProperty].toString();\n });\n } else {\n data[valueProperty] = data[valueProperty].toString();\n }\n return data;\n }\n if (_this21.isBooleanOrNumber(data)) {\n data = data.toString();\n }\n if (Array.isArray(data) && data.some(function (item) {\n return _this21.isBooleanOrNumber(item);\n })) {\n data = data.map(function (item) {\n if (_this21.isBooleanOrNumber(item)) {\n item = item.toString();\n }\n });\n }\n return data;\n };\n value = convertToString(value);\n if (['values', 'custom'].includes(this.component.dataSrc) && !this.asyncCustomValues()) {\n var _getFromValues;\n var _ref4 = this.component.dataSrc === 'values' ? {\n items: convertToString(this.getNormalizedValues(), 'value'),\n valueProperty: 'value'\n } : {\n items: convertToString(this.getCustomItems(), this.valueProperty),\n valueProperty: this.valueProperty\n },\n items = _ref4.items,\n valueProperty = _ref4.valueProperty;\n var getFromValues = function getFromValues() {\n var initialValue = _lodash[\"default\"].find(items, [valueProperty, value]);\n var values = _this21.defaultSchema.data.values || [];\n return _lodash[\"default\"].isEqual(initialValue, values[0]) ? '-' : initialValue;\n };\n value = this.component.multiple && Array.isArray(value) ? _lodash[\"default\"].filter(items, function (item) {\n return value.includes(item.value);\n }) : valueProperty ? (_getFromValues = getFromValues()) !== null && _getFromValues !== void 0 ? _getFromValues : {\n value: value,\n label: value\n } : value;\n }\n if (_lodash[\"default\"].isString(value)) {\n return value;\n }\n var getTemplateValue = function getTemplateValue(v) {\n var itemTemplate = _this21.itemTemplate(v);\n return options.csv && itemTemplate ? (0, _utils.unescapeHTML)(itemTemplate) : itemTemplate;\n };\n if (Array.isArray(value)) {\n var _items = [];\n value.forEach(function (item) {\n return _items.push(getTemplateValue(item));\n });\n if (this.component.dataSrc === 'resource' && _items.length > 0) {\n return _items.join(', ');\n } else if (_items.length > 0) {\n return _items.join('
');\n } else {\n return '-';\n }\n }\n if (this.isEntireObjectDisplay() && _lodash[\"default\"].isObject(value)) {\n return JSON.stringify(value);\n }\n return !_lodash[\"default\"].isNil(value) ? getTemplateValue(value) : '-';\n }\n }, {\n key: \"detach\",\n value: function detach() {\n this.off('blur');\n if (this.choices) {\n var _this$choices$contain, _this$choices$contain2;\n if ((_this$choices$contain = this.choices.containerOuter) !== null && _this$choices$contain !== void 0 && (_this$choices$contain2 = _this$choices$contain.element) !== null && _this$choices$contain2 !== void 0 && _this$choices$contain2.parentNode) {\n this.choices.destroy();\n }\n this.choices = null;\n }\n _get(_getPrototypeOf(SelectComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"focus\",\n value: function focus() {\n if (this.focusableElement) {\n _get(_getPrototypeOf(SelectComponent.prototype), \"focus\", this).call(this);\n this.focusableElement.focus();\n }\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(elements, dirty, hasError, hasMessages) {\n var element = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.element;\n _get(_getPrototypeOf(SelectComponent.prototype), \"setErrorClasses\", this).call(this, elements, dirty, hasError, hasMessages, element);\n if (this.choices) {\n _get(_getPrototypeOf(SelectComponent.prototype), \"setErrorClasses\", this).call(this, [this.choices.containerInner.element], dirty, hasError, hasMessages, element);\n } else {\n _get(_getPrototypeOf(SelectComponent.prototype), \"setErrorClasses\", this).call(this, [this.refs.selectContainer], dirty, hasError, hasMessages, element);\n }\n }\n }], [{\n key: \"schema\",\n value: function schema() {\n for (var _len3 = arguments.length, extend = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n extend[_key3] = arguments[_key3];\n }\n return _ListComponent2[\"default\"].schema.apply(_ListComponent2[\"default\"], [{\n type: 'select',\n label: 'Select',\n key: 'select',\n idPath: 'id',\n data: {\n values: [{\n label: '',\n value: ''\n }],\n json: '',\n url: '',\n resource: '',\n custom: ''\n },\n clearOnRefresh: false,\n limit: 100,\n valueProperty: '',\n lazyLoad: true,\n filter: '',\n searchEnabled: true,\n searchDebounce: 0.3,\n searchField: '',\n minSearch: 0,\n readOnlyValue: false,\n selectFields: '',\n selectThreshold: 0.3,\n uniqueOptions: false,\n tableView: true,\n fuseOptions: {\n include: 'score',\n threshold: 0.3\n },\n indexeddb: {\n filter: {}\n },\n customOptions: {},\n useExactSearch: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Select',\n group: 'basic',\n icon: 'th-list',\n weight: 70,\n documentation: '/userguide/form-building/form-components#select',\n schema: SelectComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return SelectComponent.conditionOperatorsSettings;\n }\n }, {\n key: \"conditionOperatorsSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(SelectComponent), \"conditionOperatorsSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n var valueComp = _objectSpread(_objectSpread({}, classComp), {}, {\n type: 'select'\n });\n if ((0, _utils.isSelectResourceWithObjectValue)(classComp)) {\n valueComp.reference = false;\n valueComp.onSetItems = \"\\n var templateKeys = utils.getItemTemplateKeys(component.template) || [];\\n items = _.map(items || [], i => {\\n var item = {};\\n _.each(templateKeys, k => _.set(item, k, _.get(i, k)));\\n return item;\\n })\\n \";\n }\n return valueComp;\n }\n });\n }\n }, {\n key: \"savedValueTypes\",\n value: function savedValueTypes(schema) {\n var _boolean = _utils.componentValueTypes[\"boolean\"],\n string = _utils.componentValueTypes.string,\n number = _utils.componentValueTypes.number,\n object = _utils.componentValueTypes.object,\n array = _utils.componentValueTypes.array;\n var dataType = schema.dataType,\n reference = schema.reference;\n var types = (0, _utils.getComponentSavedTypes)(schema);\n if (types) {\n return types;\n }\n if (reference) {\n return [object];\n }\n if (dataType === 'object') {\n return [object, array];\n }\n if (_utils.componentValueTypes[dataType]) {\n return [_utils.componentValueTypes[dataType]];\n }\n return [_boolean, string, number, object, array];\n }\n }]);\n return SelectComponent;\n}(_ListComponent2[\"default\"]);\nexports[\"default\"] = SelectComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/select/Select.js?"); /***/ }), @@ -1784,7 +1784,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.reflect.construct.js */ \". /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.regexp.flags.js */ \"./node_modules/core-js/modules/es.regexp.flags.js\");\nvar _utils = __webpack_require__(/*! ../../../utils/utils */ \"./lib/utils/utils.js\");\nvar _default = [{\n key: 'dataSrc',\n data: {\n values: [{\n label: 'Values',\n value: 'values'\n }, {\n label: 'URL',\n value: 'url'\n }, {\n label: 'Resource',\n value: 'resource'\n }, {\n label: 'Custom',\n value: 'custom'\n }, {\n label: 'Raw JSON',\n value: 'json'\n }]\n }\n}, {\n type: 'textfield',\n weight: 10,\n input: true,\n key: 'indexeddb.database',\n label: 'Database name',\n tooltip: 'The name of the indexeddb database.',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'indexeddb']\n }\n }\n}, {\n type: 'textfield',\n input: true,\n key: 'indexeddb.table',\n label: 'Table name',\n weight: 16,\n tooltip: 'The name of table in the indexeddb database.',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'indexeddb']\n }\n }\n}, {\n type: 'textarea',\n as: 'json',\n editor: 'ace',\n weight: 18,\n input: true,\n key: 'indexeddb.filter',\n label: 'Row Filter',\n tooltip: 'Filter table items that match the object.',\n defaultValue: {},\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'indexeddb']\n }\n }\n}, {\n type: 'textarea',\n as: 'json',\n editor: 'ace',\n weight: 10,\n input: true,\n key: 'data.json',\n label: 'Data Source Raw JSON',\n tooltip: 'A valid JSON array to use as a data source.',\n description: '
Example:
[\"apple\", \"banana\", \"orange\"].
Example 2:
[{\"name\": \"John\", \"email\": \"john.doe@test.com\"}, {\"name\": \"Jane\", \"email\": \"jane.doe@test.com\"}].
',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'json']\n }\n }\n}, {\n type: 'checkbox',\n input: true,\n label: 'Lazy Load Data',\n key: 'lazyLoad',\n tooltip: 'When set, this will not fire off the request to the URL until this control is within focus. This can improve performance if you have many Select dropdowns on your form where the API\\'s will only fire when the control is activated.',\n weight: 11,\n conditional: {\n json: {\n and: [{\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['resource', 'url']]\n }, {\n '!==': [{\n \"var\": 'data.widget'\n }, 'html5']\n }]\n }\n }\n}, {\n type: 'datagrid',\n input: true,\n label: 'Data Source Values',\n key: 'data.values',\n tooltip: 'Values to use as the data source. Labels are shown in the select field. Values are the corresponding values saved with the submission.',\n weight: 10,\n reorder: true,\n defaultValue: [{\n label: '',\n value: ''\n }],\n components: [{\n label: 'Label',\n key: 'label',\n input: true,\n type: 'textfield'\n }, {\n label: 'Value',\n key: 'value',\n input: true,\n type: 'textfield',\n allowCalculateOverride: true,\n calculateValue: 'value = _.camelCase(row.label);'\n }],\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'values']\n }\n }\n}, {\n type: 'select',\n input: true,\n dataSrc: 'url',\n data: {\n url: '/form?type=resource&limit=1000000&select=_id,title'\n },\n authenticate: true,\n template: '{{ item.title }}',\n valueProperty: '_id',\n clearOnHide: false,\n label: 'Resource',\n key: 'data.resource',\n lazyLoad: false,\n weight: 10,\n tooltip: 'The resource to be used with this field.',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'resource']\n }\n }\n}, {\n type: 'textfield',\n input: true,\n label: 'Data Path',\n key: 'selectValues',\n weight: 12,\n description: 'The object path to the iterable items.',\n tooltip: 'The property within the source data, where iterable items reside. For example: results.items or results[0].items',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'url']\n }\n }\n}, {\n type: 'select',\n input: true,\n label: 'Value Property',\n key: 'valueProperty',\n skipMerge: true,\n clearOnHide: true,\n tooltip: 'The field to use as the value.',\n weight: 11,\n refreshOn: 'data.resource',\n template: '{{ item.label }}',\n valueProperty: 'key',\n dataSrc: 'url',\n lazyLoad: false,\n onSetItems: function onSetItems(component, form) {\n var newItems = form.type === 'resource' ? [{\n label: '{Entire Object}',\n key: 'data'\n }] : [];\n (0, _utils.eachComponent)(form.components, function (component, path) {\n if (component.input) {\n newItems.push({\n label: component.label || component.key,\n key: \"data.\".concat(path)\n });\n }\n });\n return newItems;\n },\n onChange: function onChange(context) {\n if (context && context.flags && context.flags.modified) {\n var valueProp = context.instance.data.valueProperty;\n var templateProp = valueProp ? valueProp : 'data';\n var template = \"{{ item.\".concat(templateProp, \" }}\");\n var searchField = valueProp ? \"\".concat(valueProp, \"__regex\") : '';\n context.instance.root.getComponent('template').setValue(template);\n context.instance.root.getComponent('searchField').setValue(searchField);\n }\n },\n data: {\n url: '/form/{{ data.data.resource }}'\n },\n conditional: {\n json: {\n and: [{\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'resource']\n }, {\n '!==': [{\n \"var\": 'data.reference'\n }, true]\n }, {\n \"var\": 'data.data.resource'\n }]\n }\n }\n}, {\n type: 'select',\n input: true,\n label: 'Storage Type',\n key: 'dataType',\n clearOnHide: true,\n tooltip: 'The type to store the data. If you select something other than autotype, it will force it to that type.',\n weight: 12,\n template: '{{ item.label }}',\n dataSrc: 'values',\n data: {\n values: [{\n label: 'Autotype',\n value: 'auto'\n }, {\n label: 'String',\n value: 'string'\n }, {\n label: 'Number',\n value: 'number'\n }, {\n label: 'Boolean',\n value: 'boolean'\n }, {\n label: 'Object',\n value: 'object'\n }]\n }\n}, {\n type: 'textfield',\n input: true,\n key: 'idPath',\n weight: 12,\n label: 'ID Path',\n placeholder: 'id',\n tooltip: 'Path to the select option id.'\n}, {\n type: 'textfield',\n input: true,\n label: 'Select Fields',\n key: 'selectFields',\n tooltip: 'The properties on the resource to return as part of the options. Separate property names by commas. If left blank, all properties will be returned.',\n placeholder: 'Comma separated list of fields to select.',\n weight: 14,\n conditional: {\n json: {\n and: [{\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'resource']\n }, {\n '===': [{\n \"var\": 'data.valueProperty'\n }, '']\n }]\n }\n }\n}, {\n type: 'checkbox',\n input: true,\n key: 'disableLimit',\n label: 'Disable limiting response',\n tooltip: 'When enabled the request will not include the limit and skip options in the query string',\n weight: 15,\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'url']\n }\n }\n}, {\n type: 'textfield',\n input: true,\n key: 'searchField',\n label: 'Search Query Name',\n weight: 16,\n description: 'Name of URL query parameter',\n tooltip: 'The name of the search querystring parameter used when sending a request to filter results with. The server at the URL must handle this query parameter.',\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource']]\n }\n }\n}, {\n type: 'number',\n input: true,\n key: 'searchDebounce',\n label: 'Search request delay',\n weight: 16,\n description: 'The delay (in seconds) before the search request is sent.',\n tooltip: 'The delay in seconds before the search request is sent, measured from the last character input in the search field.',\n validate: {\n min: 0,\n customMessage: '',\n json: '',\n max: 1\n },\n delimiter: false,\n requireDecimal: false,\n encrypted: false,\n defaultValue: 0.3,\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource']]\n }\n }\n}, {\n type: 'number',\n input: true,\n key: 'minSearch',\n weight: 17,\n label: 'Minimum Search Length',\n tooltip: 'The minimum amount of characters they must type before a search is made.',\n defaultValue: 0,\n conditional: {\n json: {\n and: [{\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'url']\n }, {\n '!=': [{\n \"var\": 'data.searchField'\n }, '']\n }]\n }\n }\n}, {\n type: 'textfield',\n input: true,\n key: 'filter',\n label: 'Filter Query',\n weight: 18,\n description: 'The filter query for results.',\n tooltip: 'Use this to provide additional filtering using query parameters.',\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource']]\n }\n }\n}, {\n type: 'textfield',\n input: true,\n key: 'sort',\n label: 'Sort Query',\n weight: 18,\n description: 'The sort query for results',\n tooltip: 'Use this to provide additional sorting using query parameters',\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource']]\n }\n }\n}, {\n type: 'number',\n input: true,\n key: 'limit',\n label: 'Limit',\n weight: 18,\n description: 'Maximum number of items to view per page of results.',\n tooltip: 'Use this to limit the number of items to request or view.',\n clearOnHide: false,\n conditional: {\n json: {\n and: [{\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource']]\n }, {\n '!==': [{\n \"var\": 'data.disableLimit'\n }, true]\n }]\n }\n }\n}, {\n type: 'textarea',\n input: true,\n key: 'data.custom',\n label: 'Custom Values',\n editor: 'ace',\n rows: 10,\n weight: 14,\n placeholder: \"values = data['mykey'] or values = Promise.resolve(['myValue'])\",\n tooltip: 'Write custom code to return the value options or a promise with value options. The form data object is available.',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'custom']\n }\n }\n}, {\n type: 'select',\n input: true,\n key: 'refreshOn',\n label: 'Refresh Options On',\n weight: 19,\n tooltip: 'Refresh data when another field changes.',\n dataSrc: 'custom',\n valueProperty: 'value',\n data: {\n custom: function custom(context) {\n var values = [];\n values.push({\n label: 'Any Change',\n value: 'data'\n });\n context.utils.eachComponent(context.instance.options.editForm.components, function (component, path) {\n if (component.key !== context.data.key) {\n values.push({\n label: component.label || component.key,\n value: path\n });\n }\n });\n return values;\n }\n },\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource', 'values', 'custom']]\n }\n }\n}, {\n type: 'select',\n input: true,\n key: 'refreshOnBlur',\n label: 'Refresh Options On Blur',\n weight: 19,\n tooltip: 'Refresh data when another field is blured.',\n dataSrc: 'custom',\n valueProperty: 'value',\n data: {\n custom: function custom(context) {\n var values = [];\n values.push({\n label: 'Any Change',\n value: 'data'\n });\n context.utils.eachComponent(context.instance.options.editForm.components, function (component, path) {\n if (component.key !== context.data.key) {\n values.push({\n label: component.label || component.key,\n value: path\n });\n }\n });\n return values;\n }\n },\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource', 'values']]\n }\n }\n}, {\n type: 'checkbox',\n input: true,\n weight: 20,\n key: 'clearOnRefresh',\n label: 'Clear Value On Refresh Options',\n defaultValue: false,\n tooltip: 'When the Refresh On field is changed, clear this components value.',\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource', 'values', 'custom']]\n }\n }\n}, {\n type: 'checkbox',\n input: true,\n weight: 21,\n key: 'searchEnabled',\n label: 'Enable Static Search',\n defaultValue: true,\n tooltip: 'When checked, the select dropdown will allow for searching within the static list of items provided.'\n}, {\n type: 'checkbox',\n input: true,\n weight: 21,\n key: 'noRefreshOnScroll',\n label: 'Disable Options Refresh When Scrolling',\n defaultValue: false,\n tooltip: 'When checked, the select with search input won\\'t perform new api requests when scrolling through the list of options.',\n conditional: {\n json: {\n and: [{\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource']]\n }, {\n '===': [{\n \"var\": 'data.searchEnabled'\n }, true]\n }]\n }\n }\n}, {\n label: 'Search Threshold',\n mask: false,\n tableView: true,\n alwaysEnabled: false,\n type: 'number',\n input: true,\n key: 'selectThreshold',\n validate: {\n min: 0,\n customMessage: '',\n json: '',\n max: 1\n },\n delimiter: false,\n requireDecimal: false,\n encrypted: false,\n defaultValue: 0.3,\n weight: 22,\n tooltip: 'At what point does the match algorithm give up. A threshold of 0.0 requires a perfect match, a threshold of 1.0 would match anything.'\n}, {\n type: 'checkbox',\n input: true,\n weight: 23,\n key: 'addResource',\n label: 'Add Resource',\n tooltip: 'Allows to create a new resource while entering a submission.',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'resource']\n }\n }\n}, {\n type: 'textfield',\n label: 'Add Resource Label',\n key: 'addResourceLabel',\n tooltip: 'Set the text of the Add Resource button.',\n placeholder: 'Add Resource',\n weight: 24,\n input: true,\n conditional: {\n json: {\n and: [{\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'resource']\n }, {\n '!!': {\n \"var\": 'data.addResource'\n }\n }]\n }\n }\n}, {\n type: 'checkbox',\n input: true,\n weight: 25,\n key: 'reference',\n label: 'Save as reference',\n tooltip: 'Using this option will save this field as a reference and link its value to the value of the origin record.',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'resource']\n }\n }\n}, {\n type: 'checkbox',\n input: true,\n weight: 27,\n key: 'readOnlyValue',\n label: 'Read Only Value',\n tooltip: 'Check this if you would like to show just the value when in Read Only mode.'\n}, {\n type: 'textarea',\n as: 'json',\n editor: 'ace',\n weight: 28,\n input: true,\n key: 'customOptions',\n label: 'Choices.js options',\n tooltip: 'A raw JSON object to use as options for the Select component (Choices JS).',\n defaultValue: {}\n}, {\n type: 'checkbox',\n input: true,\n weight: 29,\n key: 'useExactSearch',\n label: 'Use exact search',\n tooltip: 'Disables search algorithm threshold.'\n}];\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/components/select/editForm/Select.edit.data.js?"); +eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.array.find.js */ \"./node_modules/core-js/modules/es.array.find.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"./node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"./node_modules/core-js/modules/web.timers.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.flags.js */ \"./node_modules/core-js/modules/es.regexp.flags.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _utils = __webpack_require__(/*! ../../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nvar calculateSingleSelectData = function calculateSingleSelectData(context, defaultValue) {\n var instance = context.instance,\n data = context.data;\n var rawDefaultValue = instance.downloadedResources.find(function (resource) {\n return _lodash[\"default\"].get(resource, data.valueProperty) === defaultValue;\n });\n var options = {\n data: {},\n noeval: true\n };\n instance.interpolate(data.template, {\n item: rawDefaultValue\n }, options);\n return options.data.item;\n};\nvar calculateSelectData = function calculateSelectData(context) {\n var instance = context.instance;\n var defaultValue = instance.getValue();\n if (instance.component.multiple) {\n var multiSelectData = {};\n (defaultValue !== null && defaultValue !== void 0 ? defaultValue : []).forEach(function (defaultValueItem) {\n multiSelectData[defaultValueItem] = calculateSingleSelectData(context, defaultValueItem);\n });\n return multiSelectData;\n } else {\n return calculateSingleSelectData(context, defaultValue);\n }\n};\nvar setSelectData = function setSelectData(context) {\n // Wait before downloadedResources will be set\n setTimeout(function () {\n var _instance$downloadedR;\n var instance = context.instance,\n data = context.data;\n var selectDataComponent = instance === null || instance === void 0 ? void 0 : instance.root.getComponent('selectData');\n // nothing can set if don't have downloaded resources\n if (!selectDataComponent || !instance.getValue() || !((_instance$downloadedR = instance.downloadedResources) !== null && _instance$downloadedR !== void 0 && _instance$downloadedR.length)) {\n return;\n }\n // if valueProperty is not provided, we have entire object\n var shouldCalculateUrlData = data.dataSrc === 'url' && data.data.url && data.valueProperty;\n var shouldCalculateResourceData = data.dataSrc === 'resource' && data.data.resource && data.valueProperty;\n var newValue = shouldCalculateUrlData || shouldCalculateResourceData ? calculateSelectData(context) : undefined;\n selectDataComponent.setValue(newValue);\n }, 0);\n};\nvar _default = [{\n key: 'dataSrc',\n data: {\n values: [{\n label: 'Values',\n value: 'values'\n }, {\n label: 'URL',\n value: 'url'\n }, {\n label: 'Resource',\n value: 'resource'\n }, {\n label: 'Custom',\n value: 'custom'\n }, {\n label: 'Raw JSON',\n value: 'json'\n }]\n }\n}, {\n type: 'textfield',\n weight: 10,\n input: true,\n key: 'indexeddb.database',\n label: 'Database name',\n tooltip: 'The name of the indexeddb database.',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'indexeddb']\n }\n }\n}, {\n type: 'textfield',\n input: true,\n key: 'indexeddb.table',\n label: 'Table name',\n weight: 16,\n tooltip: 'The name of table in the indexeddb database.',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'indexeddb']\n }\n }\n}, {\n type: 'textarea',\n as: 'json',\n editor: 'ace',\n weight: 18,\n input: true,\n key: 'indexeddb.filter',\n label: 'Row Filter',\n tooltip: 'Filter table items that match the object.',\n defaultValue: {},\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'indexeddb']\n }\n }\n}, {\n type: 'textarea',\n as: 'json',\n editor: 'ace',\n weight: 10,\n input: true,\n key: 'data.json',\n label: 'Data Source Raw JSON',\n tooltip: 'A valid JSON array to use as a data source.',\n description: '
Example:
[\"apple\", \"banana\", \"orange\"].
Example 2:
[{\"name\": \"John\", \"email\": \"john.doe@test.com\"}, {\"name\": \"Jane\", \"email\": \"jane.doe@test.com\"}].
',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'json']\n }\n }\n}, {\n type: 'checkbox',\n input: true,\n label: 'Lazy Load Data',\n key: 'lazyLoad',\n tooltip: 'When set, this will not fire off the request to the URL until this control is within focus. This can improve performance if you have many Select dropdowns on your form where the API\\'s will only fire when the control is activated.',\n weight: 11,\n conditional: {\n json: {\n and: [{\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['resource', 'url']]\n }, {\n '!==': [{\n \"var\": 'data.widget'\n }, 'html5']\n }]\n }\n }\n}, {\n type: 'datagrid',\n input: true,\n label: 'Data Source Values',\n key: 'data.values',\n tooltip: 'Values to use as the data source. Labels are shown in the select field. Values are the corresponding values saved with the submission.',\n weight: 10,\n reorder: true,\n defaultValue: [{\n label: '',\n value: ''\n }],\n components: [{\n label: 'Label',\n key: 'label',\n input: true,\n type: 'textfield'\n }, {\n label: 'Value',\n key: 'value',\n input: true,\n type: 'textfield',\n allowCalculateOverride: true,\n calculateValue: 'value = _.camelCase(row.label);'\n }],\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'values']\n }\n }\n}, {\n type: 'select',\n input: true,\n dataSrc: 'url',\n data: {\n url: '/form?type=resource&limit=1000000&select=_id,title'\n },\n authenticate: true,\n template: '{{ item.title }}',\n valueProperty: '_id',\n clearOnHide: false,\n label: 'Resource',\n key: 'data.resource',\n lazyLoad: false,\n weight: 10,\n tooltip: 'The resource to be used with this field.',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'resource']\n }\n }\n}, {\n type: 'textfield',\n input: true,\n label: 'Data Path',\n key: 'selectValues',\n weight: 12,\n description: 'The object path to the iterable items.',\n tooltip: 'The property within the source data, where iterable items reside. For example: results.items or results[0].items',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'url']\n }\n }\n}, {\n type: 'select',\n input: true,\n label: 'Value Property',\n key: 'valueProperty',\n skipMerge: true,\n clearOnHide: true,\n tooltip: 'The field to use as the value.',\n weight: 11,\n refreshOn: 'data.resource',\n template: '{{ item.label }}',\n valueProperty: 'key',\n dataSrc: 'url',\n lazyLoad: false,\n onSetItems: function onSetItems(component, form) {\n var newItems = form.type === 'resource' ? [{\n label: '{Entire Object}',\n key: 'data'\n }] : [];\n (0, _utils.eachComponent)(form.components, function (component, path) {\n if (component.input) {\n newItems.push({\n label: component.label || component.key,\n key: \"data.\".concat(path)\n });\n }\n });\n return newItems;\n },\n onChange: function onChange(context) {\n if (context && context.flags && context.flags.modified) {\n var valueProp = context.instance.data.valueProperty;\n var templateProp = valueProp ? valueProp : 'data';\n var template = \"{{ item.\".concat(templateProp, \" }}\");\n var searchField = valueProp ? \"\".concat(valueProp, \"__regex\") : '';\n context.instance.root.getComponent('template').setValue(template);\n context.instance.root.getComponent('searchField').setValue(searchField);\n }\n },\n data: {\n url: '/form/{{ data.data.resource }}'\n },\n conditional: {\n json: {\n and: [{\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'resource']\n }, {\n '!==': [{\n \"var\": 'data.reference'\n }, true]\n }, {\n \"var\": 'data.data.resource'\n }]\n }\n }\n}, {\n type: 'select',\n input: true,\n label: 'Storage Type',\n key: 'dataType',\n clearOnHide: true,\n tooltip: 'The type to store the data. If you select something other than autotype, it will force it to that type.',\n weight: 12,\n template: '{{ item.label }}',\n dataSrc: 'values',\n data: {\n values: [{\n label: 'Autotype',\n value: 'auto'\n }, {\n label: 'String',\n value: 'string'\n }, {\n label: 'Number',\n value: 'number'\n }, {\n label: 'Boolean',\n value: 'boolean'\n }, {\n label: 'Object',\n value: 'object'\n }]\n }\n}, {\n type: 'textfield',\n input: true,\n key: 'idPath',\n weight: 12,\n label: 'ID Path',\n placeholder: 'id',\n tooltip: 'Path to the select option id.'\n}, {\n type: 'textfield',\n input: true,\n label: 'Select Fields',\n key: 'selectFields',\n tooltip: 'The properties on the resource to return as part of the options. Separate property names by commas. If left blank, all properties will be returned.',\n placeholder: 'Comma separated list of fields to select.',\n weight: 14,\n conditional: {\n json: {\n and: [{\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'resource']\n }, {\n '===': [{\n \"var\": 'data.valueProperty'\n }, '']\n }]\n }\n }\n}, {\n type: 'checkbox',\n input: true,\n key: 'disableLimit',\n label: 'Disable limiting response',\n tooltip: 'When enabled the request will not include the limit and skip options in the query string',\n weight: 15,\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'url']\n }\n }\n}, {\n type: 'textfield',\n input: true,\n key: 'searchField',\n label: 'Search Query Name',\n weight: 16,\n description: 'Name of URL query parameter',\n tooltip: 'The name of the search querystring parameter used when sending a request to filter results with. The server at the URL must handle this query parameter.',\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource']]\n }\n }\n}, {\n type: 'number',\n input: true,\n key: 'searchDebounce',\n label: 'Search request delay',\n weight: 16,\n description: 'The delay (in seconds) before the search request is sent.',\n tooltip: 'The delay in seconds before the search request is sent, measured from the last character input in the search field.',\n validate: {\n min: 0,\n customMessage: '',\n json: '',\n max: 1\n },\n delimiter: false,\n requireDecimal: false,\n encrypted: false,\n defaultValue: 0.3,\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource']]\n }\n }\n}, {\n type: 'number',\n input: true,\n key: 'minSearch',\n weight: 17,\n label: 'Minimum Search Length',\n tooltip: 'The minimum amount of characters they must type before a search is made.',\n defaultValue: 0,\n conditional: {\n json: {\n and: [{\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'url']\n }, {\n '!=': [{\n \"var\": 'data.searchField'\n }, '']\n }]\n }\n }\n}, {\n type: 'textfield',\n input: true,\n key: 'filter',\n label: 'Filter Query',\n weight: 18,\n description: 'The filter query for results.',\n tooltip: 'Use this to provide additional filtering using query parameters.',\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource']]\n }\n }\n}, {\n type: 'textfield',\n input: true,\n key: 'sort',\n label: 'Sort Query',\n weight: 18,\n description: 'The sort query for results',\n tooltip: 'Use this to provide additional sorting using query parameters',\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource']]\n }\n }\n}, {\n type: 'number',\n input: true,\n key: 'limit',\n label: 'Limit',\n weight: 18,\n description: 'Maximum number of items to view per page of results.',\n tooltip: 'Use this to limit the number of items to request or view.',\n clearOnHide: false,\n conditional: {\n json: {\n and: [{\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource']]\n }, {\n '!==': [{\n \"var\": 'data.disableLimit'\n }, true]\n }]\n }\n }\n}, {\n type: 'textarea',\n input: true,\n key: 'data.custom',\n label: 'Custom Values',\n editor: 'ace',\n rows: 10,\n weight: 14,\n placeholder: \"values = data['mykey'] or values = Promise.resolve(['myValue'])\",\n tooltip: 'Write custom code to return the value options or a promise with value options. The form data object is available.',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'custom']\n }\n }\n}, {\n type: 'select',\n input: true,\n key: 'refreshOn',\n label: 'Refresh Options On',\n weight: 19,\n tooltip: 'Refresh data when another field changes.',\n dataSrc: 'custom',\n valueProperty: 'value',\n data: {\n custom: function custom(context) {\n var values = [];\n values.push({\n label: 'Any Change',\n value: 'data'\n });\n context.utils.eachComponent(context.instance.options.editForm.components, function (component, path) {\n if (component.key !== context.data.key) {\n values.push({\n label: component.label || component.key,\n value: path\n });\n }\n });\n return values;\n }\n },\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource', 'values', 'custom']]\n }\n }\n}, {\n type: 'select',\n input: true,\n key: 'refreshOnBlur',\n label: 'Refresh Options On Blur',\n weight: 19,\n tooltip: 'Refresh data when another field is blured.',\n dataSrc: 'custom',\n valueProperty: 'value',\n data: {\n custom: function custom(context) {\n var values = [];\n values.push({\n label: 'Any Change',\n value: 'data'\n });\n context.utils.eachComponent(context.instance.options.editForm.components, function (component, path) {\n if (component.key !== context.data.key) {\n values.push({\n label: component.label || component.key,\n value: path\n });\n }\n });\n return values;\n }\n },\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource', 'values']]\n }\n }\n}, {\n type: 'checkbox',\n input: true,\n weight: 20,\n key: 'clearOnRefresh',\n label: 'Clear Value On Refresh Options',\n defaultValue: false,\n tooltip: 'When the Refresh On field is changed, clear this components value.',\n conditional: {\n json: {\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource', 'values', 'custom']]\n }\n }\n}, {\n type: 'checkbox',\n input: true,\n weight: 21,\n key: 'searchEnabled',\n label: 'Enable Static Search',\n defaultValue: true,\n tooltip: 'When checked, the select dropdown will allow for searching within the static list of items provided.'\n}, {\n type: 'checkbox',\n input: true,\n weight: 21,\n key: 'noRefreshOnScroll',\n label: 'Disable Options Refresh When Scrolling',\n defaultValue: false,\n tooltip: 'When checked, the select with search input won\\'t perform new api requests when scrolling through the list of options.',\n conditional: {\n json: {\n and: [{\n \"in\": [{\n \"var\": 'data.dataSrc'\n }, ['url', 'resource']]\n }, {\n '===': [{\n \"var\": 'data.searchEnabled'\n }, true]\n }]\n }\n }\n}, {\n label: 'Search Threshold',\n mask: false,\n tableView: true,\n alwaysEnabled: false,\n type: 'number',\n input: true,\n key: 'selectThreshold',\n validate: {\n min: 0,\n customMessage: '',\n json: '',\n max: 1\n },\n delimiter: false,\n requireDecimal: false,\n encrypted: false,\n defaultValue: 0.3,\n weight: 22,\n tooltip: 'At what point does the match algorithm give up. A threshold of 0.0 requires a perfect match, a threshold of 1.0 would match anything.'\n}, {\n type: 'checkbox',\n input: true,\n weight: 23,\n key: 'addResource',\n label: 'Add Resource',\n tooltip: 'Allows to create a new resource while entering a submission.',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'resource']\n }\n }\n}, {\n type: 'textfield',\n label: 'Add Resource Label',\n key: 'addResourceLabel',\n tooltip: 'Set the text of the Add Resource button.',\n placeholder: 'Add Resource',\n weight: 24,\n input: true,\n conditional: {\n json: {\n and: [{\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'resource']\n }, {\n '!!': {\n \"var\": 'data.addResource'\n }\n }]\n }\n }\n}, {\n type: 'checkbox',\n input: true,\n weight: 25,\n key: 'reference',\n label: 'Save as reference',\n tooltip: 'Using this option will save this field as a reference and link its value to the value of the origin record.',\n conditional: {\n json: {\n '===': [{\n \"var\": 'data.dataSrc'\n }, 'resource']\n }\n }\n}, {\n type: 'checkbox',\n input: true,\n weight: 27,\n key: 'readOnlyValue',\n label: 'Read Only Value',\n tooltip: 'Check this if you would like to show just the value when in Read Only mode.'\n}, {\n type: 'textarea',\n as: 'json',\n editor: 'ace',\n weight: 28,\n input: true,\n key: 'customOptions',\n label: 'Choices.js options',\n tooltip: 'A raw JSON object to use as options for the Select component (Choices JS).',\n defaultValue: {}\n}, {\n type: 'checkbox',\n input: true,\n weight: 29,\n key: 'useExactSearch',\n label: 'Use exact search',\n tooltip: 'Disables search algorithm threshold.'\n}, {\n key: 'defaultValue',\n onSetItems: function onSetItems(component) {\n setSelectData(component.evalContext());\n },\n onChange: function onChange(context) {\n if (context && context.flags && context.flags.modified) {\n setSelectData(context);\n }\n }\n}, {\n key: 'selectData',\n conditional: {\n json: {\n 'and': [{\n '!==': [{\n \"var\": 'data.valueProperty'\n }, null]\n }, {\n '!==': [{\n \"var\": 'data.valueProperty'\n }, '']\n }]\n }\n }\n}, {\n key: 'template',\n onChange: function onChange(context) {\n if (context && context.flags && context.flags.modified) {\n var defaultValueComponent = context.instance.root.getComponent('defaultValue');\n if (!defaultValueComponent) {\n return;\n }\n setSelectData(defaultValueComponent.evalContext());\n }\n }\n}];\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/components/select/editForm/Select.edit.data.js?"); /***/ }), @@ -2958,7 +2958,7 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.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 if (ctx.component.tooltip) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n
\\n';\nreturn __p\n}\n\n//# sourceURL=webpack://Formio/./lib/templates/bootstrap/checkbox/form.ejs.js?"); +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((__t = (ctx.input.type)) == null ? '' : __t) +\n'\\n ref=\"input\"\\n ';\n for (var attr in ctx.input.attr) { ;\n__p += '\\n ' +\n((__t = (attr)) == null ? '' : __t) +\n'=\"' +\n((__t = (ctx.input.attr[attr])) == null ? '' : __t) +\n'\"\\n ';\n } ;\n__p += '\\n id=\"' +\n((__t = (ctx.instance.id)) == null ? '' : __t) +\n'-' +\n((__t = (ctx.component.key)) == null ? '' : __t) +\n'\"\\n ';\n if (ctx.checked) { ;\n__p += 'checked=true';\n } ;\n__p += '\\n aria-required=\"' +\n((__t = (ctx.component.validate.required)) == null ? '' : __t) +\n'\"\\n aria-labelledby=\"l-' +\n((__t = (ctx.instance.id)) == null ? '' : __t) +\n'-' +\n((__t = (ctx.component.key)) == null ? '' : __t) +\n'\"\\n ';\n if (ctx.component.description) { ;\n__p += '\\n aria-describedby=\"d-' +\n((__t = (ctx.instance.id)) == null ? '' : __t) +\n'-' +\n((__t = (ctx.component.key)) == null ? '' : __t) +\n'\"\\n ';\n } ;\n__p += '\\n >\\n ';\n if (!ctx.self.labelIsHidden()) { ;\n__p += '' +\n((__t = (ctx.input.label)) == null ? '' : __t) +\n'';\n } ;\n__p += '\\n ' +\n((__t = (ctx.input.content)) == null ? '' : __t) +\n'\\n \\n \\n ';\n if (ctx.component.tooltip) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n
\\n';\nreturn __p\n}\n\n//# sourceURL=webpack://Formio/./lib/templates/bootstrap/checkbox/form.ejs.js?"); /***/ }), diff --git a/lib/formio.full.min.css b/lib/formio.full.min.css index 9514fd42..6c2fcdee 100644 --- a/lib/formio.full.min.css +++ b/lib/formio.full.min.css @@ -1,4 +1,4 @@ @charset "UTF-8";.choices{position:relative;overflow:hidden;margin-bottom:24px;font-size:16px}.choices:focus{outline:0}.choices:last-child{margin-bottom:0}.choices.is-open{overflow:visible}.choices.is-disabled .choices__inner,.choices.is-disabled .choices__input{background-color:#eaeaea;cursor:not-allowed;-webkit-user-select:none;user-select:none}.choices.is-disabled .choices__item{cursor:not-allowed}.choices [hidden]{display:none!important}.choices[data-type*=select-one]{cursor:pointer}.choices[data-type*=select-one] .choices__inner{padding-bottom:7.5px}.choices[data-type*=select-one] .choices__input{display:block;width:100%;padding:10px;border-bottom:1px solid #ddd;background-color:#fff;margin:0}.choices[data-type*=select-one] .choices__button{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMDAwIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==);padding:0;background-size:8px;position:absolute;top:50%;right:0;margin-top:-10px;margin-right:25px;height:20px;width:20px;border-radius:10em;opacity:.25}.choices[data-type*=select-one] .choices__button:focus,.choices[data-type*=select-one] .choices__button:hover{opacity:1}.choices[data-type*=select-one] .choices__button:focus{box-shadow:0 0 0 2px #00bcd4}.choices[data-type*=select-one] .choices__item[data-value=""] .choices__button{display:none}.choices[data-type*=select-one]::after{content:"";height:0;width:0;border-style:solid;border-color:#333 transparent transparent transparent;border-width:5px;position:absolute;right:11.5px;top:50%;margin-top:-2.5px;pointer-events:none}.choices[data-type*=select-one].is-open::after{border-color:transparent transparent #333 transparent;margin-top:-7.5px}.choices[data-type*=select-one][dir=rtl]::after{left:11.5px;right:auto}.choices[data-type*=select-one][dir=rtl] .choices__button{right:auto;left:0;margin-left:25px;margin-right:0}.choices[data-type*=select-multiple] .choices__inner,.choices[data-type*=text] .choices__inner{cursor:text}.choices[data-type*=select-multiple] .choices__button,.choices[data-type*=text] .choices__button{position:relative;display:inline-block;margin-top:0;margin-right:-4px;margin-bottom:0;margin-left:8px;padding-left:16px;border-left:1px solid #008fa1;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==);background-size:8px;width:8px;line-height:1;opacity:.75;border-radius:0}.choices[data-type*=select-multiple] .choices__button:focus,.choices[data-type*=select-multiple] .choices__button:hover,.choices[data-type*=text] .choices__button:focus,.choices[data-type*=text] .choices__button:hover{opacity:1}.choices__inner{display:inline-block;vertical-align:top;width:100%;background-color:#f9f9f9;padding:7.5px 7.5px 3.75px;border:1px solid #ddd;border-radius:2.5px;font-size:14px;min-height:44px;overflow:hidden}.is-focused .choices__inner,.is-open .choices__inner{border-color:#b7b7b7}.is-open .choices__inner{border-radius:2.5px 2.5px 0 0}.is-flipped.is-open .choices__inner{border-radius:0 0 2.5px 2.5px}.choices__list{margin:0;padding-left:0;list-style:none}.choices__list--single{display:inline-block;padding:4px 16px 4px 4px;width:100%}[dir=rtl] .choices__list--single{padding-right:4px;padding-left:16px}.choices__list--single .choices__item{width:100%}.choices__list--multiple{display:inline}.choices__list--multiple .choices__item{display:inline-block;vertical-align:middle;border-radius:20px;padding:4px 10px;font-size:12px;font-weight:500;margin-right:3.75px;margin-bottom:3.75px;background-color:#00bcd4;border:1px solid #00a5bb;color:#fff;word-break:break-all;box-sizing:border-box}.choices__list--multiple .choices__item[data-deletable]{padding-right:5px}[dir=rtl] .choices__list--multiple .choices__item{margin-right:0;margin-left:3.75px}.choices__list--multiple .choices__item.is-highlighted{background-color:#00a5bb;border:1px solid #008fa1}.is-disabled .choices__list--multiple .choices__item{background-color:#aaa;border:1px solid #919191}.choices__list--dropdown,.choices__list[aria-expanded]{visibility:hidden;z-index:1;position:absolute;width:100%;background-color:#fff;border:1px solid #ddd;top:100%;margin-top:-1px;border-bottom-left-radius:2.5px;border-bottom-right-radius:2.5px;overflow:hidden;word-break:break-all;will-change:visibility}.is-active.choices__list--dropdown,.is-active.choices__list[aria-expanded]{visibility:visible}.is-open .choices__list--dropdown,.is-open .choices__list[aria-expanded]{border-color:#b7b7b7}.is-flipped .choices__list--dropdown,.is-flipped .choices__list[aria-expanded]{top:auto;bottom:100%;margin-top:0;margin-bottom:-1px;border-radius:.25rem .25rem 0 0}.choices__list--dropdown .choices__list,.choices__list[aria-expanded] .choices__list{position:relative;max-height:300px;overflow:auto;-webkit-overflow-scrolling:touch;will-change:scroll-position}.choices__list--dropdown .choices__item,.choices__list[aria-expanded] .choices__item{position:relative;padding:10px;font-size:14px}[dir=rtl] .choices__list--dropdown .choices__item,[dir=rtl] .choices__list[aria-expanded] .choices__item{text-align:right}@media (min-width:640px){.choices__list--dropdown .choices__item--selectable,.choices__list[aria-expanded] .choices__item--selectable{padding-right:100px}.choices__list--dropdown .choices__item--selectable::after,.choices__list[aria-expanded] .choices__item--selectable::after{content:attr(data-select-text);font-size:12px;opacity:0;position:absolute;right:10px;top:50%;transform:translateY(-50%)}[dir=rtl] .choices__list--dropdown .choices__item--selectable,[dir=rtl] .choices__list[aria-expanded] .choices__item--selectable{text-align:right;padding-left:100px;padding-right:10px}[dir=rtl] .choices__list--dropdown .choices__item--selectable::after,[dir=rtl] .choices__list[aria-expanded] .choices__item--selectable::after{right:auto;left:10px}}.choices__list--dropdown .choices__item--selectable.is-highlighted,.choices__list[aria-expanded] .choices__item--selectable.is-highlighted{background-color:#f2f2f2}.choices__list--dropdown .choices__item--selectable.is-highlighted::after,.choices__list[aria-expanded] .choices__item--selectable.is-highlighted::after{opacity:.5}.choices__item{cursor:default}.choices__item--selectable{cursor:pointer}.choices__item--disabled{cursor:not-allowed;-webkit-user-select:none;user-select:none;opacity:.5}.choices__heading{font-weight:600;font-size:12px;padding:10px;border-bottom:1px solid #f7f7f7;color:gray}.choices__button{text-indent:-9999px;-webkit-appearance:none;appearance:none;border:0;background-color:transparent;background-repeat:no-repeat;background-position:center;cursor:pointer}.choices__button:focus{outline:0}.choices__input{display:inline-block;vertical-align:baseline;background-color:#f9f9f9;font-size:14px;margin-bottom:5px;border:0;border-radius:0;max-width:100%;padding:4px 0 4px 2px}.choices__input:focus{outline:0}.choices__input::-webkit-search-cancel-button,.choices__input::-webkit-search-decoration,.choices__input::-webkit-search-results-button,.choices__input::-webkit-search-results-decoration{display:none}.choices__input::-ms-clear,.choices__input::-ms-reveal{display:none;width:0;height:0}[dir=rtl] .choices__input{padding-right:2px;padding-left:0}.choices__placeholder{opacity:.5}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}dialog{position:absolute;left:0;right:0;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;margin:auto;border:solid;padding:1em;background:#fff;color:#000;display:block}dialog:not([open]){display:none}dialog+.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.1)}._dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0}dialog.fixed{position:fixed;top:50%;transform:translate(0,-50%)}.gu-mirror{position:fixed!important;margin:0!important;z-index:9999!important;opacity:.8;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";filter:alpha(opacity=80)}.gu-hide{display:none!important}.gu-unselectable{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.gu-transit{opacity:.2;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";filter:alpha(opacity=20)}/*! * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?v=4.7.0);src:url(fonts/fontawesome-webfont.eot?#iefix&v=4.7.0) format('embedded-opentype'),url(fonts/fontawesome-webfont.woff2?v=4.7.0) format('woff2'),url(fonts/fontawesome-webfont.woff?v=4.7.0) format('woff'),url(fonts/fontawesome-webfont.ttf?v=4.7.0) format('truetype'),url(fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular) format('svg');font-weight:400;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-close:before,.fa-remove:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-bed:before,.fa-hotel:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-y-combinator:before,.fa-yc:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-television:before,.fa-tv:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:"\f2a3"}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-sign-language:before,.fa-signing:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-address-card:before,.fa-vcard:before{content:"\f2bb"}.fa-address-card-o:before,.fa-vcard-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.formio-loader{position:relative;min-height:60px}.loader-wrapper{z-index:1000;position:absolute;top:0;left:0;bottom:0;right:0;height:120px;background-color:rgba(0,0,0,0)}.loader{position:absolute;left:50%;top:50%;margin-left:-30px;margin-top:-30px;z-index:10000;display:inline-block;border:6px solid #f3f3f3;border-top:6px solid #3498db;border-radius:50%;width:60px;height:60px;animation:spin 2s linear infinite}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.formio-form{position:relative;min-height:80px}.formio-error-wrapper,.formio-warning-wrapper{padding:1em}.formio-error-wrapper{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.formio-error-wrapper .formio-errors .error{color:#c20000}.formio-error-wrapper .field-required:after{color:#c20000}.formio-warning-wrapper{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.formio-disabled-input .form-control.flatpickr-input{background-color:#eee}.builder-component.has-error .invalid-feedback,.formio-component-modal-wrapper.has-error .invalid-feedback,.formio-component-modal-wrapper.has-message .invalid-feedback,.formio-component.alert-danger .invalid-feedback,.formio-component.has-error .invalid-feedback,.formio-component.has-message .invalid-feedback{display:block;color:inherit;margin-top:4px}.formio-errors .error{color:#dc3545}.formio-errors .warning{color:#856404}.formio-errors .info{color:#004085}.formio-form-group{margin-bottom:1rem}.formio-wysiwyg-editor{min-height:200px;background-color:#fff}.has-feedback .form-control{padding-right:10px}.has-feedback .form-control[type=hidden]{padding-right:0}.has-error.bg-danger{padding:4px}.ql-source:after{content:"[source]";white-space:nowrap}.quill-source-code{width:100%;margin:0;background:#1d1d1d;box-sizing:border-box;color:#ccc;font-size:15px;outline:0;padding:20px;line-height:24px;font-family:Consolas,Menlo,Monaco,"Courier New",monospace;position:absolute;top:0;bottom:0;border:none;display:none}.formio-component-tags tags{background-color:#fff}.field-required:after,.tab-error::after{content:" *";color:#eb0000}.field-required:after{position:relative;z-index:10}.glyphicon-spin{-webkit-animation:formio-spin 1s infinite linear;-moz-animation:formio-spin 1s infinite linear;-o-animation:formio-spin 1s infinite linear;animation:formio-spin 1s infinite linear}@-moz-keyframes formio-spin{from{-moz-transform:rotate(0)}to{-moz-transform:rotate(360deg)}}@-webkit-keyframes formio-spin{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(360deg)}}@keyframes formio-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}.button-icon-right{margin-left:5px}.formio-component-submit .submit-success::after{content:"✓";position:relative;right:-4px;top:1px;line-height:1}.formio-component-submit .submit-fail::after{content:"✗";position:relative;right:-4px;top:1px;line-height:1}.card-vertical{display:flex;flex-direction:row;margin-top:5px}.card-vertical .card-body,.tab,.tab-content{flex-grow:2}.nav-tabs-vertical{display:flex;flex-direction:column;border-right:1px solid #ddd;padding-left:5px;margin-right:10px;border-bottom:0}.card-vertical>.card-body,.card-vertical>.tab,.card-vertical>.tab-content{flex-basis:85%}.card-vertical ul>li>.nav-link-vertical{border-right-color:transparent;border-radius:4px 0 0 4px;margin-right:0}.card-vertical ul>li>.nav-link-vertical.active{border-bottom-color:#ddd;border-right-color:transparent}.card-vertical ul>li>.nav-link-vertical.active:hover{border-right-color:transparent}.nav-tabs-vertical>li{margin:0 -1px 0 0}.formio-component-submit .submit-fail[disabled]{opacity:1}.form-control.flatpickr-input{background-color:#fff}.input-group .flatpickr-wrapper{flex-grow:1}.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-calendar .flatpickr-current-month input.cur-year:focus,.flatpickr-calendar .flatpickr-days:focus{outline:auto}td>.form-group,td>.formio-form-group{margin-bottom:0}.signature-pad-body{overflow:hidden;position:relative}.signature-pad-body .form-control-feedback{position:absolute;font-size:.8rem;top:1px;right:3px}.signature-pad-canvas{border-radius:4px;box-shadow:0 0 5px rgba(0,0,0,.02) inset;border:1px solid #f4f4f4}.btn.signature-pad-refresh{position:absolute;left:0;top:0;z-index:1000;padding:3px;line-height:0}[dir=rtl] .btn.signature-pad-refresh{left:unset;right:0}.formio-component-multiple .choices__input{width:100%}.formio-component-multiple .is-invalid{border-color:#f04124}.formio-component-multiple :not(.is-invalid){border-color:#ccc}.choices__list--dropdown .choices__item--selectable{padding-right:0}.signature-pad-refresh img{height:1.2em}.signature-pad-footer{text-align:center;color:#c3c3c3}.is-active.choices__list--dropdown{z-index:100}.choices__list--multiple .choices__item{border-radius:0;padding:2px 8px;line-height:1em;margin-bottom:6px}.choices__list--single{padding:0}.choices__item.choices__item--selectable{white-space:nowrap;overflow:hidden;padding-right:25px;text-overflow:ellipsis}.choices__input{padding:2px}.choices[dir=rtl]>*{text-align:right}.choices[dir=rtl] .choices__list--multiple .choices__item[data-deletable]{padding-left:5px;float:right}.choices[dir=rtl] .choices__list--multiple .choices__item[data-deletable] .choices__button{float:left;margin:0 8px 0 -4px;padding-left:unset;padding-right:16px;border-left:unset;border-right:1px solid #008fa1;overflow:hidden}@-moz-document url-prefix(){.choices__button{float:right}}.formio-component-file .fileSelector{position:relative;padding:15px;border:2px dashed #ddd;text-align:center}.formio-component-file .fileSelector .loader-wrapper{display:none;width:100%;height:100%;background-color:rgba(0,0,0,.1)}.formio-component-file .fileSelector .loader-wrapper .loader{height:45px;width:45px;margin-top:-23px;margin-left:-23px}.formio-component-file .fileSelector a{text-decoration:underline}.formio-component-file .fileSelector.fileDragOver{border-color:#127abe}.formio-component-file .fileSelector .fa,.formio-component-file .fileSelector .glyphicon{font-size:20px;margin-right:5px}[dir=rtl] .formio-component-file .fileSelector .fa,[dir=rtl] .formio-component-file .fileSelector .glyphicon{margin-right:unset;margin-left:5px}.formio-component-file .fileSelector .browse{cursor:pointer}@-webkit-keyframes formio-dialog-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes formio-dialog-fadeout{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes formio-dialog-fadein{0%{opacity:0}100%{opacity:1}}@keyframes formio-dialog-fadein{0%{opacity:0}100%{opacity:1}}.formio-dialog{box-sizing:border-box;font-size:.8em;color:#666}.formio-dialog.formio-modaledit-dialog{font-size:inherit}.formio-dialog *,.formio-dialog :after,.formio-dialog :before{box-sizing:inherit}.formio-dialog{position:fixed;overflow:auto;-webkit-overflow-scrolling:touch;z-index:10000;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.4);animation:formio-dialog-fadein .5s}.formio-dialog.formio-dialog-disabled-animation,.formio-dialog.formio-dialog-disabled-animation .formio-dialog-content,.formio-dialog.formio-dialog-disabled-animation .formio-dialog-overlay{-webkit-animation:none!important;animation:none!important}.formio-dialog-overlay{position:fixed;top:0;right:0;bottom:0;left:0;-webkit-backface-visibility:hidden;-webkit-animation:formio-dialog-fadein .5s;animation:formio-dialog-fadein .5s;margin-right:15px;background:0 0}.formio-dialog-no-overlay{pointer-events:none}.formio-dialog.formio-dialog-closing .formio-dialog-overlay{-webkit-backface-visibility:hidden;-webkit-animation:formio-dialog-fadeout .5s;animation:formio-dialog-fadeout .5s}.formio-dialog-content{background:#fff;-webkit-backface-visibility:hidden;-webkit-animation:formio-dialog-fadein .5s;animation:formio-dialog-fadein .5s;pointer-events:all;overflow:auto}.formio-component-modal-wrapper-select .formio-dialog-content{overflow:initial}.formio-dialog.formio-dialog-closing .formio-dialog-content{-webkit-backface-visibility:hidden;-webkit-animation:formio-dialog-fadeout .5s;animation:formio-dialog-fadeout .5s}.formio-dialog-close:before{font-family:Helvetica,Arial,sans-serif;content:"×";cursor:pointer}body.formio-dialog-open,html.formio-dialog-open{overflow:hidden}.formio-dialog .tab-content{padding-top:12px}.formio-dialog-close{z-index:1000}@-webkit-keyframes formio-dialog-flyin{0%{opacity:0;-webkit-transform:translateY(-40px);transform:translateY(-40px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes formio-dialog-flyin{0%{opacity:0;-webkit-transform:translateY(-40px);transform:translateY(-40px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes formio-dialog-flyout{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-40px);transform:translateY(-40px)}}@keyframes formio-dialog-flyout{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-40px);transform:translateY(-40px)}}.formio-dialog.formio-dialog-theme-default{padding-bottom:160px;padding-top:160px}.formio-dialog.formio-dialog-theme-default .component-edit-container{padding:.5em}.formio-dialog.formio-dialog-theme-default.formio-dialog-closing .formio-dialog-content{-webkit-animation:formio-dialog-flyout .5s;animation:formio-dialog-flyout .5s}.formio-dialog.formio-dialog-theme-default .formio-dialog-content{-webkit-animation:formio-dialog-flyin .5s;animation:formio-dialog-flyin .5s;background:#f0f0f0;border-radius:5px;font-family:Helvetica,sans-serif;font-size:1.1em;line-height:1.5em;margin:0 auto;max-width:100%;padding:1em;position:relative;width:80%}.formio-dialog.formio-dialog-theme-default .formio-dialog-close{border:none;background:0 0;cursor:pointer;position:absolute;right:1px;top:1px;z-index:100}.formio-clickable{cursor:pointer}.component-settings .nav>li>a{padding:8px 10px}.formio-dialog.formio-dialog-theme-default .formio-dialog-close:before{display:block;padding:3px;background:0 0;color:#8a8a8a;content:"×";font-size:26px;font-weight:400;line-height:26px;text-align:center}.formio-dialog.formio-dialog-theme-default .formio-dialog-close:active:before,.formio-dialog.formio-dialog-theme-default .formio-dialog-close:hover:before{color:#777}.formio-dialog.formio-dialog-theme-default .formio-dialog-message{margin-bottom:.5em}.formio-dialog.formio-dialog-theme-default .formio-dialog-input{margin-bottom:1em}.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=email],.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=password],.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=text],.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=url],.formio-dialog.formio-dialog-theme-default .formio-dialog-input textarea{background:#fff;border:0;border-radius:3px;font-family:inherit;font-size:inherit;font-weight:inherit;margin:0 0 .25em;min-height:2.5em;padding:.25em .67em;width:100%}.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=email]:focus,.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=password]:focus,.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=text]:focus,.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=url]:focus,.formio-dialog.formio-dialog-theme-default .formio-dialog-input textarea:focus{box-shadow:inset 0 0 0 2px #8dbdf1;outline:0}.formio-dialog-buttons{display:flex;justify-content:flex-end}.formio-dialog.formio-dialog-theme-default .formio-dialog-buttons{*zoom:1}.formio-dialog.formio-dialog-theme-default .formio-dialog-buttons:after{content:"";display:table;clear:both}.formio-dialog.formio-dialog-theme-default .formio-dialog-button{border:0;border-radius:3px;cursor:pointer;float:right;font-family:inherit;font-size:.8em;letter-spacing:.1em;line-height:1em;margin:0 0 0 .5em;padding:.75em 2em;text-transform:uppercase}.formio-dialog.formio-dialog-theme-default .formio-dialog-button:focus{-webkit-animation:formio-dialog-pulse 1.1s infinite;animation:formio-dialog-pulse 1.1s infinite;outline:0}@media (max-width:568px){.formio-dialog.formio-dialog-theme-default .formio-dialog-button:focus{-webkit-animation:none;animation:none}}.formio-dialog.formio-dialog-theme-default .formio-dialog-button.formio-dialog-button-primary{background:#3288e6;color:#fff}.formio-dialog.formio-dialog-theme-default .formio-dialog-button.formio-dialog-button-secondary{background:#e0e0e0;color:#777}.formio-dialog-content .panel{margin:0}.formio-dialog-content [ref=dialogHeader]{padding-right:15px}.formio-placeholder{position:absolute;color:#999}.formio-dialog .formio-dialog-close{cursor:pointer}.formio-iframe{border:none;width:100%;height:1000px}.inline-form-button{margin-right:10px}.tooltip{opacity:1}.tooltip[x-placement=right] .tooltip-arrow{border-right:5px solid #000}.tooltip[x-placement=right] .tooltip-inner{margin-left:8px}.control-label--bottom{margin-bottom:0;margin-top:5px}.formio-component-label-hidden{position:relative}.formio-hidden{margin:0}.formio-removed{display:none}.control-label--hidden{position:absolute;top:6px;right:5px}.formio-component-datetime .control-label--hidden.field-required{right:45px;z-index:3}.formio-component-selectboxes .control-label--hidden.field-required,.formio-component-survey .control-label--hidden.field-required{top:0}.formio-component-resource .control-label--hidden.field-required,.formio-component-select .control-label--hidden.field-required{right:40px;z-index:2}.formio-component-radio .control-label--hidden.field-required:after,.formio-component-selectboxes .control-label--hidden.field-required:after{display:none}.formio-component-radio.formio-component-label-hidden.required .form-check-label:before,.formio-component-selectboxes.formio-component-label-hidden.required .form-check-label:before{position:relative;content:"* ";color:#eb0000}.formio-component-radio.formio-component-label-hidden.required .label-position-right.form-check-label:before,.formio-component-selectboxes.formio-component-label-hidden.required .label-position-right.form-check-label:before{right:20px}.formio-component-datasource,.formio-component-hidden:not(.formio-component-checkbox){margin-bottom:0}.checkbox-inline label,.radio-inline label{font-weight:400;cursor:pointer}.editgrid-listgroup{margin-bottom:10px;overflow-wrap:break-word}.tree-listgroup{flex-direction:row}.formio-component-submit button[disabled]+.has-error{display:block}.formio-choices.form-group,.formio-choices.formio-form-group{margin-bottom:0}.formio-choices[data-type=select-multiple] .form-control{height:auto}.form-control.formio-multiple-mask-select{width:15%;z-index:4}.form-control.formio-multiple-mask-input{width:85%}.input-group.formio-multiple-mask-container{width:100%}.formio-component .table{margin-bottom:0;word-break:break-word}.formio-component-htmlelement{word-wrap:break-word}.formio-component-htmlelement ol,.formio-component-htmlelement ul{margin-left:10px}.editgrid-table-container{margin-bottom:10px;max-width:calc(100vw - 140px)}.editgrid-table-container .table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.editgrid-table-column{border:none}.editgrid-table-head{border:1px solid #ddd}.editgrid-table-body{border:1px solid #ddd;border-top:0}.formio-hide-label-panel-tooltip{margin-top:-10px;margin-left:-10px}.is-disabled .choices__list--multiple .choices__item{padding:5px 10px}.is-disabled .choices__list--multiple .choices__item .choices__button{display:none}.formio-collapse-icon{cursor:pointer;margin-right:4px}[dir=rtl] .formio-collapse-icon{margin-right:unset;margin-left:4px}.formio-component-dateTime .form-control[type=datetime-local]~.input-group-addon,.formio-component-datetime .form-control[type=datetime-local]~.input-group-addon{width:auto}.formio-component-datagrid .formio-datagrid-remove{position:absolute;top:0;right:0;visibility:hidden;opacity:0;transition:opacity .2s linear,visibility 0s .2s}.formio-component-datagrid{overflow-x:auto}.formio-component-datagrid .datagrid-table,.formio-component-datagrid .datagrid-table td,.formio-component-datagrid .datagrid-table th{border:3px solid #ddd!important;padding:10px}.formio-component-datagrid .datagrid-table>tbody>tr>td:last-child{position:relative}.formio-component-datagrid .datagrid-table>tbody>tr:hover>td:last-child .formio-datagrid-remove{visibility:visible;opacity:1;transition:visibility 0s,opacity .2s linear}.datagrid-table>tbody>tr>td{word-break:auto-phrase}.formio-component-modaledit .formio-modaledit-view-container{position:relative;border:1px solid #ddd;min-height:34px;padding:6px 12px;cursor:text}td .formio-component-modaledit .formio-modaledit-view-container{padding:0;border-style:none}.formio-component-modaledit .formio-modaledit-edit{position:absolute;top:0;left:0;visibility:hidden;opacity:0;transition:opacity .2s linear,visibility 0s .2s}.formio-component-modaledit .formio-modaledit-view-container:hover .formio-modaledit-edit{visibility:visible;opacity:1;transition:visibility 0s,opacity .2s linear}.formio-modaledit-dialog .formio-modaledit-close{position:absolute;top:100%;right:0;border-radius:0}.reset-margins a,.reset-margins abbr,.reset-margins acronym,.reset-margins address,.reset-margins applet,.reset-margins article,.reset-margins aside,.reset-margins audio,.reset-margins b,.reset-margins big,.reset-margins blockquote,.reset-margins body,.reset-margins canvas,.reset-margins caption,.reset-margins center,.reset-margins cite,.reset-margins code,.reset-margins dd,.reset-margins del,.reset-margins details,.reset-margins dfn,.reset-margins div,.reset-margins dl,.reset-margins dt,.reset-margins em,.reset-margins embed,.reset-margins fieldset,.reset-margins figcaption,.reset-margins figure,.reset-margins footer,.reset-margins form,.reset-margins h1,.reset-margins h2,.reset-margins h3,.reset-margins h4,.reset-margins h5,.reset-margins h6,.reset-margins header,.reset-margins hgroup,.reset-margins html,.reset-margins i,.reset-margins iframe,.reset-margins img,.reset-margins ins,.reset-margins kbd,.reset-margins label,.reset-margins legend,.reset-margins li,.reset-margins mark,.reset-margins menu,.reset-margins nav,.reset-margins object,.reset-margins ol,.reset-margins output,.reset-margins p,.reset-margins pre,.reset-margins q,.reset-margins ruby,.reset-margins s,.reset-margins samp,.reset-margins section,.reset-margins small,.reset-margins span,.reset-margins strike,.reset-margins strong,.reset-margins sub,.reset-margins summary,.reset-margins sup,.reset-margins table,.reset-margins tbody,.reset-margins td,.reset-margins tfoot,.reset-margins th,.reset-margins thead,.reset-margins time,.reset-margins tr,.reset-margins tt,.reset-margins u,.reset-margins ul,.reset-margins var,.reset-margins video{margin:0}.ck-body .ck.ck-balloon-panel{z-index:101000}.formio-component-select select[disabled=disabled]{-webkit-appearance:none;-moz-appearance:none;text-indent:1px;text-overflow:""}.formio-component-select .choices.is-disabled[data-type*=select-one]:after,.formio-component-select div[disabled=disabled] button{display:none}.datagrid-group-label.collapsed>td{display:none}.datagrid-group-header.clickable{cursor:pointer}.datagrid-group-header.clickable .datagrid-group-label:before{display:inline-block;vertical-align:middle;content:"▾";margin:0 5px}.datagrid-group-header.clickable.collapsed .datagrid-group-label:before{content:"▸"}.formio-component.alert-danger .help-block,.formio-component.alert-warning .help-block{color:inherit}.tree__level_even{background-color:#f6f6f6}.tree__node-content{margin-bottom:10px;overflow-wrap:break-word}.tree__node-children{margin:0}.formio-select-autocomplete-input{opacity:0;position:relative;z-index:-1;display:block;height:0;border:none}.has-error>.help-block{margin-top:5px;margin-bottom:10px}.no-top-border-table>.table>tbody>tr:first-child>td{border-top:none}.table>tbody>tr>td.cell-align-left{text-align:left}.table>tbody>tr>td.cell-align-center{text-align:center}.table>tbody>tr>td.cell-align-center>div{margin-left:auto;margin-right:auto}.table>tbody>tr>td.cell-align-right{text-align:right}.table>tbody>tr>td.cell-align-right>div{margin-left:auto}.table-responsive[ref=component]{overflow-x:visible}.formio-component-textarea .alert .ck-editor__editable{color:inherit}.formio-component-textarea .ck.ck-editor__editable .image .ck-progress-bar{height:4px}.formio-component-textarea .ck.ck-editor ol,.formio-component-textarea .ck.ck-editor ul{margin-left:10px}div[data-oembed-url]{width:100%}.checkbox label.label-position-bottom,.checkbox label.label-position-left,.checkbox label.label-position-top,.radio label.label-position-bottom,.radio label.label-position-left,.radio label.label-position-top{padding-left:0}.checkbox label.label-position-bottom span,.checkbox label.label-position-top span,.radio label.label-position-bottom span,.radio label.label-position-top span{display:block}.checkbox label.label-position-bottom input[type=checkbox],.checkbox label.label-position-top input[type=checkbox],.radio label.label-position-bottom input[type=radio],.radio label.label-position-top input[type=radio]{position:relative;margin-left:0}.checkbox label.label-position-top input[type=checkbox],.radio label.label-position-top input[type=radio]{margin-top:4px}.checkbox label.label-position-bottom input[type=checkbox],.radio label.label-position-bottom input[type=radio]{margin-bottom:8px}.radio label.label-position-left input[type=radio]{margin-left:10px}.checkbox label.label-position-left input[type=checkbox]{margin-left:4px;position:relative}.open-modal-button{width:100%;text-align:left;white-space:normal;height:auto}.formio-component-modal-wrapper-signature .open-modal-button{text-align:center;height:100%;font-size:1.4em;padding:0;margin:0}.formio-component-content .image{display:table;clear:both;text-align:center;margin:1em auto}.formio-component-content .image>img{display:block;margin:0 auto;max-width:100%;min-width:50px}.formio-component-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:hsl(0deg,0%,20%);background-color:hsl(0deg,0%,97%);padding:.6em;font-size:.75em;outline-offset:-1px}.formio-component-content .image.image_resized{max-width:100%;display:block;box-sizing:border-box}.formio-component-content .image.image_resized img{width:100%}.formio-component-content .image.image_resized>figcaption{display:block}.formio-component-content .media{clear:both;margin:1em 0;display:block;min-width:15em}.formio-component-content .image-style-align-center:not(.image_resized),.formio-component-content .image-style-align-left:not(.image_resized),.formio-component-content .image-style-align-right:not(.image_resized),.formio-component-content .image-style-side:not(.image_resized){max-width:50%}.formio-component-content .image-style-align-center:not(.image_resized),.formio-component-content .image-style-align-left:not(.image_resized),.formio-component-content .image-style-align-right:not(.image_resized),.formio-component-content .image-style-side:not(.image_resized){max-width:50%}.formio-component-content .image-style-align-center:not(.image_resized),.formio-component-content .image-style-align-left:not(.image_resized),.formio-component-content .image-style-align-right:not(.image_resized),.formio-component-content .image-style-side:not(.image_resized){max-width:50%}.formio-component-content .image-style-align-center:not(.image_resized),.formio-component-content .image-style-align-left:not(.image_resized),.formio-component-content .image-style-align-right:not(.image_resized),.formio-component-content .image-style-side:not(.image_resized){max-width:50%}.formio-component-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing)}.formio-component-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.formio-component-content .image-style-align-center{margin-left:auto;margin-right:auto}.formio-component-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.formio-component-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:solid 5px hsl(0deg,0%,80%)}.formio-component-content[dir=rtl] blockquote{border-left:0;border-right:solid 5px hsl(0deg,0%,80%)}.formio-component-content .text-tiny{font-size:.7em}.formio-component-content .text-small{font-size:.85em}.formio-component-content .text-big{font-size:1.4em}.formio-component-content .text-huge{font-size:1.8em}.formio-component-content ol{padding-inline-start:40px}.formio-component-address.formio-component-label-hidden>label.field-required{z-index:1}.formio-component-address.formio-component-label-hidden>label.field-required~.address-autocomplete-container .address-autocomplete-remove-value-icon{right:20px}.address-autocomplete-container{position:relative}.address-autocomplete-container .address-autocomplete-remove-value-icon{cursor:pointer;position:absolute;margin-top:-9px;right:10px;top:50%}.address-autocomplete-container .address-autocomplete-remove-value-icon--hidden{display:none}.autocomplete{background:#fff;font:14px/22px "-apple-system",BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;overflow:auto;box-sizing:border-box;border:1px solid rgba(50,50,50,.6);z-index:11000}.autocomplete>div{cursor:pointer;padding:6px 10px}.autocomplete>div.selected,.autocomplete>div:hover:not(.group){background:#1e90ff;color:#fff}.field-wrapper{display:flex}.field-wrapper--reverse{flex-direction:row-reverse}.field-wrapper .field-label--right{text-align:right}.formio-component-modal-wrapper{margin-bottom:10px}.formio-component-modal-wrapper .open-modal-button{height:auto}.formio-component-modal-wrapper .component-rendering-hidden{visibility:hidden}.formio-component-textarea div.formio-editor-read-only-content[ref=input]{white-space:pre-wrap}.formio-editor-read-only-content img{max-width:100%}.formio-editor-read-only-content li[data-list=bullet]{list-style-type:none}.formio-editor-read-only-content li[data-list=bullet] .ql-ui{padding-right:.5rem}.formio-editor-read-only-content li[data-list=bullet] .ql-ui::before{content:"•"}.formio-editor-read-only-content li[data-list=ordered]{list-style-type:none;counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;counter-increment:list-0}.formio-editor-read-only-content li[data-list=ordered] .ql-ui{padding-right:.5rem}.formio-editor-read-only-content li[data-list=ordered] .ql-ui::before{content:counter(list-0,decimal) ". "}.formio-editor-read-only-content figure.table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3;table-layout:fixed}.formio-editor-read-only-content figure.table table td,.formio-editor-read-only-content figure.table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.formio-component-password .pull-right:not(:last-child),.formio-component-textarea .pull-right:not(:last-child),.formio-component-textfield .pull-right:not(:last-child){padding-left:12px}.formio-form>div>nav>ul.pagination{flex-flow:wrap row;justify-content:flex-start}.formio-form>div>nav>ul.pagination .page-link{cursor:pointer;color:#1c74d9}.formio-form>div>nav>ul.pagination .page-item.active .page-link{color:#fff;background-color:#1c74d9;border-color:#1c74d9}.classic-pagination{border-bottom:solid 1px #e0e0e0;padding:0 15px 10px 15px;line-height:1em}.classic-pagination-page{padding:0;position:relative}.classic-pagination-title{color:#595959;font-size:16px;margin-bottom:5px}.classic-pagination-dot{position:absolute;width:30px;height:30px;display:block;background:#fbe8aa;top:40px;left:50%;margin-top:-15px;margin-left:-15px;border-radius:50%}.classic-pagination-dot::after{content:" ";width:14px;height:14px;background:#fbbd19;border-radius:50px;position:absolute;top:8px;left:8px}.classic-pagination .progress,.classic-pagination-progress{position:relative;border-radius:0;height:8px;box-shadow:none;margin:20px 0;border:none;padding:0;background-color:#f6f6f6}.classic-pagination .progress-bar,.classic-pagination-progress-bar{width:0;height:10px;box-shadow:none;background:#fbe8aa}.classic-pagination-page.complete .classic-pagination-progress-bar,.classic-pagination-page.complete .progress-bar{width:100%}.classic-pagination-page.active .classic-pagination-progress-bar,.classic-pagination-page.active .progress-bar{width:50%}.classic-pagination-page.disabled .classic-pagination-dot{background-color:#f5f5f5}.classic-pagination-page.disabled .classic-pagination-dot::after{opacity:0}.classic-pagination-page:first-child .classic-pagination-progress,.classic-pagination-page:first-child .progress{left:50%;width:50%}.classic-pagination-page:first-child.active .classic-pagination-progress-bar,.classic-pagination-page:first-child.active .progress-bar{width:0%}.classic-pagination-page:last-child .classic-pagination-progress,.classic-pagination-page:last-child .progress{width:50%}.classic-pagination-page:last-child.active .classic-pagination-progress-bar,.classic-pagination-page:last-child.active .progress-bar{width:100%}.pac-container{z-index:11000}[ref=buttonMessageContainer].has-error{cursor:pointer}[ref=passwordStrengthIndicator]{display:inline}.formio-security-indicator{display:flex;height:5px}.formio-security-indicator [class^=security-]{width:100%;height:100%}.formio-security-indicator .security-low{background-color:#c51e00}.formio-security-indicator .security-medium{background-color:#ebb400}.formio-security-indicator .security-high{background-color:#bddf00}.formio-security-indicator .security-very-high{background-color:#009118}.formio-component-textarea .formio-editor-read-only-content .text-big{font-size:1.4em}.formio-component-textarea .formio-editor-read-only-content .text-huge{font-size:1.8em}.formio-component-textarea .formio-editor-read-only-content .text-small{font-size:.85em}.formio-component-textarea .formio-editor-read-only-content .text-tiny{font-size:.7em}.formio-component [ref=valueMaskInput]{display:none}.formio-wizard-nav-container{display:flex}.formio-wizard-nav-container li{margin-right:.5rem}@media not all and (min-width:30em){.formio-wizard-nav-container{flex-direction:column}.formio-wizard-nav-container li{margin-right:0}.formio-wizard-nav-container li .btn{width:100%;margin-bottom:.25rem}}.formio-tooltip__trigger{cursor:pointer}.formio-tooltip__body{background-color:#1b1b1b;border-radius:.25rem;bottom:0;color:#f0f0f0;display:none;font-size:1rem;padding:.5rem;position:absolute;left:0;transform:translateX(-50%);width:auto;white-space:pre;z-index:1000}.formio-tooltip__body.formio-tooltip--is-set{display:block}.formio-tooltip__body--whitespace{white-space:normal;width:250px}.formio-tooltip__body--right{top:auto;transform:translateX(0)}.formio-tooltip__body--left{top:auto;left:0;right:auto;transform:translateX(0)}.formio-tooltip__body--bottom{bottom:auto;top:0}.formio-tooltip__wrapper{position:relative}.formio-tooltip__wrapper>span{font-weight:400}.ace_editor,.ace_editor div,.ace_editor span{font-family:Monaco,Menlo,"Ubuntu Mono","Droid Sans Mono",Consolas,monospace!important}span[role=link]{text-decoration:underline;cursor:pointer}.hidden{display:none!important}.formbuilder{position:relative}.drag-container{padding:10px;border:dotted 2px #e8e8e8}.drag-container:hover{cursor:move;border:dotted 2px #ccc}.drag-container.formio-builder-form,.drag-container.formio-builder-form:hover,.panel-body>.drag-container.formio-builder-components,.panel-body>.drag-container.formio-builder-components:hover,.tab-pane>.drag-container.formio-builder-components,.tab-pane>.drag-container.formio-builder-components:hover{padding:0 0 1rem 0;border:none}.component-btn-group{display:flex;flex-direction:row-reverse;position:absolute;right:0;z-index:1000;margin-top:-2px}.builder-component{position:relative;min-height:15px;margin-bottom:15px}.builder-component .formio-component-htmlelement{border:dotted 2px #e8e8e8}.builder-component .formio-component-htmlelement [ref=html]:empty:before{content:"HTML Content";color:#aaa}.builder-component:not(:hover) .component-btn-group{display:none}.builder-group-button{background-color:transparent;white-space:normal;text-align:left}.form-builder-group-header{padding:0}.component-btn-group .component-settings-button{float:right;z-index:1001;margin:4px 4px 0 0;z-index:1001;-webkit-box-shadow:0 0 10px 1px rgba(48,113,169,.6);-moz-box-shadow:0 0 10px 1px rgba(48,113,169,.6);box-shadow:0 0 10px 1px rgba(48,113,169,.6)}.formbuilder .formio-component-content,.formbuilder .formio-component-datasource,.formbuilder .formio-component-form,.formbuilder .formio-component-hidden{border:2px dashed #ddd}.formbuilder .formio-component-datasource,.formbuilder .formio-component-form,.formbuilder .formio-component-hidden{min-height:3em;text-align:center;color:#aaa;padding-top:.5em}.btn-group-xxs>.btn,.btn-xxs,.component-btn-group .component-settings-button{padding:2px 2px;font-size:10px;line-height:1.2em;border-radius:0;width:18px;height:18px}.formcomponents .formcomponent{text-align:left;padding:5px 5px 5px 8px;margin-top:.2rem;font-size:.8em;line-height:1.2;border-radius:.3em}.form-builder-panel .panel-body{padding:5px}.formio-component-tabs .ui.tabular.menu .item{padding:.8em}.formio-pdf-builder{position:relative}.formio-drop-zone{display:none;position:absolute;z-index:10;background-color:#0d87e9;opacity:.1}.formio-drop-zone.enabled{display:inherit}.component-settings .formio-dialog-content{max-height:100%}.component-settings .formio-dialog-content .ck-editor__editable ol{padding-inline-start:40px}.component-btn-group .btn.component-settings-button-paste{display:none}.builder-paste-mode .component-settings-button-paste{display:inherit!important}.wizard-page-label{cursor:pointer;border-radius:0}.panel-body .drag-and-drop-alert{margin-bottom:0}.builder-sidebar_scroll{position:sticky;top:15px;max-height:100vh;overflow-y:auto}.builder-sidebar_search{margin-bottom:10px;appearance:auto}.formio-wizard-builder-component-title{color:#6c757d;text-align:center;padding:.5rem}.formio-wizard-position{position:relative}.gu-mirror{list-style-type:none}.formio-settings-help{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc;margin-top:10px}.help-block{margin:0}.builder-sidebar .btn{white-space:normal}.component-settings{padding-top:20px!important;padding-bottom:20px!important}.component-edit-container{height:auto;overflow:hidden}.component-edit-content{height:calc(100% - 4em)}.component-edit-tabs.col-sm-6{min-height:87vh;height:100%}.component-edit-tabs.col-sm-12{height:calc(100% - 4em);overflow-y:auto}.component-edit-tabs.col-sm-12 .editForm{height:calc(100% - 4em);overflow-y:auto}.progress.pdf-progress{height:2rem}.progress.pdf-progress .progress-bar{font-size:1rem;line-height:2rem}.builder-sidebar.disabled .formcomponent{cursor:not-allowed;opacity:.65;box-shadow:none}.builder-component-selected{border:2px dashed #919191;outline:0!important} \ No newline at end of file + */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?v=4.7.0);src:url(fonts/fontawesome-webfont.eot?#iefix&v=4.7.0) format('embedded-opentype'),url(fonts/fontawesome-webfont.woff2?v=4.7.0) format('woff2'),url(fonts/fontawesome-webfont.woff?v=4.7.0) format('woff'),url(fonts/fontawesome-webfont.ttf?v=4.7.0) format('truetype'),url(fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular) format('svg');font-weight:400;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-close:before,.fa-remove:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-bed:before,.fa-hotel:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-y-combinator:before,.fa-yc:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-television:before,.fa-tv:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:"\f2a3"}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-sign-language:before,.fa-signing:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-address-card:before,.fa-vcard:before{content:"\f2bb"}.fa-address-card-o:before,.fa-vcard-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.formio-loader{position:relative;min-height:60px}.loader-wrapper{z-index:1000;position:absolute;top:0;left:0;bottom:0;right:0;height:120px;background-color:rgba(0,0,0,0)}.loader{position:absolute;left:50%;top:50%;margin-left:-30px;margin-top:-30px;z-index:10000;display:inline-block;border:6px solid #f3f3f3;border-top:6px solid #3498db;border-radius:50%;width:60px;height:60px;animation:spin 2s linear infinite}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.formio-form{position:relative;min-height:80px}.formio-error-wrapper,.formio-warning-wrapper{padding:1em}.formio-error-wrapper{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.formio-error-wrapper .formio-errors .error{color:#c20000}.formio-error-wrapper .field-required:after{color:#c20000}.formio-warning-wrapper{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.formio-disabled-input .form-control.flatpickr-input{background-color:#eee}.builder-component.has-error .invalid-feedback,.formio-component-modal-wrapper.has-error .invalid-feedback,.formio-component-modal-wrapper.has-message .invalid-feedback,.formio-component.alert-danger .invalid-feedback,.formio-component.has-error .invalid-feedback,.formio-component.has-message .invalid-feedback{display:block;color:inherit;margin-top:4px}.formio-errors .error{color:#dc3545}.formio-errors .warning{color:#856404}.formio-errors .info{color:#004085}.formio-form-group{margin-bottom:1rem}.formio-wysiwyg-editor{min-height:200px;background-color:#fff}.has-feedback .form-control{padding-right:10px}.has-feedback .form-control[type=hidden]{padding-right:0}.has-error.bg-danger{padding:4px}.ql-source:after{content:"[source]";white-space:nowrap}.quill-source-code{width:100%;margin:0;background:#1d1d1d;box-sizing:border-box;color:#ccc;font-size:15px;outline:0;padding:20px;line-height:24px;font-family:Consolas,Menlo,Monaco,"Courier New",monospace;position:absolute;top:0;bottom:0;border:none;display:none}.formio-component-tags tags{background-color:#fff}.field-required:after,.tab-error::after{content:" *";color:#eb0000}.field-required:after{position:relative;z-index:10}.glyphicon-spin{-webkit-animation:formio-spin 1s infinite linear;-moz-animation:formio-spin 1s infinite linear;-o-animation:formio-spin 1s infinite linear;animation:formio-spin 1s infinite linear}@-moz-keyframes formio-spin{from{-moz-transform:rotate(0)}to{-moz-transform:rotate(360deg)}}@-webkit-keyframes formio-spin{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(360deg)}}@keyframes formio-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}.button-icon-right{margin-left:5px}.formio-component-submit .submit-success::after{content:"✓";position:relative;right:-4px;top:1px;line-height:1}.formio-component-submit .submit-fail::after{content:"✗";position:relative;right:-4px;top:1px;line-height:1}.card-vertical{display:flex;flex-direction:row;margin-top:5px}.card-vertical .card-body,.tab,.tab-content{flex-grow:2}.nav-tabs-vertical{display:flex;flex-direction:column;border-right:1px solid #ddd;padding-left:5px;margin-right:10px;border-bottom:0}.card-vertical>.card-body,.card-vertical>.tab,.card-vertical>.tab-content{flex-basis:85%}.card-vertical ul>li>.nav-link-vertical{border-right-color:transparent;border-radius:4px 0 0 4px;margin-right:0}.card-vertical ul>li>.nav-link-vertical.active{border-bottom-color:#ddd;border-right-color:transparent}.card-vertical ul>li>.nav-link-vertical.active:hover{border-right-color:transparent}.nav-tabs-vertical>li{margin:0 -1px 0 0}.formio-component-submit .submit-fail[disabled]{opacity:1}.form-control.flatpickr-input{background-color:#fff}.input-group .flatpickr-wrapper{flex-grow:1}.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-calendar .flatpickr-current-month input.cur-year:focus,.flatpickr-calendar .flatpickr-days:focus{outline:auto}td>.form-group,td>.formio-form-group{margin-bottom:0}.signature-pad-body{overflow:hidden;position:relative}.signature-pad-body .form-control-feedback{position:absolute;font-size:.8rem;top:1px;right:3px}.signature-pad-canvas{border-radius:4px;box-shadow:0 0 5px rgba(0,0,0,.02) inset;border:1px solid #f4f4f4}.btn.signature-pad-refresh{position:absolute;left:0;top:0;z-index:1000;padding:3px;line-height:0}[dir=rtl] .btn.signature-pad-refresh{left:unset;right:0}.formio-component-multiple .choices__input{width:100%}.formio-component-multiple .is-invalid{border-color:#f04124}.formio-component-multiple :not(.is-invalid){border-color:#ccc}.choices__list--dropdown .choices__item--selectable{padding-right:0}.signature-pad-refresh img{height:1.2em}.signature-pad-footer{text-align:center;color:#c3c3c3}.is-active.choices__list--dropdown{z-index:100}.choices__list--multiple .choices__item{border-radius:0;padding:2px 8px;line-height:1em;margin-bottom:6px}.choices__list--single{padding:0}.choices__item.choices__item--selectable{white-space:nowrap;overflow:hidden;padding-right:25px;text-overflow:ellipsis}.choices__input{padding:2px}.choices[dir=rtl]>*{text-align:right}.choices[dir=rtl] .choices__list--multiple .choices__item[data-deletable]{padding-left:5px;float:right}.choices[dir=rtl] .choices__list--multiple .choices__item[data-deletable] .choices__button{float:left;margin:0 8px 0 -4px;padding-left:unset;padding-right:16px;border-left:unset;border-right:1px solid #008fa1;overflow:hidden}@-moz-document url-prefix(){.choices__button{float:right}}.formio-component-file .fileSelector{position:relative;padding:15px;border:2px dashed #ddd;text-align:center}.formio-component-file .fileSelector .loader-wrapper{display:none;width:100%;height:100%;background-color:rgba(0,0,0,.1)}.formio-component-file .fileSelector .loader-wrapper .loader{height:45px;width:45px;margin-top:-23px;margin-left:-23px}.formio-component-file .fileSelector a{text-decoration:underline}.formio-component-file .fileSelector.fileDragOver{border-color:#127abe}.formio-component-file .fileSelector .fa,.formio-component-file .fileSelector .glyphicon{font-size:20px;margin-right:5px}[dir=rtl] .formio-component-file .fileSelector .fa,[dir=rtl] .formio-component-file .fileSelector .glyphicon{margin-right:unset;margin-left:5px}.formio-component-file .fileSelector .browse{cursor:pointer}@-webkit-keyframes formio-dialog-fadeout{0%{opacity:1}100%{opacity:0}}@keyframes formio-dialog-fadeout{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes formio-dialog-fadein{0%{opacity:0}100%{opacity:1}}@keyframes formio-dialog-fadein{0%{opacity:0}100%{opacity:1}}.formio-dialog{box-sizing:border-box;font-size:.8em;color:#666}.formio-dialog.formio-modaledit-dialog{font-size:inherit}.formio-dialog *,.formio-dialog :after,.formio-dialog :before{box-sizing:inherit}.formio-dialog{position:fixed;overflow:auto;-webkit-overflow-scrolling:touch;z-index:10000;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.4);animation:formio-dialog-fadein .5s}.formio-dialog.formio-dialog-disabled-animation,.formio-dialog.formio-dialog-disabled-animation .formio-dialog-content,.formio-dialog.formio-dialog-disabled-animation .formio-dialog-overlay{-webkit-animation:none!important;animation:none!important}.formio-dialog-overlay{position:fixed;top:0;right:0;bottom:0;left:0;-webkit-backface-visibility:hidden;-webkit-animation:formio-dialog-fadein .5s;animation:formio-dialog-fadein .5s;margin-right:15px;background:0 0}.formio-dialog-no-overlay{pointer-events:none}.formio-dialog.formio-dialog-closing .formio-dialog-overlay{-webkit-backface-visibility:hidden;-webkit-animation:formio-dialog-fadeout .5s;animation:formio-dialog-fadeout .5s}.formio-dialog-content{background:#fff;-webkit-backface-visibility:hidden;-webkit-animation:formio-dialog-fadein .5s;animation:formio-dialog-fadein .5s;pointer-events:all;overflow:auto}.formio-component-modal-wrapper-select .formio-dialog-content{overflow:initial}.formio-dialog.formio-dialog-closing .formio-dialog-content{-webkit-backface-visibility:hidden;-webkit-animation:formio-dialog-fadeout .5s;animation:formio-dialog-fadeout .5s}.formio-dialog-close:before{font-family:Helvetica,Arial,sans-serif;content:"×";cursor:pointer}body.formio-dialog-open,html.formio-dialog-open{overflow:hidden}.formio-dialog .tab-content{padding-top:12px}.formio-dialog-close{z-index:1000}@-webkit-keyframes formio-dialog-flyin{0%{opacity:0;-webkit-transform:translateY(-40px);transform:translateY(-40px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes formio-dialog-flyin{0%{opacity:0;-webkit-transform:translateY(-40px);transform:translateY(-40px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes formio-dialog-flyout{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-40px);transform:translateY(-40px)}}@keyframes formio-dialog-flyout{0%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}100%{opacity:0;-webkit-transform:translateY(-40px);transform:translateY(-40px)}}.formio-dialog.formio-dialog-theme-default{padding-bottom:160px;padding-top:160px}.formio-dialog.formio-dialog-theme-default .component-edit-container{padding:.5em}.formio-dialog.formio-dialog-theme-default.formio-dialog-closing .formio-dialog-content{-webkit-animation:formio-dialog-flyout .5s;animation:formio-dialog-flyout .5s}.formio-dialog.formio-dialog-theme-default .formio-dialog-content{-webkit-animation:formio-dialog-flyin .5s;animation:formio-dialog-flyin .5s;background:#f0f0f0;border-radius:5px;font-family:Helvetica,sans-serif;font-size:1.1em;line-height:1.5em;margin:0 auto;max-width:100%;padding:1em;position:relative;width:80%}.formio-dialog.formio-dialog-theme-default .formio-dialog-close{border:none;background:0 0;cursor:pointer;position:absolute;right:1px;top:1px;z-index:100}.formio-clickable{cursor:pointer}.component-settings .nav>li>a{padding:8px 10px}.formio-dialog.formio-dialog-theme-default .formio-dialog-close:before{display:block;padding:3px;background:0 0;color:#8a8a8a;content:"×";font-size:26px;font-weight:400;line-height:26px;text-align:center}.formio-dialog.formio-dialog-theme-default .formio-dialog-close:active:before,.formio-dialog.formio-dialog-theme-default .formio-dialog-close:hover:before{color:#777}.formio-dialog.formio-dialog-theme-default .formio-dialog-message{margin-bottom:.5em}.formio-dialog.formio-dialog-theme-default .formio-dialog-input{margin-bottom:1em}.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=email],.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=password],.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=text],.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=url],.formio-dialog.formio-dialog-theme-default .formio-dialog-input textarea{background:#fff;border:0;border-radius:3px;font-family:inherit;font-size:inherit;font-weight:inherit;margin:0 0 .25em;min-height:2.5em;padding:.25em .67em;width:100%}.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=email]:focus,.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=password]:focus,.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=text]:focus,.formio-dialog.formio-dialog-theme-default .formio-dialog-input input[type=url]:focus,.formio-dialog.formio-dialog-theme-default .formio-dialog-input textarea:focus{box-shadow:inset 0 0 0 2px #8dbdf1;outline:0}.formio-dialog-buttons{display:flex;justify-content:flex-end}.formio-dialog.formio-dialog-theme-default .formio-dialog-buttons:after{content:"";display:table;clear:both}.formio-dialog.formio-dialog-theme-default .formio-dialog-button{border:0;border-radius:3px;cursor:pointer;float:right;font-family:inherit;font-size:.8em;letter-spacing:.1em;line-height:1em;margin:0 0 0 .5em;padding:.75em 2em;text-transform:uppercase}.formio-dialog.formio-dialog-theme-default .formio-dialog-button:focus{-webkit-animation:formio-dialog-pulse 1.1s infinite;animation:formio-dialog-pulse 1.1s infinite;outline:0}@media (max-width:568px){.formio-dialog.formio-dialog-theme-default .formio-dialog-button:focus{-webkit-animation:none;animation:none}}.formio-dialog.formio-dialog-theme-default .formio-dialog-button.formio-dialog-button-primary{background:#3288e6;color:#fff}.formio-dialog.formio-dialog-theme-default .formio-dialog-button.formio-dialog-button-secondary{background:#e0e0e0;color:#777}.formio-dialog-content .panel{margin:0}.formio-dialog-content [ref=dialogHeader]{padding-right:15px}.formio-placeholder{position:absolute;color:#999}.formio-dialog .formio-dialog-close{cursor:pointer}.formio-iframe{border:none;width:100%;height:1000px}.inline-form-button{margin-right:10px}.tooltip{opacity:1}.tooltip[x-placement=right] .tooltip-arrow{border-right:5px solid #000}.tooltip[x-placement=right] .tooltip-inner{margin-left:8px}.control-label--bottom{margin-bottom:0;margin-top:5px}.formio-component-label-hidden{position:relative}.formio-hidden{margin:0}.formio-removed{display:none}.control-label--hidden{position:absolute;top:6px;right:5px}.formio-component-datetime .control-label--hidden.field-required{right:45px;z-index:3}.formio-component-selectboxes .control-label--hidden.field-required,.formio-component-survey .control-label--hidden.field-required{top:0}.formio-component-resource .control-label--hidden.field-required,.formio-component-select .control-label--hidden.field-required{right:40px;z-index:2}.formio-component-radio .control-label--hidden.field-required:after,.formio-component-selectboxes .control-label--hidden.field-required:after{display:none}.formio-component-radio.formio-component-label-hidden.required .form-check-label:before,.formio-component-selectboxes.formio-component-label-hidden.required .form-check-label:before{position:relative;content:"* ";color:#eb0000}.formio-component-radio.formio-component-label-hidden.required .form-check .label-position-right.form-check-label:before,.formio-component-selectboxes.formio-component-label-hidden.required .form-check .label-position-right.form-check-label:before{right:20px}.formio-component-datasource,.formio-component-hidden:not(.formio-component-checkbox){margin-bottom:0}.checkbox-inline label,.radio-inline label{font-weight:400;cursor:pointer}.editgrid-listgroup{margin-bottom:10px;overflow-wrap:break-word}.tree-listgroup{flex-direction:row}.formio-component-submit button[disabled]+.has-error{display:block}.formio-choices.form-group,.formio-choices.formio-form-group{margin-bottom:0}.formio-choices[data-type=select-multiple] .form-control{height:auto}.form-control.formio-multiple-mask-select{width:15%;z-index:4}.form-control.formio-multiple-mask-input{width:85%}.input-group.formio-multiple-mask-container{width:100%}.formio-component .table{margin-bottom:0;word-break:break-word}.formio-component-htmlelement{word-wrap:break-word}.formio-component-htmlelement ol,.formio-component-htmlelement ul{margin-left:10px}.editgrid-table-container{margin-bottom:10px;max-width:calc(100vw - 140px)}.editgrid-table-container .table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.editgrid-table-column{border:none}.editgrid-table-head{border:1px solid #ddd}.editgrid-table-body{border:1px solid #ddd;border-top:0}.formio-hide-label-panel-tooltip{margin-top:-10px;margin-left:-10px}.is-disabled .choices__list--multiple .choices__item{padding:5px 10px}.is-disabled .choices__list--multiple .choices__item .choices__button{display:none}.formio-collapse-icon{cursor:pointer;margin-right:4px}[dir=rtl] .formio-collapse-icon{margin-right:unset;margin-left:4px}.formio-component-dateTime .form-control[type=datetime-local]~.input-group-addon,.formio-component-datetime .form-control[type=datetime-local]~.input-group-addon{width:auto}.formio-component-datagrid .formio-datagrid-remove{position:absolute;top:0;right:0;visibility:hidden;opacity:0;transition:opacity .2s linear,visibility 0s .2s}.formio-component-datagrid{overflow-x:auto}.formio-component-datagrid .datagrid-table,.formio-component-datagrid .datagrid-table td,.formio-component-datagrid .datagrid-table th{border:3px solid #ddd!important;padding:10px}.formio-component-datagrid .datagrid-table>tbody>tr>td:last-child{position:relative}.formio-component-datagrid .datagrid-table>tbody>tr:hover>td:last-child .formio-datagrid-remove{visibility:visible;opacity:1;transition:visibility 0s,opacity .2s linear}.datagrid-table>tbody>tr>td{word-break:auto-phrase}.formio-component-modaledit .formio-modaledit-view-container{position:relative;border:1px solid #ddd;min-height:34px;padding:6px 12px;cursor:text}td .formio-component-modaledit .formio-modaledit-view-container{padding:0;border-style:none}.formio-component-modaledit .formio-modaledit-edit{position:absolute;top:0;left:0;visibility:hidden;opacity:0;transition:opacity .2s linear,visibility 0s .2s}.formio-component-modaledit .formio-modaledit-view-container:hover .formio-modaledit-edit{visibility:visible;opacity:1;transition:visibility 0s,opacity .2s linear}.formio-modaledit-dialog .formio-modaledit-close{position:absolute;top:100%;right:0;border-radius:0}.reset-margins a,.reset-margins abbr,.reset-margins acronym,.reset-margins address,.reset-margins applet,.reset-margins article,.reset-margins aside,.reset-margins audio,.reset-margins b,.reset-margins big,.reset-margins blockquote,.reset-margins body,.reset-margins canvas,.reset-margins caption,.reset-margins center,.reset-margins cite,.reset-margins code,.reset-margins dd,.reset-margins del,.reset-margins details,.reset-margins dfn,.reset-margins div,.reset-margins dl,.reset-margins dt,.reset-margins em,.reset-margins embed,.reset-margins fieldset,.reset-margins figcaption,.reset-margins figure,.reset-margins footer,.reset-margins form,.reset-margins h1,.reset-margins h2,.reset-margins h3,.reset-margins h4,.reset-margins h5,.reset-margins h6,.reset-margins header,.reset-margins hgroup,.reset-margins html,.reset-margins i,.reset-margins iframe,.reset-margins img,.reset-margins ins,.reset-margins kbd,.reset-margins label,.reset-margins legend,.reset-margins li,.reset-margins mark,.reset-margins menu,.reset-margins nav,.reset-margins object,.reset-margins ol,.reset-margins output,.reset-margins p,.reset-margins pre,.reset-margins q,.reset-margins ruby,.reset-margins s,.reset-margins samp,.reset-margins section,.reset-margins small,.reset-margins span,.reset-margins strike,.reset-margins strong,.reset-margins sub,.reset-margins summary,.reset-margins sup,.reset-margins table,.reset-margins tbody,.reset-margins td,.reset-margins tfoot,.reset-margins th,.reset-margins thead,.reset-margins time,.reset-margins tr,.reset-margins tt,.reset-margins u,.reset-margins ul,.reset-margins var,.reset-margins video{margin:0}.ck-body .ck.ck-balloon-panel{z-index:101000}.formio-component-select select[disabled=disabled]{-webkit-appearance:none;-moz-appearance:none;text-indent:1px;text-overflow:""}.formio-component-select .choices.is-disabled[data-type*=select-one]:after,.formio-component-select div[disabled=disabled] button{display:none}.datagrid-group-label.collapsed>td{display:none}.datagrid-group-header.clickable{cursor:pointer}.datagrid-group-header.clickable .datagrid-group-label:before{display:inline-block;vertical-align:middle;content:"▾";margin:0 5px}.datagrid-group-header.clickable.collapsed .datagrid-group-label:before{content:"▸"}.formio-component.alert-danger .help-block,.formio-component.alert-warning .help-block{color:inherit}.tree__level_even{background-color:#f6f6f6}.tree__node-content{margin-bottom:10px;overflow-wrap:break-word}.tree__node-children{margin:0}.formio-select-autocomplete-input{opacity:0;position:relative;z-index:-1;display:block;height:0;border:none}.has-error>.help-block{margin-top:5px;margin-bottom:10px}.no-top-border-table>.table>tbody>tr:first-child>td{border-top:none}.table>tbody>tr>td.cell-align-left{text-align:left}.table>tbody>tr>td.cell-align-center{text-align:center}.table>tbody>tr>td.cell-align-center>div{margin-left:auto;margin-right:auto}.table>tbody>tr>td.cell-align-right{text-align:right}.table>tbody>tr>td.cell-align-right>div{margin-left:auto}.table-responsive[ref=component]{overflow-x:visible}.formio-component-textarea .alert .ck-editor__editable{color:inherit}.formio-component-textarea .ck.ck-editor__editable .image .ck-progress-bar{height:4px}.formio-component-textarea .ck.ck-editor ol,.formio-component-textarea .ck.ck-editor ul{margin-left:10px}div[data-oembed-url]{width:100%}.checkbox label.label-position-bottom,.checkbox label.label-position-left,.checkbox label.label-position-top,.radio label.label-position-bottom,.radio label.label-position-left,.radio label.label-position-top{padding-left:0}.checkbox label.label-position-bottom span,.checkbox label.label-position-top span,.radio label.label-position-bottom span,.radio label.label-position-top span{display:block}.checkbox label.label-position-bottom input[type=checkbox],.checkbox label.label-position-top input[type=checkbox],.radio label.label-position-bottom input[type=radio],.radio label.label-position-top input[type=radio]{position:relative;margin-left:0}.checkbox label.label-position-top input[type=checkbox],.radio label.label-position-top input[type=radio]{margin-top:4px}.checkbox label.label-position-bottom input[type=checkbox],.radio label.label-position-bottom input[type=radio]{margin-bottom:8px}.radio label.label-position-left input[type=radio]{margin-left:10px}.checkbox label.label-position-left input[type=checkbox]{margin-left:4px;position:relative}.open-modal-button{width:100%;text-align:left;white-space:normal;height:auto}.formio-component-modal-wrapper-signature .open-modal-button{text-align:center;height:100%;font-size:1.4em;padding:0;margin:0}.formio-component-content .image{display:table;clear:both;text-align:center;margin:1em auto}.formio-component-content .image>img{display:block;margin:0 auto;max-width:100%;min-width:50px}.formio-component-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:hsl(0deg,0%,20%);background-color:hsl(0deg,0%,97%);padding:.6em;font-size:.75em;outline-offset:-1px}.formio-component-content .image.image_resized{max-width:100%;display:block;box-sizing:border-box}.formio-component-content .image.image_resized img{width:100%}.formio-component-content .image.image_resized>figcaption{display:block}.formio-component-content .media{clear:both;margin:1em 0;display:block;min-width:15em}.formio-component-content .image-style-align-center:not(.image_resized),.formio-component-content .image-style-align-left:not(.image_resized),.formio-component-content .image-style-align-right:not(.image_resized),.formio-component-content .image-style-side:not(.image_resized){max-width:50%}.formio-component-content .image-style-align-center:not(.image_resized),.formio-component-content .image-style-align-left:not(.image_resized),.formio-component-content .image-style-align-right:not(.image_resized),.formio-component-content .image-style-side:not(.image_resized){max-width:50%}.formio-component-content .image-style-align-center:not(.image_resized),.formio-component-content .image-style-align-left:not(.image_resized),.formio-component-content .image-style-align-right:not(.image_resized),.formio-component-content .image-style-side:not(.image_resized){max-width:50%}.formio-component-content .image-style-align-center:not(.image_resized),.formio-component-content .image-style-align-left:not(.image_resized),.formio-component-content .image-style-align-right:not(.image_resized),.formio-component-content .image-style-side:not(.image_resized){max-width:50%}.formio-component-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing)}.formio-component-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.formio-component-content .image-style-align-center{margin-left:auto;margin-right:auto}.formio-component-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.formio-component-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:solid 5px hsl(0deg,0%,80%)}.formio-component-content[dir=rtl] blockquote{border-left:0;border-right:solid 5px hsl(0deg,0%,80%)}.formio-component-content .text-tiny{font-size:.7em}.formio-component-content .text-small{font-size:.85em}.formio-component-content .text-big{font-size:1.4em}.formio-component-content .text-huge{font-size:1.8em}.formio-component-content ol{padding-inline-start:40px}.formio-component-address.formio-component-label-hidden>label.field-required{z-index:1}.formio-component-address.formio-component-label-hidden>label.field-required~.address-autocomplete-container .address-autocomplete-remove-value-icon{right:20px}.address-autocomplete-container{position:relative}.address-autocomplete-container .address-autocomplete-remove-value-icon{cursor:pointer;position:absolute;margin-top:-9px;right:10px;top:50%}.address-autocomplete-container .address-autocomplete-remove-value-icon--hidden{display:none}.autocomplete{background:#fff;font:14px/22px "-apple-system",BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;overflow:auto;box-sizing:border-box;border:1px solid rgba(50,50,50,.6);z-index:11000}.autocomplete>div{cursor:pointer;padding:6px 10px}.autocomplete>div.selected,.autocomplete>div:hover:not(.group){background:#1e90ff;color:#fff}.field-wrapper{display:flex}.field-wrapper--reverse{flex-direction:row-reverse}.field-wrapper .field-label--right{text-align:right}.formio-component-modal-wrapper{margin-bottom:10px}.formio-component-modal-wrapper .open-modal-button{height:auto}.formio-component-modal-wrapper .component-rendering-hidden{visibility:hidden}.formio-component-textarea div.formio-editor-read-only-content[ref=input]{white-space:pre-wrap}.formio-editor-read-only-content img{max-width:100%}.formio-editor-read-only-content li[data-list=bullet]{list-style-type:none}.formio-editor-read-only-content li[data-list=bullet] .ql-ui{padding-right:.5rem}.formio-editor-read-only-content li[data-list=bullet] .ql-ui::before{content:"•"}.formio-editor-read-only-content li[data-list=ordered]{list-style-type:none;counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;counter-increment:list-0}.formio-editor-read-only-content li[data-list=ordered] .ql-ui{padding-right:.5rem}.formio-editor-read-only-content li[data-list=ordered] .ql-ui::before{content:counter(list-0,decimal) ". "}.formio-editor-read-only-content figure.table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3;table-layout:fixed}.formio-editor-read-only-content figure.table table td,.formio-editor-read-only-content figure.table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.formio-component-password .pull-right:not(:last-child),.formio-component-textarea .pull-right:not(:last-child),.formio-component-textfield .pull-right:not(:last-child){padding-left:12px}.formio-form>div>nav>ul.pagination{flex-flow:wrap row;justify-content:flex-start}.formio-form>div>nav>ul.pagination .page-link{cursor:pointer;color:#1c74d9}.formio-form>div>nav>ul.pagination .page-item.active .page-link{color:#fff;background-color:#1c74d9;border-color:#1c74d9}.classic-pagination{border-bottom:solid 1px #e0e0e0;padding:0 15px 10px 15px;line-height:1em}.classic-pagination-page{padding:0;position:relative}.classic-pagination-title{color:#595959;font-size:16px;margin-bottom:5px}.classic-pagination-dot{position:absolute;width:30px;height:30px;display:block;background:#fbe8aa;top:40px;left:50%;margin-top:-15px;margin-left:-15px;border-radius:50%}.classic-pagination-dot::after{content:" ";width:14px;height:14px;background:#fbbd19;border-radius:50px;position:absolute;top:8px;left:8px}.classic-pagination .progress,.classic-pagination-progress{position:relative;border-radius:0;height:8px;box-shadow:none;margin:20px 0;border:none;padding:0;background-color:#f6f6f6}.classic-pagination .progress-bar,.classic-pagination-progress-bar{width:0;height:10px;box-shadow:none;background:#fbe8aa}.classic-pagination-page.complete .classic-pagination-progress-bar,.classic-pagination-page.complete .progress-bar{width:100%}.classic-pagination-page.active .classic-pagination-progress-bar,.classic-pagination-page.active .progress-bar{width:50%}.classic-pagination-page.disabled .classic-pagination-dot{background-color:#f5f5f5}.classic-pagination-page.disabled .classic-pagination-dot::after{opacity:0}.classic-pagination-page:first-child .classic-pagination-progress,.classic-pagination-page:first-child .progress{left:50%;width:50%}.classic-pagination-page:first-child.active .classic-pagination-progress-bar,.classic-pagination-page:first-child.active .progress-bar{width:0%}.classic-pagination-page:last-child .classic-pagination-progress,.classic-pagination-page:last-child .progress{width:50%}.classic-pagination-page:last-child.active .classic-pagination-progress-bar,.classic-pagination-page:last-child.active .progress-bar{width:100%}.pac-container{z-index:11000}[ref=buttonMessageContainer].has-error{cursor:pointer}[ref=passwordStrengthIndicator]{display:inline}.formio-security-indicator{display:flex;height:5px}.formio-security-indicator [class^=security-]{width:100%;height:100%}.formio-security-indicator .security-low{background-color:#c51e00}.formio-security-indicator .security-medium{background-color:#ebb400}.formio-security-indicator .security-high{background-color:#bddf00}.formio-security-indicator .security-very-high{background-color:#009118}.formio-component-textarea .formio-editor-read-only-content .text-big{font-size:1.4em}.formio-component-textarea .formio-editor-read-only-content .text-huge{font-size:1.8em}.formio-component-textarea .formio-editor-read-only-content .text-small{font-size:.85em}.formio-component-textarea .formio-editor-read-only-content .text-tiny{font-size:.7em}.formio-component [ref=valueMaskInput]{display:none}.formio-wizard-nav-container{display:flex}.formio-wizard-nav-container li{margin-right:.5rem}@media not all and (min-width:30em){.formio-wizard-nav-container{flex-direction:column}.formio-wizard-nav-container li{margin-right:0}.formio-wizard-nav-container li .btn{width:100%;margin-bottom:.25rem}}.formio-tooltip__trigger{cursor:pointer}.formio-tooltip__body{background-color:#1b1b1b;border-radius:.25rem;bottom:0;color:#f0f0f0;display:none;font-size:1rem;padding:.5rem;position:absolute;left:0;transform:translateX(-50%);width:auto;white-space:pre;z-index:1000}.formio-tooltip__body.formio-tooltip--is-set{display:block}.formio-tooltip__body--whitespace{white-space:normal;width:250px}.formio-tooltip__body--right{top:auto;transform:translateX(0)}.formio-tooltip__body--left{top:auto;left:0;right:auto;transform:translateX(0)}.formio-tooltip__body--bottom{bottom:auto;top:0}.formio-tooltip__wrapper{position:relative}.formio-tooltip__wrapper>span{font-weight:400}.ace_editor,.ace_editor div,.ace_editor span{font-family:Monaco,Menlo,"Ubuntu Mono","Droid Sans Mono",Consolas,monospace!important}span[role=link]{text-decoration:underline;cursor:pointer}.hidden{display:none!important}.formbuilder{position:relative}.drag-container{padding:10px;border:dotted 2px #e8e8e8}.drag-container:hover{cursor:move;border:dotted 2px #ccc}.drag-container.formio-builder-form,.drag-container.formio-builder-form:hover,.panel-body>.drag-container.formio-builder-components,.panel-body>.drag-container.formio-builder-components:hover,.tab-pane>.drag-container.formio-builder-components,.tab-pane>.drag-container.formio-builder-components:hover{padding:0 0 1rem 0;border:none}.component-btn-group{display:flex;flex-direction:row-reverse;position:absolute;right:0;z-index:1000;margin-top:-2px}.builder-component{position:relative;min-height:15px;margin-bottom:15px}.builder-component .formio-component-htmlelement{border:dotted 2px #e8e8e8}.builder-component .formio-component-htmlelement [ref=html]:empty:before{content:"HTML Content";color:#aaa}.builder-component:not(:hover) .component-btn-group{display:none}.builder-group-button{background-color:transparent;white-space:normal;text-align:left}.form-builder-group-header{padding:0}.component-btn-group .component-settings-button{float:right;z-index:1001;margin:4px 4px 0 0;z-index:1001;-webkit-box-shadow:0 0 10px 1px rgba(48,113,169,.6);-moz-box-shadow:0 0 10px 1px rgba(48,113,169,.6);box-shadow:0 0 10px 1px rgba(48,113,169,.6)}.formbuilder .formio-component-content,.formbuilder .formio-component-datasource,.formbuilder .formio-component-form,.formbuilder .formio-component-hidden{border:2px dashed #ddd}.formbuilder .formio-component-datasource,.formbuilder .formio-component-form,.formbuilder .formio-component-hidden{min-height:3em;text-align:center;color:#aaa;padding-top:.5em}.btn-group-xxs>.btn,.btn-xxs,.component-btn-group .component-settings-button{padding:2px 2px;font-size:10px;line-height:1.2em;border-radius:0;width:18px;height:18px}.formcomponents .formcomponent{text-align:left;padding:5px 5px 5px 8px;margin-top:.2rem;font-size:.8em;line-height:1.2;border-radius:.3em}.form-builder-panel .panel-body{padding:5px}.formio-component-tabs .ui.tabular.menu .item{padding:.8em}.formio-pdf-builder{position:relative}.formio-drop-zone{display:none;position:absolute;z-index:10;background-color:#0d87e9;opacity:.1}.formio-drop-zone.enabled{display:inherit}.component-settings .formio-dialog-content{max-height:100%}.component-settings .formio-dialog-content .ck-editor__editable ol{padding-inline-start:40px}.component-btn-group .btn.component-settings-button-paste{display:none}.builder-paste-mode .component-settings-button-paste{display:inherit!important}.wizard-page-label{cursor:pointer;border-radius:0}.panel-body .drag-and-drop-alert{margin-bottom:0}.builder-sidebar_scroll{position:sticky;top:15px;max-height:100vh;overflow-y:auto}.builder-sidebar_search{margin-bottom:10px;appearance:auto}.formio-wizard-builder-component-title{color:#6c757d;text-align:center;padding:.5rem}.formio-wizard-position{position:relative}.gu-mirror{list-style-type:none}.formio-settings-help{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc;margin-top:10px}.help-block{margin:0}.builder-sidebar .btn{white-space:normal}.component-settings{padding-top:20px!important;padding-bottom:20px!important}.component-edit-container{height:auto;overflow:hidden}.component-edit-content{height:calc(100% - 4em)}.component-edit-tabs.col-sm-6{min-height:87vh;height:100%}.component-edit-tabs.col-sm-12{height:calc(100% - 4em);overflow-y:auto}.component-edit-tabs.col-sm-12 .editForm{height:calc(100% - 4em);overflow-y:auto}.progress.pdf-progress{height:2rem}.progress.pdf-progress .progress-bar{font-size:1rem;line-height:2rem}.builder-sidebar.disabled .formcomponent{cursor:not-allowed;opacity:.65;box-shadow:none}.builder-component-selected{border:2px dashed #919191;outline:0!important} \ No newline at end of file diff --git a/lib/formio.full.min.js b/lib/formio.full.min.js index b1f24fcd..19f06738 100644 --- a/lib/formio.full.min.js +++ b/lib/formio.full.min.js @@ -1,2 +1,2 @@ /*! For license information please see formio.full.min.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Formio=t():e.Formio=t()}(self,(function(){return function(){var e={44964:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n3&&void 0!==arguments[3]&&arguments[3];if(this.events){var o="".concat(this.options.namespace,".").concat(e);return t.id=this.id,t.key=this.key,t.internal=n,this.events[r?"once":"on"](o,t)}}},{key:"once",value:function(e,t,n){return this.on(e,t,n,!0)}},{key:"onAny",value:function(e){if(this.events)return this.events.onAny(e)}},{key:"offAny",value:function(e){if(this.events)return this.events.offAny(e)}},{key:"off",value:function(e,t){var n=this;if(this.events){var r="".concat(this.options.namespace,".").concat(e);this.events.listeners(r).forEach((function(e){e&&e.id===n.id&&(t&&t!==e||n.events.off(r,e))}))}}},{key:"emit",value:function(e){if(this.events){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:null,o=[];if(e)return this.eventHandlers.forEach((function(i,a){i.id!==n.id||!e.removeEventListener||i.type!==t||r&&i.func!==r||(e.removeEventListener(t,i.func),o.push(a))})),o.length&&u.default.pullAt(this.eventHandlers,o),this}},{key:"removeEventListeners",value:function(){var e=this;this.eventHandlers.forEach((function(t){e.id===t.id&&t.type&&t.obj&&t.obj.removeEventListener&&t.obj.removeEventListener(t.type,t.func)})),this.eventHandlers=[]}},{key:"removeAllEvents",value:function(e){var t=this;u.default.each(this.events._events,(function(n,r){u.default.each(n,(function(n){n&&t.id===n.id&&(e||n.internal)&&t.events.off(r,n)}))}))}},{key:"destroy",value:function(){this.removeEventListeners(),this.removeAllEvents()}},{key:"appendTo",value:function(e,t){return null==t||t.appendChild(e),this}},{key:"prependTo",value:function(e,t){if(t)if(t.firstChild)try{t.insertBefore(e,t.firstChild)}catch(n){console.warn(n),t.appendChild(e)}else t.appendChild(e);return this}},{key:"removeChildFrom",value:function(e,t){if(t&&t.contains(e))try{t.removeChild(e)}catch(e){console.warn(e)}return this}},{key:"ce",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=document.createElement(e);return t&&this.attr(r,t),this.appendChild(r,n),r}},{key:"appendChild",value:function(e,t){var n=this;return Array.isArray(t)?t.forEach((function(t){return n.appendChild(e,t)})):t instanceof HTMLElement||t instanceof Text?e.appendChild(t):t&&e.appendChild(this.text(t.toString())),this}},{key:"maskPlaceholder",value:function(e){var t=this;return e.map((function(e){return e instanceof RegExp?t.placeholderChar:e})).join("")}},{key:"placeholderChar",get:function(){var e;return(null===(e=this.component)||void 0===e?void 0:e.inputMaskPlaceholderChar)||"_"}},{key:"setInputMask",value:function(e,t,n){if(e&&t){var r=i.getInputMask(t,this.placeholderChar);this.defaultMask=r;try{e.mask&&e.mask.destroy(),e.mask=(0,s.default)({inputElement:e,mask:r,placeholderChar:this.placeholderChar,shadowRoot:this.root?this.root.shadowRoot:null})}catch(e){console.warn(e)}r.numeric&&e.setAttribute("pattern","\\d*"),n&&e.setAttribute("placeholder",this.maskPlaceholder(r))}}},{key:"t",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o-1)}},{key:"addClass",value:function(e,t){if(!(e&&e instanceof HTMLElement))return this;var n=e.getAttribute("class");return null!=n&&n.includes(t)||e.setAttribute("class","".concat(n," ").concat(t)),this}},{key:"removeClass",value:function(e,t){if(!(e&&t&&e instanceof HTMLElement))return this;var n=e.getAttribute("class");return n&&(n=n.replace(new RegExp(" ".concat(t),"g"),""),e.setAttribute("class",n)),this}},{key:"empty",value:function(e){if(e)for(;e.firstChild;)e.removeChild(e.firstChild)}},{key:"evalContext",value:function(e){var t;return Object.assign({_:u.default,utils:i,util:i,user:o.GlobalFormio.getUser(),moment:l.default,instance:this,self:this,token:o.GlobalFormio.getToken({decode:!0}),config:this.root&&this.root.form&&this.root.form.config?this.root.form.config:null!==(t=this.options)&&void 0!==t&&t.formConfig?this.options.formConfig:{}},e,u.default.get(this.root,"options.evalContext",{}))}},{key:"interpolate",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"function"==typeof e||!this.component.content&&!this.component.html||i.Evaluator.templateSettings.interpolate.test(e)||(e=i.translateHTMLTemplate(String(e),(function(e){return n.t(e)}))),i.interpolate(e,this.evalContext(t),r)}},{key:"evaluate",value:function(e,t,n,r){return i.evaluate(e,this.evalContext(t),n,r)}},{key:"hook",value:function(){var e=arguments[0];if(this.options&&this.options.hooks&&this.options.hooks[e])return this.options.hooks[e].apply(this,Array.prototype.slice.call(arguments,1));var t="function"==typeof arguments[arguments.length-1]?arguments[arguments.length-1]:null;return t?t(null,arguments[1]):arguments[1]}}],n&&p(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=h},85542:function(e,t,n){"use strict";n(69070),n(68304),n(24812),n(30489),n(74819),n(38880),n(12419),n(78011),n(32165),n(66992),n(78783),n(33948),n(4129),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92222),n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r=n(26729),o=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var l=o?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(r,u,l):r[u]=e[u]}return r.default=e,n&&n.set(e,r),r}(n(82531));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function s(e,t){if(t&&("object"===a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=d(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},f.apply(this,arguments)}function d(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function h(e,t,n){return(t=y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){var t=function(e,t){if("object"!==a(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===a(t)?t:String(t)}var m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(a,e);var t,n,r,i=(n=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=p(n);if(r){var o=p(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return s(this,e)});function a(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u(this,a);var l=r.loadLimit,s=void 0===l?1e3:l,d=r.eventsSafeInterval,y=void 0===d?300:d;h(c(n=i.call(this)),"onAny",(function(e){n.on("any",e)})),h(c(n),"offAny",(function(e){n.off("any",e)}));var m=function(){console.warn("There were more than ".concat(s," events emitted in ").concat(y," ms. It might be caused by events' infinite loop"),n.id)},v=o.observeOverload(m,{limit:s,delay:y});return n.emit=function(){for(var r,o,i=arguments.length,u=new Array(i),l=0;l'):"";i+='
'),document.write(i);var a=0,u=setInterval((function(){a++;var t=document.getElementById(r);(t||a>10)&&(n(new d(t,e.src).ready),clearInterval(u))}),10)}))}}],(o=[{key:"create",value:function(e){return this.options&&(this.options.flatten||"flat"===this.options.renderMode)&&(e="form"),this.display=e,a.default.displays[e]?new a.default.displays[e](this.element,this.options):new a.default.displays.webform(this.element,this.options)}},{key:"form",get:function(){return this._form},set:function(e){return this.setForm(e)}},{key:"errorForm",value:function(e){return{components:[{label:"HTML",tag:"div",className:"error error-message alert alert-danger ui red message",attrs:[{attr:"role",value:"alert"}],key:"errorMessage",type:"htmlelement",input:!1,content:"string"==typeof e?e:e.message}]}}},{key:"setForm",value:function(e){var t,n=this;if("string"==typeof(e=e||this.form)){var r,o=new i.GlobalFormio(e);t=this.getSubmission(o,this.options).catch((function(e){r=e})).then((function(t){return o.loadForm().catch((function(e){r=e})).then((function(o){if(r&&(o=n.errorForm(r)),n.instance=n.instance||n.create(o.display),n.instance.url=e,n.instance.nosubmit=!1,n._form=n.instance.form=o,t&&(n.instance.submission=t),r)throw r;return n.instance}))}))}else this.instance=this.instance||this.create(e.display),this._form=this.instance.form=e,t=this.instance.ready;return t.then((function(){return n.element=n.instance.element,n.instance}))}},{key:"getSubmission",value:function(e,t){return e.submissionId?e.loadSubmission(null,t):s.default.resolve()}},{key:"setDisplay",value:function(e){return this.display===e&&this.instance?s.default.resolve(this.instance):(this.form.display=e,this.instance.destroy(),this.instance=this.create(e),this.setForm(this.form))}},{key:"empty",value:function(){if(this.element)for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild)}},{key:"sanitize",value:function(e,t){return!1!==this.options.sanitize||t?l.sanitize(e,this.options):e}},{key:"setContent",value:function(e,t,n){return e instanceof HTMLElement&&(e.innerHTML=this.sanitize(t,n),!0)}},{key:"build",value:function(){var e=this;if(!this.instance)return s.default.reject("Form not ready. Use form.ready promise");if(!this.element)return s.default.reject("No DOM element for form.");var t=this.options&&this.options.template?this.options.template:"bootstrap",n=u.default[t].loader||u.default.bootstrap.loader;return this.setContent(this.element,n.form),this.render().then((function(t){return e.setContent(e.element,t),e.attach(e.element).then((function(){return e.instance}))})).then((function(t){return e.emit("build",t),t}))}},{key:"render",value:function(){var e=this;return this.instance?s.default.resolve(this.instance.render()).then((function(t){return e.emit("render",t),t})):s.default.reject("Form not ready. Use form.ready promise")}},{key:"attach",value:function(e){var t=this;return this.instance?(this.element=e,this.instance.attach(this.element).then((function(e){return t.emit("attach",e),e}))):s.default.reject("Form not ready. Use form.ready promise")}}])&&h(r.prototype,o),c&&h(r,c),Object.defineProperty(r,"prototype",{writable:!1}),d}(o.default);t.default=g,i.GlobalFormio.embedForm=function(e){return g.embed(e)},i.GlobalFormio.createForm=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};if(g(this,e),!(this instanceof e))return new e(t);if(this.base="",this.projectsUrl="",this.projectUrl="",this.projectId="",this.roleUrl="",this.rolesUrl="",this.roleId="",this.formUrl="",this.formsUrl="",this.formId="",this.submissionsUrl="",this.submissionUrl="",this.submissionId="",this.actionsUrl="",this.actionId="",this.actionUrl="",this.vsUrl="",this.vId="",this.vUrl="",this.query="",this.path=t,this.options=r,r.useSessionToken&&e.useSessionToken(r),r.hasOwnProperty("base")?this.base=r.base:e.baseUrl?this.base=e.baseUrl:"undefined"!=typeof window&&(this.base=window.location.href.match(/http[s]?:\/\/api./)[0]),!t)return this.projectUrl=e.projectUrl||"".concat(this.base,"/project"),this.projectsUrl="".concat(this.base,"/project"),this.projectId=!1,void(this.query="");r.hasOwnProperty("project")&&(this.projectUrl=r.project);var o=this.projectUrl||e.projectUrl,i=/(^|\/)(project)($|\/[^/]+)/,a=-1!==t.search(i);o&&this.base===o&&!a&&(this.noProject=!0,this.projectUrl=this.base),0!==t.indexOf("http")&&0!==t.indexOf("//")&&(t=this.base+t);var u=this.getUrlParts(t),l=[],s=u[1]+u[2],c=(t=u.length>3?u[3]:"").split("?");c.length>1&&(t=c[0],this.query="?".concat(c[1]));var f=function(e,r){n["".concat(e,"sUrl")]="".concat(r,"/").concat(e);var o=new RegExp("/".concat(e,"/([^/]+)"));return-1!==t.search(o)&&(l=t.match(o),n["".concat(e,"Url")]=l?r+l[0]:"",n["".concat(e,"Id")]=l.length>1?l[1]:"",r+=l[0]),r},d=function e(t,n,r){for(var o in t)if(t.hasOwnProperty(o)){var i=t[o];if(Array.isArray(i))e(i,n,!0);else{var a=f(i,n);n=r?n:a}}};if(!this.projectUrl||this.projectUrl===this.base)if(this.projectUrl||a||"Subdirectories"!==e.pathType)this.projectUrl=s;else{var p="^".concat(s.replace(/\//g,"\\/"),".[^/]+"),h=o.match(new RegExp(p));this.projectUrl=h?h[0]:s}var y=!1;if(e.pathType&&(y="Subdomains"!==e.pathType),!this.noProject){if(a)d(["project"],s),t=t.replace(i,"");else if(s===this.base){if(u.length>3&&t.split("/").length>1){var m=t.match(/.json/),v=t.split("/");m?this.projectUrl=s:(v.shift(),this.projectId=v.shift(),t="/".concat(v.join("/")),this.projectUrl="".concat(s,"/").concat(this.projectId))}}else u.length>2&&(u[2].split(".").length>2||s.includes("localhost"))&&!y&&(this.projectUrl=s,this.projectId=u[2].split(".")[0]);this.projectsUrl=this.projectsUrl||"".concat(this.base,"/project")}if(d(["role"],this.projectUrl),/(^|\/)(form)($|\/)/.test(t))d(["form",["submission","action","v"]],this.projectUrl);else{var b=new RegExp("/(submission|action|v)($|/.*)"),w=t.match(b);this.pathType=w&&w.length>1?w[1]:"",t=(t=t.replace(b,"")).replace(/\/$/,""),this.formsUrl="".concat(this.projectUrl,"/form"),this.formUrl=t?this.projectUrl+t:"",this.formId=t.replace(/^\/+|\/+$/g,"");var k=["submission","action","v"];for(var O in k)if(k.hasOwnProperty(O)){var _=k[O];this["".concat(_,"sUrl")]="".concat(this.projectUrl+t,"/").concat(_),this.pathType===_&&w.length>2&&w[2]&&(this["".concat(_,"Id")]=w[2].replace(/^\/+|\/+$/g,""),this["".concat(_,"Url")]=this.projectUrl+t+w[0])}}e.projectUrlSet||(e.projectUrl=this.projectUrl)}var t,o,i;return t=e,o=[{key:"delete",value:function(t,n){var o="".concat(t,"Id"),i="".concat(t,"Url");return this[o]?(e.cache={},this.makeRequest(t,this[i],"delete",null,n)):r.default.reject("Nothing to delete")}},{key:"index",value:function(t,n,r){var o="".concat(t,"Url");return(n=n||"")&&x(n)&&(n="?".concat(e.serialize(n.params))),this.makeRequest(t,this[o]+n,"get",null,r)}},{key:"save",value:function(t,n,r){var o="".concat(t,"Id"),i="".concat(t,"Url"),a=this[o]||n._id?"put":"post",u=this[o]?this[i]:this["".concat(t,"sUrl")];return this[o]||!n._id||"put"!==a||u.includes(n._id)||(u+="/".concat(n._id)),e.cache={},this.makeRequest(t,u+this.query,a,n,r)}},{key:"load",value:function(t,n,o){var i="".concat(t,"Id"),a="".concat(t,"Url");if(n&&x(n)&&(n=e.serialize(n.params)),n=n?this.query?"".concat(this.query,"&").concat(n):"?".concat(n):this.query,!this[i])return r.default.reject("Missing ".concat(i));var u=this[a]+n;return"form"!==t||isNaN(parseInt(this.vId))||0===parseInt(this.vId)||(u+=u.match(/\?/)?"&":"?",u+="formRevision=".concat(this.vId)),this.makeRequest(t,u,"get",null,o)}},{key:"makeRequest",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r-1&&("read"===e.defaultPermission&&(a[i.read]=!0),"create"===e.defaultPermission&&(a[i.create]=!0,a[i.read]=!0),"write"===e.defaultPermission&&(a[i.create]=!0,a[i.read]=!0,a[i.update]=!0),"admin"===e.defaultPermission&&(a[i.create]=!0,a[i.read]=!0,a[i.update]=!0,a[i.delete]=!0))}))}})),a}))}},{key:"canSubmit",value:function(){var t=this;return this.userPermissions().then((function(n){return!n.create&&e.getUser()?t.userPermissions(null).then((function(t){return!!t.create&&(e.setUser(null),!0)})):n.create}))}},{key:"getUrlParts",value:function(t){return e.getUrlParts(t,this)}}],i=[{key:"useSessionToken",value:function(t){var n="".concat(t.namespace||e.namespace||"formio","Token"),r=localStorage.getItem(n);r&&(localStorage.removeItem(n),sessionStorage.setItem(n,r));var o="".concat(t.namespace||e.namespace||"formio","User"),i=localStorage.getItem(o);i&&(localStorage.removeItem(o),sessionStorage.setItem(o,i)),localStorage.setItem("useSessionToken",!0)}},{key:"loadProjects",value:function(t,n){return x(t=t||"")&&(t="?".concat(e.serialize(t.params))),e.makeStaticRequest("".concat(e.baseUrl,"/project").concat(t),"GET",null,n)}},{key:"getUrlParts",value:function(t,n){var r=n&&n.base?n.base:e.baseUrl,o="^(http[s]?:\\/\\/)";return r&&0===t.indexOf(r)?o+="(".concat(r.replace(/^http[s]?:\/\//,""),")"):o+="([^/]+)",o+="($|\\/.*)",t.match(new RegExp(o))}},{key:"serialize",value:function(e,t){var n,r=[];for(var o in e)e.hasOwnProperty(o)&&r.push("".concat(encodeURIComponent(o),"=").concat(encodeURIComponent((n=e[o],t?t(n):n))));return r.join("&")}},{key:"getRequestArgs",value:function(e,t,n,r,o,i){r=(r||"GET").toUpperCase(),i&&x(i)||(i={});var a={url:n,method:r,data:o||null,opts:i};return t&&(a.type=t),e&&(a.formio=e),a}},{key:"makeStaticRequest",value:function(t,n,r,o){var i=e.getRequestArgs(null,"",t,n,r,o),a=e.pluginWait("preRequest",i).then((function(){return e.pluginGet("staticRequest",i).then((function(t){return P(t)?e.request(i.url,i.method,i.data,i.opts.header,i.opts):t}))}));return e.pluginAlter("wrapStaticRequestPromise",a,i)}},{key:"makeRequest",value:function(t,n,r,o,i,a){if(!t)return e.makeStaticRequest(r,o,i,a);var u=e.getRequestArgs(t,n,r,o,i,a);u.opts=u.opts||{},u.opts.formio=t,u.opts.headers||(u.opts.headers={}),u.opts.headers=(0,f.default)(u.opts.headers,{Accept:"application/json","Content-type":"application/json"});var l=e.pluginWait("preRequest",u).then((function(){return e.pluginGet("request",u).then((function(t){return P(t)?e.request(u.url,u.method,u.data,u.opts.header,u.opts):t}))}));return e.pluginAlter("wrapRequestPromise",l,u)}},{key:"request",value:function(t,n,o,i,a){if(!t)return r.default.reject("No url provided");var u=e;n=(n||"GET").toUpperCase(),O(a)===O(!0)&&(a={ignoreCache:a}),a&&x(a)||(a={});var l=btoa(encodeURI(t));if(!a.ignoreCache&&"GET"===n&&u.cache.hasOwnProperty(l))return r.default.resolve(E(u.cache[l]));var s=i||new j(a.headers||{Accept:"application/json","Content-type":"application/json"}),c=u.getToken(a);c&&!a.noToken&&s.append("x-jwt-token",c);var f={};s.forEach((function(e,t){f[t]=e}));var d={method:n,headers:f,mode:"cors"};o&&(d.body=JSON.stringify(o)),((d=u.pluginAlter("requestOptions",d,t)).namespace||u.namespace)&&(a.namespace=d.namespace||u.namespace);var p=d.headers["x-jwt-token"],h=u.pluginAlter("wrapFetchRequestPromise",u.fetch(t,d),{url:t,method:n,data:o,opts:a}).then((function(e){if(!(e=u.pluginAlter("requestResponse",e,u,o)).ok){if(440===e.status)u.setToken(null,a),u.events.emit("formio.sessionExpired",e.body);else if(401===e.status)u.events.emit("formio.unauthorized",e.body);else if(416===e.status)u.events.emit("formio.rangeIsNotSatisfiable",e.body);else if(504===e.status)return r.default.reject(new Error("Network request failed"));return(e.headers.get("content-type").includes("application/json")?e.json():e.text()).then((function(e){return r.default.reject(e)}))}var i=e.headers.get("x-jwt-token"),l=!1;return"GET"!==n||p||!i||a.external||t.includes("token=")||t.includes("x-jwt-token=")||(console.warn("Token was introduced in request."),l=!0),e.status>=200&&e.status<300&&i&&""!==i&&!l&&u.setToken(i,a),204===e.status?{}:(e.headers.get("content-type").includes("application/json")?e.json():e.text()).then((function(t){var n=e.headers.get("content-range");if(n&&x(t)){if("*"!==(n=n.split("/"))[0]){var r=n[0].split("-");t.skip=Number(r[0]),t.limit=r[1]-r[0]+1}t.serverCount="*"===n[1]?n[1]:Number(n[1])}if(!a.getHeaders)return t;var o={};return e.headers.forEach((function(e,t){o[t]=e})),{result:t,headers:o}}))})).then((function(e){return a.getHeaders?e:("GET"===n&&(u.cache[l]=e),E(e))})).catch((function(e){return"Bad Token"===e&&(u.setToken(null,a),u.events.emit("formio.badToken",e)),e.message&&((e=new Error("Could not connect to API server (".concat(e.message,"): ").concat(t))).networkError=!0),"GET"===n&&delete u.cache[l],r.default.reject(e)}));return h}},{key:"token",get:function(){return e.tokens||(e.tokens={}),e.tokens.formioToken||""},set:function(t){e.tokens||(e.tokens={}),e.tokens.formioToken=t||""}},{key:"setToken",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;t=t||"";var o="".concat((n="string"==typeof n?{namespace:n}:n||{}).namespace||e.namespace||"formio","Token");e.tokens||(e.tokens={});var i=localStorage.getItem("useSessionToken")?sessionStorage:localStorage;if(!t){n.fromUser||(n.fromToken=!0,e.setUser(null,n));try{i.removeItem(o)}catch(e){a.default.erase(o,{path:"/"})}return e.tokens[o]=t,r.default.resolve(null)}if(e.tokens[o]!==t){e.tokens[o]=t;try{i.setItem(o,t)}catch(e){a.default.set(o,t,{path:"/"})}}return this.currentUserResolved?e.currentUser(n.formio,n):r.default.resolve(null)}},{key:"getToken",value:function(t){var n="".concat((t="string"==typeof t?{namespace:t}:t||{}).namespace||e.namespace||"formio","Token"),r=t.decode?"".concat(n,"Decoded"):n;if(e.tokens||(e.tokens={}),e.tokens[r])return e.tokens[r];try{var o=localStorage.getItem("useSessionToken")?sessionStorage.getItem(n):localStorage.getItem(n);return e.tokens[n]=o||"",t.decode?(e.tokens[r]=e.tokens[n]?(0,p.default)(e.tokens[n]):{},e.tokens[r]):e.tokens[n]}catch(t){return e.tokens[n]=a.default.get(n),e.tokens[n]}}},{key:"oauthLogoutURI",value:function(t,n){var r="".concat((n="string"==typeof n?{namespace:n}:n||{}).namespace||e.namespace||"formio","LogoutAuthUrl");return e.tokens[r],localStorage.setItem(r,t),e.tokens[r]}},{key:"setUser",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="".concat(n.namespace||e.namespace||"formio","User"),o=localStorage.getItem("useSessionToken")?sessionStorage:localStorage;if(!t){n.fromToken||(n.fromUser=!0,e.setToken(null,n)),e.events.emit("formio.user",null);try{return o.removeItem(r)}catch(e){return a.default.erase(r,{path:"/"})}}try{o.setItem(r,JSON.stringify(t))}catch(e){a.default.set(r,JSON.stringify(t),{path:"/"})}e.events.emit("formio.user",t)}},{key:"getUser",value:function(t){var n="".concat((t=t||{}).namespace||e.namespace||"formio","User");try{return JSON.parse((localStorage.getItem("useSessionToken")?sessionStorage:localStorage).getItem(n)||null)}catch(e){return JSON.parse(a.default.get(n))}}},{key:"setBaseUrl",value:function(t){e.baseUrl=t,e.projectUrlSet||(e.projectUrl=t)}},{key:"getBaseUrl",value:function(){return e.baseUrl}},{key:"setApiUrl",value:function(t){return e.setBaseUrl(t)}},{key:"getApiUrl",value:function(){return e.getBaseUrl()}},{key:"setAppUrl",value:function(t){console.warn("Formio.setAppUrl() is deprecated. Use Formio.setProjectUrl instead."),e.projectUrl=t,e.projectUrlSet=!0}},{key:"setProjectUrl",value:function(t){e.projectUrl=t,e.projectUrlSet=!0}},{key:"setAuthUrl",value:function(t){e.authUrl=t}},{key:"getAppUrl",value:function(){return console.warn("Formio.getAppUrl() is deprecated. Use Formio.getProjectUrl instead."),e.projectUrl}},{key:"getProjectUrl",value:function(){return e.projectUrl}},{key:"clearCache",value:function(){e.cache={}}},{key:"noop",value:function(){}},{key:"identity",value:function(e){return e}},{key:"deregisterPlugin",value:function(t){var n=e.plugins.length;return e.plugins=e.plugins.filter((function(n){return n!==t&&n.__name!==t||((n.deregister||e.noop).call(t,e),!1)})),n!==e.plugins.length}},{key:"registerPlugin",value:function(t,n){var r=e;r.plugins.push(t),r.plugins.sort((function(e,t){return(t.priority||0)-(e.priority||0)})),t.__name=n,(t.init||r.noop).call(t,r)}},{key:"getPlugin",value:function(t){var n,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=v(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e.plugins);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.__name===t)return o}}catch(e){r.e(e)}finally{r.f()}return null}},{key:"pluginWait",value:function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i2?r-2:0),i=2;i1&&(e[n[0]]=n[1]&&decodeURIComponent(n[1]))})),t.forEach((function(t){(n=t.split("=")).length>1?e[n[0]]=n[1]&&decodeURIComponent(n[1]):0===t.indexOf("/")&&(e.paths=t.substr(1).split("/"))})),e}},{key:"oAuthCurrentUser",value:function(t,n){return e.currentUser(t,{external:!0,headers:{Authorization:"Bearer ".concat(n)}})}},{key:"samlInit",value:function(t){t=t||{};var n=e.pageQuery();if(n.saml){e.setUser(null);var r=e.setToken(n.saml),o=window.location.toString();return o=o.substring(0,o.indexOf("?")),window.location.hash&&(o+=window.location.hash),window.history.replaceState({},document.title,o),r}t.relay||(t.relay=window.location.href);var i=e.authUrl||e.projectUrl;return window.location.href="".concat(i,"/saml/sso?relay=").concat(encodeURI(t.relay)),!1}},{key:"oktaInit",value:function(t){if(t=t||{},void 0!==("undefined"==typeof OktaAuth?"undefined":O(OktaAuth))&&(t.OktaAuth=OktaAuth),void 0===O(t.OktaAuth)){var n="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.";return console.warn(n),r.default.reject(n)}return new r.default((function(n,r){var o=t.OktaAuth;delete t.OktaAuth;var i=new o(t);i.tokenManager.get("accessToken").then((function(o){o?n(e.oAuthCurrentUser(t.formio,o.accessToken)):location.hash?i.token.parseFromUrl().then((function(r){i.tokenManager.add("accessToken",r),n(e.oAuthCurrentUser(t.formio,r.accessToken))})).catch((function(e){console.warn(e),r(e)})):(i.token.getWithRedirect({responseType:"token",scopes:t.scopes}),n(!1))})).catch((function(e){r(e)}))}))}},{key:"ssoInit",value:function(t,n){switch(t){case"saml":return e.samlInit(n);case"okta":return e.oktaInit(n);default:return console.warn("Unknown SSO type"),r.default.reject("Unknown SSO type")}}},{key:"requireLibrary",value:function(t,n,o,i,a){if(!e.libraries.hasOwnProperty(t)){e.libraries[t]={},e.libraries[t].ready=new r.default((function(n,r){e.libraries[t].resolve=n,e.libraries[t].reject=r}));var u="".concat(t,"Callback");i||window[u]||(window[u]=function(){return e.libraries[t].resolve()});var l=(0,s.default)(window,n);if(l)e.libraries[t].resolve(l);else if((o=Array.isArray(o)?o:[o]).forEach((function(n){var r={},o="";switch("string"==typeof n&&(n={type:"script",src:n}),n.type){case"script":o="script",r={src:n.src,type:"text/javascript",defer:!0,async:!0,referrerpolicy:"origin"};break;case"styles":o="link",r={href:n.src,rel:"stylesheet"}}var i=document.createElement(o);if(i.setAttribute)for(var u in r)i.setAttribute(u,r[u]);a&&i.addEventListener("load",(function(){e.libraries[t].loaded=!0,a(e.libraries[t].ready)}));var l=document.head;l&&l.appendChild(i)})),i)var c=setInterval((function(){var r=(0,s.default)(window,n);r&&(clearInterval(c),e.libraries[t].resolve(r))}),200)}var f=e.libraries[t];return a&&f.loaded?a(f.ready):f.ready}},{key:"libraryReady",value:function(t){return e.libraries.hasOwnProperty(t)&&e.libraries[t].ready?e.libraries[t].ready:r.default.reject("".concat(t," library was not required."))}},{key:"addToGlobal",value:function(t){"object"!==O(t)||t.Formio||(t.Formio=e)}},{key:"setPathType",value:function(t){"string"==typeof t&&(e.pathType=t)}},{key:"getPathType",value:function(){return e.pathType}},{key:"rulesEntities",get:function(){return{ValueSources:e.ValueSources,Conjunctions:e.Conjunctions,Operators:e.Operators,Transformers:e.Transformers,QuickRules:e.QuickRules,Rules:e.Rules}}},{key:"GlobalFormio",get:function(){return void 0!==n.g&&n.g.Formio?n.g.Formio:"undefined"!=typeof window&&window.Formio?window.Formio:e}}],o&&w(t.prototype,o),i&&w(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();C=T,(A=k(A="currentUserResolved"))in C?Object.defineProperty(C,A,{value:true,enumerable:!0,configurable:!0,writable:!0}):C[A]=true,T.libraries={},T.Promise=r.default,T.fetch=S,T.Headers=j,T.baseUrl="https://api.form.io",T.projectUrl=T.baseUrl,T.authUrl="",T.projectUrlSet=!1,T.plugins=[],T.cache={},T.Providers=u.default,T.version="4.19.1",T.pathType="",T.events=new i.default,T.cdn=new h.default,(T.version||"").includes("rc")&&T.cdn.setBaseUrl("https://cdn.test-form.io"),void 0!==n.g&&T.addToGlobal(n.g),"undefined"!=typeof window&&T.addToGlobal(window);var R=T.GlobalFormio;t.GlobalFormio=R;var M=T;t.default=M},48254:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(47941),n(57327),n(89554),n(54747),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(41539),n(88674),n(69826),n(69600),n(68309),n(73210),n(68304),n(24812),n(30489);var o=l(n(91459)),i=n(19161),a=l(n(12215)),u=n(82531);function l(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return this.postMessage({name:"getErrors"}),this.getSubmission().then((function(){return p(v(d.prototype),"submitForm",e).call(e,t)}))}},{key:"getSrc",value:function(){if(!this._form||!this._form.settings||!this._form.settings.pdf)return"";var e="".concat(this._form.settings.pdf.src,".html"),t=["id=".concat(this.id)];return(this.options.showCheckboxBackground||this._form.settings.showCheckboxBackground)&&t.push("checkboxbackground=1"),this.options.readOnly&&t.push("readonly=1"),this.options.zoom&&t.push("zoom=".concat(this.options.zoom)),this.builderMode&&t.push("builder=1"),t.length&&(e+="?".concat(t.join("&"))),e}},{key:"setForm",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return p(v(d.prototype),"setForm",this).call(this,e,n).then((function(){t.formio&&(e.projectUrl=t.formio.projectUrl,e.url=t.formio.formUrl,e.base=t.formio.base,t.postMessage({name:"token",data:t.formio.getToken()})),t.postMessage({name:"form",data:t.form})}))}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=p(v(d.prototype),"setValue",this).call(this,e,n);return n&&n.fromIframe||this.once("iframe-ready",(function(){r&&t.postMessage({name:"submission",data:e})})),r}},{key:"postMessage",value:function(e){var t=this;this.iframeReady&&(e.type||(e.type="iframe-data"),this.iframeReady.then((function(){!t.iframeElement||!t.iframeElement.contentWindow||"form"===e.name&&t.iframeFormSetUp||(t.iframeElement.contentWindow.postMessage(JSON.stringify(e),"*"),t.iframeFormSetUp="form"===e.name)})))}},{key:"focusOnComponent",value:function(e){this.postMessage({name:"focusErroredField",data:e})}},{key:"clear",value:function(){}},{key:"showErrors",value:function(e,t){var n,r=document.getElementById("submit-error"),o=this.t("submitError"),i=(null===(n=this.refs.buttonMessage)||void 0===n?void 0:n.textContent.trim())===o;if(!r&&this.errors.length&&!i){var a=this.ce("p",{class:"help-block"});this.setContent(a,o),a.addEventListener("click",(function(){window.scrollTo(0,0)}));var u=this.ce("div",{id:"submit-error",class:"has-error"});this.appendTo(a,u),this.appendTo(u,this.element)}!this.errors.length&&r&&r.remove(),p(v(d.prototype),"showErrors",this).call(this,e,t)}},{key:"isSubmitButtonHidden",value:function(){var e=!1;return(0,u.eachComponent)(this.component.components,(function(t){"button"!==t.type||"submit"!==t.action&&t.action||(e=t.hidden||!1)})),e}}],n&&f(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),d}(a.default);t.default=b,"undefined"!=typeof window&&window.addEventListener("message",(function(e){var t=null;try{t=JSON.parse(e.data)}catch(e){t=null}t&&t.name&&t.formId&&i.GlobalFormio.forms.hasOwnProperty(t.formId)&&i.GlobalFormio.forms[t.formId].emit("iframe-".concat(t.name),t.data)}))},6487:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(79753),n(32165),n(91038),n(47042),n(68309),n(74916),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(21249),n(92222),n(66992),n(41539),n(78783),n(33948),n(60285),n(41637),n(26699),n(32023),n(24812),n(89554),n(54747),n(65743),n(68304),n(30489);var o=d(n(96486)),i=d(n(91459)),a=n(19161),u=d(n(95529)),l=n(82531),s=n(32725),c=d(n(1848)),f=d(n(48254));function d(e){return e&&e.__esModule?e:{default:e}}function p(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n98?t.t("Converting PDF. Please wait."):"".concat(t.t("Uploading")," ").concat(n,"%")}}),"".concat(this.projectUrl,"/upload"),{},"file").then((function(e){var n,r=!1;if(null!==(n=e.data.formfields)&&void 0!==n&&n.components&&e.data.formfields.components.length){var i,a,u,l="submit"===(null===(i=t.webform.form.components[0])||void 0===i?void 0:i.key),s="page1"===(null===(a=t.webform.form.components[0])||void 0===a?void 0:a.key)&&0===(null===(u=t.webform.form.components[0])||void 0===u?void 0:u.components.length),c=0===t.webform.form.components.length;(l||s||c)&&(r=!0,t.webform.form.components=e.data.formfields.components)}t.refs.dragDropText&&(t.refs.dragDropText.style.display="inherit"),t.refs.uploadProgressWrapper&&(t.refs.uploadProgressWrapper.style.display="none"),o.default.set(t.webform.form,"settings.pdf",{id:e.data.file,src:e.data.filesServer?"".concat(e.data.filesServer).concat(e.data.path):"".concat(new URL(t.projectUrl).origin,"/pdf-proxy").concat(e.data.path),nonFillableConversionUsed:r&&e.data.formfields.nonFillableConversionUsed}),t.emit("pdfUploaded",e.data),t.redraw()})).catch((function(e){return t.setUploadError(e)}))}},{key:"setUploadError",value:function(e){this.refs.uploadError&&(this.refs.uploadError.style.display=e?"":"none",this.refs.uploadError.innerHTML=e)}},{key:"createForm",value:function(e){var t=this;return e.skipInit=!1,e.hideLoader=!0,this.webform=new f.default(this.element,e),this.webform.on("attach",(function(){t.refs.iframeDropzone&&!p(t.refs.form.children).includes(t.refs.iframeDropzone)&&t.prependTo(t.refs.iframeDropzone,t.refs.form)})),this.webform}},{key:"destroy",value:function(e){v(k(h.prototype),"destroy",this).call(this,e),this.webform.destroy(e)}},{key:"getParentContainer",value:function(e){var t=[],n=null;return(0,s.eachComponent)(this.webform._form.components,(function(r,o,i){if(r.id===e.component.id)return t=i,n=r,!0}),!0),{formioComponent:e.parent,formioContainer:t,originalComponent:n}}},{key:"initIframeEvents",value:function(){var e=this;this.webform.off("iframe-elementUpdate"),this.webform.off("iframe-componentUpdate"),this.webform.off("iframe-componentClick"),this.webform.on("iframe-elementUpdate",(function(t){var n=e.webform.getComponentById(t.id);return n&&n.component&&(n.component.overlay={page:t.page,left:t.left,top:t.top,height:t.height,width:t.width},e.options.noNewEdit||n.component.noNewEdit||e.editComponent(n.component,e.getParentContainer(n),!0),e.emit("updateComponent",n.component)),n})),this.webform.on("iframe-componentUpdate",(function(t){var n=e.webform.getComponentById(t.id);return n&&n.component&&(n.component.overlay={page:t.overlay.page,left:t.overlay.left,top:t.overlay.top,height:t.overlay.height,width:t.overlay.width},e.emit("updateComponent",n.component),e.emit("change",e.form)),n})),this.webform.on("iframe-componentClick",(function(t){var n=e.webform.getComponentById(t.id);n&&e.editComponent(n.component,e.getParentContainer(n))}),!0)}},{key:"initDropzoneEvents",value:function(){this.refs.iframeDropzone&&(this.removeEventListener(this.refs.iframeDropzone,"dragover"),this.removeEventListener(this.refs.iframeDropzone,"drop"),this.addEventListener(this.refs.iframeDropzone,"dragover",(function(e){return e.preventDefault(),!1})),this.addEventListener(this.refs.iframeDropzone,"drop",this.onDropzoneDrop.bind(this)))}},{key:"updateDragAndDrop",value:function(){this.pdfLoaded&&(this.initDropzoneEvents(),this.prepSidebarComponentsForDrag())}},{key:"prepSidebarComponentsForDrag",value:function(){var e=this;this.refs["sidebar-container"]&&this.refs["sidebar-container"].forEach((function(t){p(t.children).forEach((function(t){t.draggable=!0,t.setAttribute("draggable",!0),e.removeEventListener(t,"dragstart"),e.removeEventListener(t,"dragend"),e.addEventListener(t,"dragstart",e.onDragStart.bind(e),!0),e.addEventListener(t,"dragend",e.onDragEnd.bind(e),!0),e.addEventListener(t,"drag",(function(e){e.target.style.cursor="none"}))}))}))}},{key:"updateDropzoneDimensions",value:function(){if(this.refs.iframeDropzone){var e=(0,l.getElementRect)(this.webform.refs.iframeContainer);this.refs.iframeDropzone.style.height=e&&e.height?"".concat(e.height,"px"):"1000px",this.refs.iframeDropzone.style.width=e&&e.width?"".concat(e.width,"px"):"100%"}}},{key:"onDragStart",value:function(e){var t=e.offsetX,n=void 0===t?0:t,r=e.offsetY,o=void 0===r?0:r;this.itemOffsetX=n,this.itemOffsetY=o,e.dataTransfer.setData("text",""),this.updateDropzoneDimensions(),this.addClass(this.refs.iframeDropzone,"enabled"),this.dropEmitted=!1}},{key:"onDropzoneDrop",value:function(e){return this.dropEmitted=!0,this.dropEvent=e,e.preventDefault(),!1}},{key:"onDragEnd",value:function(e){var t=this.webform.refs.iframeContainer.getBoundingClientRect(),n=this.dropEvent?this.dropEvent.layerX:null,r=this.dropEvent?this.dropEvent.layerY:null;if(this.removeClass(this.refs.iframeDropzone,"enabled"),!this.dropEvent){if(!(!this.dropEmitted&&((0,l.getBrowserInfo)().chrome||(0,l.getBrowserInfo)().edge)&&"macOS"===globalThis.navigator.userAgentData.platform&&t.left2&&void 0!==arguments[2]&&arguments[2],o=r.default.assign((0,p.fastCloneDeep)(l.default.resources.en.translation),t);this.i18next.addResourceBundle(e,"translation",o,!0,!0),n&&(this.language=e)}},{key:"localize",value:function(){var e=this;return this.i18next.initialized?c.default.resolve(this.i18next):(this.i18next.initialized=!0,new c.default((function(t,n){try{e.i18next.init(b(b({},e.options.i18n),{compatibilityJSON:"v3"}),(function(r){if(e.options.language=e.i18next.language.split(";")[0],r)return n(r);t(e.i18next)}))}catch(e){return n(e)}})))}},{key:"keyboardCatchableElement",value:function(e){return"TEXTAREA"!==e.nodeName&&("INPUT"!==e.nodeName||-1===["text","email","password"].indexOf(e.type))}},{key:"addShortcut",value:function(e,t){if(t&&/^([A-Z]|Enter|Esc)$/i.test(t))if("Enter"===(t=r.default.capitalize(t))||"Esc"===t){if("BUTTON"!==e.tagName)return;this.shortcuts.push({shortcut:t,element:e})}else this.shortcuts.push({ctrl:!0,shortcut:t,element:e})}},{key:"removeShortcut",value:function(e,t){t&&/^([A-Z]|Enter|Esc)$/i.test(t)&&r.default.remove(this.shortcuts,{shortcut:t,element:e})}},{key:"src",get:function(){return this._src},set:function(e){this.setSrc(e)}},{key:"loadSubmission",value:function(){var e=this;return this.loadingSubmission=!0,this.formio.submissionId?this.onSubmission=this.formio.loadSubmission().then((function(t){return e.setSubmission(t)}),(function(t){return e.submissionReadyReject(t)})).catch((function(t){return e.submissionReadyReject(t)})):this.submissionReadyResolve(),this.submissionReady}},{key:"setSrc",value:function(e,t){var n=this;return this.setUrl(e,t)?(this.nosubmit=!1,this.formio.loadForm({params:{live:1}}).then((function(e){var t=n.setForm(e);return n.loadSubmission(),t})).catch((function(e){console.warn(e),n.formReadyReject(e)}))):c.default.resolve()}},{key:"url",get:function(){return this._src},set:function(e){this.setUrl(e)}},{key:"setUrl",value:function(e,t){return!(!e||"string"!=typeof e||e===this._src||(this._src=e,this.nosubmit=!0,this.formio=this.options.formio=new s.GlobalFormio(e,t),"form"===this.type&&(this.options.src=e),0))}},{key:"ready",get:function(){var e=this;return this.formReady.then((function(){return k(P(d.prototype),"ready",e).then((function(){return!e.loadingSubmission||e.submissionReady}))}))}},{key:"loading",get:function(){return this._loading},set:function(e){if(this._loading!==e){if(this._loading=e,!this.loader&&e){this.loader=this.ce("div",{class:"loader-wrapper"});var t=this.ce("div",{class:"loader text-center"});this.loader.appendChild(t)}if(this.loader)try{e?this.prependTo(this.loader,this.wrapper):this.removeChildFrom(this.loader,this.wrapper)}catch(e){}}}},{key:"setForm",value:function(e,t){var n,o=this,a=this._form&&(null===(n=this._form.components)||void 0===n?void 0:n.length);try{var u,l;if(a&&JSON.stringify(this._form)===JSON.stringify(e))return c.default.resolve();if(this._form=null!=t&&t.keepAsReference?e:r.default.cloneDeep(e),this.onSetForm&&this.onSetForm(r.default.cloneDeep(this._form),e),null!==(u=this.parent)&&void 0!==u&&null!==(l=u.component)&&void 0!==l&&l.modalEdit)return c.default.resolve()}catch(e){return console.warn(e),c.default.resolve()}if(e&&e.settings&&e.settings.components&&(this.options.components=e.settings.components),e&&e.properties&&(this.options.properties=e.properties),"schema"in e&&(0,i.default)(e.schema,"1.x")>0&&this.ready.then((function(){o.setAlert("alert alert-danger","Form schema is for a newer version, please upgrade your renderer. Some functionality may not work.")})),e&&e.module){var f=null;if("string"==typeof e.module)try{f=this.evaluate("return ".concat(e.module))}catch(e){console.warn(e)}else f=e.module;f&&(s.GlobalFormio.use(f),f.options&&f.options.form&&(this.options=Object.assign(this.options,f.options.form)))}return this.initialized=!1,(this.rebuild()||c.default.resolve()).then((function(){return o.emit("formLoad",e),o.triggerRecaptcha(),setTimeout((function(){o.onChange(t),o.formReadyResolve()}),0),o.formReady}))}},{key:"form",get:function(){return this._form||(this._form={components:[]}),this._form},set:function(e){this.setForm(e)}},{key:"submission",get:function(){return this.getValue()},set:function(e){this.setSubmission(e)}},{key:"setSubmission",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=b(b({},n),{},{fromSubmission:!r.default.has(n,"fromSubmission")||n.fromSubmission}),this.onSubmission=this.formReady.then((function(r){return r&&(n=b(b({},n),r)),t.submissionSet=!0,t.triggerChange(n),t.emit("beforeSetSubmission",e),t.setValue(e,n),t.submissionReadyResolve(e)}),(function(e){return t.submissionReadyReject(e)})).catch((function(e){return t.submissionReadyReject(e)}))}},{key:"handleDraftError",value:function(e,t,n){var o=r.default.trim("".concat(this.t(e)," ").concat(t||""));console.warn(o),this.emit(n?"restoreDraftError":"saveDraftError",t||o)}},{key:"saveDraft",value:function(){var e=this;if(this.draftEnabled)if(this.formio)if(s.GlobalFormio.getUser()){var t=(0,p.fastCloneDeep)(this.submission);t.state="draft",this.savingDraft||(this.emit("saveDraftBegin"),this.savingDraft=!0,this.formio.saveSubmission(t).then((function(t){e.submission._id=t._id,e.savingDraft=!1,e.emit("saveDraft",t)})).catch((function(t){e.savingDraft=!1,e.handleDraftError("saveDraftError",t)})))}else this.handleDraftError("saveDraftAuthError");else this.handleDraftError("saveDraftInstanceError")}},{key:"restoreDraft",value:function(e){var t=this;this.formio?(this.savingDraft=!0,this.formio.loadSubmissions({params:{state:"draft",owner:e}}).then((function(e){if(e.length>0&&!t.options.skipDraftRestore){var n=(0,p.fastCloneDeep)(e[0]);return t.setSubmission(n).then((function(){t.draftEnabled=!0,t.savingDraft=!1,t.emit("restoreDraft",n)}))}t.draftEnabled=!0,t.savingDraft=!1,t.emit("restoreDraft",null)})).catch((function(e){t.draftEnabled=!0,t.savingDraft=!1,t.handleDraftError("restoreDraftError",e,!0)}))):this.handleDraftError("restoreDraftInstanceError",null,!0)}},{key:"schema",get:function(){var e=(0,p.fastCloneDeep)(r.default.omit(this._form,["components"]));return e.components=[],this.eachComponent((function(t){return e.components.push(t.schema)})),e}},{key:"mergeData",value:function(e,t){r.default.mergeWith(e,t,(function(e,t){if(Array.isArray(e)&&Array.isArray(t)&&e.length!==t.length)return t}))}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e&&e.data||(e={data:{}}),this._submission.metadata=e.metadata||{},this.editing=!!e._id,!this.options.submissionTimezone&&e.metadata&&e.metadata.timezone&&(this.options.submissionTimezone=e.metadata.timezone);var n=k(P(d.prototype),"setValue",this).call(this,e.data,t);return t.sanitize||this.mergeData(this.data,e.data),e.data=this.data,this._submission=e,n}},{key:"getValue",value:function(){return this._submission.data||(this._submission.data={}),this.viewOnly||(this._submission.data=this.data),this._submission}},{key:"init",value:function(){var e=this;return this._submission=this._submission||{data:{}},this.components&&this.components.length&&(this.destroyComponents(),this.components=[]),this.component?this.component.components=this.form?this.form.components:[]:this.component=this.form,this.component.type="form",this.component.input=!1,this.addComponents(),this.on("submitButton",(function(t){e.submit(!1,t).catch((function(e){return!1!==e&&console.log(e)}))}),!0),this.on("checkValidity",(function(t){return e.checkValidity(t,!0,t)}),!0),this.on("requestUrl",(function(t){return e.submitUrl(t.url,t.headers)}),!0),this.on("resetForm",(function(){return e.resetValue()}),!0),this.on("deleteSubmission",(function(){return e.deleteSubmission()}),!0),this.on("refreshData",(function(){return e.updateValue()}),!0),this.executeFormController(),this.formReady}},{key:"executeFormController",value:function(){var e=this;if(!this.form||!this.form.controller||(!this.visible||this.component.hidden)&&this.component.clearOnHide&&!this.rootPristine)return!1;this.formReady.then((function(){e.evaluate(e.form.controller,{components:e.components,instance:e})}))}},{key:"destroy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.off("submitButton"),this.off("checkValidity"),this.off("requestUrl"),this.off("resetForm"),this.off("deleteSubmission"),this.off("refreshData"),e&&(this.emit("formDelete",this.id),delete s.GlobalFormio.forms[this.id]),k(P(d.prototype),"destroy",this).call(this)}},{key:"build",value:function(e){var t=this;return e||this.element?this.ready.then((function(){e=e||t.element,k(P(d.prototype),"build",t).call(t,e)})):this.ready}},{key:"getClassName",value:function(){var e="formio-form";return this.options.readOnly&&(e+=" formio-read-only"),e}},{key:"render",value:function(){return k(P(d.prototype),"render",this).call(this,this.renderTemplate("webform",{classes:this.getClassName(),children:this.renderComponents()}),this.builderMode?"builder":"form",!0)}},{key:"redraw",value:function(){return this.element?(this.clear(),this.setContent(this.element,this.render()),this.attach(this.element)):c.default.resolve()}},{key:"attach",value:function(e){var t=this;this.element=e,this.loadRefs(e,{webform:"single"});var n=this.attachComponents(this.refs.webform);return this.addEventListener(document,"keydown",this.executeShortcuts),this.currentForm=this,this.hook("attachWebform",e,this),n.then((function(){return t.emit("render",t.element),t.setValue(t._submission,{noUpdateEvent:!0})}))}},{key:"hasRequiredFields",value:function(){var e=!1;return(0,h.eachComponent)(this.form.components,(function(t){if(t.validate.required)return e=!0,!0}),!0),e}},{key:"resetValue",value:function(){r.default.each(this.getComponents(),(function(e){return e.resetValue()})),this.setPristine(!0),this.onChange({resetValue:!0})}},{key:"setAlert",value:function(e,t,n){var r=this;if(e||!this.submitted)if(this.options.noAlerts)t||this.emit("error",!1);else{if(this.alert)try{this.refs.errorRef&&this.refs.errorRef.length&&this.refs.errorRef.forEach((function(e){r.removeEventListener(e,"click"),r.removeEventListener(e,"keypress")})),this.removeChild(this.alert),this.alert=null}catch(e){}if(t){var o={class:n&&n.classes||"alert alert-".concat(e),id:"error-list-".concat(this.id)},i={message:t instanceof HTMLElement?t.outerHTML:t,attrs:o,type:e};this.alert=(0,p.convertStringToHTMLElement)(this.renderTemplate("alert",i),"#".concat(o.id))}this.alert&&(this.loadRefs(this.alert,{errorRef:"multiple"}),this.refs.errorRef&&this.refs.errorRef.length&&this.refs.errorRef.forEach((function(e){r.addEventListener(e,"click",(function(e){var t=e.currentTarget.dataset.componentKey;r.focusOnComponent(t)})),r.addEventListener(e,"keydown",(function(e){if(13===e.keyCode){e.preventDefault();var t=e.currentTarget.dataset.componentKey;r.focusOnComponent(t)}}))})),this.prepend(this.alert))}else this.alert&&(this.refs.errorRef&&this.refs.errorRef.length&&this.refs.errorRef.forEach((function(e){r.removeEventListener(e,"click"),r.removeEventListener(e,"keypress")})),this.removeChild(this.alert),this.alert=null)}},{key:"focusOnComponent",value:function(e){if(e){var t=this.getComponent(e);t&&t.focus()}}},{key:"showErrors",value:function(e,t,n){var o=this;this.loading=!1;var i=this.errors;if(e?Array.isArray(e)?i=i.concat(e):i.push(e):i=k(P(d.prototype),"errors",this),(i=(i=i.concat(this.customErrors)).concat(this.serverErrors||[])).length){i.forEach((function(e){var t=e.components,n=void 0===t?[]:t;e.component&&n.push(e.component),e.path&&n.push(e.path),n.forEach((function(t){var n=o._parentPath+(0,p.getStringFromComponentPath)(t),i=o.getComponent(t,r.default.identity,n);e.fromServer&&(i.serverErrors?i.serverErrors.push(e):i.serverErrors=[e]),r.default.compact(Array.isArray(i)?i:[i]).forEach((function(t){return t.setCustomValidity(e.message,!0)}))}))}));var a=[];i.forEach((function(e){if(e){var t=function(t,n){var i=!r.default.isUndefined(n)&&e.messages&&e.messages[n],a=i&&i.formattedKeyOrPath||i.path||e.component&&e.component.key||e.fromServer&&e.path,u=a?(0,p.getStringFromComponentPath)(a):"";return u=o._parentPath+u,"string"==typeof e||e.formattedKeyOrPath||(e.formattedKeyOrPath=u),{message:(0,p.unescapeHTML)(t),keyOrPath:u}};if(e.messages=r.default.uniqBy(e.messages,(function(e){return e.message})),e.messages&&e.messages.length){var n=e.component;e.messages.forEach((function(e,r){var i=e.message,u=e.context,l=e.fromServer,s=null!=u&&u.hasLabel||l?o.t("alertMessage",{message:o.t(i)}):o.t("alertMessageWithLabel",{label:o.t(n.label),message:o.t(i)});a.push(t(s,r))}))}else if(e){var i=r.default.isObject(e)?o.t("alertMessage",{message:o.t(e.message||"")}):o.t("alertMessage",{message:o.t(e)});a.push(t(i))}}}));var u=this.renderTemplate("errorsList",{errors:a});return this.root.setAlert("danger",u),t&&this.emit("error",i),i}this.setAlert(!1)}},{key:"onSubmit",value:function(e,t){var n;return this.loading=!1,this.submitting=!1,this.setPristine(!0),this.setValue((0,p.fastCloneDeep)(e),{noValidate:!0,noCheck:!0}),this.setAlert("success","

".concat(this.t("complete"),"

")),this.draftEnabled&&null!==(n=this.triggerSaveDraft)&&void 0!==n&&n.cancel&&this.triggerSaveDraft.cancel(),this.emit("submit",e,t),t&&this.emit("submitDone",e),e}},{key:"normalizeError",value:function(e){return e&&("object"===m(e)&&"details"in e&&(e=e.details),"string"==typeof e&&(e={message:e})),e}},{key:"onSubmissionError",value:function(e){return e=this.normalizeError(e),this.submitting=!1,this.setPristine(!1),this.emit("submitError",e),e&&e.silent?(this.emit("change",{isValid:!0},{silent:!0}),!1):(t=this.submitted?this.showErrors():this.showErrors(e,!0),this.root&&this.root.alert&&this.scrollIntoView(this.root.alert),t);var t}},{key:"onChange",value:function(e,t,n,o){e=e||{};var i=!1;t&&t.component&&(this.customErrors=this.customErrors.filter((function(e){return e.component&&e.component!==t.component.key}))),k(P(d.prototype),"onChange",this).call(this,e,!0);var a=r.default.clone(this.submission);e.changed=a.changed=t,e.changes=o,n&&this.pristine&&(this.pristine=!1),a.isValid=this.checkData(a.data,e),this.loading=!1,this.submitted&&this.showErrors(),n&&this.options.saveDraft&&this.triggerSaveDraft(),e&&e.noEmit||(this.emit("change",a,e,n),i=!0),i&&!this.initialized&&(this.emit("initialized"),this.initialized=!0)}},{key:"checkData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=k(P(d.prototype),"checkData",this).call(this,e,t);return(r.default.isEmpty(t)||t.noValidate)&&this.submitted&&this.showErrors(),n}},{key:"deleteSubmission",value:function(){var e=this;return this.formio.deleteSubmission().then((function(){e.emit("submissionDeleted",e.submission),e.resetValue()}))}},{key:"cancel",value:function(e){return this.hook("beforeCancel",!0)&&(e||confirm(this.t("confirmCancel")))?(this.resetValue(),!0):(this.emit("cancelSubmit"),!1)}},{key:"setMetadata",value:function(e){e.metadata=e.metadata||{},r.default.defaults(e.metadata,{timezone:r.default.get(this,"_submission.metadata.timezone",(0,p.currentTimezone)()),offset:parseInt(r.default.get(this,"_submission.metadata.offset",(0,o.default)().utcOffset()),10),origin:document.location.origin,referrer:document.referrer,browserName:navigator.appName,userAgent:navigator.userAgent,pathName:window.location.pathname,onLine:navigator.onLine})}},{key:"submitForm",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.clearServerErrors(),new c.default((function(n,o){if(e.options.readOnly)return n({submission:e.submission,saved:!1});var i=(0,p.fastCloneDeep)(e.submission||{});e.setMetadata(i),i.state=t.state||"submitted";var a="draft"===i.state;e.hook("beforeSubmit",b(b({},i),{},{component:t.component}),(function(u,l){return u?o(u):(i._vnote=l&&l._vnote?l._vnote:"",a||i.data?a||e.checkValidity(i.data,!0)?(e.everyComponent((function(e){"client-only"===e.component.persistent&&r.default.unset(i.data,e.path)})),void e.hook("customValidation",b(b({},i),{},{component:t.component}),(function(t){if(t)return"string"==typeof t&&(t={message:t}),t=Array.isArray(t)?t:[t],e.customErrors=t,o();if(e.loading=!0,e._form&&e._form.action){var r=i.data._id&&e._form.action.includes(i.data._id)?"PUT":"POST";return s.GlobalFormio.makeStaticRequest(e._form.action,r,i,e.formio?e.formio.options:{}).then((function(e){return n({submission:e,saved:!0})})).catch((function(t){return e.setServerErrors(t),o(t)}))}var a=e.formio;if(e.nosubmit||!a)return n({submission:i,saved:!1});a[a.actionUrl?"saveAction":"saveSubmission"](i).then((function(e){return n({submission:e,saved:!0})})).catch((function(t){return e.setServerErrors(t),o(t)}))}))):o():o("Invalid Submission"))}))}))}},{key:"setServerErrors",value:function(e){e.details?this.serverErrors=e.details.filter((function(e){return e.level?"error"===e.level:e})).map((function(e){return e.fromServer=!0,e})):"string"==typeof e&&(this.serverErrors=[{fromServer:!0,level:"error",message:e}])}},{key:"executeSubmit",value:function(e){var t=this;return this.submitted=!0,this.submitting=!0,this.submitForm(e).then((function(e){var n=e.submission,r=e.saved;return t.onSubmit(n,r)})).then((function(e){return t.submissionInProcess=!1,e})).catch((function(e){return t.submissionInProcess=!1,c.default.reject(t.onSubmissionError(e))}))}},{key:"clearServerErrors",value:function(){var e,t=this;null===(e=this.serverErrors)||void 0===e||e.forEach((function(e){if(e.path){var n=(0,p.getArrayFromComponentPath)(e.path),o=t.getComponent(n,r.default.identity,e.formattedKeyOrPath);o&&(o.serverErrors=[])}})),this.serverErrors=[]}},{key:"submit",value:function(e,t){var n=this;return this.submissionInProcess=!0,e?this.executeSubmit(t):this.beforeSubmit(t).then((function(){return n.executeSubmit(t)}))}},{key:"submitUrl",value:function(e,t){var n=this;if(!e)return console.warn("Missing URL argument");var r=this.submission||{},o=e,i={method:"POST",headers:{}};if(t&&t.length>0&&t.map((function(e){""!==e.header&&""!==e.value&&(i.headers[e.header]=n.interpolate(e.value,r))})),!o||!i)return this.emit("error","You should add a URL to this button."),this.setAlert("warning","You should add a URL to this button."),console.warn("You should add a URL to this button.");s.GlobalFormio.makeStaticRequest(o,i.method,r,{headers:i.headers}).then((function(){n.emit("requestDone"),n.setAlert("success","

Success

")})).catch((function(e){n.showErrors("".concat(e.statusText?e.statusText:""," ").concat(e.status?e.status:e)),n.emit("error","".concat(e.statusText?e.statusText:""," ").concat(e.status?e.status:e)),console.error("".concat(e.statusText?e.statusText:""," ").concat(e.status?e.status:e)),n.setAlert("danger","

".concat(e.statusText?e.statusText:""," ").concat(e.status?e.status:e,"

"))}))}},{key:"triggerRecaptcha",value:function(){if(this&&this.components){var e=(0,p.searchComponents)(this.components,{"component.type":"recaptcha","component.eventType":"formLoad"});e.length>0&&e[0].verify("".concat(this.form.name?this.form.name:"form","Load"))}}},{key:"nosubmit",get:function(){return this._nosubmit||!1},set:function(e){this._nosubmit=!!e,this.emit("nosubmit",this._nosubmit)}},{key:"conditions",get:function(){var e,t;return null!==(e=null===(t=this.schema.settings)||void 0===t?void 0:t.conditions)&&void 0!==e?e:[]}},{key:"variables",get:function(){var e,t;return null!==(e=null===(t=this.schema.settings)||void 0===t?void 0:t.variables)&&void 0!==e?e:[]}}],n&&w(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),d}(d.default);t.default=A,A.setBaseUrl=s.GlobalFormio.setBaseUrl,A.setApiUrl=s.GlobalFormio.setApiUrl,A.setAppUrl=s.GlobalFormio.setAppUrl},95529:function(e,t,n){"use strict";n(69070),n(68304),n(30489),n(12419),n(78011),n(74819),n(38880),n(49337),n(33321),n(32165),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(21249),n(2707),n(57327),n(41539),n(74916),n(15306),n(26699),n(32023),n(68309),n(24812),n(47941),n(82772),n(79753),n(92222),n(89554),n(54747),n(47042),n(4723),n(69600),n(91038),n(78783),n(69826),n(34553),n(5212),n(40561),n(66992),n(51532),n(33948),n(23157),n(92087),n(96649),n(96078),n(82526),n(41817),n(9653);var r=h(n(12215)),o=h(n(64430)),i=h(n(31051)),a=h(n(91459)),u=h(n(39086)),l=n(19161),s=n(82531),c=n(32725),f=h(n(1848)),d=h(n(96486)),p=h(n(2201));function h(e){return e&&e.__esModule?e:{default:e}}function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function m(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0||o.noDragDrop?t:((!r||!r.length&&!r.nodrop||"form"===o.type&&r.length<=1&&(0===r.length||"button"===r[0].type))&&(t=e.renderTemplate("builderPlaceholder",{position:0})+t),e.renderTemplate("builderComponents",{key:o.key,type:o.type,html:t}))},e.options.hooks.renderInput=function(e,t){var n=t.self;return"hidden"===n.type?e+n.name:e},e.options.hooks.renderLoading=function(e,t){var n=t.self;return"form"===n.type&&n.key?n.name:e},e.options.hooks.attachComponents=function(t,n,r,o){if(t){if(o.noDragDrop)return t;var i=t.querySelector('[ref="'.concat(o.component.key,'-container"]'))||t;return i.formioContainer=r,i.formioComponent=o,e.dragula&&e.allowDrop(t)&&e.dragula.containers.push(i),("datagrid"===o.type||"datamap"===o.type)&&n.length>0?t:t.children[0]}},e.options.hooks.attachDatagrid=function(e,t){t.loadRefs(e,E({},"".concat(t.key,"-container"),"single"));var n=t.refs["".concat(t.key,"-container")];n&&t.attachComponents(n.parentNode,[],t.component.components)},e.options.hooks.attachComponent=e.attachComponent.bind(P(e));var b={params:{type:"resource",limit:1e6,select:"_id,title,name,components"}};e.options&&e.options.resourceTag?b.params.tags=[e.options.resourceTag]:e.options&&e.options.hasOwnProperty("resourceTag")||(b.params.tags=["builder"]);var g=new l.GlobalFormio(l.GlobalFormio.projectUrl),k=e.options.builder&&!1===e.options.builder.resource;if(g.loadProject().then((function(t){if(t&&(d.default.get(t,"settings.addConfigToForms",!1)||d.default.get(t,"addConfigToForms",!1))){var n=t.config||{};e.options.formConfig=n;var r="webform._form.config",o=d.default.get(P(e),r);e.webform&&!o&&d.default.set(P(e),r,n)}})).catch((function(e){console.warn("Could not load project settings: ".concat(e.message||e))})),!g.noProject&&!k){var O=e.options.builder&&e.options.builder.resource;g.loadForms(b).then((function(t){t.length&&(e.builder.resource={title:O?O.title:"Existing Resource Fields",key:"resource",weight:O?O.weight:50,subgroups:[],components:[],componentOrder:[]},e.groups.resource={title:O?O.title:"Existing Resource Fields",key:"resource",weight:O?O.weight:50,subgroups:[],components:[],componentOrder:[]},e.groupOrder.includes("resource")||e.groupOrder.push("resource"),e.addExistingResourceFields(t))}))}return e.options.attachMode="builder",e.webform=e.webform||e.createForm(e.options),e.pathComponentsMapping={},e.arrayDataComponentPaths=[],e.nestedDataComponents=[],e.arrayDataComponents=[],e}return t=v,n=[{key:"allowDrop",value:function(){return!0}},{key:"addExistingResourceFields",value:function(e){var t=this;d.default.each(e,(function(e,n){var r="resource-".concat(e.name),o={key:r,title:e.title,components:[],componentOrder:[],default:0===n};(0,c.eachComponent)(e.components,(function(n){if("button"!==n.type&&(!t.options||!t.options.resourceFilter||n.tags&&-1!==n.tags.indexOf(t.options.resourceFilter))){var i=n.label;!i&&n.key&&(i=d.default.upperFirst(n.key)),o.componentOrder.push("component-".concat(n.key)),o.components["component-".concat(n.key)]=d.default.merge((0,s.fastCloneDeep)(u.default.components[n.type]?u.default.components[n.type].builderInfo:u.default.components.unknown.builderInfo),{key:n.key,title:i,group:"resource",subgroup:r},{schema:g(g({},n),{},{label:n.label,key:n.key,lockKey:!0,source:t.options.noSource?void 0:e._id,isNew:!0})})}}),!0),t.groups.resource.subgroups.push(o)})),this.triggerRedraw()}},{key:"attachTooltip",value:function(e,t){return(0,i.default)(e,{allowHTML:!0,trigger:"mouseenter focus",placement:"top",delay:[200,0],zIndex:1e4,content:t})}},{key:"attachComponent",value:function(e,t){var n=this;if(!(t instanceof v)){if(e.formioComponent=t,t.loadRefs(e,{removeComponent:"single",editComponent:"single",moveComponent:"single",copyComponent:"single",pasteComponent:"single",editJson:"single"}),t.refs.copyComponent&&(this.attachTooltip(t.refs.copyComponent,this.t("Copy")),t.addEventListener(t.refs.copyComponent,"click",(function(){return n.copyComponent(t)}))),t.refs.pasteComponent){var r=this.attachTooltip(t.refs.pasteComponent,this.t("Paste below"));t.addEventListener(t.refs.pasteComponent,"click",(function(){r.hide(),n.pasteComponent(t)}))}t.refs.moveComponent&&(this.attachTooltip(t.refs.moveComponent,this.t("Move")),this.keyboardActionsEnabled&&t.addEventListener(t.refs.moveComponent,"click",(function(){n.moveComponent(t)})));var o=this.getParentElement(e);return t.refs.editComponent&&(this.attachTooltip(t.refs.editComponent,this.t("Edit")),t.addEventListener(t.refs.editComponent,"click",(function(){return n.editComponent(t.schema,o,!1,!1,t.component,{inDataGrid:t.isInDataGrid})}))),t.refs.editJson&&(this.attachTooltip(t.refs.editJson,this.t("Edit JSON")),t.addEventListener(t.refs.editJson,"click",(function(){return n.editComponent(t.schema,o,!1,!0,t.component)}))),t.refs.removeComponent&&(this.attachTooltip(t.refs.removeComponent,this.t("Remove")),t.addEventListener(t.refs.removeComponent,"click",(function(){return n.removeComponent(t.schema,o,t.component)}))),e}}},{key:"createForm",value:function(e){return this.webform=new r.default(this.element,e),this.element&&(this.loadRefs(this.element,{form:"single"}),this.refs.form&&(this.webform.element=this.refs.form)),this.webform}},{key:"ready",get:function(){return this.webform.ready}},{key:"defaultGroups",get:function(){return{basic:{title:"Basic",weight:0,default:!0},advanced:{title:"Advanced",weight:10},layout:{title:"Layout",weight:20},data:{title:"Data",weight:30},premium:{title:"Premium",weight:40}}}},{key:"redraw",value:function(){return r.default.prototype.redraw.call(this)}},{key:"form",get:function(){return this.webform.form},set:function(e){this.setForm(e)}},{key:"schema",get:function(){return this.webform.schema}},{key:"container",get:function(){return this.webform.form.components}},{key:"findNamespaceRoot",value:function(e){var t=(0,s.getArrayFromComponentPath)(e.path),n=this.webform.getComponent(t);n=Array.isArray(n)?n[0]:n;var r=this.recurseNamespace(n);if(!r||this.form.key===r)return this.form.components;var o=e.component;if(r===e.key)return[].concat(m(o.components),[o]);var i=(0,c.getComponent)(this.form.components,r,!0);return i?i.components:n.components}},{key:"recurseNamespace",value:function(e){return e?["address","container","datagrid","editgrid","dynamicWizard","tree"].includes(e.type)||e.tree||e.arrayTree?e.key:this.recurseNamespace(e.parent):null}},{key:"render",value:function(){var e=this;return this.renderTemplate("builder",{sidebar:this.renderTemplate("builderSidebar",{scrollEnabled:this.sideBarScroll,groupOrder:this.groupOrder,groupId:"builder-sidebar-".concat(this.id),groups:this.groupOrder.map((function(t){return e.renderTemplate("builderSidebarGroup",{group:e.groups[t],groupKey:t,groupId:"builder-sidebar-".concat(e.id),subgroups:e.groups[t].subgroups.map((function(n){return e.renderTemplate("builderSidebarGroup",{group:n,groupKey:n.key,groupId:"group-container-".concat(t),subgroups:[]})})),keyboardActionsEnabled:e.keyboardActionsEnabled})}))}),form:this.webform.render()})}},{key:"attach",value:function(e){var t=this;return this.on("change",(function(e){t.populateRecaptchaSettings(e)})),O(x(v.prototype),"attach",this).call(this,e).then((function(){t.loadRefs(e,{form:"single",sidebar:"single","sidebar-search":"single","sidebar-groups":"single",container:"multiple","sidebar-anchor":"multiple","sidebar-group":"multiple","sidebar-container":"multiple","sidebar-component":"multiple"}),t.sideBarScroll&&T.current.handleBuilderSidebarScroll&&T.current.handleBuilderSidebarScroll.call(t,t),"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.getItem("formio.clipboard")&&t.addClass(t.refs.form,"builder-paste-mode"),(0,s.bootstrapVersion)(t.options)||(t.refs["sidebar-group"].forEach((function(e){e.style.display="true"===e.getAttribute("data-default")?"inherit":"none"})),t.refs["sidebar-anchor"].forEach((function(e,n){t.addEventListener(e,"click",(function(){var r=e.getAttribute("data-parent").slice("#builder-sidebar-".length),o=e.getAttribute("data-target").slice("#group-".length);t.refs["sidebar-group"].forEach((function(e,t){var i="true"===e.getAttribute("data-default"),a=e.getAttribute("id").slice("group-".length),u=e.getAttribute("data-parent").slice("#builder-sidebar-".length);e.style.display=i&&u===o||a===r||t===n?"inherit":"none"}))}),!0)}))),t.keyboardActionsEnabled&&t.refs["sidebar-component"].forEach((function(e){t.addEventListener(e,"keydown",(function(n){13===n.keyCode&&t.addNewComponent(e)}))})),t.addEventListener(t.refs["sidebar-search"],"input",d.default.debounce((function(e){var n=e.target.value;t.searchFields(n)}),300)),t.dragDropEnabled&&t.initDragula();var n=t.dragula;if(t.refs.form)return(0,p.default)([window],{margin:20,maxSpeed:6,scrollWhenOutside:!0,autoScroll:function(){return this.down&&(null==n?void 0:n.dragging)}}),t.webform.attach(t.refs.form)}))}},{key:"searchFields",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t.toLowerCase(),r=this.refs.sidebar,o=this.refs["sidebar-groups"];if(r&&o){var i=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=d.default.toPlainObject(t),o=r.subgroups,i=void 0===o?[]:o,a=r.components,u=[];for(var l in a){var s=a[l].title.toLowerCase().match(n),c=a[l].key.toLowerCase().match(n);(s||c)&&u.push(a[l])}return e.orderComponents(r,u),n&&(r.default=!0),r.componentOrder.length||i.length?r:null},a=function(t,n){return d.default.cloneDeep(t).filter((function(t){return i(e.groups[t],n)}))},u=function(e,t){return d.default.clone(e).map((function(e){return i(e,t)})).filter((function(e){return!d.default.isNull(e)}))},l=function(t){return{group:i(e.groups[t],n),groupKey:t,groupId:r.id||o.id,subgroups:u(e.groups[t].subgroups,n).map((function(n){return e.renderTemplate("builderSidebarGroup",{group:n,groupKey:n.key,groupId:"group-container-".concat(t),subgroups:[]})}))}};o.innerHTML=a(this.groupOrder,n).map((function(t){return e.renderTemplate("builderSidebarGroup",l(t))})).join(""),this.loadRefs(this.element,{"sidebar-groups":"single","sidebar-anchor":"multiple","sidebar-group":"multiple","sidebar-container":"multiple"}),this.updateDragAndDrop(),""===n&&this.triggerRedraw()}}},{key:"orderComponents",value:function(e,t){var n=t||e.components,r=0===e.key.indexOf("resource-");n&&(e.componentOrder=Object.keys(n).map((function(e){return n[e]})).filter((function(e){return e&&!e.ignore&&!e.ignoreForForm})).sort((function(e,t){return e.weight-t.weight})).map((function(e){return r?"component-".concat(e.key):e.key})))}},{key:"updateDragAndDrop",value:function(){if(this.dragDropEnabled&&this.initDragula(),this.refs.form)return this.webform.attach(this.refs.form)}},{key:"initDragula",value:function(){var e=this,t=this.options;this.dragula&&this.dragula.destroy();var n=Array.prototype.slice.call(this.refs["sidebar-container"]).filter((function(e){return"group-container-resource"!==e.id}));A&&(this.dragula=A(n,{moves:function(e){var n=!0;return Array.from(e.classList).filter((function(e){return 0===e.indexOf("formio-component-")})).forEach((function(e){var r=e.slice("formio-component-".length);t.disabled&&t.disabled.includes(r)&&(n=!1)})),e.classList.contains("no-drag")&&(n=!1),n},copy:function(e){return e.classList.contains("drag-copy")},accepts:function(e,t){return!e.contains(t)&&!t.classList.contains("no-drop")}}).on("drop",(function(t,n,r,o){return e.onDrop(t,n,r,o)})))}},{key:"detach",value:function(){this.dragula&&this.dragula.destroy(),this.dragula=null,this.sideBarScroll&&T.current.clearBuilderSidebarScroll&&T.current.clearBuilderSidebarScroll.call(this,this),O(x(v.prototype),"detach",this).call(this)}},{key:"getComponentInfo",value:function(e,t){var n;if(t&&"resource"===t.slice(0,t.indexOf("-"))){var r=this.groups.resource.subgroups,o=d.default.find(r,{key:t});o&&o.components.hasOwnProperty("component-".concat(e))&&(n=(0,s.fastCloneDeep)(o.components["component-".concat(e)].schema))}else if(this.schemas.hasOwnProperty(e))n=(0,s.fastCloneDeep)(this.schemas[e]);else if(this.groups.hasOwnProperty(t)){var i=this.groups[t].components;i.hasOwnProperty(e)&&(n=(0,s.fastCloneDeep)(i[e].schema))}else if("searchFields"===t)for(var a=this.groups.resource.subgroups,u=0;u1&&void 0!==arguments[1]?arguments[1]:[];if(e)return t.forEach((function(t){e[t]&&(e[t]=e[t].replace(/"/g,"'"))})),e}},{key:"updateComponent",value:function(e,t){var n=this;if(this.preview){this.preview.form={components:[d.default.omit(g({},e),["hidden","conditional","calculateValue","logic","autofocus","customConditional"])],config:this.options.formConfig||{}};var r=["label","tooltip"];this.preview.form.components.forEach((function(e){return n.replaceDoubleQuotes(e,r)}));var o=this.componentEdit.querySelector('[ref="preview"]');o&&(this.setContent(o,this.preview.render()),this.preview.attach(o))}var i=(0,c.getComponent)(this.editForm.components,"defaultValue",!0);if(i&&"hidden"!==e.type)if(t&&(t.component&&"defaultValue"===t.component.key||t.instance&&i.hasComponent&&i.hasComponent(t.instance))){var a=t.instance._data.key,u=(0,s.getArrayFromComponentPath)(t.instance.path);u.shift(),u.length&&(u.unshift(e.key),a=(0,s.getStringFromComponentPath)(u)),d.default.set(this.preview._data,a,t.value),d.default.set(this.webform._data,a,t.value)}else{d.default.assign(i.component,d.default.omit(g({},e),["key","label","placeholder","tooltip","hidden","autofocus","validate","disabled","defaultValue","customDefaultValue","calculateValue","conditional","customConditional","id"]));var l=i.parent,f=-1,p=-1;if(l.tabs.some((function(e,t){e.some((function(e,n){return e.id===i.id&&(f=t,p=n,!0)}))})),-1!==f&&-1!==p&&t&&!d.default.isNil(t.value)){var h=l.tabs[f][p+1];l.removeComponent(i);var y=l.addComponent(i.component,i.data,h);d.default.pull(y.validators,"required"),l.tabs[f].splice(p,1,y),y.checkValidity=function(){return!0},y.build(i.element)}}this.emit("updateComponent",e)}},{key:"findRepeatablePaths",value:function(){var e=[],t=new Map;return(0,c.eachComponent)(this.form.components,(function(n,r){n.key&&(t.has(n.key)?t.get(n.key).includes(r)?e.push(r):t.set(n.key,[].concat(m(t.get(n.key)),[r])):t.set(n.key,[r]))}),!0),e}},{key:"highlightInvalidComponents",value:function(){var e=this.findRepeatablePaths(),t=!1;this.webform.everyComponent((function(n){var r,o,i=n.path;e.includes(i)?(n.setCustomValidity("API Key is not unique: ".concat(n.key)),t=!0):null!==(r=n.error)&&void 0!==r&&null!==(o=r.message)&&void 0!==o&&o.startsWith("API Key is not unique")&&n.setCustomValidity("")})),this.emit("builderFormValidityChange",t)}},{key:"saveComponent",value:function(e,t,n,r){var o=this;this.editForm.detach();var i=t?t.formioContainer:this.container,u=t?t.formioComponent:this;this.dialog.close();var l=i?this.getComponentsPath(e,u.component):"";r||(r=t.formioContainer.find((function(t){return t.id===e.id})));var s=i?i.indexOf(r):0;if(-1!==s){var c=this.editForm.submission.data;c=c.componentJson||c,this.replaceDoubleQuotes(c,["label","tooltip"]),this.hook("beforeSaveComponentSettings",c);var f=null;u.getComponents().forEach((function(e){e.component.key===r.key&&(f=e)}));var d=f.component,p=f.schema,h=this.isParentSaveChildMethod(t.formioComponent);return i&&!h?(i[s]=c,f&&(f.component=c)):h&&t.formioComponent.saveChildComponent(c),(u.rebuild()||a.default.resolve()).then((function(){var e=i?i[s]:f?f.schema:[];if(o.emitSaveComponentEvent(e,d,u.schema,l,s,n,p),o.emit("change",o.form),o.highlightInvalidComponents(),o.isComponentCreated){var r=t.formioComponent.components[0];o.moveComponent(r),o.isComponentCreated=!1}}))}return this.highlightInvalidComponents(),a.default.resolve()}},{key:"emitSaveComponentEvent",value:function(e,t,n,r,o,i,a){this.emit("saveComponent",e,t,n,r,o,i,a)}},{key:"attachEditComponentControls",value:function(e,t,n,r,o){var i=this;this.componentEdit.querySelectorAll('[ref="cancelButton"]').forEach((function(t){i.editForm.addEventListener(t,"click",(function(t){t.preventDefault(),i.editForm.detach(),i.emit("cancelComponent",e),i.dialog.close(),i.highlightInvalidComponents()}))})),this.componentEdit.querySelectorAll('[ref="removeButton"]').forEach((function(n){i.editForm.addEventListener(n,"click",(function(n){n.preventDefault(),i.saved=!0,i.editForm.detach(),i.removeComponent(e,t,r),i.dialog.close(),i.highlightInvalidComponents()}))})),this.componentEdit.querySelectorAll('[ref="saveButton"]').forEach((function(o){i.editForm.addEventListener(o,"click",(function(o){if(o.preventDefault(),!i.editForm.checkValidity(i.editForm.data,!0,i.editForm.data))return i.editForm.setPristine(!1),i.editForm.showErrors(),!1;i.saved=!0,i.saveComponent(e,t,n,r)}))})),this.componentEdit.querySelectorAll('[ref="previewButton"]').forEach((function(a){i.editForm.addEventListener(a,"click",(function(a){a.preventDefault(),i.showPreview=!i.showPreview,i.editForm.detach(),i.setContent(i.componentEdit,i.renderTemplate("builderEditForm",{componentInfo:o.builderInfo,editForm:i.editForm.render(),preview:!!i.preview&&i.preview.render(),showPreview:i.showPreview,helplinks:i.helplinks})),i.editForm.attach(i.componentEdit.querySelector('[ref="editForm"]')),i.attachEditComponentControls(e,t,n,r,o)}))}))}},{key:"editComponent",value:function(e,t,n,o,i){var a,l=this,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(e.key){this.saved=!1;var p=(0,s.fastCloneDeep)(e),h=u.default.components[p.type],y=void 0===h;o=o||y,h=y?u.default.components.unknown:h,this.dialog&&(this.dialog.close(),this.highlightInvalidComponents());var m=d.default.clone(d.default.get(this,"options.editForm",{}));this.editForm&&this.editForm.destroy();var v=d.default.get(this.options,"editForm.".concat(p.type),{});m.editForm=this.form,m.editComponent=e,m.flags=c,this.hook("editComponentParentInstance",m,t),this.editForm=new r.default(g(g({},d.default.omit(this.options,["hooks","builder","events","attachMode","skipInit"])),{},{language:this.options.language},m)),this.hook("editFormProperties",t),this.editForm.form=o&&!y?{components:[{type:"textarea",as:"json",editor:"ace",weight:10,input:!0,key:"componentJson",label:"Component JSON",tooltip:"Edit the JSON for this component."},{type:"checkbox",key:"showFullSchema",label:"Full Schema"}]}:h.editForm(d.default.cloneDeep(v));var b={inFormBuilder:!0};this.hook("instanceOptionsPreview",b);var w=new h(p,b),k=this.hook("builderComponentSchema",e,w);this.editForm.submission=o?{data:{componentJson:k,showFullSchema:this.options.showFullJsonSchema}}:{data:w.component},this.preview&&this.preview.destroy(),h.builderInfo.hasOwnProperty("preview")&&!h.builderInfo.preview||(this.preview=new r.default(d.default.omit(g(g({},this.options),{},{preview:!0}),["hooks","builder","events","attachMode","calculateValue"])),this.hook("previewFormSettitngs",k,o)),this.showPreview=null===(a=h.builderInfo.showPreview)||void 0===a||a,this.componentEdit=this.ce("div",{class:"component-edit-container"}),this.setContent(this.componentEdit,this.renderTemplate("builderEditForm",{componentInfo:h.builderInfo,editForm:this.editForm.render(),preview:!!this.preview&&this.preview.render(),showPreview:this.showPreview,helplinks:this.helplinks})),this.dialog=this.createModal(this.componentEdit,d.default.get(this.options,"dialogAttr",{})),this.editForm.attach(this.componentEdit.querySelector('[ref="editForm"]')),this.hook("editFormWrapper"),this.updateComponent(p),this.editForm.on("change",(function(r){if(r.changed){if(r.changed.component&&"showFullSchema"===r.changed.component.key){var i=r.changed.value;return void(l.editForm.submission={data:{componentJson:i?w.component:e,showFullSchema:i}})}(r.changed.component&&"key"===r.changed.component.key||o)&&(p.keyModified=!0);var a=!1;if(r.changed.instance?a=["label","title"].includes(r.changed.instance.path):r.changed.component&&(a=["label","title"].includes(r.changed.component.key)),a&&n&&(r.data.keyModified||l.editForm.everyComponent((function(e){if("key"===e.key&&"tabs"===e.parent.component.key)return e.setValue(l.updateComponentKey(r.data)),!1})),l.form)){var u=l.findNamespaceRoot(t.formioComponent);u=u.filter((function(e){return m.editComponent.id!==e.id})),f.default.uniquify(u,r.data)}l.updateComponent(r.data.componentJson||r.data,r.changed)}})),this.attachEditComponentControls(e,t,n,i,h);var O=function r(){l.editForm.destroy(!0),l.preview&&(l.preview.destroy(!0),l.preview=null),n&&!l.saved&&(l.removeComponent(e,t,i),l.highlightInvalidComponents()),l.removeEventListener(l.dialog,"close",r),l.dialog=null};this.addEventListener(this.dialog,"close",O),this.emit("editComponent",e)}}},{key:"updateComponentKey",value:function(e){return d.default.camelCase(e.title||e.label||e.placeholder||e.type).replace(/^[0-9]*/,"")}},{key:"moveComponent",value:function(e){var t;this.selectedComponent&&(null===(t=this.selectedComponent.element)||void 0===t||t.classList.remove("builder-component-selected"),this.removeEventListener(document,"keydown")),e.element.focus(),e.element.classList.add("builder-component-selected"),this.selectedComponent=e,this.addEventListener(document,"keydown",this.moveHandler.bind(this))}},{key:"updateComponentPlacement",value:function(e){var t,n,r=this.selectedComponent,o=e?-1:1;if(r){var i=r.element,a=e?i.previousElementSibling:i.nextElementSibling,u=i.parentNode,l=u.formioContainer.length;if(l&&l<=1)return;u.formioContainer&&-1!==(t=d.default.findIndex(u.formioContainer,{key:i.formioComponent.component.key}))&&(n=(n=u.formioContainer.splice(d.default.findIndex(u.formioContainer,{key:i.formioComponent.component.key}),1))[0],u.removeChild(i));var s=u.formioComponent.components.length;if(-1===(t=-1===t?0:t+o))u.formioContainer.push(n),u.appendChild(i);else if(t===s){var c=u.formioContainer[0].key;t=d.default.findIndex(u.formioComponent.components,{key:c});var f=u.formioComponent.components[t].element;u.formioContainer.splice(0,0,n),u.insertBefore(i,f)}else-1!==t&&(u.formioContainer.splice(t,0,n),e?u.insertBefore(i,a):u.insertBefore(i,a.nextElementSibling));i.focus()}}},{key:"stopMoving",value:function(e){var t=e.element.parentNode;this.removeEventListener(document,"keydown"),t.formioComponent.rebuild(),this.selectedComponent=null}},{key:"addNewComponent",value:function(e){var t,n,r=this,o=document.querySelector(".formio-builder-form"),i=e.getAttribute("data-key"),a=e.getAttribute("data-group");i&&a&&(n=this.getComponentInfo(i,a)),this.options.noNewEdit||n.noNewEdit||(f.default.uniquify(this.findNamespaceRoot(o.formioComponent),n),this.editComponent(n,o,!0,null,null)),(null===(t=o.formioComponent.components[0])||void 0===t?void 0:t.element)?o.formioContainer.splice(0,0,n):o.formioContainer.push(n),o.formioComponent.rebuild().then((function(){r.isComponentCreated=!0}))}},{key:"copyComponent",value:function(e){if(!window.sessionStorage)return console.warn("Session storage is not supported in this browser.");this.addClass(this.refs.form,"builder-paste-mode"),window.sessionStorage.setItem("formio.clipboard",JSON.stringify(e.schema))}},{key:"pasteComponent",value:function(e){if(!window.sessionStorage)return console.warn("Session storage is not supported in this browser.");if(this.removeClass(this.refs.form,"builder-paste-mode"),window.sessionStorage){var t=window.sessionStorage.getItem("formio.clipboard");if(t){var n=JSON.parse(t),r=this.getParentElement(e.element);if(r){f.default.uniquify(this.findNamespaceRoot(r.formioComponent),n);var o="",i=0,a=this.isParentSaveChildMethod(r.formioComponent);r.formioContainer&&!a?(i=r.formioContainer.indexOf(e.component),o=this.getComponentsPath(n,r.formioComponent.component),r.formioContainer.splice(i+1,0,n)):a&&r.formioComponent.saveChildComponent(n,!1),r.formioComponent.rebuild(),this.emitSaveComponentEvent(n,n,r.formioComponent.component,o,i+1,!0,n)}this.emit("change",this.form)}}}},{key:"isParentSaveChildMethod",value:function(e){return!(!e||!e.saveChildComponent)}},{key:"getParentElement",value:function(e){var t=e;do{t=t.parentNode}while(t&&!t.formioComponent);return t}},{key:"addBuilderComponentInfo",value:function(e){if(e&&e.group&&this.groups[e.group]){e=d.default.clone(e);var t=this.groups[e.group];return t.components.hasOwnProperty(e.key)||(t.components[e.key]=e),e}}},{key:"init",value:function(){return this.webform&&this.webform.init(),O(x(v.prototype),"init",this).call(this)}},{key:"clear",value:function(){this.webform.initialized&&this.webform.clear()}},{key:"destroy",value:function(e){this.webform.initialized&&this.webform.destroy(e),O(x(v.prototype),"destroy",this).call(this,e)}},{key:"addBuilderGroup",value:function(e,t){this.groups[e]?this.updateBuilderGroup(e,t):(this.groups[e]=t,this.groupOrder.push(e),this.triggerRedraw())}},{key:"updateBuilderGroup",value:function(e,t){this.groups[e]&&(this.groups[e]=t,this.triggerRedraw())}},{key:"generateKey",value:function(e){return e.key||d.default.camelCase(e.title||e.label||e.placeholder||e.type)}}],n&&k(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),v}(o.default);t.default=R},33456:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(49337),n(33321),n(79753),n(32165),n(66992),n(78783),n(33948),n(91038),n(47042),n(74916),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(57327),n(41539),n(26699),n(32023),n(89554),n(54747),n(69826),n(68309),n(21249),n(47941),n(92222),n(24812),n(34553),n(91058),n(85827),n(68304),n(30489);var o=s(n(91459)),i=s(n(96486)),a=s(n(12215)),u=n(19161),l=n(82531);function s(e){return e&&e.__esModule?e:{default:e}}function c(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},n=t.all,r=void 0!==n&&n,o=this.hasExtraPages?this.components:this.pages,a=o.filter(r?i.default.identity:function(t,n){return e._seenPages.includes(n)});return a}},{key:"hasExtraPages",get:function(){return!i.default.isEmpty(this.subWizards)}},{key:"data",get:function(){return g(_(s.prototype),"data",this)},set:function(e){var t=this;this._data=e,i.default.each(this.getPages({all:!0}),(function(e){e.data=t.componentContext(e)}))}},{key:"localData",get:function(){var e,t;return(null===(e=this.pages[this.page])||void 0===e||null===(t=e.root)||void 0===t?void 0:t.submission.data)||this.submission.data}},{key:"checkConditions",value:function(e,t,n){var r=g(_(s.prototype),"checkConditions",this).call(this,e,t,n);return this.establishPages(e),r}},{key:"getComponents",value:function(){return this.submitting?this.getPages({all:this.isLastPage()}):g(_(s.prototype),"getComponents",this).call(this)}},{key:"resetValue",value:function(){this.getPages({all:!0}).forEach((function(e){return e.resetValue()})),this.setPristine(!0)}},{key:"init",value:function(){var e,t,n,r=this;this.options.buttonSettings=i.default.defaults(this.options.buttonSettings,{showPrevious:!0,showNext:!0,showSubmit:!0,showCancel:!this.options.readOnly}),this.isSecondInit||(this.isClickableDefined=null===(t=this.options)||void 0===t||null===(n=t.breadcrumbSettings)||void 0===n?void 0:n.hasOwnProperty("clickable"),this.isSecondInit=!0),this.options.breadcrumbSettings=i.default.defaults(this.options.breadcrumbSettings,{clickable:!0}),this.options.allowPrevious=this.options.allowPrevious||!1,this.page=0;var o=g(_(s.prototype),"init",this).call(this);return this.setComponentSchema(),null!==(e=this.pages)&&void 0!==e&&e[this.page]&&(this.component=this.pages[this.page].component),this.on("subWizardsUpdated",(function(e){var t=r.subWizards.find((function(t){var n;return(null==e?void 0:e.id)&&(null===(n=t.subForm)||void 0===n?void 0:n.id)===(null==e?void 0:e.id)}));r.subWizards.length&&t&&(t.subForm.setValue(e._submission,{},!0),r.establishPages(),r.redraw())})),o}},{key:"wizardKey",get:function(){return"wizard-".concat(this.id)}},{key:"wizard",get:function(){return this.form},set:function(e){this.setForm(e)}},{key:"buttons",get:function(){var e=this,t={};return[{name:"cancel",method:"cancel"},{name:"previous",method:"prevPage"},{name:"next",method:"nextPage"},{name:"submit",method:"submit"}].forEach((function(n){e.hasButton(n.name)&&(t[n.name]=n)})),t}},{key:"buttonOrder",get:function(){var e,t,n;return null!==(e=null===(t=this.options.properties)||void 0===t||null===(n=t.wizardButtonOrder)||void 0===n?void 0:n.toLowerCase().split(", "))&&void 0!==e?e:["cancel","previous","next","submit"]}},{key:"renderContext",get:function(){var e,t;return{disableWizardSubmit:this.form.disableWizardSubmit,wizardKey:this.wizardKey,isBreadcrumbClickable:this.isBreadcrumbClickable(),isSubForm:!!this.parent&&"wizard"===!(null!==(e=this.root)&&void 0!==e&&null!==(t=e.component)&&void 0!==t&&t.type),panels:this.allPages.length?this.allPages.map((function(e){return e.component})):this.pages.map((function(e){return e.component})),buttons:this.buttons,currentPage:this.page,buttonOrder:this.buttonOrder}}},{key:"prepareNavigationSettings",value:function(e){var t=this.currentPanel;return t&&t.buttonSettings&&Object.keys(t.buttonSettings).forEach((function(){Object.keys(e.buttons).forEach((function(n){(void 0!==t.buttonSettings[n]&&!t.buttonSettings[n]||e.isSubForm)&&(e.buttons[n]=null)}))})),this.renderTemplate("wizardNav",e)}},{key:"prepareHeaderSettings",value:function(e,t){return this.currentPanel&&"none"===this.currentPanel.breadcrumb||e.isSubForm?null:this.renderTemplate(t,e)}},{key:"render",value:function(){var e=this,t=this.renderContext;this.component.key&&t.panels.map((function(n){n.key===e.component.key&&(e.currentPanel=n,t.wizardPageTooltip=e.getFormattedTooltip(n.tooltip))}));var n=this.prepareNavigationSettings(t),r="wizardHeader".concat(i.default.get(this.form,"settings.wizardHeaderType","")),o=i.default.get(this.form,"settings.wizardHeaderLocation","left"),a=this.prepareHeaderSettings(t,r);return this.renderTemplate("wizard",h(h({},t),{},{className:g(_(s.prototype),"getClassName",this).call(this),wizardHeader:a,wizardHeaderType:r,wizardHeaderLocation:o,wizardNav:n,components:this.renderComponents([].concat(c(this.prefixComps),c(this.currentPage.components),c(this.suffixComps)))}),this.builderMode?"builder":"form")}},{key:"redrawNavigation",value:function(){if(this.element){var e,t=this.element.querySelector("#".concat(this.wizardKey,"-nav"));t&&(this.detachNav(),t.outerHTML=this.renderTemplate("wizardNav",this.renderContext),t=this.element.querySelector("#".concat(this.wizardKey,"-nav")),this.loadRefs(t,(y(e={},"".concat(this.wizardKey,"-cancel"),"single"),y(e,"".concat(this.wizardKey,"-previous"),"single"),y(e,"".concat(this.wizardKey,"-next"),"single"),y(e,"".concat(this.wizardKey,"-submit"),"single"),e)),this.attachNav())}}},{key:"redrawHeader",value:function(){if(this.element){var e,t=this.element.querySelector("#".concat(this.wizardKey,"-header"));t&&(this.detachHeader(),t.outerHTML=this.renderTemplate("wizardHeader".concat(i.default.get(this.form,"settings.wizardHeaderType","")),this.renderContext),t=this.element.querySelector("#".concat(this.wizardKey,"-header")),this.loadRefs(t,(y(e={},"".concat(this.wizardKey,"-link"),"multiple"),y(e,"".concat(this.wizardKey,"-tooltip"),"multiple"),e)),this.attachHeader())}}},{key:"attach",value:function(e){var t,n,r=this;this.element=e,this.loadRefs(e,(y(t={},this.wizardKey,"single"),y(t,"".concat(this.wizardKey,"-header"),"single"),y(t,"".concat(this.wizardKey,"-cancel"),"single"),y(t,"".concat(this.wizardKey,"-previous"),"single"),y(t,"".concat(this.wizardKey,"-next"),"single"),y(t,"".concat(this.wizardKey,"-submit"),"single"),y(t,"".concat(this.wizardKey,"-link"),"multiple"),y(t,"".concat(this.wizardKey,"-tooltip"),"multiple"),t)),!this.options.readOnly&&!this.editMode||this.enabledIndex||(this.enabledIndex=(null===(n=this.pages)||void 0===n?void 0:n.length)-1),this.hook("attachWebform",e,this);var o=this.attachComponents(this.refs[this.wizardKey],[].concat(c(this.prefixComps),c(this.currentPage.components),c(this.suffixComps)));return this.attachNav(),this.attachHeader(),o.then((function(){r.emit("render",{component:r.currentPage,page:r.page}),r.component.scrollToTop&&r.scrollPageToTop()}))}},{key:"scrollPageToTop",value:function(){var e,t=null!==(e=this.refs["".concat(this.wizardKey,"-header")])&&void 0!==e?e:this.refs[this.wizardKey];t&&("scrollIntoView"in t?t.scrollIntoView(!0):this.scrollIntoView(t))}},{key:"isBreadcrumbClickable",value:function(){var e=this,t=null;return this.pages.map((function(n){i.default.isEqual(e.currentPage.component,n.component)&&(t=n)})),this.isClickableDefined?this.options.breadcrumbSettings.clickable:i.default.get(t,"component.breadcrumbClickable",!0)}},{key:"isAllowPrevious",value:function(){var e=this,t=null;return this.pages.map((function(n){i.default.isEqual(e.currentPage.component,n.component)&&(t=n)})),i.default.get(t.component,"allowPrevious",this.options.allowPrevious)}},{key:"handleNaviageteOnEnter",value:function(e){if(13===e.keyCode){var t=new CustomEvent("click"),n=this.refs["".concat(this.wizardKey,"-").concat(this.buttons.next.name)];n&&n.dispatchEvent(t)}}},{key:"handleSaveOnEnter",value:function(e){if(13===e.keyCode){var t=new CustomEvent("click"),n=this.refs["".concat(this.wizardKey,"-").concat(this.buttons.submit.name)];n&&n.dispatchEvent(t)}}},{key:"attachNav",value:function(){var e=this;this.component.navigateOnEnter&&this.addEventListener(document,"keyup",this.handleNaviageteOnEnter.bind(this)),this.component.saveOnEnter&&this.addEventListener(document,"keyup",this.handleSaveOnEnter.bind(this)),i.default.each(this.buttons,(function(t){var n=e.refs["".concat(e.wizardKey,"-").concat(t.name)];e.addEventListener(n,"click",(function(r){r.preventDefault(),n.setAttribute("disabled","disabled"),e.setLoading(n,!0),e[t.method]().then((function(){n.removeAttribute("disabled"),e.setLoading(n,!1)})).catch((function(){n.removeAttribute("disabled"),e.setLoading(n,!1)}))}))}))}},{key:"emitWizardPageSelected",value:function(e){this.emit("wizardPageSelected",this.pages[e],e)}},{key:"attachHeader",value:function(){var e,t=this,n=this.isAllowPrevious();this.attachTooltips(this.refs["".concat(this.wizardKey,"-tooltip")],this.currentPanel.tooltip),(this.isBreadcrumbClickable()||n)&&(null===(e=this.refs["".concat(this.wizardKey,"-link")])||void 0===e||e.forEach((function(e,r){(!n||r<=t.enabledIndex)&&t.addEventListener(e,"click",(function(e){return t.emit("wizardNavigationClicked",t.pages[r]),e.preventDefault(),t.setPage(r).then((function(){t.emitWizardPageSelected(r)}))}))})))}},{key:"detachNav",value:function(){var e=this;this.component.navigateOnEnter&&this.removeEventListener(document,"keyup",this.handleNaviageteOnEnter.bind(this)),this.component.saveOnEnter&&this.removeEventListener(document,"keyup",this.handleSaveOnEnter.bind(this)),i.default.each(this.buttons,(function(t){e.removeEventListener(e.refs["".concat(e.wizardKey,"-").concat(t.name)],"click")}))}},{key:"detachHeader",value:function(){var e=this;this.refs["".concat(this.wizardKey,"-link")]&&this.refs["".concat(this.wizardKey,"-link")].forEach((function(t){e.removeEventListener(t,"click")}))}},{key:"transformPages",value:function(){var e=this,t=[],n=this.getSortedComponents(this),r=[];this.allPages=[];var o=function t(n,o){var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],u=[],s=["datagrid","editgrid","dynamicWizard"],f=null!=n&&n.subForm?e.getSortedComponents(n.subForm):(null==n?void 0:n.components)||[],d=f.filter((function(e){return e._visible})),p=d.filter((function(e){return!s.includes(e.component.type)&&("form"!==e.type||e.isNestedWizard)})),h=f.filter((function(e){var t;return"wizard"!==(null===(t=e.subForm)||void 0===t?void 0:t._form.display)})),y=!1;if((0,l.eachComponent)(p,(function(n){if(n&&n.component&&("panel"===n.component.type&&null!=n&&n.parent.wizard&&!t(n,o,!1)&&(a&&(e.setRootPanelId(n),u.push(n)),y=!0),n.isNestedWizard&&n.subForm)){var r=t(n,u,a);y||(y=r)}}),!0),"panel"===n.component.type&&(!y&&a&&(e.setRootPanelId(n),o.push(n)),y&&h.length)){var m=i.default.clone(n);m.components=h,e.setRootPanelId(m),r.push(m)}return a&&(o.push.apply(o,c(r).concat(u)),r=[]),y};n.forEach((function(e){e.visible&&o(e,t)}),[]),this.localRoot&&this.id===this.localRoot.id&&t.forEach((function(e,t){e.eachComponent((function(e){e.page=t}))})),this.allPages=t}},{key:"getSortedComponents",value:function(e){var t=e.components,n=e.originalComponents,r=[],o=[];return t&&t.length&&t.map((function(e){"panel"===e.component.type&&(o[e.component.key||e.component.title]=e)})),null==n||n.forEach((function(e){e.key||(e.key=e.title),o[e.key]&&r.push(o[e.key])})),r}},{key:"findRootPanel",value:function(e){var t;return null!==(t=e.parent)&&void 0!==t&&t.parent?this.findRootPanel(e.parent):e}},{key:"setRootPanelId",value:function(e){var t;if(!e.rootPanelId||e.rootPanelId===e.id){var n=null!==(t=e.parent)&&void 0!==t&&t.parent?this.findRootPanel(e.parent):e;e.rootPanelId=n.id}}},{key:"establishPages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.data;this.pages=[],this.prefixComps=[],this.suffixComps=[];var n=[],r={},o=h(h({},i.default.clone(this.options)),this.parent?{root:this}:{});return this.components&&this.components.length&&this.components.forEach((function(e){"panel"===e.component.type&&(r[e.component.key||e.component.title]=e)})),this.originalComponents&&this.originalComponents.forEach((function(i){if("panel"===i.type){i.key||(i.key=i.title);var a=r[i.key],u=e.shouldForceShow(i),s=e.shouldForceHide(i),c=a?a.visible:(0,l.checkCondition)(i,t,t,e.component,e)&&!i.hidden;u?c=!0:s&&(c=!1),c&&(n.push(i),a&&e.pages.push(a)),!a&&c&&((a=e.createComponent(i,o)).visible=c,e.pages.push(a),a.eachComponent((function(t){t.page=e.pages.length-1})))}else"button"!==i.type&&(e.pages.length?e.suffixComps.push(e.createComponent(i,o)):e.prefixComps.push(e.createComponent(i,o)))})),this.pages.length&&this.emit("pagesChanged"),this.transformPages(),this.allPages&&this.allPages.length&&this.updatePages(),n}},{key:"updatePages",value:function(){this.pages=this.allPages}},{key:"addComponents",value:function(){this.establishPages()}},{key:"setPage",value:function(e){var t=this;if(e===this.page)return o.default.resolve();if(e>=0&&e=this.page?this.pages[this.page]:{components:[]}}},{key:"getNextPage",value:function(){var e;if(null!==(e=this.pages)&&void 0!==e&&e[this.page]){var t=this.submission.data,n=this.pages[this.page].component;if(n){var r=this.pages.length>this.page+1&&!this.showAllErrors?this.page+1:-1;if(n.nextPage){var o=this.evaluate(n.nextPage,{next:r,data:t,page:r,form:n},"next");if(null===o)return this.currentNextPage=null,null;var i=parseInt(o,10);return!isNaN(parseInt(i,10))&&isFinite(i)?(this.currentNextPage=i,i):(this.currentNextPage=this.getPageIndexByKey(o),this.currentNextPage)}return this.currentNextPage=r,r}this.currentNextPage=null}return null}},{key:"getPreviousPage",value:function(){return this.page-1}},{key:"beforeSubmit",value:function(){var e=this.getPages();return o.default.all(e.map((function(e){return e.options.beforeSubmit=!0,e.beforeSubmit()})))}},{key:"beforePage",value:function(e){var t=this;return new o.default((function(n,r){t.hook(e?"beforeNext":"beforePrev",t.currentPage,t.submission,(function(o){o&&(t.showErrors(o,!0),r(o));var i=t.currentPage;i?i.beforePage(e).then(n).catch(r):n()}))}))}},{key:"emitNextPage",value:function(){this.emit("nextPage",{page:this.page,submission:this.submission})}},{key:"nextPage",value:function(){var e=this;return this.options.readOnly?this.beforePage(!0).then((function(){return e.setPage(e.getNextPage()).then((function(){e.emitNextPage()}))})):this.checkValidity(this.localData,!0,this.localData,!0)?(this.checkData(this.submission.data),this.beforePage(!0).then((function(){return e.setPage(e.getNextPage()).then((function(){!e.options.readOnly&&!e.editMode&&e.enabledIndex1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,o=this.getPages({all:!0}).reduce((function(r,o){return t.setNestedValue(o,e.data,n,r)||r}),!1);return this.mergeData(this.data,e.data),o&&this.pageFieldLogic(this.page),e.data=this.data,this._submission=e,r||this.establishPages(e.data),this.setEditMode(e),o}},{key:"isClickable",value:function(e,t){return this.page!==t&&(0,l.firstNonNil)([i.default.get(e,"breadcrumbClickable"),this.options.breadcrumbSettings.clickable])}},{key:"hasButton",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getNextPage(),n=i.default.get(this.currentPage,"component.buttonSettings",{}),r=n.previous,o=void 0===r?this.options.buttonSettings.showPrevious:r,a=n.cancel,u=void 0===a?this.options.buttonSettings.showCancel:a,l=n.submit,s=void 0===l?this.options.buttonSettings.showSubmit:l,c=n.next,f=void 0===c?this.options.buttonSettings.showNext:c;switch(e){case"previous":return o&&this.getPreviousPage()>-1;case"next":return f&&null!==t&&-1!==t;case"cancel":return u&&!this.options.readOnly;case"submit":return s&&!this.options.readOnly&&(null===t||this.page===this.pages.length-1);default:return!0}}},{key:"pageId",value:function(e){return e.key?"".concat(e.key,"-").concat(e.title):e.components&&e.components.length>0?this.pageId(e.components[0]):e.title}},{key:"onChange",value:function(e,t,n,r){var o,a,u=this;g(_(s.prototype),"onChange",this).call(this,e,t,n,r),this.alert&&!this.submitted&&(this.checkValidity(this.localData,!1,this.localData,!0),this.showErrors([],!0,!0));var l,c,f=this.currentNextPage;this.hasExtraPages?(o=this.pages.map((function(e){return e.component.key})),this.establishPages(),a=this.pages.map((function(e){return e.component.key}))):(o=this.currentPanels||this.pages.map((function(e){return e.component.key})),a=this.establishPages().map((function(e){return e.key})),this.currentPanels=a,null!==(l=this.currentPanel)&&void 0!==l&&l.key&&null!==(c=this.currentPanels)&&void 0!==c&&c.length&&this.setPage(this.currentPanels.findIndex((function(e){return e===u.currentPanel.key})))),(!i.default.isEqual(a,o)||e&&e.fromSubmission)&&this.redrawHeader(),f!==this.getNextPage()&&this.redrawNavigation(),this.options.readOnly&&(this.prefixComps.length||this.suffixComps.length)&&this.redraw()}},{key:"redraw",value:function(){var e,t;return null!==(e=this.parent)&&void 0!==e&&null!==(t=e.component)&&void 0!==t&&t.modalEdit?this.parent.redraw():g(_(s.prototype),"redraw",this).call(this)}},{key:"checkValidity",value:function(e,t,n,r){return this.checkCondition(n,e)?(!r||this.isLastPage()?this.getComponents():this.currentPage.components).reduce((function(r,o){return o.checkValidity(e,t,n)&&r}),!0):(this.setCustomValidity(""),!0)}},{key:"errors",get:function(){return this.isLastPage()?g(_(s.prototype),"errors",this):this.currentPage.errors}},{key:"focusOnComponent",value:function(e){var t,n,r=this,o=0,i=this.pages.filter((function(t,n){var r=!1;return t.getComponent(e,(function(t){t.path===e&&(o=n,r=!0)})),r})),a=(t=i,n=1,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],l=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,n)||f(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return a&&a!==this.currentPage?this.setPage(o).then((function(){r.checkValidity(r.submission.data,!0,r.submission.data),r.showErrors(),g(_(s.prototype),"focusOnComponent",r).call(r,e)})):g(_(s.prototype),"focusOnComponent",this).call(this,e)}}],n&&v(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(a.default);t.default=S,S.setBaseUrl=u.GlobalFormio.setBaseUrl,S.setApiUrl=u.GlobalFormio.setApiUrl,S.setAppUrl=u.GlobalFormio.setAppUrl},72940:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(21249),n(26699),n(32023),n(82772),n(34553),n(2707),n(57327),n(41539),n(47941),n(79753),n(89554),n(54747),n(24812),n(40561),n(69826),n(68304),n(30489);var o,i=c(n(95529)),a=c(n(12215)),u=c(n(1848)),l=c(n(96486)),s=n(82531);function c(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n=this.page?e[this.page]:null}},{key:"form",get:function(){return this._form},set:function(e){if(this._form=e,this._form.components&&Array.isArray(this._form.components)||(this._form.components=[]),0===this.pages.length){var t=this._form.components.filter((function(e){return"button"!==e.type}));this._form.components=[this.getPageConfig(1,t)]}this.rebuild()}},{key:"schema",get:function(){l.default.assign(this.currentPage,this.webform._form.components[0]);var e=new a.default(this.options);return e.setForm(this._form,{noEmit:!0}),e.schema}},{key:"render",value:function(){var e=this;return this.renderTemplate("builderWizard",{sidebar:this.renderTemplate("builderSidebar",{scrollEnabled:this.sideBarScroll,groupOrder:this.groupOrder,groupId:"builder-sidebar-".concat(this.id),groups:this.groupOrder.map((function(t){return e.renderTemplate("builderSidebarGroup",{group:e.groups[t],groupKey:t,groupId:"builder-sidebar-".concat(e.id),subgroups:e.groups[t].subgroups.map((function(n){return e.renderTemplate("builderSidebarGroup",{group:n,groupKey:n.key,groupId:"group-container-".concat(t),subgroups:[]})}))})}))}),pages:this.pages,form:this.webform.render()})}},{key:"attach",value:function(e){var t=this;return this.loadRefs(e,{addPage:"multiple",gotoPage:"multiple"}),this.refs.gotoPage.forEach((function(e,t){e.parentNode.dragInfo={index:t}})),o&&(this.navigationDragula=o([this.element.querySelector(".wizard-pages")],{moves:function(e){return!e.classList.contains("wizard-add-page")},accepts:function(e,t,n,r){return!!r}}).on("drop",this.onReorder.bind(this))),this.refs.addPage.forEach((function(e){t.addEventListener(e,"click",(function(e){e.preventDefault(),t.addPage()}))})),this.refs.gotoPage.forEach((function(e,n){t.addEventListener(e,"click",(function(e){e.preventDefault(),t.setPage(n)}))})),p(v(h.prototype),"attach",this).call(this,e)}},{key:"detach",value:function(){this.navigationDragula&&this.navigationDragula.destroy(),this.navigationDragula=null,p(v(h.prototype),"detach",this).call(this)}},{key:"rebuild",value:function(){var e,t=this.currentPage;return this.webform.setForm({display:"form",type:"form",components:t?[t]:[],controller:(null===(e=this._form)||void 0===e?void 0:e.controller)||""},{keepAsReference:!0}),this.redraw()}},{key:"addPage",value:function(e){var t=e&&e.schema?(0,s.fastCloneDeep)(e.schema):this.getPageConfig(this.pages.length+1);return u.default.uniquify(this._form.components,t),this._form.components.push(t),this.emitSaveComponentEvent(t,t,this._form,"components",this._form.components.length-1,!0,t),this.emit("change",this._form),this.rebuild()}},{key:"removePage",value:function(e,t){return this._form.components.splice(t,1),this.emit("change",this._form),e===this.pages.length?0===e?(this._form.components.push(this.getPageConfig(1)),this.rebuild()):this.setPage(e-1):this.rebuild()}},{key:"onReorder",value:function(e,t,n,r){var o=this,i=null==r?void 0:r.classList.contains("wizard-add-page");if(e.dragInfo&&(!r||r.dragInfo||i)){var a=e.dragInfo.index,u=r&&r.dragInfo?r.dragInfo.index:this.pages.length,l=u>a,c=(0,s.fastCloneDeep)(this._form.components),f=this._form.components[a];return c.splice(u,0,f),c.splice(l?a:a+1,1),this._form.components=(0,s.fastCloneDeep)(c),this.rebuild().then((function(){o.emit("change",o._form)}))}console.warn("There is no Drag Info available for either dragged or sibling element")}},{key:"setPage",value:function(e){if(e!==this.page)return this.page=e,this.rebuild()}},{key:"getPageConfig",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{title:"Page ".concat(e),label:"Page ".concat(e),type:"panel",key:"page".concat(e),components:t}}},{key:"pasteComponent",value:function(e){if(!(e instanceof h))return this._form.components.find((function(t){return l.default.isEqual(e.component,t)}))?void this.addPage(e):p(v(h.prototype),"pasteComponent",this).call(this,e)}}],n&&d(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),h}(i.default);t.default=b},59671:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(41539),n(12419),n(78011),n(69070),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(68304),n(24812),n(30489);var o=u(n(34558)),i=u(n(91459)),a=u(n(96486));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var n=0;n\n
  • < 28 bits = Very Weak;
  • \n
  • 28 - 35 bits = Weak; should keep out most people;
  • \n
  • 36 - 59 bits = Reasonable; fairly secure passwords for network and company passwords;
  • \n
  • 60 - 127 bits = Strong; can be good for guarding financial information;
  • \n
  • > 128 bits = Very Strong; often overkill;
  • \n\n",mask:!1,spellcheck:!0,tableView:!1,delimiter:!1,requireDecimal:!1,inputFormat:"plain",validate:{required:!0,min:1,max:128},key:"maxEntropy",type:"number",input:!0},{label:"Style",tooltip:"Specifies the background color style using bootstrap classes",tableView:!0,data:{values:[{label:"Danger",value:"danger"},{label:"Warning",value:"warning"},{label:"Info",value:"info"},{label:"Success",value:"success"}]},selectThreshold:.3,validate:{onlyAvailableItems:!1},key:"style",type:"select",indexeddb:{filter:{}},input:!0},{label:"Color",placeholder:"#0079c0",tooltip:"Specifies a color of the indicator element",tableView:!0,key:"color",type:"textfield",input:!0}]},{label:"Update On",tableView:!0,data:{values:[{label:"Strength Level Change",value:"levelChange"},{label:"Entropy Change",value:"entropyChange"}]},selectThreshold:.3,validate:{onlyAvailableItems:!1},key:"updateOn",type:"select",indexeddb:{filter:{}},input:!0},{label:"Rules",reorder:!1,addAnotherPosition:"bottom",layoutFixed:!1,enableRowGroups:!1,initEmpty:!1,tableView:!1,defaultValue:[{}],key:"rulesSettings",type:"datagrid",input:!0,components:[{label:"Name",tableView:!0,data:{values:[{label:"Length",value:"length"},{label:"Lower Case",value:"lowerCase"},{label:"Upper Case",value:"upperCase"},{label:"Numeric",value:"numeric"},{label:"Symbols",value:"symbols"}]},selectThreshold:.3,validate:{required:!0,onlyAvailableItems:!1},key:"name",type:"select",indexeddb:{filter:{}},input:!0},{label:"Error Message",tableView:!0,key:"errorMessage",type:"textfield",input:!0},{label:"Required",tableView:!1,key:"required",type:"checkbox",input:!0,defaultValue:!1}]},{label:"Custom Rules",tableView:!1,rowDrafts:!1,key:"customRules",type:"editgrid",input:!0,components:[{label:"Name",tableView:!0,validate:{required:!0},key:"name",type:"textfield",input:!0},o.default.javaScriptValue("Check","check","",1100,'

    Example:

    valid = !value.includes(data.email) ? true : "Password should not be variation of the email";

    ',"","",!0),{label:"Increase Characters Pool Size",description:"Set this to amount of characters that may be used in the password if there is a specific group of characters is used.\nE.g., if your validation checks if there is any numeric symbol in the password, then you should set it to 10 (there are 10 possible numbers).\n",mask:!1,spellcheck:!0,tableView:!1,delimiter:!1,requireDecimal:!1,inputFormat:"plain",key:"increaseCharactersPoolSize",type:"number",input:!0},{label:"Required",tooltip:"Check if this check is required to proceed",tableView:!1,key:"required",type:"checkbox",input:!0,defaultValue:!1}]},o.default.javaScriptValue("Is Valid","isValid","",1100,"

    Example:

    valid = entropy > maxEntropy / 2 ;

    ","","entropyCurrent entropy bits of the password.levelCurrent strength level of the password.",!0),{label:"Required",description:"Check this if you don't want to allow submitting password which does not correspond to the minimal strength requirements.",tableView:!1,key:"required",type:"checkbox",input:!0,defaultValue:!1},{label:"Black List",tooltip:"Add words to search in the password. If there are some words from that list were found, the entropy of the password will be recalculated.\n",tableView:!0,multiple:!0,key:"blackList",type:"textfield",input:!0},o.default.javaScriptValue("Custom Blacklisted Words","customBlackListedWords","",1100,"

    Example:

    values = [ data.name, data.dataOfBirth, data.favoriteColor ];

    ","","",!0),{label:"Disable Blacklisted Words",tooltip:"Check if you want to disable submitting passwords containing words form the clack list",tableView:!1,key:"disableBlacklistedWords",type:"checkbox",input:!0,defaultValue:!1},{label:"Location",hideLabel:!1,tableView:!1,key:"location",type:"container",input:!0,components:[{label:"Insert",tooltip:"Specifies where the indicator will be inserted: before or aftre an element",tableView:!0,data:{values:[{label:"Before",value:"before"},{label:"After",value:"after"}]},selectThreshold:.3,validate:{onlyAvailableItems:!1},key:"insert",type:"select",indexeddb:{filter:{}},input:!0},{label:"Selector",placeholder:"[ref='element']",description:"Specifies the selector of the element which will be used as a reference to insert the indicator template",tableView:!0,key:"selector",type:"textfield",input:!0}]},{label:"Template",editor:"ace",tableView:!0,key:"template",type:"textarea",input:!0,as:"html"}];t.default=i},16996:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(79753),n(32165),n(66992),n(78783),n(33948),n(91038),n(47042),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(2707),n(74916),n(68309),n(44914),n(15306),n(24812),n(24603),n(39714),n(89554),n(41539),n(54747),n(92222),n(69600),n(68304),n(30489);var o=u(n(96486)),i=u(n(59671)),a=u(n(10902));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n/?~]/.test(e)||"Value must contain symbols"},increaseCharactersPoolSize:32}}}},{key:"charactersPoolLength",get:function(){return this._charactersPoolLength},set:function(e){this._charactersPoolLength=e}},{key:"level",get:function(){return this._level||this.getLevel()},set:function(e){this._level=e}},{key:"entropy",get:function(){return this._entropy},set:function(e){var t=this.getLevel(),n="entropyChange"===this.settings.updateOn&&this._entropy!==e;this._entropy=e,this.level=this.getLevel(),("levelChange"===this.settings.updateOn&&t.name!==this.level.name||n)&&this.updateView()}},{key:"dictionarySize",get:function(){return this.settings.dictionarySize||171476}},{key:"template",get:function(){return this.settings.template}},{key:"tooltip",get:function(){var e,t;return(null===(e=this.level)||void 0===e?void 0:e.tooltip)||"".concat(null===(t=this.level)||void 0===t?void 0:t.name," strongness")}},{key:"rulesSettings",get:function(){return this.settings.rulesSettings||[]}},{key:"customRules",get:function(){return this.settings.customRules||[]}},{key:"log2",value:function(e){return"function"==typeof Math.log2?Math.log2(e):Math.log(e)*Math.LOG2E}},{key:"calculatePasswordEntropy",value:function(e,t){return e&&t?this.log2(Math.pow(t,e)):0}},{key:"calculatePasswordEntropyWords",value:function(e){return this.dictionarySize?this.log2(this.dictionarySize)*e:0}},{key:"render",value:function(){var e=this.component.interpolate(this.template,{entropy:this.entropy,maxEntropy:this.maxEntropy,level:this.level,levelName:this.level.name.replace(" ","-").toLowerCase(),levels:this.levels,readOnly:this.component.options.readOnly,pristine:this.component.pristine,t:this.t.bind(this),tooltip:this.tooltip});return this.component.sanitize(e)}},{key:"checkBlackList",value:function(e){var t=l(this.settings.blackList),n=this.settings.customBlacklistedWords;n&&"string"==typeof n&&(n=this.evaluate(n,this.component.evalContext({value:e}),"values"))&&n.length&&t.push.apply(t,l(n));for(var r=e,o=[],i=0;i=Math.round(this.maxEntropy/2)}},{key:"handleRuleCheckResult",value:function(e,t,n,r){if(!0!==e)r.push({validation:t.name,message:n,level:t.required?"error":"warning"});else if(t.increaseCharactersPoolSize)return t.increaseCharactersPoolSize;return 0}},{key:"performChecks",value:function(e){var t=this,n=[],r=0;return this.rulesSettings.forEach((function(i){if(t.rules[i.name]){var a=o.default.merge({},t.rules[i.name],i),u=a.check(e,i.options||{}),l=i.message||u;r+=t.handleRuleCheckResult(u,a,l,n)}})),this.customRules.forEach((function(o){if(o.check&&"string"==typeof o.check){var i=t.evaluate(o.check,t.component.evalContext({value:e}),"valid"),a="string"==typeof i?i:"Password does not meet ".concat(o.name," validation");r+=t.handleRuleCheckResult(i,o,a,n)}})),{charactersPoolSize:r,errors:n}}},{key:"checkValidity",value:function(e){var t,n=e.length,r=this.performChecks(e),o=r.charactersPoolSize,i=r.errors;this.errors=i;var a=this.calculatePasswordEntropy(n,o),u=null!==(t=this.settings.blackList)&&void 0!==t&&t.length||this.settings.customBlacklistedWords?this.checkBlackList(e):null;return u&&!0!==u?(this.handleBlackListCheckResult(u),this.entropy=Math.min(a,u.entropy)):this.entropy=a,this.isValid()||this.errors.push({message:"Password is not strong enough",level:this.settings.required?"error":"warning"}),!this.errors.length}},{key:"handleBlackListCheckResult",value:function(e){var t=e.blacklistedWords,n=this.settings.disableBlacklistedWords,r="Password ".concat(n?"must":"should"," not include common words: ").concat(t.join(", ")),o={name:"blacklist",required:n};this.handleRuleCheckResult(!1,o,r,this.errors)}},{key:"attach",value:function(e){var t=this;f(y(d.prototype),"attach",this).call(this,e);var n=this.component.ce("div",{ref:"passwordStrengthIndicator"});this.insertContainer(e,n)||this.component.append(n),this._element=n,this.component.on("redraw",(function(){return t.updateView()})),this.component.on("componentError",(function(){return t.updateView()})),this.updateView()}},{key:"insertContainer",value:function(e,t){var n,r;if(!e||!t)return!1;var o,i=null===(n=this.settings.location)||void 0===n?void 0:n.insert,a=null===(r=this.settings.location)||void 0===r?void 0:r.selector;if(a&&(o=e.querySelector(a)),!o)return console.warn("No elements found using selector: ".concat(a)),!1;var u=o.parentNode;switch(i){case"after":return!!u&&(u.insertBefore(t,o.nextSibling||null),!0);case"before":return!!u&&(u.insertBefore(t,o),!0);default:return console.warn("Unknown insert option: ".concat(i)),!1}}},{key:"destroy",value:function(){f(y(d.prototype),"destroy",this).call(this)}},{key:"getLevel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.entropy,t=this.levels[0],n=t.maxEntropy;if(e<=t.maxEntropy)return t;if(e>=this.maxEntropy)return this.levels[this.levels.length-1];for(var r=1;rn&&e<=o.maxEntropy)return o;n=o.maxEntropy}return t}},{key:"updateView",value:function(){if(this.element){var e=this.render();this.element.innerHTML=e}}}],r=[{key:"info",get:function(){return{supportedComponents:["password"],name:"passwordStrength",components:a.default,label:"Password Strength",defaultSettings:{rulesSettings:[{name:"length",required:!1,message:"Value should be longer"},{name:"upperCase",required:!1,message:"Value should have uppercase letters"},{name:"numeric",required:!1,message:"Value should have numeric symbols"},{name:"lowerCase",required:!1,message:"Value should be have lowercase letters"},{name:"symbols",required:!1,message:"Value should have symbols"}],updateOn:"levelChange",required:!0,levels:[{name:"Low",maxEntropy:28,style:"danger"},{name:"Medium",maxEntropy:45,style:"warning"},{name:"High",maxEntropy:59,style:"info"},{name:"Very High",maxEntropy:85,style:"success"}],blackList:[],template:"\n
    \n {% if (!ctx.readOnly && !ctx.pristine) { %}\n
    \n {% } %}\n \n ",location:{insert:"after",selector:'[ref="element"]'}}}}}],n&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),d}(i.default);t.default=m},24951:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.editForms=t.default=void 0,n(21249),n(68309);var r,o=(r=n(16996))&&r.__esModule?r:{default:r},i=[o.default.info].map((function(e){var t=e.components,n=e.name;return{type:"form",key:"settings",display:"form",input:!0,components:t,defaultValue:{data:e.defaultSettings},customConditional:function(e){return e.row.name.value===n}}}));t.editForms=i;var a={passwordStrength:o.default};t.default=a},57514:function(e,t,n){"use strict";n(69070),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r=u(n(96486)),o=u(n(6487)),i=u(n(95529)),a=u(n(72940));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function s(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function S(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||j(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){if(e){if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(e,t):void 0}}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};return u.default.defaultsDeep(e,this.defaultSchema)}},{key:"ready",get:function(){return i.default.resolve(this)}},{key:"isPDFReadOnlyMode",get:function(){return this.parent&&this.parent.form&&"pdf"===this.parent.form.display&&this.options.readOnly}},{key:"labelInfo",get:function(){var e={};e.hidden=this.labelIsHidden(),e.className="",e.labelPosition=this.component.labelPosition,e.tooltipClass="".concat(this.iconClass("question-sign")," text-muted");var t=this.isPDFReadOnlyMode;return this.hasInput&&this.component.validate&&(0,c.boolValue)(this.component.validate.required)&&!t&&(e.className+=" field-required"),e.hidden&&(e.className+=" control-label--hidden"),this.info.attr.id&&(e.for=this.info.attr.id),e}},{key:"init",value:function(){var e,t=this;this.disabled=this.shouldDisabled,this._visible=this.conditionallyVisible(null,null),null!==(e=this.component.addons)&&void 0!==e&&e.length&&this.component.addons.forEach((function(e){return t.createAddon(e)}))}},{key:"afterComponentAssign",value:function(){}},{key:"createAddon",value:function(e){var t,n=e.name;if(n){var r=(null===(t=e.settings)||void 0===t?void 0:t.data)||{},o=y.default[n.value],i=null;if(o){var a=o.info.supportedComponents;null!=a&&a.length&&-1===a.indexOf(this.component.type)?console.warn("Addon ".concat(n.label," does not support component of type ").concat(this.component.type,".")):(i=new o(r,this),this.addons.push(i))}return i}}},{key:"destroy",value:function(){C(D(w.prototype),"destroy",this).call(this),this.detach(),this.addons.forEach((function(e){return e.destroy()}))}},{key:"shouldDisabled",get:function(){return this.options.readOnly||this.component.disabled||this.options.hasOwnProperty("disabled")&&this.options.disabled[this.key]}},{key:"isInputComponent",get:function(){return!this.component.hasOwnProperty("input")||this.component.input}},{key:"allowData",get:function(){return this.hasInput}},{key:"hasInput",get:function(){return this.isInputComponent||this.refs.input&&this.refs.input.length}},{key:"defaultSchema",get:function(){return w.schema()}},{key:"key",get:function(){return u.default.get(this.component,"key","")}},{key:"parentVisible",get:function(){return this._parentVisible},set:function(e){this._parentVisible=e}},{key:"parentDisabled",get:function(){return this._parentDisabled},set:function(e){this._parentDisabled=e}},{key:"shouldForceVisibility",value:function(e,t){return!!this.options[t]&&(e||(e=this.component),u.default.isArray(this.options[t])?this.options[t].includes(e.key):this.options[t][e.key])}},{key:"shouldForceHide",value:function(e){return this.shouldForceVisibility(e,"hide")}},{key:"shouldForceShow",value:function(e){return this.shouldForceVisibility(e,"show")}},{key:"visible",get:function(){return!!(this.builderMode||this.previewMode||this.options.showHiddenFields)||!this.shouldForceHide()&&(!!this.shouldForceShow()||this._visible&&this._parentVisible)},set:function(e){if(this._visible!==e){if(e&&this.shouldForceHide())return;if(!e&&this.shouldForceShow())return;this._visible=e,this.clearOnHide(),this.redraw()}}},{key:"currentForm",get:function(){return this._currentForm},set:function(e){this._currentForm=e}},{key:"fullMode",get:function(){return"full"===this.options.attachMode}},{key:"builderMode",get:function(){return"builder"===this.options.attachMode}},{key:"calculatedPath",get:function(){return console.error("component.calculatedPath was deprecated, use component.path instead."),this.path}},{key:"labelPosition",get:function(){return this.component.labelPosition}},{key:"labelWidth",get:function(){var e=this.component.labelWidth;return e>=0?e:30}},{key:"labelMargin",get:function(){var e=this.component.labelMargin;return e>=0?e:3}},{key:"isAdvancedLabel",get:function(){return["left-left","left-right","right-left","right-right"].includes(this.labelPosition)}},{key:"labelPositions",get:function(){return this.labelPosition.split("-")}},{key:"skipInEmail",get:function(){return!1}},{key:"rightDirection",value:function(e){return!this.options.condensedMode&&"right"===e}},{key:"getLabelInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.rightDirection(this.labelPositions[0]),n="left"===this.labelPositions[0]||e,r=this.rightDirection(this.labelPositions[1]),o="";if(this.component.hideLabel){var i=e?0:this.labelWidth+this.labelMargin;o=t?"margin-right: ".concat(i,"%"):"",o=n?"margin-left: ".concat(i,"%"):""}var a="\n flex: ".concat(this.labelWidth,";\n ").concat(t?"margin-left":"margin-right",": ").concat(this.labelMargin,"%;\n "),u="\n flex: ".concat(100-this.labelWidth-this.labelMargin,";\n ").concat(o,";\n ").concat(this.component.hideLabel?"max-width: ".concat(100-this.labelWidth-this.labelMargin):"",";\n ");return{isRightPosition:t,isRightAlign:r,labelStyles:a,contentStyles:u}}},{key:"getModifiedSchema",value:function(e,t,n){var r=this,o={};return t?(u.default.each(e,(function(e,i){if(!u.default.isArray(e)&&u.default.isObject(e)&&t.hasOwnProperty(i)){var a=r.getModifiedSchema(e,t[i],!0);u.default.isEmpty(a)||(o[i]=a)}else u.default.isArray(e)?0===e.length||u.default.isEqual(e,t[i])||(o[i]=e):(!n&&"type"===i||!n&&"key"===i||!n&&"label"===i||!n&&"input"===i||!n&&"tableView"===i||""!==e&&!t.hasOwnProperty(i)||""!==e&&e!==t[i]||t[i]&&e!==t[i])&&(o[i]=e)})),o):e}},{key:"schema",get:function(){return(0,c.fastCloneDeep)(this.getModifiedSchema(u.default.omit(this.component,"id"),this.defaultSchema))}},{key:"isInDataGrid",get:function(){return this.inDataGrid}},{key:"t",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"";if(e in v.default&&n._userInput)return e;n.data=this.rootValue,n.row=this.data,n.component=this.component;for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i");return this.getFormattedAttribute(t)}},{key:"isHtmlRenderMode",value:function(){return"html"===this.options.renderMode}},{key:"renderTemplate",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,o=r||this.options.renderMode||"form";n.component=this.component,n.self=this,n.options=this.options,n.readOnly=this.options.readOnly,n.iconClass=this.iconClass.bind(this),n.size=this.size.bind(this),n.t=this.t.bind(this),n.transform=this.transform.bind(this),n.id=n.id||this.id,n.key=n.key||this.key,n.value=n.value||this.dataValue,n.disabled=this.disabled,n.builder=this.builderMode,n.render=function(){return console.warn("Form.io 'render' template function is deprecated.\n If you need to render template (template A) inside of another template (template B),\n pass pre-compiled template A (use this.renderTemplate('template_A_name') as template context variable for template B"),t.renderTemplate.apply(t,arguments)},n.label=n.labelInfo||this.labelInfo,n.tooltip=this.getFormattedTooltip(this.component.tooltip);var i=["".concat(e,"-").concat(this.component.type,"-").concat(this.key),"".concat(e,"-").concat(this.component.type),"".concat(e,"-").concat(this.key),"".concat(e)];return this.hook("render".concat(e.charAt(0).toUpperCase()+e.substring(1,e.length)),this.interpolate(this.getTemplate(i,o),n),n,o)}},{key:"sanitize",value:function(e,t,n){var r;return this.shouldSanitizeValue||t?c.sanitize(e,{sanitizeConfig:u.default.merge((null===(r=this.options)||void 0===r?void 0:r.sanitizeConfig)||{},n||{})}):e}},{key:"renderString",value:function(e,t){return e?this.interpolate(e,t):""}},{key:"performInputMapping",value:function(e){return e}},{key:"widget",get:function(){var e,t=this.component.widget;return t&&null!==(e=this.root)&&void 0!==e&&e.shadowRoot&&(t.shadowRoot=this.root.shadowRoot),t&&h.default[t.type]?new h.default[t.type](t,this.component,this):null}},{key:"getBrowserLanguage",value:function(){var e,t=window.navigator,n=["language","browserLanguage","systemLanguage","userLanguage"];if(Array.isArray(t.languages))for(var r=0;r [ref="'.concat(n,'"]'):'[ref="'.concat(n,'"]');o&&r.startsWith("single")?this.refs[n]=e.querySelector(i):this.refs[n]=e.querySelectorAll(i)}}},{key:"setOpenModalElement",value:function(e){this.componentModal.setOpenModalElement(e||this.getModalPreviewTemplate())}},{key:"getModalPreviewTemplate",value:function(){var e,t,n="password"===this.component.type?this.dataValue.replace(/./g,"•"):this.dataValue,r=this.error?{level:"error",message:this.error.message}:"";return this.hasInput&&null!==(e=this.component.validate)&&void 0!==e&&e.required&&!this.isPDFReadOnlyMode&&(t={className:"field-required"}),this.renderTemplate("modalPreview",{previewText:this.getValueAsString(n,{modalPreview:!0})||this.t("Click to set value"),messages:r&&this.renderTemplate("message",r),labelInfo:t})}},{key:"build",value:function(e){return e=e||this.element,this.empty(e),this.setContent(e,this.render()),this.attach(e)}},{key:"hasModalSaveButton",get:function(){return!0}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Unknown component: ".concat(this.component.type),t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.visible;return this.rendered=!0,this.builderMode||this.previewMode||!this.component.modalEdit?this.renderTemplate("component",{visible:n,id:this.id,classes:this.className,styles:this.customStyle,children:e},t):p.default.render(this,{visible:n,showSaveButton:this.hasModalSaveButton,id:this.id,classes:this.className,styles:this.customStyle,children:e},t)}},{key:"attachTooltips",value:function(e){var t=this;null==e||e.forEach((function(e,n){if(e){var r=e.getAttribute("data-tooltip"),o=e.getAttribute("data-title"),i=t.interpolate(o||r).replace(/(?:\r\n|\r|\n)/g,"
    ");t.tooltips[n]=(0,a.default)(e,{allowHTML:!0,trigger:"mouseenter click focus",placement:"right",zIndex:1e4,interactive:!0,content:t.t(t.sanitize(i),{_userInput:!0})})}}))}},{key:"createComponentModal",value:function(e,t,n){return new p.default(this,e,t,n)}},{key:"attach",value:function(e){if(!this.builderMode&&!this.previewMode&&this.component.modalEdit){var t=!!this.componentModal&&this.componentModal.isOpened,n=t?this.componentModal.currentValue:this.dataValue,r=this.componentModal&&t?this.componentModal.openModalTemplate:null;this.componentModal=this.createComponentModal(e,t,n),this.setOpenModalElement(r)}this.attached=!0,this.element=e,e.component=this,this.element.id&&(this.id=this.element.id,this.component.id=this.id),this.loadRefs(e,{messageContainer:"single",tooltip:"multiple"}),this.attachTooltips(this.refs.tooltip),this.attachLogic(),this.autofocus(),this.hook("attachComponent",e,this);var o=this.component.type;return o&&this.hook("attach".concat(o.charAt(0).toUpperCase()+o.substring(1,o.length)),e,this),this.restoreFocus(),this.addons.forEach((function(t){return t.attach(e)})),i.default.resolve()}},{key:"restoreFocus",value:function(){var e,t,n;(null===(e=this.root)||void 0===e||null===(t=e.focusedComponent)||void 0===t?void 0:t.path)===this.path&&(this.loadRefs(this.element,{input:"multiple"}),this.focus(null===(n=this.root.currentSelection)||void 0===n?void 0:n.index),this.restoreCaretPosition())}},{key:"addShortcut",value:function(e,t){e&&this.root&&this.root!==this&&(t||(t=this.component.shortcut),this.root.addShortcut(e,t))}},{key:"removeShortcut",value:function(e,t){e&&this.root!==this&&(t||(t=this.component.shortcut),this.root.removeShortcut(e,t))}},{key:"detach",value:function(){this.refs={},this.removeEventListeners(),this.detachLogic(),this.tooltip&&this.tooltip.destroy()}},{key:"checkRefresh",value:function(e,t,n){var r=u.default.get(t,"instance.path",!1);r&&this.path===r||("data"===e?this.refresh(this.data,t,n):r&&(0,c.getComponentPath)(t.instance)===e&&t&&t.instance&&this.inContext(t.instance)&&this.refresh(t.value,t,n))}},{key:"checkRefreshOn",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=e||[],!n.noRefresh){!e.length&&n.changed&&(e=[n.changed]);var r=n.fromBlur?this.component.refreshOnBlur:this.component.refreshOn||this.component.redrawOn;r&&(Array.isArray(r)?r.forEach((function(r){return e.forEach((function(e){return t.checkRefresh(r,e,n)}))})):e.forEach((function(e){return t.checkRefresh(r,e,n)})))}}},{key:"refresh",value:function(e){this.hasOwnProperty("refreshOnValue")?this.refreshOnChanged=!u.default.isEqual(e,this.refreshOnValue):this.refreshOnChanged=!0,this.refreshOnValue=(0,c.fastCloneDeep)(e),this.refreshOnChanged&&(this.component.clearOnRefresh&&this.setValue(null),this.triggerRedraw())}},{key:"inContext",value:function(e){if(e.data===this.data)return!0;for(var t=this.parent;t;){if(t.data===e.data)return!0;t=t.parent}return!1}},{key:"viewOnly",get:function(){return this.options.readOnly&&this.options.viewAsHtml}},{key:"createViewOnlyElement",value:function(){return this.element=this.ce("dl",{id:this.id}),this.element&&(this.element.component=this),this.element}},{key:"defaultViewOnlyValue",get:function(){return"-"}},{key:"getWidgetValueAsString",value:function(e,t){var n=this,r=!this.refs.input||!this.refs.input[0]||!this.refs.input[0].widget;if(!e||r)return this.widget&&e?this.widget.getValueAsString(e):e;if(Array.isArray(e)){var o=[];return e.forEach((function(e,r){var i=n.refs.input[r]&&n.refs.input[r].widget;i&&o.push(i.getValueAsString(e,t))})),o}return this.refs.input[0].widget.getValueAsString(e,t)}},{key:"getValueAsString",value:function(e,t){if(!e)return"";if(e=this.getWidgetValueAsString(e,t),Array.isArray(e))return e.join(", ");if(u.default.isPlainObject(e))return JSON.stringify(e);if(null==e)return"";var n=e.toString();return this.sanitize(n)}},{key:"getView",value:function(e,t){return this.component.protected?"--- PROTECTED ---":this.getValueAsString(e,t)}},{key:"updateItems",value:function(){this.restoreValue(),this.onChange.apply(this,arguments)}},{key:"itemValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u.default.isObject(e)&&!u.default.isArray(e)){if(this.valueProperty)return u.default.get(e,this.valueProperty);if(t)return e.value}return e}},{key:"itemValueForHTMLMode",value:function(e){var t=this;return Array.isArray(e)?e.map((function(e){return Array.isArray(e)?t.itemValueForHTMLMode(e):t.itemValue(e)})).join(", "):this.itemValue(e)}},{key:"createModal",value:function(e,t,n){var r=this,o=this.ce("div",t||{});this.setContent(o,this.renderTemplate("dialog")),o.refs={},this.loadRefs.call(o,o,{dialogOverlay:"single",dialogContents:"single",dialogClose:"single"}),o.refs.dialogContents.appendChild(e),document.body.appendChild(o),document.body.classList.add("modal-open"),o.close=function(){document.body.classList.remove("modal-open"),o.dispatchEvent(new CustomEvent("close"))},this.addEventListener(o,"close",(function(){return r.removeChildFrom(o,document.body)}));var i=function(e){e.preventDefault(),o.close()},a=function(e){n?n().then((function(){return i(e)})).catch((function(){})):i(e)};return this.addEventListener(o.refs.dialogOverlay,"click",a),this.addEventListener(o.refs.dialogClose,"click",a),o}},{key:"optimizeRedraw",get:function(){return!(!this.options.optimizeRedraw||!this.element||this.visible||(this.addClass(this.element,"formio-removed"),0))}},{key:"className",get:function(){var e=this.hasInput?"".concat(this.transform("class","form-group")," has-feedback "):"";return e+="formio-component formio-component-".concat(this.component.type," "),this.key&&"form"!==this.key&&(e+="formio-component-".concat(this.key," ")),this.component.multiple&&(e+="formio-component-multiple "),this.component.customClass&&(e+=this.component.customClass),this.hasInput&&this.component.validate&&(0,c.boolValue)(this.component.validate.required)&&(e+=" required"),this.labelIsHidden()&&(e+=" formio-component-label-hidden"),this.visible||(e+=" formio-hidden"),e}},{key:"customStyle",get:function(){var e="";return u.default.each(this.component.style,(function(t,n){""!==t&&(e+="".concat(n,":").concat(t,";"))})),e}},{key:"isMobile",get:function(){return(0,l.default)()}},{key:"getElement",value:function(){return this.element}},{key:"evalContext",value:function(e){return C(D(w.prototype),"evalContext",this).call(this,Object.assign({component:this.component,row:this.data,rowIndex:this.rowIndex,data:this.rootValue,iconClass:this.iconClass.bind(this),t:this.t.bind(this),submission:this.root?this.root._submission:{data:this.rootValue},form:this.root?this.root._form:{},options:this.options},e))}},{key:"setPristine",value:function(e){this.pristine=e}},{key:"isPristine",get:function(){return this.pristine}},{key:"setDirty",value:function(e){this.dirty=e}},{key:"isDirty",get:function(){return this.dirty}},{key:"removeValue",value:function(e){this.splice(e),this.redraw(),this.restoreValue(),this.triggerRootChange()}},{key:"iconClass",value:function(e,t){var n=this.options.iconset||L.current.defaultIconset||"fa";return L.current.hasOwnProperty("iconClass")?L.current.iconClass(n,e,t):"fa"===this.options.iconset?L.defaultTemplates.iconClass(n,e,t):e}},{key:"size",value:function(e){return L.current.hasOwnProperty("size")?L.current.size(e):e}},{key:"name",get:function(){return this.t(this.component.label||this.component.placeholder||this.key,{_userInput:!0})}},{key:"errorLabel",get:function(){return this.t(this.component.errorLabel||this.component.label||this.component.placeholder||this.key)}},{key:"errorMessage",value:function(e){return this.component.errors&&this.component.errors[e]?this.component.errors[e]:e}},{key:"setContent",value:function(e,t,n,r){return e instanceof HTMLElement&&(e.innerHTML=this.sanitize(t,n,r),!0)}},{key:"restoreCaretPosition",value:function(){var e,t;if(null!==(e=this.root)&&void 0!==e&&e.currentSelection&&null!==(t=this.refs.input)&&void 0!==t&&t.length){var n=this.root.currentSelection,r=n.selection,o=n.index,i=this.refs.input[o],a=function(e){return/text|search|password|tel|url/i.test((null==e?void 0:e.type)||"")};if(i){var u;a(i)&&(u=i).setSelectionRange.apply(u,S(r))}else{var l,s=(null===(l=(i=this.refs.input[this.refs.input.length]).value)||void 0===l?void 0:l.length)||0;a(i)&&i.setSelectionRange(s,s)}}}},{key:"redraw",value:function(){if(!this.element||!this.element.parentNode||this.optimizeRedraw)return i.default.resolve();this.detach(),this.emit("redraw");var e=this.element.parentNode,t=Array.prototype.indexOf.call(e.children,this.element);return this.element.outerHTML=this.sanitize(this.render()),this.element=e.children[t],this.attach(this.element)}},{key:"rebuild",value:function(){return this.destroy(),this.init(),this.visible=this.conditionallyVisible(null,null),this.redraw()}},{key:"removeEventListeners",value:function(){C(D(w.prototype),"removeEventListeners",this).call(this),this.tooltips.forEach((function(e){return e.destroy()})),this.tooltips=[]}},{key:"hasClass",value:function(e,t){if(e)return C(D(w.prototype),"hasClass",this).call(this,e,this.transform("class",t))}},{key:"addClass",value:function(e,t){if(e)return C(D(w.prototype),"addClass",this).call(this,e,this.transform("class",t))}},{key:"removeClass",value:function(e,t){if(e)return C(D(w.prototype),"removeClass",this).call(this,e,this.transform("class",t))}},{key:"hasCondition",value:function(){return null!==this._hasCondition||(this._hasCondition=c.hasCondition(this.component)),this._hasCondition}},{key:"conditionallyVisible",value:function(e,t){return e=e||this.rootValue,t=t||this.data,this.builderMode||this.previewMode||!this.hasCondition()?!this.component.hidden:(e=e||(this.root?this.root.data:{}),this.checkCondition(t,e))}},{key:"checkCondition",value:function(e,t){return c.checkCondition(this.component,e||this.data,t||this.rootValue,this.root?this.root._form:{},this)}},{key:"checkComponentConditions",value:function(e,t,n){e=e||this.rootValue,t=t||{},n=n||this.data,!this.builderMode&!this.previewMode&&this.fieldLogic(e,n)&&this.redraw();var r=this.conditionallyVisible(e,n);return this.visible!==r&&(this.visible=r),r}},{key:"checkConditions",value:function(e,t,n){return e=e||this.rootValue,t=t||{},n=n||this.data,this.checkComponentConditions(e,t,n)}},{key:"logic",get:function(){return this.component.logic||[]}},{key:"fieldLogic",value:function(e,t){var n=this;e=e||this.rootValue,t=t||this.data;var r=this.logic;if(0!==r.length){var o=(0,c.fastCloneDeep)(this.originalComponent),i=r.reduce((function(r,i){var a=c.checkTrigger(o,i.trigger,t,e,n.root?n.root._form:{},n);return!!a&&n.applyActions(o,i.actions,a,t,e)||r}),!1);if(!u.default.isEqual(this.component,o)){this.component=o,i=!0;var a=this.shouldDisabled;this.disabled!==a&&(this.disabled=a)}return i}}},{key:"isIE",value:function(){if("undefined"==typeof window)return!1;var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var r=e.indexOf("Edge/");return r>0&&parseInt(e.substring(r+5,e.indexOf(".",r)),10)}},{key:"defineActionValue",value:function(e,t){return this.evaluate(e.value,t,"value")}},{key:"applyActions",value:function(e,t,n,r,o){var i=this;return o=o||this.rootValue,r=r||this.data,t.reduce((function(t,a){switch(a.type){case"property":c.setActionProperty(e,a,n,r,o,i);var l=a.property.value;u.default.isEqual(u.default.get(i.component,l),u.default.get(e,l))||(t=!0);break;case"value":var s=i.getValue(),f=i.defineActionValue(a,{value:u.default.clone(s),data:o,row:r,component:e,result:n});u.default.isEqual(s,f)||i.component.clearOnHide&&!i.visible||(i.setValue(f),i.viewOnly&&(i.dataValue=f),t=!0);break;case"mergeComponentSchema":var d=i.evaluate(a.schemaDefinition,{value:u.default.clone(i.getValue()),data:o,row:r,component:e,result:n},"schema");u.default.assign(e,d),u.default.isEqual(i.component,e)||(t=!0);break;case"customAction":var p=i.getValue(),h=i.evaluate(a.customAction,{value:u.default.clone(p),data:o,row:r,input:p,component:e,result:n},"value");u.default.isEqual(p,h)||i.component.clearOnHide&&!i.visible||(i.setValue(h),i.viewOnly&&(i.dataValue=h),t=!0)}return t}),!1)}},{key:"addInputError",value:function(e,t,n){this.addMessages(e),this.setErrorClasses(n,t,!!e)}},{key:"removeInputError",value:function(e){this.setErrorClasses(e,!0,!1)}},{key:"addMessages",value:function(e){var t=this;e&&("string"==typeof e&&(e={messages:e,level:"error"}),Array.isArray(e)||(e=[e]),e=u.default.uniqBy(e,(function(e){return e.message})),this.refs.messageContainer&&this.setContent(this.refs.messageContainer,e.map((function(e){return e.message&&"string"==typeof e.message&&(e.message=e.message.replaceAll("<","<").replaceAll(">",">")),t.renderTemplate("message",e)})).join("")))}},{key:"setErrorClasses",value:function(e,t,n,r){var o=this,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.element;this.clearErrorClasses(),e.forEach((function(e){o.setElementInvalid(o.performInputMapping(e),!1)})),this.setInputWidgetErrorClasses(e,n),n&&(e.forEach((function(e){o.setElementInvalid(o.performInputMapping(e),!0)})),t&&this.options.highlightErrors?this.addClass(i,this.options.componentErrorClass):this.addClass(i,"has-error")),r&&this.addClass(i,"has-message")}},{key:"setElementInvalid",value:function(e,t){e&&(t?this.addClass(e,"is-invalid"):this.removeClass(e,"is-invalid"),e.setAttribute("aria-invalid",t?"true":"false"))}},{key:"clearOnHide",value:function(){this.rootPristine&&!this.options.server&&!(0,c.isInsideScopingComponent)(this)||!1===this.component.clearOnHide||this.options.readOnly||this.options.showHiddenFields||(this.visible?!this.hasValue()&&this.shouldAddDefaultValue&&this.setValue(this.defaultValue,{noUpdateEvent:!0}):this.deleteValue())}},{key:"triggerRootChange",value:function(){var e;if(this.options.onChange)(e=this.options).onChange.apply(e,arguments);else if(this.root){var t;(t=this.root).triggerChange.apply(t,arguments)}}},{key:"onChange",value:function(e,t){(e=e||{}).modified&&(e.noPristineChangeOnModified||(this.pristine=!1),this.addClass(this.getElement(),"formio-modified")),"blur"!==this.component.validateOn||this.errors.length||(e.noValidate=!0),this.component.onChange&&this.evaluate(this.component.onChange,{flags:e});var n={instance:this,component:this.component,value:this.dataValue,flags:e};this.emit("componentChange",n);var r=!1;return e.modified&&(r=!0,delete e.modified),t||this.triggerRootChange(e,n,r),n}},{key:"wysiwygDefault",get:function(){return{quill:{theme:"snow",placeholder:this.t(this.component.placeholder,{_userInput:!0}),modules:{toolbar:[[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{font:[]}],["bold","italic","underline","strike",{script:"sub"},{script:"super"},"clean"],[{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["blockquote","code-block"],["link","image","video","formula","source"]]}},ace:{theme:"ace/theme/xcode",maxLines:12,minLines:12,tabSize:2,mode:"ace/mode/javascript",placeholder:this.t(this.component.placeholder,{_userInput:!0})},ckeditor:{image:{toolbar:["imageTextAlternative","|","imageStyle:full","imageStyle:alignLeft","imageStyle:alignCenter","imageStyle:alignRight"],styles:["full","alignLeft","alignCenter","alignRight"]},extraPlugins:[]},default:{}}}},{key:"addCKE",value:function(e,t,n){return(t=u.default.isEmpty(t)?{}:t).base64Upload=!this.component.isUploadEnabled,t.mediaEmbed={previewsInData:!0},t=u.default.merge(this.wysiwygDefault.ckeditor,u.default.get(this.options,"editors.ckeditor.settings",{}),t),this.component.isUploadEnabled&&t.extraPlugins.push((0,m.getFormioUploadAdapterPlugin)(this.fileService,this)),s.GlobalFormio.requireLibrary("ckeditor",I?"CKEDITOR":"ClassicEditor",u.default.get(this.options,"editors.ckeditor.src","".concat(s.GlobalFormio.cdn.ckeditor,"/ckeditor.js")),!0).then((function(){if(!e.parentNode)return i.default.reject();if(I){var r=CKEDITOR.replace(e);return r.on("change",(function(){return n(r.getData())})),i.default.resolve(r)}return ClassicEditor.create(e,t).then((function(e){return e.model.document.on("change",(function(){return n(e.data.get())})),e}))}))}},{key:"addQuill",value:function(e,t,n){var r=this;return t=u.default.isEmpty(t)?this.wysiwygDefault.quill:t,t=k(k({},t=u.default.merge(this.wysiwygDefault.quill,u.default.get(this.options,"editors.quill.settings",{}),t)),{},{modules:k({table:!0},t.modules)}),s.GlobalFormio.requireLibrary("quill-css-".concat(t.theme),"Quill",[{type:"styles",src:"".concat(s.GlobalFormio.cdn.quill,"/quill.").concat(t.theme,".css")}],!0),s.GlobalFormio.requireLibrary("quill","Quill",u.default.get(this.options,"editors.quill.src","".concat(s.GlobalFormio.cdn.quill,"/quill.min.js")),!0).then((function(){return s.GlobalFormio.requireLibrary("quill-table","Quill","".concat(s.GlobalFormio.cdn.baseUrl,"/quill/quill-table.js"),!0).then((function(){if(!e.parentNode)return i.default.reject();r.quill=new Quill(e,I?k(k({},t),{},{modules:{}}):t);var o=document.createElement("textarea");o.setAttribute("class","quill-source-code"),r.quill.addContainer("ql-custom").appendChild(o);var a=e.parentNode.querySelector(".ql-source");a&&r.addEventListener(a,"click",(function(e){e.preventDefault(),"inherit"===o.style.display&&r.quill.setContents(r.quill.clipboard.convert({html:o.value})),o.style.display="none"===o.style.display?"inherit":"none"})),r.addEventListener(e,"click",(function(){return r.quill.focus()}));for(var u=document.querySelectorAll(".ql-formats > button"),l=0;l1&&void 0!==arguments[1]?arguments[1]:{};if(this.hasValue()){var n=this.dataValue||[];u.default.isArray(n)&&n.hasOwnProperty(e)&&(n.splice(e,1),this.dataValue=n,this.triggerChange(t))}}},{key:"unset",value:function(){u.default.unset(this._data,this.key)}},{key:"deleteValue",value:function(){this.setValue(null,{noUpdateEvent:!0,noDefault:!0}),this.unset()}},{key:"getCustomDefaultValue",value:function(e){return this.component.customDefaultValue&&!this.options.preview&&(e=this.evaluate(this.component.customDefaultValue,{value:""},"value")),e}},{key:"shouldAddDefaultValue",get:function(){return!this.options.noDefaults||this.component.defaultValue&&!this.isEmpty(this.component.defaultValue)||this.component.customDefaultValue}},{key:"defaultValue",get:function(){var e=this,t=this.emptyValue;this.component.defaultValue&&(t=this.component.defaultValue),t=this.getCustomDefaultValue(t);var n=function(t){if("string"==typeof t){var n=e.placeholderChar;t=(0,o.conformToMask)(t,e.defaultMask,{placeholderChar:n}).conformedValue,c.matchInputMask(t,e.defaultMask)||(t="")}else t="";return t};return this.defaultMask&&(t=Array.isArray(t)?t.map(n):n(t)),u.default.cloneDeep(t)}},{key:"getValue",value:function(){if(!this.hasInput||this.viewOnly||!this.refs.input||!this.refs.input.length)return this.dataValue;var e=[];for(var t in this.refs.input)if(this.refs.input.hasOwnProperty(t)){if(!this.component.multiple)return this.getValueAt(t);e.push(this.getValueAt(t))}return 0!==e.length||this.component.multiple?e:""}},{key:"getValueAt",value:function(e){var t=this.performInputMapping(this.refs.input[e]);return t?t.value:void 0}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.updateValue(e,t);if(e=this.dataValue,!this.hasInput)return n;var r=Array.isArray(e),o=this.refs.fileLink||this.refs.input;if(r&&Array.isArray(this.defaultValue)&&this.refs.hasOwnProperty("input")&&o&&o.length!==e.length&&this.visible&&this.redraw(),this.isHtmlRenderMode()&&t&&t.fromSubmission&&n)return this.redraw(),n;for(var i in this.refs.input)this.refs.input.hasOwnProperty(i)&&this.setValueAt(i,r?e[i]:e,t);return n}},{key:"setValueAt",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.noDefault||null!=t||this.component.multiple||(t=this.defaultValue);var r=this.performInputMapping(this.refs.input[e]),o=this.refs.valueMaskInput;null!=o&&o.mask&&o.mask.textMaskInputElement.update(t),r.mask?r.mask.textMaskInputElement.update(t):r.widget&&r.widget.setValue?r.widget.setValue(t):r.value=t}},{key:"hasSetValue",get:function(){return this.hasValue()&&!this.isEmpty(this.dataValue)}},{key:"setDefaultValue",value:function(){if(this.defaultValue&&this.shouldAddDefaultValue){var e=this.component.multiple&&!this.dataValue.length?[]:this.defaultValue;this.setValue(e,{noUpdateEvent:!0})}}},{key:"restoreValue",value:function(){this.hasSetValue?this.setValue(this.dataValue,{noUpdateEvent:!0}):this.setDefaultValue()}},{key:"normalizeValue",value:function(e){return this.component.multiple&&!Array.isArray(e)&&(e=e?[e]:[]),e}},{key:"updateComponentValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.resetValue||null!=e?e:this.getValue();n=this.normalizeValue(n,t);var r=this.dataValue,o=void 0!==n&&this.hasChanged(n,r);return o&&(this.dataValue=n,o=this.dataValue!==r,this.updateOnChange(t,o)),this.componentModal&&t&&t.fromSubmission&&this.componentModal.setValue(e),o}},{key:"updateValue",value:function(){return this.updateComponentValue.apply(this,arguments)}},{key:"getIcon",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"icon";return this.renderTemplate("icon",{className:this.iconClass(e),ref:r,styles:n,content:t})}},{key:"resetValue",value:function(){this.unset(),this.setValue(this.emptyValue,{noUpdateEvent:!0,noValidate:!0,resetValue:!0})}},{key:"hasChanged",value:function(e,t){return!(null==e&&(null==t||this.isEmpty(t))||(null==e||!this.allowData||this.hasValue())&&u.default.isEqual(e,t))}},{key:"updateOnChange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!(e.noUpdateEvent||!t||(this.triggerChange(e),0))}},{key:"convertNumberOrBoolToString",value:function(e){return"number"==typeof e||"boolean"==typeof e?e.toString():e}},{key:"doValueCalculation",value:function(e,t,n){var r;return this.evaluate(this.component.calculateValue,{value:e,data:t,row:n||this.data,submission:(null===(r=this.root)||void 0===r?void 0:r._submission)||{data:this.rootValue}},"value")}},{key:"calculateComponentValue",value:function(e,t,n){if(u.default.isUndefined(u.default.get(this,"root.data")))return!1;var r=this.component.clearOnHide,o=!this.visible&&r,i=u.default.get(this.component,"allowCalculateOverride",!1);if(o)return this.hasOwnProperty("calculatedValue")&&i&&u.default.unset(this,"calculatedValue"),!1;if(this.options.readOnly&&!this.options.pdf&&!this.component.calculateValue||!this.component.calculateValue&&!this.component.calculateValueVariable||this.options.server&&!this.component.calculateServer||t.dataSourceInitialLoading&&i)return!1;var a=this.dataValue,l=this.doValueCalculation(a,e,n,t);if(this.options.readOnly&&a&&!l)return!1;u.default.isNil(l)&&(l=this.emptyValue);var s=!u.default.isEqual(a,l);if(i){var f=t.fromSubmission&&!0===this.component.persistent;if(this.isEmpty(a))this.calculationLocked=!1;else if(this.calculationLocked||f)return this.calculationLocked=!0,!1;var d=void 0===this.calculatedValue||t.resetValue;d&&(this.calculatedValue=null);var p=this.normalizeValue(this.convertNumberOrBoolToString(l)),h=this.normalizeValue(this.convertNumberOrBoolToString(this.calculatedValue)),y=this.normalizeValue(this.convertNumberOrBoolToString(a)),m=!u.default.isEqual(h,p),v=!u.default.isEqual(y,h);if(m&&v&&!d)return!1;if(h&&v&&!m)return!1;if(t.isReordered||!m)return!1;if(f)return this.calculatedValue=(0,c.fastCloneDeep)(l),!1;if(d&&!this.isEmpty(a)&&s&&m)return!0}return this.calculatedValue=(0,c.fastCloneDeep)(l),!!s&&(t.noPristineChangeOnModified||(this.pristine=!1),t.triggeredComponentId=this.id,this.setValue(l,t))}},{key:"calculateValue",value:function(e,t,n){return e=e||this.rootValue,t=t||{},n=n||this.data,this.calculateComponentValue(e,t,n)}},{key:"label",get:function(){return this.component.label},set:function(e){this.component.label=e,this.labelElement&&(this.labelElement.innerText=e)}},{key:"getRoot",value:function(){return this.root}},{key:"invalidMessage",value:function(e,t,n,r){return n||this.checkCondition(r,e)?this.invalid?this.invalid:!this.hasInput||!t&&this.pristine?"":u.default.map(f.default.checkComponent(this,e),"message").join("\n\n"):""}},{key:"isValid",value:function(e,t){return!this.invalidMessage(e,t)}},{key:"setComponentValidity",value:function(e,t,n){var r=!!e.filter((function(e){return"error"===e.level&&!e.fromServer})).length;return!e.length||n&&!this.error||this.isEmpty(this.defaultValue)&&!t&&this.pristine?n||this.setCustomValidity(""):this.setCustomValidity(e,t),!r}},{key:"checkComponentValidity",value:function(e,t,n){var r,o=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e=e||this.rootValue,n=n||this.data;var u=a.async,l=void 0!==u&&u,s=a.silentCheck,c=void 0!==s&&s;if(this.shouldSkipValidation(e,t,n))return this.setCustomValidity(""),!l||i.default.resolve(!0);var d=f.default.checkComponent(this,e,n,!0,l),p=d;return null!==(r=this.serverErrors)&&void 0!==r&&r.length&&(p=d.concat(this.serverErrors)),l?p.then((function(e){return o.setComponentValidity(e,t,c)})):this.setComponentValidity(p,t,c)}},{key:"checkValidity",value:function(e,t,n,r){e=e||this.rootValue,n=n||this.data;var o=this.checkComponentValidity(e,t,n,{silentCheck:r});return this.checkModal(),o}},{key:"checkAsyncValidity",value:function(e,t,n,r){return i.default.resolve(this.checkComponentValidity(e,t,n,{async:!0,silentCheck:r}))}},{key:"checkData",value:function(e,t,n){if(e=e||this.rootValue,t=t||{},n=n||this.data,this.resetCaches(),t.fromBlur||this.checkRefreshOn(t.changes,t),t.noCheck)return!0;if(this.checkComponentConditions(e,t,n),this.id!==t.triggeredComponentId&&this.calculateComponentValue(e,t,n),t.noValidate&&!t.validateOnInit&&!t.fromIframe)return t.fromSubmission&&this.rootPristine&&this.pristine&&this.error&&t.changed&&this.checkComponentValidity(e,!!this.options.alwaysDirty,n,!0),!0;var r=!1;if((this.options.alwaysDirty||t.dirty)&&(r=!0),t.fromSubmission&&this.hasValue(e)&&(r=!0),this.setDirty(r),"blur"===this.component.validateOn&&t.fromSubmission)return!0;var o=this.checkComponentValidity(e,r,n,t);return this.checkModal(),o}},{key:"checkModal",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.component.modalEdit&&this.componentModal&&(t&&!e?this.setErrorClasses([this.refs.openModal],t,!e,!!this.errors.length,this.refs.openModalWrapper):this.clearErrorClasses(this.refs.openModalWrapper))}},{key:"validationValue",get:function(){return this.dataValue}},{key:"isEmpty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dataValue,t=!(!u.default.isArray(e)||1!==e.length)&&u.default.isEqual(e[0],this.emptyValue);return null==e||0===e.length||u.default.isEqual(e,this.emptyValue)||t}},{key:"isEqual",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dataValue;return this.isEmpty(e)&&this.isEmpty(t)||u.default.isEqual(e,t)}},{key:"validateMultiple",value:function(){return!0}},{key:"errors",get:function(){return this.error?[this.error]:[]}},{key:"clearErrorClasses",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.element;this.removeClass(e,this.options.componentErrorClass),this.removeClass(e,"alert alert-danger"),this.removeClass(e,"has-error"),this.removeClass(e,"has-message")}},{key:"setInputWidgetErrorClasses",value:function(e,t){this.isInputComponent&&this.component.widget&&null!=e&&e.length&&e.forEach((function(e){null!=e&&e.widget&&e.widget.setErrorClasses&&e.widget.setErrorClasses(t)}))}},{key:"addFocusBlurEvents",value:function(e){var t=this;this.addEventListener(e,"focus",(function(){t.root.focusedComponent!==t?(t.root.pendingBlur&&t.root.pendingBlur(),t.root.focusedComponent=t,t.emit("focus",t)):t.root.focusedComponent===t&&t.root.pendingBlur&&(t.root.pendingBlur.cancel(),t.root.pendingBlur=null)})),this.addEventListener(e,"blur",(function(){t.root.pendingBlur=c.delay((function(){t.emit("blur",t),"blur"===t.component.validateOn&&t.root.triggerChange({fromBlur:!0},{instance:t,component:t.component,value:t.dataValue,flags:{fromBlur:!0}}),t.root.focusedComponent=null,t.root.pendingBlur=null}))}))}},{key:"setCustomValidity",value:function(e,t,n){var r=this,o=this.isInputComponent?this.refs.input||[]:null;"string"==typeof e&&e&&(e={level:"error",message:e}),Array.isArray(e)||(e=e?[e]:[]);var i=!!e.filter((function(e){return"error"===e.level})).length,a=o;if(this.component.multiple){var u=Array.from(o);u.forEach((function(e){r.setElementInvalid(r.performInputMapping(e),!1)})),this.setInputWidgetErrorClasses(u,!1),a=u.filter((function(t){var n,r;return null===(n=(r=e).some)||void 0===n?void 0:n.call(r,(function(e){var n;return(null==e||null===(n=e.context)||void 0===n?void 0:n.input)===t}))}))}e.length?(this.refs.messageContainer&&this.empty(this.refs.messageContainer),this.error={component:this.component,message:e[0].message,messages:e,external:!!n},this.emit("componentError",this.error),this.addMessages(e,t,a),a&&this.setErrorClasses(a,t,i,!!e.length)):(!this.error||this.error&&this.error.external===!!n)&&(this.refs.messageContainer&&this.empty(this.refs.messageContainer),this.refs.modalMessageContainer&&this.empty(this.refs.modalMessageContainer),this.error=null,a&&this.setErrorClasses(a,t,i,!!e.length),this.clearErrorClasses())}},{key:"isValueHidden",value:function(){return(!this.component.protected||!this.root.editing)&&!(!this.root||!this.root.hasOwnProperty("editing"))&&!(!this.root||!this.root.editing)&&(this.component.protected||!this.component.persistent||"client-only"===this.component.persistent)}},{key:"shouldSkipValidation",value:function(e,t,n){var r=this;return[function(){return r.options.readOnly},function(){return!r.hasInput},function(){return r.isValueHidden()},function(){return!r.visible},function(){return!r.checkCondition(n,e)}].some((function(e){return e()}))}},{key:"whenReady",value:function(){return console.warn("The whenReady() method has been deprecated. Please use the dataReady property instead."),this.dataReady}},{key:"dataReady",get:function(){return i.default.resolve()}},{key:"asString",value:function(e){return e=e||this.getValue(),(Array.isArray(e)?e:[e]).map(u.default.toString).join(", ")}},{key:"disabled",get:function(){return this._disabled||this.parentDisabled},set:function(e){this._disabled=e}},{key:"setDisabled",value:function(e,t){e&&(e.disabled=t,t?e.setAttribute("disabled","disabled"):e.removeAttribute("disabled"))}},{key:"setLoading",value:function(e,t){e&&e.loading!==t&&(e.loading=t,!e.loader&&t&&(e.loader=this.ce("i",{class:"".concat(this.iconClass("refresh",!0)," button-icon-right")})),e.loader&&(t?this.appendTo(e.loader,e):this.removeChildFrom(e.loader,e)))}},{key:"selectOptions",value:function(e,t,n,r){var o=this;u.default.each(n,(function(t){var n={value:t.value};void 0!==r&&t.value===r&&(n.selected="selected");var i=o.ce("option",n);i.appendChild(o.text(t.label)),e.appendChild(i)}))}},{key:"setSelectValue",value:function(e,t){var n=e.querySelectorAll("option");u.default.each(n,(function(e){e.value===t?e.setAttribute("selected","selected"):e.removeAttribute("selected")})),e.onchange&&e.onchange(),e.onselect&&e.onselect()}},{key:"getRelativePath",value:function(e){var t=".".concat(this.key),n=this.isInputComponent?this.path:this.path.slice(0).replace(t,"");return e.replace(n,"")}},{key:"clear",value:function(){this.detach(),this.empty(this.getElement())}},{key:"append",value:function(e){this.appendTo(e,this.element)}},{key:"prepend",value:function(e){this.prependTo(e,this.element)}},{key:"removeChild",value:function(e){this.removeChildFrom(e,this.element)}},{key:"detachLogic",value:function(){var e=this;this.logic.forEach((function(t){if("event"===t.trigger.type){var n=e.interpolate(t.trigger.event);e.off(n)}}))}},{key:"attachLogic",value:function(){var e=this;this.builderMode||this.logic.forEach((function(t){if("event"===t.trigger.type){var n=e.interpolate(t.trigger.event);e.on(n,(function(){for(var n=(0,c.fastCloneDeep)(e.originalComponent),r=arguments.length,o=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:this.element;if(e){var t=e.getBoundingClientRect(),n=t.left,r=t.top;window.scrollTo(n+window.scrollX,r+window.scrollY)}}},{key:"focus",value:function(e){var t;if("beforeFocus"in this.parent&&this.parent.beforeFocus(this),null!==(t=this.refs.input)&&void 0!==t&&t.length){var n,r="number"==typeof e&&this.refs.input[e]?this.refs.input[e]:this.refs.input[this.refs.input.length-1];if("calendar"===(null===(n=this.component.widget)||void 0===n?void 0:n.type)){var o=r.nextSibling;o&&o.focus()}else r.focus()}this.refs.openModal&&this.refs.openModal.focus(),this.parent.refs.openModal&&this.parent.refs.openModal.focus()}},{key:"fileService",get:function(){if(this.options.fileService)return this.options.fileService;if(this.options.formio)return this.options.formio;if(this.root&&this.root.formio)return this.root.formio;var e=new s.GlobalFormio;return this.root&&this.root._form&&this.root._form._id&&(e.formUrl="".concat(e.projectUrl,"/form/").concat(this.root._form._id)),e}},{key:"resetCaches",value:function(){}},{key:"previewMode",get:function(){return!1}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;nYou must assign the show variable a boolean result.

    Note: Advanced Conditional logic will override the results of the Simple Conditional logic.

    Example
    show = !!data.showMe;
    ",'

    Click here for an example

    ')];t.default=a},10024:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(61550))&&r.__esModule?r:{default:r},i=[{weight:0,type:"checkbox",label:"Multiple Values",tooltip:"Allows multiple values to be entered for this field.",key:"multiple",input:!0},{type:"textfield",label:"Default Value",key:"defaultValue",weight:5,placeholder:"Default Value",tooltip:"The Default Value will be the value for this field, before user interaction. Having a default value will override the placeholder text.",input:!0},{weight:30,type:"radio",label:"Persistent",tooltip:"A persistent field will be stored in database when the form is submitted.",key:"persistent",input:!0,inline:!0,defaultValue:!0,values:[{label:"None",value:!1},{label:"Server",value:!0},{label:"Client",value:"client-only"}]},{weight:150,type:"checkbox",label:"Protected",tooltip:"A protected field will not be returned when queried via API.",key:"protected",input:!0},{type:"checkbox",input:!0,weight:200,key:"dbIndex",label:"Database Index",tooltip:"Set this field as an index within the database. Increases performance for submission queries."},{weight:400,type:"checkbox",label:"Encrypted",tooltip:"Encrypt this field on the server. This is two way encryption which is not suitable for passwords.",key:"encrypted",input:!0,logic:[{name:"disabled",trigger:{type:"javascript",javascript:"result = !instance.root.options.sac;"},actions:[{name:"disabled",type:"property",property:{label:"Disabled",value:"disabled",type:"boolean"},state:!0}]},{name:"disabledToolTip",trigger:{type:"javascript",javascript:"result = !instance.root.options.sac;"},actions:[{name:"addDisabledTooltip",type:"property",property:{label:"Tooltip",value:"tooltip",type:"string"},text:"Only available with Security Module. Contact sales@form.io for more information."}]}]},{type:"select",input:!0,key:"redrawOn",label:"Redraw On",weight:600,tooltip:"Redraw this component if another component changes. This is useful if interpolating parts of the component like the label.",dataSrc:"custom",valueProperty:"value",data:{custom:function(e){var t=[];return t.push({label:"Any Change",value:"data"}),e.utils.eachComponent(e.instance.options.editForm.components,(function(n,r){n.key!==e.data.key&&t.push({label:n.label||n.key,value:r})})),t}},conditional:{json:{"!":[{var:"data.dataSrc"}]}}},{weight:700,type:"checkbox",label:"Clear Value When Hidden",key:"clearOnHide",defaultValue:!0,tooltip:"When a field is hidden, clear the value.",input:!0},o.default.javaScriptValue("Custom Default Value","customDefaultValue","customDefaultValue",1e3,'

    Example:

    value = data.firstName + " " + data.lastName;

    ','

    Example:

    {"cat": [{"var": "data.firstName"}, " ", {"var": "data.lastName"}]}
    '),o.default.javaScriptValue("Calculated Value","calculateValue","calculateValue",1100,"

    Example:

    value = data.a + data.b + data.c;

    ",'

    Example:

    {"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}

    Click here for an example

    ',"tokenThe decoded JWT token for the authenticated user."),{type:"checkbox",input:!0,weight:1100,key:"calculateServer",label:"Calculate Value on server",tooltip:"Checking this will run the calculation on the server. This is useful if you wish to override the values submitted with the calculations performed on the server."},{type:"checkbox",input:!0,weight:1200,key:"allowCalculateOverride",label:"Allow Manual Override of Calculated Value",tooltip:"When checked, this will allow the user to manually override the calculated value."}];t.default=i},10684:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92087),t.default=[{weight:0,type:"textfield",input:!0,key:"label",label:"Label",placeholder:"Field Label",tooltip:"The label for this field that will appear next to it.",validate:{required:!0},autofocus:!0},{type:"select",input:!0,key:"labelPosition",label:"Label Position",tooltip:"Position for the label for this field.",weight:20,defaultValue:"top",dataSrc:"values",data:{values:[{label:"Top",value:"top"},{label:"Left (Left-aligned)",value:"left-left"},{label:"Left (Right-aligned)",value:"left-right"},{label:"Right (Left-aligned)",value:"right-left"},{label:"Right (Right-aligned)",value:"right-right"},{label:"Bottom",value:"bottom"}]}},{type:"number",input:!0,key:"labelWidth",label:"Label Width",tooltip:"The width of label on line in percentages.",clearOnHide:!1,weight:30,placeholder:"30",suffix:"%",validate:{min:0,max:100},conditional:{json:{and:[{"!==":[{var:"data.labelPosition"},"top"]},{"!==":[{var:"data.labelPosition"},"bottom"]}]}}},{type:"number",input:!0,key:"labelMargin",label:"Label Margin",tooltip:"The width of label margin on line in percentages.",clearOnHide:!1,weight:30,placeholder:"3",suffix:"%",validate:{min:0,max:100},conditional:{json:{and:[{"!==":[{var:"data.labelPosition"},"top"]},{"!==":[{var:"data.labelPosition"},"bottom"]}]}}},{weight:100,type:"textfield",input:!0,key:"placeholder",label:"Placeholder",placeholder:"Placeholder",tooltip:"The placeholder text that will appear when this field is empty."},{weight:200,type:"textarea",input:!0,key:"description",label:"Description",placeholder:"Description for this field.",tooltip:"The description is text that will appear below the input field.",editor:"ace",as:"html",wysiwyg:{minLines:3,isUseWorkerDisabled:!0}},{weight:300,type:"textarea",input:!0,key:"tooltip",label:"Tooltip",placeholder:"To add a tooltip to this field, enter text here.",tooltip:"Adds a tooltip to the side of this field.",editor:"ace",as:"html",wysiwyg:{minLines:3,isUseWorkerDisabled:!0}},{weight:500,type:"textfield",input:!0,key:"customClass",label:"Custom CSS Class",placeholder:"Custom CSS Class",tooltip:"Custom CSS class to add to this component."},{weight:600,type:"textfield",input:!0,key:"tabindex",label:"Tab Index",placeholder:"0",tooltip:"Sets the tabindex attribute of this component to override the tab order of the form. See the MDN documentation on tabindex for more information."},{weight:1100,type:"checkbox",label:"Hidden",tooltip:"A hidden field is still a part of the form, but is hidden from view.",key:"hidden",input:!0},{weight:1200,type:"checkbox",label:"Hide Label",tooltip:"Hide the label (title, if no label) of this component. This allows you to show the label in the form builder, but not when it is rendered.",key:"hideLabel",input:!0},{weight:1350,type:"checkbox",label:"Initial Focus",tooltip:"Make this field the initially focused element on this form.",key:"autofocus",input:!0},{weight:1370,type:"checkbox",label:"Show Label in DataGrid",tooltip:"Show the label inside each row when in a Datagrid.",key:"dataGridLabel",input:!0,customConditional:function(e){var t,n;return null===(t=e.instance.options)||void 0===t||null===(n=t.flags)||void 0===n?void 0:n.inDataGrid}},{weight:1400,type:"checkbox",label:"Disabled",tooltip:"Disable the form input.",key:"disabled",input:!0},{weight:1500,type:"checkbox",label:"Table View",tooltip:"Shows this value within the table view of the submissions.",key:"tableView",input:!0},{weight:1600,type:"checkbox",label:"Modal Edit",tooltip:"Opens up a modal to edit the value of this component.",key:"modalEdit",input:!0}]},77869:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{label:"HTML Attributes",type:"datamap",input:!0,key:"attributes",keyLabel:"Attribute Name",valueComponent:{type:"textfield",key:"value",label:"Attribute Value",input:!0},tooltip:"Provide a map of HTML attributes for component's input element (attributes provided by other component settings or other attributes generated by form.io take precedence over attributes in this grid)",addAnother:"Add Attribute"},{type:"panel",legend:"PDF Overlay",title:"PDF Overlay",key:"overlay",tooltip:"The settings inside apply only to the PDF forms.",weight:2e3,collapsible:!0,collapsed:!0,components:[{type:"textfield",input:!0,key:"overlay.style",label:"Style",placeholder:"",tooltip:"Custom styles that should be applied to this component when rendered in PDF."},{type:"textfield",input:!0,key:"overlay.page",label:"Page",placeholder:"",tooltip:"The PDF page to place this component."},{type:"textfield",input:!0,key:"overlay.left",label:"Left",placeholder:"",tooltip:"The left margin within a page to place this component."},{type:"textfield",input:!0,key:"overlay.top",label:"Top",placeholder:"",tooltip:"The top margin within a page to place this component."},{type:"textfield",input:!0,key:"overlay.width",label:"Width",placeholder:"",tooltip:"The width of the component (in pixels)."},{type:"textfield",input:!0,key:"overlay.height",label:"Height",placeholder:"",tooltip:"The height of the component (in pixels)."}]}]},48911:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(19601);var r,o=(r=n(61550))&&r.__esModule?r:{default:r},i=n(82531),a=[{weight:0,input:!0,label:"Advanced Logic",key:"logic",templates:{header:'
    \n
    \n {{ value.length }} {{ ctx.t("Advanced Logic Configured") }}\n
    \n
    ',row:'
    \n
    \n
    {{ row.name }}
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    ',footer:""},type:"editgrid",addAnother:"Add Logic",saveRow:"Save Logic",components:[{weight:0,input:!0,inputType:"text",label:"Logic Name",key:"name",validate:{required:!0},type:"textfield"},{weight:10,key:"triggerPanel",input:!1,title:"Trigger",tableView:!1,components:[{weight:0,input:!0,tableView:!1,components:[{weight:0,input:!0,label:"Type",key:"type",tableView:!1,data:{values:[{value:"simple",label:"Simple"},{value:"javascript",label:"Javascript"},{value:"json",label:"JSON Logic"},{value:"event",label:"Event"}]},dataSrc:"values",template:"{{ item.label }}",type:"select"},{weight:10,label:"",key:"simple",type:"container",tableView:!1,customConditional:function(e){return"simple"===e.row.type},components:[{input:!0,key:"show",label:"Show",type:"hidden",tableView:!1,calculateValue:function(){return!0}},{type:"select",input:!0,label:"When the form component:",key:"when",dataSrc:"custom",valueProperty:"value",tableView:!1,data:{custom:function(e){return(0,i.getContextComponents)(e)}}},{type:"textfield",input:!0,label:"Has the value:",key:"eq",tableView:!1}]},{weight:10,type:"textarea",key:"javascript",rows:5,editor:"ace",as:"javascript",input:!0,tableView:!1,placeholder:"result = (data['mykey'] > 1);",description:'"row", "data", and "component" variables are available. Return "result".',customConditional:function(e){return"javascript"===e.row.type}},{weight:10,type:"textarea",key:"json",rows:5,editor:"ace",label:"JSON Logic",as:"json",input:!0,tableView:!1,placeholder:"{ ... }",description:'"row", "data", "component" and "_" variables are available. Return the result to be passed to the action if truthy.',customConditional:function(e){return"json"===e.row.type}},{weight:10,type:"textfield",key:"event",label:"Event Name",placeholder:"event",description:"The event that will trigger this logic. You can trigger events externally or via a button.",tableView:!1,customConditional:function(e){return"event"===e.row.type}}],key:"trigger",type:"container"}],type:"panel"},{weight:20,input:!0,label:"Actions",key:"actions",tableView:!1,templates:{header:'
    \n
    {{ value.length }} {{ ctx.t("actions") }}
    \n
    ',row:'
    \n
    \n
    {{ row.name }}
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    ',footer:""},type:"editgrid",addAnother:"Add Action",saveRow:"Save Action",components:[{weight:0,title:"Action",input:!1,key:"actionPanel",type:"panel",components:[{weight:0,input:!0,inputType:"text",label:"Action Name",key:"name",validate:{required:!0},type:"textfield"},{weight:10,input:!0,label:"Type",key:"type",data:{values:[{value:"property",label:"Property"},{value:"value",label:"Value"},{label:"Merge Component Schema",value:"mergeComponentSchema"},{label:"Custom Action",value:"customAction"}]},dataSrc:"values",template:"{{ item.label }}",type:"select"},{weight:20,type:"select",template:"{{ item.label }}",dataSrc:"json",tableView:!1,data:{json:[{label:"Hidden",value:"hidden",type:"boolean"},{label:"Required",value:"validate.required",type:"boolean"},{label:"Disabled",value:"disabled",type:"boolean"},{label:"Label",value:"label",type:"string"},{label:"Title",value:"title",type:"string"},{label:"Prefix",value:"prefix",type:"string"},{label:"Suffix",value:"suffix",type:"string"},{label:"Tooltip",value:"tooltip",type:"string"},{label:"Description",value:"description",type:"string"},{label:"Placeholder",value:"placeholder",type:"string"},{label:"Input Mask",value:"inputMask",type:"string"},{label:"CSS Class",value:"className",type:"string"},{label:"Container Custom Class",value:"customClass",type:"string"}]},key:"property",label:"Component Property",input:!0,customConditional:function(e){return"property"===e.row.type}},{weight:30,input:!0,label:"Set State",key:"state",tableView:!1,data:{values:[{label:"True",value:"true"},{label:"False",value:"false"}]},dataSrc:"values",template:"{{ item.label }}",type:"select",customConditional:function(e){var t=e.row;return"property"===t.type&&t.hasOwnProperty("property")&&"boolean"===t.property.type}},{weight:30,type:"textfield",key:"text",label:"Text",inputType:"text",input:!0,tableView:!1,description:'Can use templating with {{ data.myfield }}. "data", "row", "component" and "result" variables are available.',customConditional:function(e){var t=e.row;return"property"===t.type&&t.hasOwnProperty("property")&&"string"===t.property.type&&!t.property.component}},{weight:20,input:!0,label:"Value (Javascript)",key:"value",editor:"ace",as:"javascript",rows:5,placeholder:"value = data.myfield;",type:"textarea",tableView:!1,description:'"row", "data", "component", and "result" variables are available. Return the value.',customConditional:function(e){return"value"===e.row.type}},{weight:20,input:!0,label:"Schema Defenition",key:"schemaDefinition",editor:"ace",as:"javascript",rows:5,placeholder:"schema = { label: 'Updated' };",type:"textarea",tableView:!1,description:'"row", "data", "component", and "result" variables are available. Return the schema.',customConditional:function(e){return"mergeComponentSchema"===e.row.type}},Object.assign(o.default.logicVariablesTable("inputThe value that was input into this component"),{customConditional:function(e){return"customAction"===e.row.type}}),{weight:20,input:!0,label:"Custom Action (Javascript)",key:"customAction",editor:"ace",rows:5,placeholder:"value = data.myfield;",type:"textarea",tableView:!1,customConditional:function(e){return"customAction"===e.row.type}}]}]}]}];t.default=a},51250:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(61550)),o=i(n(193));function i(e){return e&&e.__esModule?e:{default:e}}var a=[{weight:10,type:"checkbox",label:"Required",tooltip:"A required field must be filled in before the form can be submitted.",key:"validate.required",input:!0},{weight:100,type:"checkbox",label:"Unique",tooltip:"Makes sure the data submitted for this field is unique, and has not been submitted before.",key:"unique",input:!0},{weight:0,type:"select",key:"validateOn",defaultValue:"change",input:!0,label:"Validate On",tooltip:"Determines when this component should trigger front-end validation.",dataSrc:"values",data:{values:[{label:"Change",value:"change"},{label:"Blur",value:"blur"}]}},{weight:190,type:"textfield",input:!0,key:"errorLabel",label:"Error Label",placeholder:"Error Label",tooltip:"The label for this field when an error occurs."},{weight:200,key:"validate.customMessage",label:"Custom Error Message",placeholder:"Custom Error Message",type:"textfield",tooltip:"Error message displayed if any error occurred.",input:!0},{type:"panel",title:"Custom Validation",collapsible:!0,collapsed:!0,style:{"margin-bottom":"10px"},key:"custom-validation-js",weight:300,customConditional:function(){return!o.default.noeval||o.default.protectedEval},components:[r.default.logicVariablesTable("inputThe value that was input into this component"),{type:"textarea",key:"validate.custom",rows:5,editor:"ace",hideLabel:!0,as:"javascript",input:!0},{type:"htmlelement",tag:"div",content:"\n \n

    Enter custom validation code.

    \n

    You must assign the valid variable as either true or an error message if validation fails.

    \n
    Example:
    \n
    valid = (input === 'Joe') ? true : 'Your name must be \"Joe\"';
    \n
    "},{type:"well",components:[{weight:100,type:"checkbox",label:"Secret Validation",tooltip:"Check this if you wish to perform the validation ONLY on the server side. This keeps your validation logic private and secret.",description:"Check this if you wish to perform the validation ONLY on the server side. This keeps your validation logic private and secret.",key:"validate.customPrivate",input:!0}]}]},{type:"panel",title:"JSONLogic Validation",collapsible:!0,collapsed:!0,key:"json-validation-json",weight:400,components:[{type:"htmlelement",tag:"div",content:'

    Execute custom logic using JSONLogic.

    Example:
    '+JSON.stringify({if:[{"===":[{var:"input"},"Bob"]},!0,"Your name must be 'Bob'!"]},null,2)+"
    "},{type:"textarea",key:"validate.json",hideLabel:!0,rows:5,editor:"ace",as:"json",input:!0}]},{type:"panel",title:"Custom Errors",collapsible:!0,collapsed:!0,key:"errors",weight:400,components:[{type:"textarea",key:"errors",hideLabel:!0,rows:5,editor:"ace",as:"json",input:!0},{type:"htmlelement",tag:"div",content:'\n

    This allows you to set different custom error messages for different errors\n (in contrast to “Custom Error Message”, which only allows you to set one\n error message for all errors). E.g.

    \n\n
    {\n  "required": "{{ field }} is required. Try again.",\n  "maxLength": "{{ field }} is too long. Try again."\n}
    \n\n

    You can set the following keys (among others):

    \n
      \n
    • required
    • \n
    • min
    • \n
    • max
    • \n
    • minLength
    • \n
    • maxLength
    • \n
    • minWords
    • \n
    • maxWords
    • \n
    • invalid_email
    • \n
    • invalid_date
    • \n
    • invalid_day
    • \n
    • invalid_regex
    • \n
    • mask
    • \n
    • pattern
    • \n
    • custom
    • \n
    \n\n

    Depending on the error message some of the following template variables can be used in the script:

    \n
      \n
    • {{ field }} is replaced with the label of the field.
    • \n
    • {{ min }}
    • \n
    • {{ max }}
    • \n
    • {{ length }}
    • \n
    • {{ pattern }}
    • \n
    • {{ minDate }}
    • \n
    • {{ maxDate }}
    • \n
    • {{ minYear }}
    • \n
    • {{ maxYear }}
    • \n
    • {{ regex }}
    • \n
    \n '}]}];t.default=a},61550:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(57327),n(41539),n(40561);var r=i(n(96486)),o=i(n(193));function i(e){return e&&e.__esModule?e:{default:e}}var a={sortAndFilterComponents:function(e){return r.default.filter(r.default.sortBy(e,"weight"),(function(e){return!e.ignore}))},unifyComponents:function(e,t){return e.key&&t.key?!e.skipMerge&&!t.skipMerge&&e.key===t.key&&(r.default.each(e,(function(n,r){!e.overrideEditForm&&t.hasOwnProperty(r)||(t[r]=n)})),r.default.each(t,(function(n,r){!t.overrideEditForm&&e.hasOwnProperty(r)||(e[r]=n)})),e.components&&(t.components=a.sortAndFilterComponents(r.default.unionWith(e.components,t.components,a.unifyComponents))),!0):r.default.isEqual(e,t)},logicVariablesTable:function(e){return{type:"htmlelement",tag:"div",content:'

    The following variables are available in all scripts.

    '+(e=e||"")+'
    formThe complete form JSON object
    submissionThe complete submission object.
    dataThe complete submission data object.
    rowContextual "row" data, used within DataGrid, EditGrid, and Container components
    componentThe current component JSON
    instanceThe current component instance.
    valueThe current value of the component.
    momentThe moment.js library for date manipulation.
    _An instance of Lodash.
    utilsAn instance of the FormioUtils object.
    utilAn alias for "utils".

    '}},javaScriptValue:function(e,t,n,r,i,a){var u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",l=arguments.length>7?arguments[7]:void 0,s=[this.logicVariablesTable(u),{type:"panel",title:"JavaScript",collapsible:!0,collapsed:!1,style:{"margin-bottom":"10px"},key:"".concat(t,"-js"),customConditional:function(){return!o.default.noeval||o.default.protectedEval},components:[{type:"textarea",key:t,rows:5,editor:"ace",hideLabel:!0,as:"javascript",input:!0},{type:"htmlelement",tag:"div",content:"

    Enter custom javascript code.

    ".concat(i)}]},{type:"panel",title:"JSONLogic",collapsible:!0,collapsed:!0,key:"".concat(t,"-json"),components:[{type:"htmlelement",tag:"div",content:'

    Execute custom logic using JSONLogic.

    Full Lodash support is provided using an "_" before each operation, such as {"_sum": {var: "data.a"}}

    '+a},{type:"textarea",key:n,rows:5,editor:"ace",hideLabel:!0,as:"json",input:!0}]}];return l&&s.splice(2,1),{type:"panel",title:e,theme:"default",collapsible:!0,collapsed:!0,key:"".concat(t,"Panel"),weight:r,components:s}}},u=a;t.default=u},72801:function(e,t,n){"use strict";n(69070),n(47941),n(57327),n(38880),n(89554),n(54747),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(24812),n(92222),n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r,o=(r=n(96486))&&r.__esModule?r:{default:r},i=n(82531);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t0?e:10,this.refs.modalWrapper.style.paddingTop="".concat(e,"px")}},{key:"openModal",value:function(){this.isOpened=!0,this.refs.modalWrapper.classList.remove("component-rendering-hidden"),"signature"===this.component.component.type&&this.positionOverElement()}},{key:"updateView",value:function(){var e=o.default.isEqual(this.currentValue,this.component.defaultValue)?this.openModalTemplate:this.component.getModalPreviewTemplate();this.component.setContent(this.refs.openModalWrapper,e),this.setOpenEventListener()}},{key:"closeModal",value:function(){this.refs.modalWrapper.classList.remove("formio-dialog-disabled-animation"),this.refs.modalWrapper.classList.add("component-rendering-hidden"),this.isOpened=!1,this.updateView()}},{key:"closeModalHandler",value:function(e){e.preventDefault(),this.component.disabled||this.component.setValue(o.default.cloneDeep(this.currentValue),{resetValue:!0}),this.closeModal()}},{key:"showDialog",value:function(){this.dialogElement=this.component.ce("div");var e='\n

    '.concat(this.component.t("Do you want to clear changes?"),'

    \n
    \n \n \n
    \n ");this.dialogElement.innerHTML=e,this.dialogElement.refs={},this.component.loadRefs.call(this.dialogElement,this.dialogElement,{dialogHeader:"single",dialogCancelButton:"single",dialogYesButton:"single"}),this.dialog=this.component.createModal(this.dialogElement),this.component.addEventListener(this.dialogElement.refs.dialogYesButton,"click",this.saveDialogListener),this.component.addEventListener(this.dialogElement.refs.dialogCancelButton,"click",this.closeDialogListener)}},{key:"closeDialog",value:function(e){e.preventDefault(),this.dialog.close(),this.component.removeEventListener(this.dialogElement.refs.dialogYesButton,"click",this.saveDialogListener),this.component.removeEventListener(this.dialogElement.refs.dialogCancelButton,"click",this.closeDialogListener)}},{key:"saveDialog",value:function(e){this.closeDialog(e),this.closeModalHandler(e)}},{key:"saveModalValueHandler",value:function(e){var t;e.preventDefault(),this.currentValue=(0,i.fastCloneDeep)(null!==(t=this.component.dataValue)&&void 0!==t?t:this.component.getValue()),this.closeModal()}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=d},68093:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o;function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t0?this.removeClass(t,"text-danger"):this.addClass(t,"text-danger"),this.setContent(t,this.t("{{ remaining }} ".concat(e," remaining."),{remaining:o}))}else this.setContent(t,this.t("{{ count }} ".concat(e),{count:n}))}},{key:"updateValueAt",value:function(e,t,n){if(t=t||{},l.default.get(this.component,"showWordCount",!1)&&this.refs.wordcount&&this.refs.wordcount[n]){var r=l.default.parseInt(l.default.get(this.component,"validate.maxWords",0),10);this.setCounter(this.t("words"),this.refs.wordcount[n],this.getWordCount(e),r)}if(l.default.get(this.component,"showCharCount",!1)&&this.refs.charcount&&this.refs.charcount[n]){var o=l.default.parseInt(l.default.get(this.component,"validate.maxLength",0),10);this.setCounter(this.t("characters"),this.refs.charcount[n],e.length,o)}}},{key:"getValueAt",value:function(e){var t=this.performInputMapping(this.refs.input[e]);return t&&t.widget?t.widget.getValue():t?t.value:void 0}},{key:"updateValue",value:function(e,t,n){t=t||{};var r=f(m(b.prototype),"updateValue",this).call(this,e,t);return this.triggerUpdateValueAt(this.dataValue,t,n),r}},{key:"parseValue",value:function(e){return e}},{key:"formatValue",value:function(e){return e}},{key:"attach",value:function(e){return this.loadRefs(e,{charcount:"multiple",wordcount:"multiple",prefix:"multiple",suffix:"multiple"}),f(m(b.prototype),"attach",this).call(this,e)}},{key:"getWidget",value:function(e){return e=e||0,this.refs.input&&this.refs.input[e]?this.refs.input[e].widget:null}},{key:"attachElement",value:function(e,t){var n=this;f(m(b.prototype),"attachElement",this).call(this,e,t),e.widget&&e.widget.destroy();var r=u.default.resolve();return e.widget=this.createWidget(t),e.widget&&(r=e.widget.attach(e),this.refs.prefix&&this.refs.prefix[t]&&e.widget.addPrefix(this.refs.prefix[t]),this.refs.suffix&&this.refs.suffix[t]&&e.widget.addSuffix(this.refs.suffix[t])),this.addFocusBlurEvents(e),this.options.submitOnEnter&&this.addEventListener(e,"keypress",(function(e){13===(e.keyCode||e.which)&&(e.preventDefault(),e.stopPropagation(),n.emit("submitButton"))})),r}},{key:"createWidget",value:function(e){var t,n=this;if(!this.component.widget)return null;var r,o="string"==typeof this.component.widget?{type:this.component.widget}:this.component.widget;if(null!==(t=this.root)&&void 0!==t&&t.shadowRoot&&(o.shadowRoot=null===(r=this.root)||void 0===r?void 0:r.shadowRoot),!a.default.hasOwnProperty(o.type))return null;var i=new a.default[o.type](o,this.component,this,e);return i.on("update",(function(){return n.updateValue(n.getValue(),{modified:!0},e)}),!0),i.on("redraw",(function(){return n.redraw()}),!0),i}},{key:"detach",value:function(){if(f(m(b.prototype),"detach",this).call(this),this.refs&&this.refs.input)for(var e=0;e<=this.refs.input.length;e++){var t=this.getWidget(e);t&&t.destroy()}this.refs.input=[]}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),b}(o.default);t.default=v},12775:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n{{ item.label }}",validate:{onlyAvailableItems:!1}}].concat(t))}}],(n=[{key:"isSelectURL",get:function(){return"url"===this.component.dataSrc}},{key:"selectData",get:function(){var e=a.default.get(this.root,"submission.metadata.selectData",{});return a.default.get(e,this.path)}},{key:"shouldLoad",get:function(){if(this.loadingError)return!1;if(!this.options.readOnly)return!0;if(this.templateKeys&&this.templateKeys.length){var e=this.dataValue,t=this.selectData;return this.templateKeys.reduce((function(n,r){var o=a.default.has(e,r)||(a.default.isArray(t)?t.every((function(e){return a.default.has(e,r)})):a.default.has(t,r));return n||!o}),!1)}return!0}},{key:"getTemplateKeys",value:function(){var e=this.component.template;this.templateKeys=this.options.readOnly&&e?(0,l.getItemTemplateKeys)(e):[]}},{key:"requestHeaders",get:function(){var e=this,t=new i.GlobalFormio.Headers;if(this.component.data&&this.component.data.headers)try{a.default.each(this.component.data.headers,(function(n){n.key&&t.set(n.key,e.interpolate(n.value))}))}catch(e){console.warn(e.message)}return t}},{key:"setItems",value:function(){}},{key:"updateCustomItems",value:function(){}},{key:"loadItems",value:function(){}},{key:"getOptionTemplate",value:function(e,t,n){if(!this.component.template)return e.label;var r={noeval:!0,data:{}},o=this.sanitize(this.component.template?this.interpolate(this.component.template,{item:e},r):e.label,this.shouldSanitizeValue),i=this.component.reference&&null!=t&&t._id?t._id.toString():t;return i&&!a.default.isObject(i)&&r.data.item&&(this.templateData[i]=r.data.item),a.default.isNumber(n)&&(this.templateData[n]=r.data.item),o}},{key:"itemTemplate",value:function(e,t,n){if(a.default.isEmpty(e))return"";var r=this.sanitize(this.getOptionTemplate(e,t,n),this.shouldSanitizeValue);if(r){var o,i=r.replace(/<\/?[^>]+(>|$)/g,""),u=null===(o=this.i18next)||void 0===o?void 0:o.translator;if(!i||u&&!this.t(i,{_userInput:!0}))return;return u?r.replace(i,this.t(i,{_userInput:!0})):i}return this.sanitize(JSON.stringify(e),this.shouldSanitizeValue)}},{key:"handleLoadingError",value:function(e){this.loading=!1,e.networkError&&(this.networkError=!0),this.itemsLoadedResolve(),this.emit("componentError",{component:this.component,message:e.toString()}),console.warn("Unable to load resources for ".concat(this.key))}},{key:"updateItems",value:function(e,t){var n=this;if(!this.component.data)return console.warn("Select component ".concat(this.key," does not have data configuration.")),void this.itemsLoadedResolve();if(this.visible)switch(this.component.dataSrc){case"values":this.setItems(this.component.data.values);break;case"json":this.setItems(this.component.data.json);break;case"custom":this.updateCustomItems(t);break;case"resource":if(!this.component.data.resource||!t&&!this.active)return void this.itemsLoadedResolve();var r=this.options.formio?this.options.formio.formsUrl:"".concat(i.GlobalFormio.getProjectUrl(),"/form");if(r+="/".concat(this.component.data.resource,"/submission"),t||this.additionalResourcesAvailable||!this.serverCount)try{this.loadItems(r,e,this.requestHeaders)}catch(e){console.warn("Unable to load resources for ".concat(this.key))}else this.setItems(this.downloadedResources);break;case"url":if(!t&&!this.active&&!this.calculatedValue&&"select"===this.component.type)return void this.itemsLoadedResolve();var o,l,s=this.component.data.url;if(s.startsWith("/")){var c=s.startsWith("/project")?i.GlobalFormio.getBaseUrl():i.GlobalFormio.getProjectUrl()||i.GlobalFormio.getBaseUrl();s=c+s}this.component.data.method?l="POST"===(o=this.component.data.method).toUpperCase()?this.component.data.body:null:o="GET";var f=this.component.authenticate?{}:{noToken:!0};this.loadItems(s,e,this.requestHeaders,f,o,l);break;case"indexeddb":if("undefined"==typeof window)return;if(window.indexedDB||window.alert("Your browser doesn't support current version of indexedDB"),this.component.indexeddb&&this.component.indexeddb.database&&this.component.indexeddb.table){var d=window.indexedDB.open(this.component.indexeddb.database);d.onupgradeneeded=function(e){if(n.component.customOptions){var t=e.target.result;t.createObjectStore(n.component.indexeddb.table,{keyPath:"myKey",autoIncrement:!0}).transaction.oncomplete=function(){var e=t.transaction(n.component.indexeddb.table,"readwrite");n.component.customOptions.forEach((function(t){e.objectStore(n.component.indexeddb.table).put(t)}))}}},d.onerror=function(){window.alert(d.errorCode)},d.onsuccess=function(e){var t=e.target.result.transaction(n.component.indexeddb.table,"readwrite").objectStore(n.component.indexeddb.table);new u.default((function(e){var n=[];t.getAll().onsuccess=function(t){t.target.result.forEach((function(e){n.push(e)})),e(n)}})).then((function(e){a.default.isEmpty(n.component.indexeddb.filter)||(e=a.default.filter(e,n.component.indexeddb.filter)),n.setItems(e)}))}}}else this.itemsLoadedResolve()}}])&&f(t.prototype,n),r&&f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),v}(o.default);t.default=y},97389:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{type:"select",input:!0,weight:0,tooltip:"The source to use for the select data. Values lets you provide your own values and labels. JSON lets you provide raw JSON data. URL lets you provide a URL to retrieve the JSON data from.",key:"dataSrc",defaultValue:"values",label:"Data Source Type",dataSrc:"values"},{type:"textfield",input:!0,key:"data.url",weight:10,label:"Data Source URL",placeholder:"Data Source URL",tooltip:"A URL that returns a JSON array to use as the data source.",conditional:{json:{"===":[{var:"data.dataSrc"},"url"]}}},{type:"datagrid",input:!0,label:"Request Headers",key:"data.headers",tooltip:"Set any headers that should be sent along with the request to the url. This is useful for authentication.",weight:11,components:[{label:"Key",key:"key",input:!0,type:"textfield"},{label:"Value",key:"value",input:!0,type:"textfield"}],conditional:{json:{"===":[{var:"data.dataSrc"},"url"]}}},{type:"textfield",input:!0,label:"Value Property",key:"valueProperty",skipMerge:!0,clearOnHide:!1,weight:13,description:"The selected item's property to save.",tooltip:"The property of each item in the data source to use as the select value. If not specified, the item itself will be used.",conditional:{json:{in:[{var:"data.dataSrc"},["json","url","custom"]]}}},{type:"textarea",input:!0,key:"template",label:"Item Template",editor:"ace",as:"html",rows:3,weight:18,tooltip:"The HTML template for the result data items.",allowCalculateOverride:!0,calculateValue:function(e){return!e.data.template&&e.instance&&e.instance._currentForm.options.editComponent?e.instance._currentForm.options.editComponent.template:e.data.template}},{type:"checkbox",input:!0,weight:26,key:"authenticate",label:"Formio Authenticate",tooltip:"Check this if you would like to use Formio Authentication with the request.",conditional:{json:{"===":[{var:"data.dataSrc"},"url"]}}},{type:"checkbox",input:!0,weight:29,key:"ignoreCache",label:"Disables Storing Request Result in the Cache",tooltip:"Check it if you don't want the requests and its results to be stored in the cache. By default, it is stored and if the Select tries to make the request to the same URL with the same paremetrs, the cached data will be returned. It allows to increase performance, but if the remote source's data is changing quite often and you always need to keep it up-to-date, uncheck this option.",conditional:{json:{or:[{"===":[{var:"data.dataSrc"},"url"]},{"===":[{var:"data.dataSrc"},"resource"]}]}}}]},99606:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(83593),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(79753),n(69600),n(21249),n(24812),n(89554),n(41539),n(54747),n(32564),n(69826),n(92222),n(68304),n(30489);var o=u(n(68093)),i=u(n(91459)),a=u(n(96486));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n\n '.concat(this.renderElement("hidden"!==this.component.type?this.dataValue:""),"\n "));var e=this.dataValue;return Array.isArray(e)||(e=e?[e]:[]),d(m(f.prototype),"render",this).call(this,this.renderTemplate("multiValueTable",{rows:e.map(this.renderRow.bind(this)).join(""),disabled:this.disabled,addAnother:this.addAnother}))}},{key:"renderElement",value:function(){return""}},{key:"renderRow",value:function(e,t){return this.renderTemplate("multiValueRow",{index:t,disabled:this.disabled,element:"".concat(this.renderElement(e,t))})}},{key:"attach",value:function(e){var t=this,n=d(m(f.prototype),"attach",this).call(this,e);this.loadRefs(e,{addButton:"multiple",input:"multiple",removeRow:"multiple",mask:"multiple",select:"multiple"});var r=[];return this.refs.input.forEach((function(e,n){r.push(t.attachElement.call(t,e,n))})),this.component.multiple?(this.refs.removeRow.forEach((function(e,n){t.addEventListener(e,"click",(function(e){e.preventDefault(),t.removeValue(n)}))})),this.refs.addButton.forEach((function(e){t.addEventListener(e,"click",(function(e){e.preventDefault(),t.addValue()}))})),n.then((function(){return i.default.all(r)}))):i.default.all(r)}},{key:"detach",value:function(){this.refs.input&&this.refs.input.length&&this.refs.input.forEach((function(e){e.mask&&e.mask.destroy(),e.widget&&e.widget.destroy()})),this.refs.mask&&this.refs.mask.length&&this.refs.mask.forEach((function(e){e.mask&&e.mask.destroy()})),d(m(f.prototype),"detach",this).call(this)}},{key:"attachElement",value:function(e,t){var n=this;if(this.addEventListener(e,this.inputInfo.changeEvent,(function(){var r=a.default.get(n.component,"case","mixed");if("mixed"!==r){var o=e.selectionStart,i=e.selectionEnd;"uppercase"===r&&e.value&&(e.value=e.value.toUpperCase()),"lowercase"===r&&e.value&&(e.value=e.value.toLowerCase()),e.selectionStart&&e.selectionEnd&&(e.selectionStart=o,e.selectionEnd=i)}try{n.saveCaretPosition(e,t)}catch(e){console.warn("An error occurred while trying to save caret position",e)}if(!e.mask)return n.updateValue(null,{modified:"hidden"!==n.component.type},t);setTimeout((function(){return n.updateValue(null,{modified:"hidden"!==n.component.type},t)}),1)})),!this.attachMultiMask(t)){var r=function(){n.setInputMask(e);var t=n.component.inputMask,r=n.component.displayMask;t&&r&&r!==t&&n.refs.valueMaskInput&&n.setInputMask(n.refs.valueMaskInput,t)};"blur"===this.inputInfo.changeEvent?this.addEventListener(e,this.inputInfo.changeEvent,(function(){var e;r(),n.dataValue=n.refs.input[0].value,null===(e=document.querySelector('[name="data[submit]"]'))||void 0===e||e.disabled,n.checkComponentValidity()&&n.updateComponentValue(n.refs.input[0].value)})):r()}}},{key:"onSelectMaskHandler",value:function(e){this.updateMask(e.target.maskInput,this.getMaskPattern(e.target.value))}},{key:"getMaskPattern",value:function(e){if(this.multiMasks||(this.multiMasks={}),this.multiMasks[e])return this.multiMasks[e];var t=this.component.inputMasks.find((function(t){return t.label===e}));return this.multiMasks[e]=t?t.mask:this.component.inputMasks[0].mask,this.multiMasks[e]}},{key:"attachMultiMask",value:function(e){if(!(this.isMultipleMasksField&&this.component.inputMasks.length&&this.refs.input.length))return!1;var t=this.refs.select[e];return t.onchange=this.onSelectMaskHandler.bind(this),t.maskInput=this.refs.mask[e],this.setInputMask(t.maskInput,this.component.inputMasks[0].mask),!0}},{key:"updateMask",value:function(e,t){t&&(this.setInputMask(e,t,!this.component.placeholder),this.updateValue())}},{key:"addNewValue",value:function(e){void 0===e&&(e=this.component.defaultValue?this.component.defaultValue:this.emptyValue,Array.isArray(e)&&0===e.length&&(e=this.emptyValue));var t=this.dataValue||[];Array.isArray(t)||(t=[t]),Array.isArray(e)?t=t.concat(e):t.push(e),this.dataValue=t}},{key:"addValue",value:function(){this.addNewValue(),this.redraw(),this.checkConditions(),this.isEmpty(this.dataValue)||this.restoreValue(),this.root&&this.root.onChange()}}])&&s(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),f}(o.default);t.default=v},40970:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&"getComponent"in e?s=e.getComponent(u,t,n):t&&t(e,o),!1})),s||(s=c),s):s}},{key:"getComponentById",value:function(e,t){var n=null;return this.everyComponent((function(r,o){if(r.id===e)return n=r,t&&t(r,o),!1})),n}},{key:"calculateComponentPath",value:function(e){var t="";if(e.component.key){for(var n=this;n&&!n.allowData&&n.parent;)n=n.parent;var r=e.row?"[".concat(Number.parseInt(e.row),"]"):"";return t=n.path?"".concat(n.path).concat(r,"."):"",(t+=e._parentPath&&e.component.shouldIncludeSubFormPath?e._parentPath:"")+e.component.key}}},{key:"createComponent",value:function(e,t,n,r,i){var u;if(e){t=t||this.options,n=n||this.data,t.parent=this,t.parentVisible=this.visible,t.root=(null===(u=t)||void 0===u?void 0:u.root)||this.root||this,t.localRoot=this.localRoot,t.skipInit=!0,"pdf"===t.display&&this.builderMode||(e.id=(0,l.getRandomComponentId)()),!this.isInputComponent&&this.component.shouldIncludeSubFormPath&&(e.shouldIncludeSubFormPath=!0);var s=a.default.create(e,t,n,!0),c=this.calculateComponentPath(s);if(c&&(s.path=c),s.init(),e.internal)return s;if(r){var f=o.default.findIndex(this.components,{id:r.id});-1!==f?this.components.splice(f,0,s):this.components.push(s)}else if(i){var d=o.default.findIndex(this.components,{id:i.id});-1!==d?this.components[d]=s:this.components.push(s)}else this.components.push(s);return s}}},{key:"getContainer",value:function(){return this.element}},{key:"componentComponents",get:function(){return this.component.components||[]}},{key:"nestedKey",get:function(){return"nested-".concat(this.key)}},{key:"templateName",get:function(){return"container"}},{key:"init",value:function(){return this.components=this.components||[],this.addComponents(),y(g(m.prototype),"init",this).call(this)}},{key:"addComponents",value:function(e,t){var n=this;e=e||this.data,(t=t||this.options).components?this.components=t.components:(this.hook("addComponents",this.componentComponents,this)||[]).forEach((function(t){return n.addComponent(t,e)}))}},{key:"addComponent",value:function(e,t,n,r){return t=t||this.data,this.options.parentPath&&(e.shouldIncludeSubFormPath=!0),e=this.hook("addComponent",e,t,n,r),this.createComponent(e,this.options,t,n||null)}},{key:"beforeFocus",value:function(){this.parent&&"beforeFocus"in this.parent&&this.parent.beforeFocus(this)}},{key:"render",value:function(e){return y(g(m.prototype),"render",this).call(this,e||this.renderTemplate(this.templateName,{children:this.visible?this.renderComponents():"",nestedKey:this.nestedKey,collapsed:!this.options.pdf&&this.collapsed}))}},{key:"renderComponents",value:function(e){var t=(e=e||this.getComponents()).map((function(e){return e.render()}));return this.renderTemplate("components",{children:t,components:e})}},{key:"attach",value:function(e){var t=this,n=y(g(m.prototype),"attach",this).call(this,e);this.loadRefs(e,p({header:"single",collapsed:this.collapsed},this.nestedKey,"single"));var r=u.default.resolve();return this.refs[this.nestedKey]&&(r=this.attachComponents(this.refs[this.nestedKey])),this.visible||this.attachComponentsLogic(),this.component.collapsible&&this.refs.header&&(this.addEventListener(this.refs.header,"click",(function(){t.collapsed=!t.collapsed})),this.addEventListener(this.refs.header,"keydown",(function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),t.collapsed=!t.collapsed)}))),u.default.all([n,r])}},{key:"attachComponentsLogic",value:function(e){e=e||this.components,o.default.each(e,(function(e){e.attachLogic(),o.default.isFunction(e.attachComponentsLogic)&&e.attachComponentsLogic()}))}},{key:"attachComponents",value:function(e,t,n){if(t=t||this.components,n=n||this.component.components,!(e=this.hook("attachComponents",e,t,n,this)))return new u.default((function(){}));var r=0,o=[];return Array.prototype.slice.call(e.children).forEach((function(e){!e.getAttribute("data-noattach")&&t[r]&&(o.push(t[r].attach(e)),r++)})),u.default.all(o)}},{key:"removeComponent",value:function(e,t){t=t||this.components,e.destroy(),o.default.remove(t,{id:e.id})}},{key:"removeComponentByKey",value:function(e,t){var n=this;if(!this.getComponent(e,(function(e,r){n.removeComponent(e,r),t&&t(e,r)})))return t&&t(null),null}},{key:"removeComponentById",value:function(e,t){var n=this;if(!this.getComponentById(e,(function(e,r){n.removeComponent(e,r),t&&t(e,r)})))return t&&t(null),null}},{key:"updateValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.components.reduce((function(e,n){return n.updateValue(null,t)||e}),y(g(m.prototype),"updateValue",this).call(this,e,t))}},{key:"shouldSkipValidation",value:function(e,t,n){return!this.component.input||y(g(m.prototype),"shouldSkipValidation",this).call(this,e,t,n)}},{key:"checkData",value:function(e,t,n,r){if(this.builderMode)return!0;e=e||this.rootValue,t=t||{},n=n||this.data;var i=(r=r&&o.default.isArray(r)?r:this.getComponents()).reduce((function(r,o){return o.checkData(e,t,n)&&r}),y(g(m.prototype),"checkData",this).call(this,e,t,n));return this.checkModal(i,this.isDirty),i}},{key:"checkConditions",value:function(e,t,n){var r=y(g(m.prototype),"checkConditions",this).call(this,e,t,n);return this.getComponents().forEach((function(n){return n.checkConditions(e,t,n.data)})),r}},{key:"clearOnHide",value:function(e){y(g(m.prototype),"clearOnHide",this).call(this,e),this.component.clearOnHide&&(!this.allowData||this.hasValue()||this.options.server&&!this.visible||(this.dataValue=this.defaultValue),this.hasValue()&&this.restoreComponentsContext()),this.getComponents().forEach((function(t){return t.clearOnHide(e)}))}},{key:"restoreComponentsContext",value:function(){var e=this;this.getComponents().forEach((function(t){return t.data=e.dataValue}))}},{key:"beforePage",value:function(e){return u.default.all(this.getComponents().map((function(t){return t.beforePage(e)})))}},{key:"beforeSubmit",value:function(){return u.default.all(this.getComponents().map((function(e){return e.beforeSubmit()})))}},{key:"calculateValue",value:function(e,t,n){return!!this.conditionallyVisible()&&this.getComponents().reduce((function(r,o){return o.calculateValue(e,t,n)||r}),y(g(m.prototype),"calculateValue",this).call(this,e,t,n))}},{key:"isLastPage",value:function(){return this.pages.length-1===this.page}},{key:"isValid",value:function(e,t){return this.getComponents().reduce((function(n,r){return r.isValid(e,t)&&n}),y(g(m.prototype),"isValid",this).call(this,e,t))}},{key:"checkChildComponentsValidity",value:function(e,t,n,r,o){return this.getComponents().reduce((function(o,i){return i.checkValidity(e,t,n,r)&&o}),o)}},{key:"checkValidity",value:function(e,t,n,r){if(!this.checkCondition(n,e))return this.setCustomValidity(""),!0;var o=this.checkChildComponentsValidity(e,t,n,r,y(g(m.prototype),"checkValidity",this).call(this,e,t,n,r));return this.checkModal(o,t),o}},{key:"checkAsyncValidity",value:function(e,t,n,r){var o=this;return this.ready.then((function(){var i=[y(g(m.prototype),"checkAsyncValidity",o).call(o,e,t,n,r)];return o.eachComponent((function(o){return i.push(o.checkAsyncValidity(e,t,n,r))})),u.default.all(i).then((function(e){return e.reduce((function(e,t){return e&&t}),!0)}))}))}},{key:"setPristine",value:function(e){y(g(m.prototype),"setPristine",this).call(this,e),this.getComponents().forEach((function(t){return t.setPristine(e)}))}},{key:"isPristine",get:function(){return this.pristine&&this.getComponents().every((function(e){return e.isPristine}))}},{key:"isDirty",get:function(){return this.dirty&&this.getComponents().every((function(e){return e.isDirty}))}},{key:"detach",value:function(){this.components.forEach((function(e){e.detach()})),y(g(m.prototype),"detach",this).call(this)}},{key:"clear",value:function(){this.components.forEach((function(e){e.clear()})),y(g(m.prototype),"clear",this).call(this)}},{key:"destroy",value:function(){this.destroyComponents(),y(g(m.prototype),"destroy",this).call(this)}},{key:"destroyComponents",value:function(){var e=this;this.getComponents().slice().forEach((function(t){return e.removeComponent(t,e.components)})),this.components=[]}},{key:"errors",get:function(){var e=this.error?[this.error]:[];return this.getComponents().reduce((function(e,t){return e.concat(t.errors||[])}),e).filter((function(e){return"hidden"!==e.level}))}},{key:"getValue",value:function(){return this.data}},{key:"resetValue",value:function(){y(g(m.prototype),"resetValue",this).call(this),this.getComponents().forEach((function(e){return e.resetValue()})),this.setPristine(!0)}},{key:"dataReady",get:function(){return u.default.all(this.getComponents().map((function(e){return e.dataReady})))}},{key:"setNestedValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e._data=this.componentContext(e),"button"!==e.type&&("components"===e.type?e.tree&&e.hasValue(t)?e.setValue(o.default.get(t,e.key),n):e.setValue(t,n):t&&e.hasValue(t)?e.setValue(o.default.get(t,e.key),n):this.rootPristine&&!e.visible||!e.shouldAddDefaultValue?void 0:(n.noValidate=!n.dirty,n.resetValue=!0,e.setValue(e.defaultValue,n)))}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!e&&(e.submitAsDraft&&!e.submit&&(n.noValidate=!0),this.getComponents().reduce((function(r,o){return t.setNestedValue(o,e,n,r)||r}),!1))}},{key:"lazyLoad",get:function(){var e;return null!==(e=this.component.lazyLoad)&&void 0!==e&&e}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&"getComponent"in e?l=e.getComponent(i,t,n):t&&t(e,o),a=null!==s?l:a.concat(l||u))}),s),a&&0!==a.length||!u||(a=null!==s?u:[u]),a):a}},{key:"everyComponent",value:function(e,t,n){var r;if(o.default.isObject(t)&&(n=t,t=null),null===(r=n)||void 0===r||!r.email){var i=this.getComponents(t);o.default.each(i,(function(t,r){return!1!==e(t,i,r)&&("function"!=typeof t.everyComponent||!1!==t.everyComponent(e,n))&&void 0}))}}},{key:"getValueAsString",value:function(e,t){if(null!=t&&t.email){var n,r='\n \n \n \n ';return null===(n=this.component.components)||void 0===n||n.forEach((function(e){var t=e.label||e.key;r+='")})),r+="\n \n \n \n ",this.iteratableRows.forEach((function(e){var n=e.components;r+="",o.default.each(n,(function(e){r+='"})),r+=""})),r+="\n \n
    '.concat(t,"
    ',e.isInputComponent&&e.visible&&!e.skipInEmail&&(r+=e.getView(e.dataValue,t)),r+="
    \n "}return e&&e.length?f(y(v.prototype),"getValueAsString",this).call(this,e,t):""}},{key:"getComponents",value:function(e){return void 0!==e?this.iteratableRows[e]?this.iteratableRows[e].components:[]:f(y(v.prototype),"getComponents",this).call(this)}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),v}(u.default);t.default=m},67329:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(47941),n(57327),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92222),n(24603),n(74916),n(39714),n(89554),n(41539),n(54747),n(15306),n(68304),n(24812),n(30489);var o=l(n(64430)),i=l(n(24561)),a=l(n(96486)),u=n(82531);function l(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t\n ').concat(e.getView(e.dataValue,t),"\n \n "))}),c(c({},t),{},{fromRoot:!0})),n+="\n \n \n "}return a.default.isEmpty(e)?"":null!=t&&t.modalPreview?(delete t.modalPreview,this.getDataValueAsTable(e,t)):"[Complex Data]"}},{key:"getDataValueAsTable",value:function(e,t){var n='\n \n \n ',r=new RegExp("<(.*?)>");return this.components.forEach((function(e){if(e.isInputComponent&&e.visible&&!e.skipInEmail){var o=e.getView(e.dataValue,t);n+='\n \n \n \n \n ")}}),c(c({},t),{},{fromRoot:!0})),n+="\n \n
    '.concat(e.label,'').concat(e.component&&"html"===e.component.inputFormat&&r.test(o)?o:''),"
    \n "}},{key:"everyComponent",value:function(e,t){if(null!=t&&t.email){if(!t.fromRoot)return;delete t.fromRoot}return y(g(f.prototype),"everyComponent",this).call(this,e,t)}},{key:"getValue",value:function(){return this.dataValue}},{key:"updateValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.default.prototype.updateValue.call(this,e,t)}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!1,r=this.hasValue();return r&&a.default.isEmpty(this.dataValue)&&(t.noValidate=!0),e&&a.default.isObject(e)&&r||(n=!0,this.dataValue=this.defaultValue),n=y(g(f.prototype),"setValue",this).call(this,e,t)||n,this.updateOnChange(t,n),n}}],r=[{key:"savedValueTypes",value:function(e){return(0,u.getComponentSavedTypes)(e)||[u.componentValueTypes.object]}}],n&&p(t.prototype,n),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),f}(i.default);t.default=w},7115:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=this.defaultSchema;return e.components&&(t=i.default.omit(t,"components")),i.default.defaultsDeep(e,t)}},{key:"init",value:function(){if(this.components=this.components||[],(this.builderMode||this.manualModeEnabled)&&s.default.prototype.addComponents.call(this,this.manualMode?this.address:{}),l.default.prototype.init.call(this),!this.builderMode)if(this.component.provider){var e=this.component,t=e.provider,n=e.providerOptions;this.provider=this.initializeProvider(t,n)}else if(this.component.map){this.component.provider=u.GoogleAddressProvider.name,this.component.providerOptions=this.component.providerOptions||{};var r=this.component,o=r.map,a=r.provider,c=r.providerOptions,f=o.key,d=o.region;f&&i.default.set(c,"params.key",f),d&&i.default.set(c,"params.region",d),this.provider=this.initializeProvider(a,c)}}},{key:"initializeProvider",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.interpolate(t.url),r=a.GlobalFormio.Providers.getProvider("address",e);return new r(v(v({},t),{},{url:n}))}},{key:"emptyValue",get:function(){return this.manualModeEnabled?{mode:x.Autocomplete,address:{}}:{}}},{key:"mode",get:function(){var e,t;return this.manualModeEnabled&&null!==(e=null===(t=this.dataValue)||void 0===t?void 0:t.mode)&&void 0!==e?e:x.Autocomplete},set:function(e){this.manualModeEnabled&&(this.dataValue.mode=e)}},{key:"autocompleteMode",get:function(){return this.mode===x.Autocomplete}},{key:"manualMode",get:function(){return this.mode===x.Manual}},{key:"manualModeEnabled",get:function(){return!this.isMultiple&&Boolean(this.component.enableManualMode)}},{key:"restoreComponentsContext",value:function(){var e=this;this.getComponents().forEach((function(t){t.data=e.address,t.setValue(t.dataValue,{noUpdateEvent:!0})}))}},{key:"isMultiple",get:function(){return Boolean(this.component.multiple)}},{key:"address",get:function(){return this.isMultiple?i.default.isArray(this.dataValue)?this.dataValue:[this.dataValue]:this.manualModeEnabled&&this.dataValue?this.dataValue.address:this.dataValue},set:function(e){this.manualModeEnabled&&!this.isMultiple?this.dataValue.address=e:this.dataValue=e}},{key:"defaultValue",get:function(){var e=O(P(_.prototype),"defaultValue",this);return this.isMultiple&&(e=i.default.isArray(e)?e:[e]),e}},{key:"defaultSchema",get:function(){return _.schema()}},{key:"isValueInLegacyFormat",value:function(e){return e&&!e.mode}},{key:"normalizeValue",value:function(e){return this.manualModeEnabled&&this.isValueInLegacyFormat(e)?{mode:x.Autocomplete,address:e}:e}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l.default.prototype.setValue.call(this,e,t);return this.manualMode&&this.restoreComponentsContext(),(n||!i.default.isEmpty(e)&&t.fromSubmission)&&this.redraw(),n}},{key:"modeSwitcher",get:function(){return this.refs&&this.refs[_.modeSwitcherRef]||null}},{key:"removeValueIcon",get:function(){return this.refs&&this.refs[_.removeValueIconRef]||null}},{key:"searchInput",get:function(){return this.refs&&this.refs[_.searchInputRef]||null}},{key:"addRowButton",get:function(){return this.refs&&this.refs[_.addRowButtonRef]||null}},{key:"removeRowButton",get:function(){return this.refs&&this.refs[_.removeRowButtonRef]||null}},{key:"searchInputAttributes",get:function(){var e={name:this.options.name,type:"text",class:"form-control",lang:this.options.language,tabindex:this.component.tabindex||0};return this.component.placeholder&&(e.placeholder=this.t(this.component.placeholder)),this.disabled&&(e.disabled="disabled"),i.default.defaults(e,this.component.attributes),e}},{key:"templateName",get:function(){return"address"}},{key:"gridTemplateName",get:function(){return"multiValueTable"}},{key:"rowTemplateName",get:function(){return"multiValueRow"}},{key:"hasChildren",get:function(){return!this.isMultiple&&(this.builderMode||this.manualModeEnabled)}},{key:"addAnother",get:function(){return this.t(this.component.addAnother||"Add Another")}},{key:"renderElement",value:function(e){return this.renderTemplate(this.templateName,{children:this.hasChildren?this.renderComponents():"",nestedKey:this.nestedKey,inputAttributes:this.searchInputAttributes,ref:{modeSwitcher:_.modeSwitcherRef,removeValueIcon:_.removeValueIconRef,searchInput:_.searchInputRef},displayValue:this.getDisplayValue(e),mode:{autocomplete:this.autocompleteMode,manual:this.manualMode}})}},{key:"renderRow",value:function(e,t){return this.renderTemplate(this.rowTemplateName,{index:t,disabled:this.disabled,element:"".concat(this.renderElement(e,t))})}},{key:"renderGrid",value:function(){return this.renderTemplate(this.gridTemplateName,{rows:this.address.map(this.renderRow.bind(this)).join(""),disabled:this.disabled,addAnother:this.addAnother})}},{key:"render",value:function(){return this.isMultiple?O(P(_.prototype),"render",this).call(this,this.renderGrid()):O(P(_.prototype),"render",this).call(this,this.renderElement())}},{key:"onSelectAddress",value:function(e,t,n){var r;this.isMultiple?(this.address[n]=e,this.address=function(e){if(Array.isArray(e))return y(e)}(r=this.address)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||h(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):this.address=e,this.triggerChange({modified:!0}),t&&(t.value=this.getDisplayValue(this.isMultiple?this.address[n]:this.address)),this.updateRemoveIcon(n)}},{key:"addRow",value:function(){this.address=this.address.concat(this.emptyValue),O(P(_.prototype),"redraw",this).call(this)}},{key:"attach",value:function(e){var t,n=this,r=(this.builderMode||this.manualMode?O(P(_.prototype),"attach",this):l.default.prototype.attach).call(this,e);if(!this.builderMode&&!this.provider&&this.component.provider){var a=this.component,u=a.provider,s=a.providerOptions;this.provider=this.initializeProvider(u,s)}return this.loadRefs(e,(b(t={},_.addRowButtonRef,"single"),b(t,_.modeSwitcherRef,"single"),b(t,_.removeRowButtonRef,"multiple"),b(t,_.removeValueIconRef,"multiple"),b(t,_.searchInputRef,"multiple"),t)),this.searchInput.forEach((function(e,t){!n.builderMode&&e&&n.provider&&("google"===n.component.provider?n.provider.attachAutocomplete(e,t,n.onSelectAddress.bind(n)):(0,o.default)({input:e,debounceWaitMs:300,fetch:function(e,t){var r=e;n.provider.search(r).then(t)},render:function(e){var t=n.ce("div");return t.textContent=n.getDisplayValue(e),t},onSelect:function(r){n.onSelectAddress(r,e,t)}}),n.addEventListener(e,"blur",(function(){e&&e.value&&(e.value=n.getDisplayValue(n.isMultiple?n.address[t]:n.address))})),n.addEventListener(e,"keyup",(function(){e&&(e.value||n.clearAddress(e,t))})))})),this.addRowButton&&this.addEventListener(this.addRowButton,"click",(function(e){e.preventDefault(),n.addRow()})),this.removeRowButton.forEach((function(e,t){n.addEventListener(e,"click",(function(e){e.preventDefault(),n.removeValue(t)}))})),this.modeSwitcher&&this.addEventListener(this.modeSwitcher,"change",(function(){n.modeSwitcher&&(n.dataValue=n.emptyValue,n.mode=n.modeSwitcher.checked?x.Manual:x.Autocomplete,n.builderMode||(n.manualMode&&n.restoreComponentsContext(),n.triggerChange({modified:!0})),n.redraw())})),this.builderMode||(this.removeValueIcon.forEach((function(e,t){n.updateRemoveIcon(t);var r=function(){var e,r=null===(e=n.searchInput)||void 0===e?void 0:e[t];n.clearAddress(r,t),r&&r.focus()};n.addEventListener(e,"click",r),n.addEventListener(e,"keydown",(function(e){"Enter"===e.key&&r()}))})),i.default.each(this.refs.searchInput||[],(function(e){return n.addFocusBlurEvents(e)}))),r}},{key:"addChildComponent",value:function(e){e.customConditional=C}},{key:"redraw",value:function(){var e=this,t=this.modeSwitcher&&document.activeElement===this.modeSwitcher;return O(P(_.prototype),"redraw",this).call(this).then((function(n){return t&&e.modeSwitcher&&e.modeSwitcher.focus(),n}))}},{key:"clearAddress",value:function(e,t){var n;this.isEmpty()||this.triggerChange(),null!==(n=this.address)&&void 0!==n&&n[t]?this.address[t]=this.emptyValue:this.address=this.emptyValue,e&&(e.value=""),this.updateRemoveIcon(t)}},{key:"getDisplayValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.address;return this.provider&&!this.manualMode?this.provider.getDisplayValue(e):""}},{key:"validateMultiple",value:function(){return this.isMultiple}},{key:"updateRemoveIcon",value:function(e){var t,n=null===(t=this.removeValueIcon)||void 0===t?void 0:t[e];if(n){var r=this.isMultiple?this.address[e]:this.address;this.isEmpty(r)||this.disabled?this.addClass(n,E):this.removeClass(n,E)}}},{key:"getValueAsString",value:function(e,t){if(!e)return"";var n=this.normalizeValue(e),r=this.manualModeEnabled?n:{address:n,mode:x.Autocomplete},o=r.address,a=r.mode===x.Manual;return this.provider&&!a?this.getDisplayValue(o):a?this.component.manualModeViewString?this.interpolate(this.component.manualModeViewString,{address:o,data:this.data,component:this.component}):this.getComponents().filter((function(e){return e.hasValue(o)})).map((function(e){return[e,i.default.get(o,e.key)]})).filter((function(e){var t=p(e,2),n=t[0],r=t[1];return!n.isEmpty(r)})).map((function(e){var n=p(e,2),r=n[0],o=n[1];return r.getValueAsString(o,t)})).join(", "):O(P(_.prototype),"getValueAsString",this).call(this,o,t)}},{key:"focus",value:function(){this.searchInput&&this.searchInput[0]&&this.searchInput[0].focus()}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;nlink for available options",conditional:{json:{"===":[{var:"data.provider"},"google"]}}},{type:"textarea",input:!0,key:"manualModeViewString",label:"Manual Mode View String",placeholder:"Enter Manual Mode View String",description:'"address" variable references component value, "data" - submission data and "component" - address component schema.',weight:60,rows:5,editor:"ace",tooltip:"Specify template which should be when quering view string for the component value entered in manual mode. This string is used in table view, CSV export and email rendering. When left blank combined value of all components joined with comma will be used."}];t.default=a},93808:function(e,t,n){"use strict";n(69070),n(47941),n(57327),n(38880),n(49337),n(33321),n(79753),n(32165),n(66992),n(78783),n(33948),n(91038),n(47042),n(68309),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(24812),n(89554),n(41539),n(54747),n(92222),n(69720),n(74916),n(15306),n(96649),n(96078),n(82526),n(41817),n(9653);var r,o=(r=n(96486))&&r.__esModule?r:{default:r},i=n(82531);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e=o.default.isArray(e)?e:[e];var r=this.createMessagesList("error",e);return this.showAlert("error",r,n),t&&this.parentComponent.emit("error",e),e}},{key:"showMessage",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e;r instanceof HTMLElement?r.setAttribute("ref","messageRef"):r=this.parentComponent.ce("p",{ref:"messageRef"}),this.showAlert(t,r,n)}},{key:"createMessagesList",value:function(e){if("error"===e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:{},r=n.customClasses,o=n.customEvents;this.setAlert(e,t,{customClasses:r}),this.alert&&(this.attach({customEvents:o}),this.parentComponent.prependTo(this.alert,this.container))}},{key:"setAlert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.alertTypes[e];if(this.alert&&this.clear(),t){var o=n.id,i=void 0===o?"".concat(e,"-list-").concat(this.parentComponent.id):o,a=n.customClasses,u=void 0===a?"alert alert-".concat(r):a;this.alert=this.parentComponent.ce("div",{id:i,class:u}),t instanceof HTMLElement?this.parentComponent.appendTo(t,this.alert):this.parentComponent.setContent(this.alert,t)}}},{key:"attach",value:function(e){var t,n,r,o=this,i=e.customEvents,a=void 0===i?{}:i;this.eventListenersKeys=[],this.loadRefs(this.alert,this.refsNames);var s=(null===(t=a.click)||void 0===t?void 0:t.listeners)||[],c=(null===(n=a.keypress)||void 0===n?void 0:n.listeners)||[];a=f(f({},a),{},{click:[].concat(u(s),[function(e){var t=e.currentTarget.dataset.componentKey;o.focusOnComponent(t)}]),keypress:[].concat(u(c),[function(e){var t=e.currentTarget.dataset.componentKey;o.focusOnComponent(t)}])}),null!==(r=this.refs.messageRef)&&void 0!==r&&r.length&&this.refs.messageRef.forEach((function(e){Object.entries(a).forEach((function(t){var n,r,i=(r=2,function(e){if(Array.isArray(e))return e}(n=t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],l=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(n,r)||l(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0];i[1].forEach((function(t){return o.parentComponent.addEventListener(e,a,t)})),o.eventListenersKeys.push(a)}))}))}},{key:"clear",value:function(){var e=this;try{var t;null!==(t=this.refs.messageRef)&&void 0!==t&&t.length&&this.refs.messageRef.forEach((function(t){e.eventListenersKeys.forEach((function(n){return e.parentComponent.removeEventListener(t,n)}))})),this.refs={},this.parentComponent.removeChildFrom(this.alert,this.container),this.alert=null}catch(e){}}},{key:"focusOnComponent",value:function(e){if(e){var t,n=this.parentComponent._parentPath?e.replace(this.parentComponent._parentPath,""):e,r=null===(t=this.parentComponent.root)||void 0===t?void 0:t.getComponent(n,null,e);r&&o.default.isFunction(r.focus)&&r.focus()}}},{key:"createMessage",value:function(e,t,n,r,o){if("error"===e)return this.createErrorMessage(t,n,r,o)}},{key:"createErrorMessage",value:function(e,t,n,r){var a,u,l={style:"cursor: pointer",ref:"messageRef",tabIndex:0,"aria-label":"".concat(t,". Click to navigate to the field with following error.")},s=this.parentComponent.ce("li",l);this.parentComponent.setContent(s,t);var c=!o.default.isUndefined(n)&&(null==r||null===(a=r.messages)||void 0===a?void 0:a[n]),f=(null==c?void 0:c.path)||(null==r||null===(u=r.component)||void 0===u?void 0:u.key);if(f){var d=(0,i.getStringFromComponentPath)(f);s.dataset.componentKey=d}this.parentComponent.appendTo(s,e)}},{key:"appendErrorToList",value:function(e,t){var n,r=this;if(null!=e&&null!==(n=e.messages)&&void 0!==n&&n.length)e.messages.forEach((function(n,o){var i=n.message;r.createMessage("error",t,i,o,e)}));else if(e){var i=o.default.isObject(e)?e.message||"":e;this.createMessage("error",t,i)}}}],n&&p(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=y},89395:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=K(n(15178)),o=K(n(7115)),i=K(n(28110)),a=K(n(87533)),u=K(n(98237)),l=K(n(3248)),s=K(n(45187)),c=K(n(67400)),f=K(n(87018)),d=K(n(11988)),p=K(n(21006)),h=K(n(4025)),y=K(n(69403)),m=K(n(68489)),v=K(n(16659)),b=K(n(52710)),g=K(n(59973)),w=K(n(44415)),k=K(n(12775)),O=K(n(45574)),_=K(n(16494)),S=K(n(40970)),j=K(n(1512)),P=K(n(81089)),x=K(n(93268)),E=K(n(54570)),C=K(n(20481)),A=K(n(124)),T=K(n(64328)),R=K(n(99966)),M=K(n(24120)),D=K(n(66369)),I=K(n(68427)),L=K(n(39450)),V=K(n(5657)),N=K(n(28145)),F=K(n(3611)),B=K(n(53983)),U=K(n(65105)),z=K(n(69561)),q=K(n(18995)),H=K(n(81541)),W=K(n(793));function K(e){return e&&e.__esModule?e:{default:e}}r.default.address.editForm=o.default,r.default.button.editForm=i.default,r.default.checkbox.editForm=a.default,r.default.columns.editForm=u.default,r.default.component.editForm=l.default,r.default.container.editForm=s.default,r.default.content.editForm=c.default,r.default.currency.editForm=f.default,r.default.datagrid.editForm=d.default,r.default.datamap.editForm=p.default,r.default.datetime.editForm=h.default,r.default.day.editForm=y.default,r.default.editgrid.editForm=m.default,r.default.email.editForm=v.default,r.default.fieldset.editForm=b.default,r.default.file.editForm=g.default,r.default.form.editForm=w.default,r.default.list.editForm=k.default,r.default.hidden.editForm=O.default,r.default.htmlelement.editForm=_.default,r.default.nested.editForm=S.default,r.default.number.editForm=j.default,r.default.panel.editForm=P.default,r.default.password.editForm=x.default,r.default.phoneNumber.editForm=E.default,r.default.radio.editForm=C.default,r.default.recaptcha.editForm=A.default,r.default.resource.editForm=T.default,r.default.select.editForm=M.default,r.default.selectboxes.editForm=R.default,r.default.signature.editForm=D.default,r.default.survey.editForm=I.default,r.default.table.editForm=L.default,r.default.tabs.editForm=V.default,r.default.tags.editForm=N.default,r.default.textarea.editForm=F.default,r.default.textfield.editForm=B.default,r.default.time.editForm=U.default,r.default.tree.editForm=z.default,r.default.unknown.editForm=q.default,r.default.url.editForm=H.default,r.default.well.editForm=W.default;var Y=r.default;t.default=Y},28110:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n")}))}},{key:"attach",value:function(e){var t=this;return this.loadRefs(e,{input:"multiple"}),this.input=this.refs.input[0],this.refs.input&&(this.addEventListener(this.input,this.inputInfo.changeEvent,(function(){return t.updateValue(null,{modified:!0})})),this.addShortcut(this.input)),h(b(p.prototype),"attach",this).call(this,e)}},{key:"detach",value:function(e){e&&this.input&&this.removeShortcut(this.input),h(b(p.prototype),"detach",this).call(this)}},{key:"emptyValue",get:function(){return"radio"===this.component.inputType&&null}},{key:"isEmpty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dataValue;return h(b(p.prototype),"isEmpty",this).call(this,e)||!1===e}},{key:"key",get:function(){return this.component.name?this.component.name:h(b(p.prototype),"key",this)}},{key:"getValueAt",value:function(e){return this.component.name?this.refs.input[e].checked?this.component.value:"":!!this.refs.input[e].checked}},{key:"getValue",value:function(){var e=h(b(p.prototype),"getValue",this).call(this);return this.component.name?e?this.setCheckedState(e):this.setCheckedState(this.dataValue):""===e?this.dataValue:!!e}},{key:"checked",get:function(){return this.component.name?this.dataValue===this.component.value:!!this.dataValue}},{key:"setCheckedState",value:function(e){if(this.input)return this.component.name?(this.input.value=e===this.component.value?this.component.value:0,this.input.checked=e===this.component.value?1:0):"on"===e?(this.input.value=1,this.input.checked=1):"off"===e?(this.input.value=0,this.input.checked=0):e?(this.input.value=1,this.input.checked=1):(this.input.value=0,this.input.checked=0),this.input.checked?this.input.setAttribute("checked",!0):this.input.removeAttribute("checked"),e}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==this.setCheckedState(e)||!this.input&&void 0!==e&&(this.visible||this.conditionallyVisible()||!this.component.clearOnHide)){var n=this.updateValue(e,t);return this.isHtmlRenderMode()&&t&&t.fromSubmission&&n&&this.redraw(),n}return!1}},{key:"getValueAsString",value:function(e){var t=this.component,n=t.name,r=t.value,i=n?o.default.isEqual(e,r):e;return this.t(i?"Yes":"No")}},{key:"updateValue",value:function(e,t){this.component.name&&t.modified&&this.dataValue===this.component.value&&(this.input.checked=0,this.input.value=0,this.dataValue="",this.updateOnChange(t,!0));var n=h(b(p.prototype),"updateValue",this).call(this,e,t);return n&&this.input&&(this.input.checked?this.input.setAttribute("checked","true"):this.input.removeAttribute("checked")),n}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nContent',key:"content",weight:30,input:!0,customConditional:function(e){return"property"===e.row.type&&e.row.hasOwnProperty("property")&&"string"===e.row.property.type&&"content"===e.row.property.component}}]}]}]}]},87018:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:this.dataValue,n=S(E(_.prototype),"isEmpty",this).call(this,t);return null!==(e=this.components)&&void 0!==e&&e.length?this.components.reduce((function(e,t){return e&&t.isEmpty()}),!0):n}},{key:"getRowChunks",value:function(e,t){var n=e.reduce((function(e,t){var n=c(e,2),r=n[0],o=n[1],i=r+t;return[i,[].concat(h(o),[[r,i]])]}),[0,[]]);return c(n,2)[1].map((function(e){return o.default.slice.apply(o.default,[t].concat(h(e)))}))}},{key:"getGroups",value:function(){var e=o.default.get(this.component,"rowGroups",[]),t=o.default.map(e,"numberOfRows").slice(0,-1).reduce((function(e,t){var n=e[e.length-1];return e.concat(n+t)}),[0]);return e.reduce((function(e,n,r){return s(s({},e),{},O({},t[r],n))}),{})}},{key:"getGroupSizes",value:function(){return o.default.map(o.default.get(this.component,"rowGroups",[]),"numberOfRows")}},{key:"hasRowGroups",value:function(){return o.default.get(this,"component.enableRowGroups",!1)&&!this.builderMode}},{key:"totalRowsNumber",value:function(e){return o.default.sum(o.default.map(e,"numberOfRows"))}},{key:"setStaticValue",value:function(e){this.dataValue=o.default.range(e).map((function(){return{}}))}},{key:"hasExtraColumn",value:function(){return this.hasRemoveButtons()||this.canAddColumn}},{key:"hasRemoveButtons",value:function(){return!this.builderMode&&!this.component.disableAddingRemovingRows&&!this.options.readOnly&&!this.disabled&&this.fullMode&&this.dataValue.length>o.default.get(this.component,"validate.minLength",0)}},{key:"hasTopSubmit",value:function(){return this.hasAddButton()&&["top","both"].includes(this.addAnotherPosition)}},{key:"hasBottomSubmit",value:function(){return this.hasAddButton()&&["bottom","both"].includes(this.addAnotherPosition)}},{key:"canAddColumn",get:function(){return this.builderMode}},{key:"render",value:function(){var e=this.getColumns(),t=0,n=this.hasRemoveButtons();this.component.reorder&&t++,n&&t++,this.canAddColumn&&t++;var r=Math.floor(12/(e.length+t));return S(E(_.prototype),"render",this).call(this,this.renderTemplate("datagrid",{rows:this.getRows(),columns:e,groups:this.hasRowGroups()?this.getGroups():[],visibleColumns:this.visibleColumns,hasToggle:o.default.get(this,"component.groupToggle",!1),hasHeader:this.hasHeader(),hasExtraColumn:this.hasExtraColumn(),hasAddButton:this.hasAddButton(),hasRemoveButtons:n,hasTopSubmit:this.hasTopSubmit(),hasBottomSubmit:this.hasBottomSubmit(),hasGroups:this.hasRowGroups(),numColumns:e.length+(this.hasExtraColumn()?1:0),datagridKey:this.datagridKey,allowReorder:this.allowReorder,builder:this.builderMode,canAddColumn:this.canAddColumn,tabIndex:this.tabIndex,placeholder:this.renderTemplate("builderPlaceholder",{position:this.componentComponents.length}),colWidth:r.toString()}))}},{key:"getRows",value:function(){return this.rows.map((function(e){var t={};return o.default.each(e,(function(e,n){t[n]=e.render()})),t}))}},{key:"getColumns",value:function(){var e=this;return this.columns.filter((function(t){return!e.visibleColumns.hasOwnProperty(t.key)||e.visibleColumns[t.key]}))}},{key:"hasHeader",value:function(){return this.component.components.reduce((function(e,t){return e||(t.label||t.title)&&!t.hideLabel}),!1)}},{key:"loadRefs",value:function(e,t){if(S(E(_.prototype),"loadRefs",this).call(this,e,t),"single"===t.messageContainer){var n=o.default.last(e.querySelectorAll("[ref=messageContainer]"));this.refs.messageContainer=n||this.refs.messageContainer}}},{key:"attach",value:function(e){var t,n=this;this.loadRefs(e,(O(t={},"".concat(this.datagridKey,"-row"),"multiple"),O(t,"".concat(this.datagridKey,"-tbody"),"single"),O(t,"".concat(this.datagridKey,"-addRow"),"multiple"),O(t,"".concat(this.datagridKey,"-removeRow"),"multiple"),O(t,"".concat(this.datagridKey,"-group-header"),"multiple"),O(t,this.datagridKey,"multiple"),O(t,"messageContainer","single"),t)),this.allowReorder&&(this.refs["".concat(this.datagridKey,"-row")].forEach((function(e,t){e.dragInfo={index:t}})),r&&(this.dragula=r([this.refs["".concat(this.datagridKey,"-tbody")]],{moves:function(e,t,n){var r=n.getAttribute("data-key");if(t.getAttribute("data-key")===r)return n.classList.contains("formio-drag-button")}}).on("drop",this.onReorder.bind(this)),this.dragula.on("cloned",(function(e,t){e&&e.children&&t&&t.children&&o.default.each(t.children,(function(t,n){var r=getComputedStyle(t,null);if(""!==r.cssText)e.children[n].style.cssText=r.cssText;else{var o=Object.values(r).reduce((function(e,t){return"".concat(e).concat(t,":").concat(r.getPropertyValue(t),";")}),"");e.children[n].style.cssText=o}}))})))),this.refs["".concat(this.datagridKey,"-addRow")].forEach((function(e){n.addEventListener(e,"click",n.addRow.bind(n))})),this.refs["".concat(this.datagridKey,"-removeRow")].forEach((function(e,t){n.addEventListener(e,"click",n.removeRow.bind(n,t))})),this.hasRowGroups()&&(this.refs.chunks=this.getRowChunks(this.getGroupSizes(),this.refs["".concat(this.datagridKey,"-row")]),this.refs["".concat(this.datagridKey,"-group-header")].forEach((function(e,t){n.addEventListener(e,"click",(function(){return n.toggleGroup(e,t)}))})));var i=this.getColumns(),a=i.length;return this.rows.forEach((function(e,t){var r=0;i.forEach((function(e){n.attachComponents(n.refs[n.datagridKey][t*a+r],[n.rows[t][e.key]],n.getComponentsContainer()),r++}))})),S(E(_.prototype),"attach",this).call(this,e)}},{key:"getComponentsContainer",value:function(){return this.component.components}},{key:"onReorder",value:function(e,t,n,r){if(!e.dragInfo||r&&!r.dragInfo)console.warn("There is no Drag Info available for either dragged or sibling element");else{var o=e.dragInfo.index,i=r?r.dragInfo.index:this.dataValue.length,u=i>o,l=(0,a.fastCloneDeep)(this.dataValue),s=l[o];l.splice(i,0,s),l.splice(u?o:o+1,1),this.setValue(l,{isReordered:!0}),this.rebuild()}}},{key:"focusOnNewRowElement",value:function(e){Object.keys(e).find((function(t){var n=e[t].element;if(n){var r=(0,a.getFocusableElements)(n);if(r&&r[0])return r[0].focus(),!0}return!1}))}},{key:"addRow",value:function(){var e,t=this,n=this.rows.length;this.dataValue.length===n&&this.dataValue.push({});var r=this.dataValue,o=this.defaultValue;this.initEmpty&&o[n]?(e=o[n],r[n]=e):e=r[n],this.rows[n]=this.createRowComponents(e,n),this.emit("dataGridAddRow",{component:this.component,row:e}),this.checkConditions(),this.triggerChange(),this.redraw().then((function(){t.focusOnNewRowElement(t.rows[n])}))}},{key:"updateComponentsRowIndex",value:function(e,t){var n=this;e.forEach((function(e,r){var o;if(null!==(o=e.options)&&void 0!==o&&o.name){var i="[".concat(n.key,"][").concat(t,"]");e.options.name=e.options.name.replace("[".concat(n.key,"][").concat(e.rowIndex,"]"),i)}e.rowIndex=t,e.row="".concat(t,"-").concat(r),e.path=n.calculateComponentPath(e)}))}},{key:"updateRowsComponents",value:function(e){var t=this;this.rows.slice(e).forEach((function(n,r){t.updateComponentsRowIndex(Object.values(n),e+r)}))}},{key:"removeRow",value:function(e){var t=0===e&&1===this.rows.length,n={isReordered:!t,resetValue:t};this.splice(e,n),this.emit("dataGridDeleteRow",{index:e});var r=c(this.rows.splice(e,1),1)[0];this.removeRowComponents(r),this.updateRowsComponents(e),this.setValue(this.dataValue,n),this.redraw()}},{key:"removeRowComponents",value:function(e){var t=this;o.default.each(e,(function(e){return t.removeComponent(e)}))}},{key:"getRowValues",value:function(){return this.dataValue}},{key:"setRowComponentsData",value:function(e,t){o.default.each(this.rows[e],(function(e){e.data=t}))}},{key:"createRows",value:function(e,t){var n=this,r=!1,o=this.getRowValues();o.forEach((function(e,o){!t&&n.rows[o]?n.setRowComponentsData(o,e):(n.rows[o]&&n.removeRowComponents(n.rows[o]),n.rows[o]=n.createRowComponents(e,o),r=!0)}));var i=this.rows.splice(o.length),a=!!i.length;return a&&i.forEach((function(e){return n.removeRowComponents(e)})),e||!r&&!a||this.redraw(),r}},{key:"createRowComponents",value:function(e,t){var n=this,r={};return this.tabIndex=0,this.component.components.map((function(i,a){var u,l=o.default.clone(n.options);l.name+="[".concat(t,"]"),l.row="".concat(t,"-").concat(a),n.builderMode?(i.id=i.id+t,u=i):u=s(s({},i),{},{id:i.id+t});var c=n.createComponent(u,l,e);c.parentDisabled=!!n.disabled,c.rowIndex=t,c.inDataGrid=!0,u.tabindex&&parseInt(u.tabindex)>n.tabIndex&&(n.tabIndex=parseInt(u.tabindex)),r[i.key]=c})),r}},{key:"checkValidity",value:function(e,t,n,r){if(e=e||this.rootValue,n=n||this.data,!this.checkCondition(n,e))return this.setCustomValidity(""),!0;if(!this.checkComponentValidity(e,t,n,{silentCheck:r}))return!1;var o=this.checkRows("checkValidity",e,t,!0,r);return this.checkModal(o,t),o}},{key:"checkColumns",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=e||this.rootValue;var r=!1;if(!this.rows||!this.rows.length)return{rebuild:!1,show:!1};if(this.builderMode)return{rebuild:!1,show:!0};var i={},a=!1,u=this.dataValue;this.rows.forEach((function(r,l){o.default.each(r,(function(r,s){if(r&&"function"==typeof r.checkConditions){var c=void 0===i[s];if(i[s]=!!i[s]||r.checkConditions(e,n,u[l])&&"hidden"!==r.type,r.component.logic&&c){var f=o.default.findIndex(t.columns,["key",s]);o.default.isEqual(t.columns[f],r.component)||(a=!0,t.columns[f]=r.component)}}}))}));var l=!o.default.isEqual(i,this.visibleColumns)||a;return o.default.each(i,(function(e){r|=e})),this.visibleColumns=i,{rebuild:l,show:r}}},{key:"checkComponentConditions",value:function(e,t,n){var r=this.visible;if(!S(E(_.prototype),"checkComponentConditions",this).call(this,e,t,n))return!1;var o=this.checkColumns(e,t),i=o.rebuild,a=o.show;return!i&&r||this.createRows(!1,i),a}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return this.dataValue=this.defaultValue,this.createRows(),!1;Array.isArray(e)||("object"===p(e)?e=[e]:(this.createRows(),e=[{}])),!e||e.length||this.initEmpty||e.push({});var r=n.fromSubmission&&!o.default.isEqual(e,this.emptyValue),i=this.hasChanged(e,this.dataValue);return this.dataValue=e,(this.initRows||r)&&!this.createRows()&&i&&this.redraw(),this.componentModal&&r&&this.componentModal.setValue(e),this.rows.forEach((function(r,i){e.length<=i||o.default.each(r,(function(r){r.rowIndex=i,t.setNestedValue(r,e[i],n)}))})),this.updateOnChange(n,i),i}},{key:"restoreComponentsContext",value:function(){var e=this;this.rows.forEach((function(t,n){return o.default.forIn(t,(function(t){return t.data=e.dataValue[n]}))}))}},{key:"getComponent",value:function(e,t){var n,r=d(n=e=Array.isArray(e)?e:[e])||m(n)||y(n)||f(),i=r[0],a=r.slice(1),u=[];if(o.default.isNumber(i)&&a.length){var l=a.pop();return(u=this.rows[i][l])||Object.entries(this.rows[i]).forEach((function(e){var n=c(e,2)[1];if("getComponent"in n){var r=n.getComponent([l],t);r&&(u=r)}})),u&&o.default.isFunction(t)&&t(u,this.getComponents()),a.length&&"getComponent"in u?u.getComponent(a,t):u}return o.default.isString(i)?(this.everyComponent((function(e,n){if(e.component.key===i){var r=e;a.length>0&&"getComponent"in e?r=e.getComponent(a,t):t&&t(e,n),u=u.concat(r)}})),u.length>0?u:null):u}},{key:"toggleGroup",value:function(e,t){e.classList.toggle("collapsed"),o.default.each(this.refs.chunks[t],(function(e){e.classList.toggle("hidden")}))}}],u=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&(e.valueComponent=this.components[this.components.length-1].schema),i.default.omit(e,"components")}},{key:"init",value:function(){this.components=[],this.rows=[],this.createRows(),this.visibleColumns=d({key:!0},this.valueKey,!0),this.component.valueComponent.hideLabel=!0}},{key:"defaultSchema",get:function(){return g.schema()}},{key:"emptyValue",get:function(){return{}}},{key:"dataValue",get:function(){return!this.key||!this.visible&&this.component.clearOnHide?this.emptyValue:(!this.hasValue()&&this.shouldAddDefaultValue&&(this.dataValue=this.emptyValue),i.default.get(this.data,this.key))},set:function(e){!function(e,t,n,r,o){if(!f(e,t,n,r||e)&&o)throw new Error("failed to set property")}(b(g.prototype),"dataValue",e,this,!0)}},{key:"defaultValue",get:function(){var e=m(b(g.prototype),"defaultValue",this);return Array.isArray(e)?e[0]:this.emptyValue}},{key:"keySchema",get:function(){return{type:"textfield",input:!0,hideLabel:!0,label:this.component.keyLabel||"Key",key:"__key",disableBuilderActions:!0}}},{key:"valueKey",get:function(){return this.component.valueComponent.key}},{key:"getRowValues",value:function(){var e=this.dataValue;return this.builderMode?[e]:i.default.isEmpty(e)?[]:Object.keys(e).map((function(){return e}))}},{key:"getComponentsContainer",value:function(){return this.builderMode?this.getComponents().map((function(e){return e.component})):m(b(g.prototype),"getComponentsContainer",this).call(this)}},{key:"iteratableRows",get:function(){return this.rows.map((function(e){return Object.keys(e).map((function(t){return{components:e[t],data:e[t].dataValue}}))}))}},{key:"componentContext",value:function(e){return this.iteratableRows[e.row].find((function(t){return t.components.key===e.key})).data}},{key:"hasHeader",value:function(){return!0}},{key:"hasRemoveButtons",value:function(){return!this.component.disableAddingRemovingRows&&!this.options.readOnly&&!this.disabled&&this.fullMode}},{key:"getColumns",value:function(){var e=Object.assign({},this.keySchema),t=Object.assign({},this.component.valueComponent);return e.hideLabel=!1,t.hideLabel=!1,this.component.keyBeforeValue?[e,t]:[t,e]}},{key:"getRowKey",value:function(e){var t=Object.keys(this.dataValue);return t[e]||(t[e]=(0,u.uniqueKey)(this.dataValue,this.defaultRowKey)),t[e]}},{key:"defaultRowKey",get:function(){return"key"}},{key:"setRowComponentsData",value:function(e,t){i.default.each(this.rows[e],(function(n){"__key"===n.key?n.data={__key:Object.keys(t)[e]}:n.data=t}))}},{key:"getValueAsString",value:function(e,t){var n=this;if(null!=t&&t.email&&this.visible&&!this.skipInEmail&&i.default.isObject(e)){var r='\n \n \n ';return(r=Object.keys(e).reduce((function(r,o){return r+'\n \n \n \n \n ")}),r))+"\n \n
    '.concat(o,'').concat(n.getView(e[o],t),"
    \n "}return i.default.isEmpty(e)?"":null!=t&&t.modalPreview?(delete t.modalPreview,this.getDataValueAsTable(e,t)):"object"===s(e)?"[Complex Data]":e}},{key:"getDataValueAsTable",value:function(e,t){var n=this,r='\n \n \n ';return this.visible&&i.default.isObject(e)&&Object.keys(e).forEach((function(o){r+='\n \n \n \n \n ")})),r+="\n \n
    '.concat(o,'').concat(n.getView(e[o],t),"
    \n "}},{key:"createRowComponents",value:function(e,t){var n=this,r=this.builderMode?this.valueKey:this.getRowKey(t),o=i.default.clone(this.options);o.events=new a.default,o.name+="[".concat(t,"]"),o.row="".concat(t);var l={};l.__key=this.createComponent(this.keySchema,o,{__key:this.builderMode?this.defaultRowKey:r}),l.__key.on("componentChange",(function(e){var t=n.dataValue,o=(0,u.uniqueKey)(t,e.value);t[o]=t[r],delete t[r];var i=l[n.valueKey];i.component.key=o,i.path=n.calculateComponentPath(i),r=o}));var s=i.default.clone(this.component.valueComponent);s.key=r;var c=this.options;return c.row=o.row,l[this.valueKey]=this.createComponent(s,c,this.dataValue),l}},{key:"canAddColumn",get:function(){return!1}},{key:"addChildComponent",value:function(e){this.component.valueComponent=e}},{key:"saveChildComponent",value:function(e){e.key!==this.keySchema.key&&(this.component.valueComponent=e)}},{key:"removeChildComponent",value:function(){var e=g.schema();this.component.valueComponent=e.valueComponent}},{key:"addRow",value:function(){var e=this.rows.length;this.rows[e]=this.createRowComponents(this.dataValue,e),this.redraw(),this.triggerChange()}},{key:"removeRow",value:function(e){var t=Object.keys(this.dataValue);t[e]&&delete this.dataValue[t[e]],this.rows.splice(e,1),this.redraw(),this.triggerChange()}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.hasChanged(e,this.dataValue);return this.dataValue=e,this.createRows(),this.updateOnChange(t,n),n}},{key:"checkColumns",value:function(){return{rebuild:!1,show:!0}}}],o=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:this.dataValue;return!(!e||"Invalid Date"!==e.toString())||v(g(h.prototype),"isEmpty",this).call(this,e)}},{key:"formatValue",value:function(e){var t=i.default.utc(e).toISOString();return"Invalid date"===t?e:t}},{key:"isEqual",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dataValue;return this.isEmpty(e)&&this.isEmpty(t)||i.default.utc(e).format(this.momentFormat)===i.default.utc(t).format(this.momentFormat)}},{key:"createWrapper",value:function(){return!1}},{key:"checkValidity",value:function(e,t,n){return this.refs.input&&this.refs.input.forEach((function(e){e.widget&&e.widget.enteredDate&&(t=!0)})),v(g(h.prototype),"checkValidity",this).call(this,e,t,n)}},{key:"getValueAsString",value:function(e){var t=a.default.convertFormatToMoment(this.component.format);t+=t.match(/z$/)?"":" z";var n=this.timezone;return e&&!this.attached&&n?o.default.trim(a.default.momentDate(e,t,n).format(t)):(e?o.default.trim((0,i.default)(e).format(t)):e)||""}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n \n !!data.match(/\\d{4}-\\d{2}-\\d{2}/g));\nvalid = isValid || 'Invalid date';"},weight:21},{type:"panel",title:"Custom Disabled Dates",collapsible:!0,collapsed:!0,style:{"margin-bottom":"10px"},key:"panel-disable-function",customConditional:function(){return!r.default.noeval||r.default.protectedEval},components:[o(n(61550)).default.logicVariablesTable("dateThe date object."),{type:"textarea",input:!0,editor:"ace",key:"datePicker.disableFunction",label:"Disabling dates by a function",description:'For more information check out the Docs',weight:22},{type:"htmlelement",tag:"div",content:"

    Example

    // Disable all weekends
    date.getDay() === 0 || date.getDay() === 6
    \n "}]},{type:"checkbox",input:!0,key:"datePicker.disableWeekends",label:"Disable weekends",tooltip:"Check to disable weekends",weight:23},{type:"checkbox",input:!0,key:"datePicker.disableWeekdays",label:"Disable weekdays",tooltip:"Check to disable weekdays",weight:23}];t.default=i},48893:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{type:"select",input:!0,key:"displayInTimezone",label:"Display in Timezone",tooltip:"This will display the captured date time in the select timezone.",weight:30,defaultValue:"viewer",dataSrc:"values",data:{values:[{label:"of Viewer",value:"viewer"},{label:"of Submission",value:"submission"},{label:"of Location",value:"location"},{label:"UTC",value:"utc"}]}},{type:"select",input:!0,key:"timezone",label:"Select Timezone",tooltip:"Select the timezone you wish to display this Date",weight:31,lazyLoad:!0,defaultValue:"",valueProperty:"name",dataSrc:"url",data:{url:"{{options.cdnUrl}}/timezones.json"},template:"{{ item.label }}",conditional:{json:{"===":[{var:"data.displayInTimezone"},"location"]}}},{type:"checkbox",input:!0,key:"useLocaleSettings",label:"Use Locale Settings",tooltip:"Use locale settings to display date and time.",weight:51},{type:"checkbox",input:!0,key:"allowInput",label:"Allow Manual Input",tooltip:"Check this if you would like to allow the user to manually enter in the date.",weight:51},{type:"textfield",input:!0,key:"format",label:"Format",placeholder:"Format",description:'Use formats provided by DateParser Codes',tooltip:"The date format for displaying the datetime value.",weight:52},{type:"editgrid",input:!0,key:"shortcutButtons",label:"Shortcut Buttons",description:"You can specify few buttons which will be shown above the calendar. Use Label to specify the name of the button and onClick to specify which date/time will be set when user clicks the button. E.g, date = new Date()",templates:{header:'
    \n
    Label
    \n
    onClick
    \n
    ',row:'
    \n
    \n {{ flattenedComponents.label.getView(row.label) }}\n
    \n
    \n {{ flattenedComponents.onClick.getView(row.onClick) }}\n
    \n {% if (!instance.disabled) { %}\n
    \n
    \n \n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\n \n {% } %}\n
    \n
    \n {% } %}\n
    '},components:[{label:"Label",key:"label",type:"textfield",input:!0,validate:{required:!0}},{label:"onClick",key:"onClick",type:"textarea",editor:"ace",input:!0,validate:{required:!0}}],defaultValue:[]}]},97839:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{type:"checkbox",input:!0,key:"enableTime",label:"Enable Time Input",tooltip:"Enables time input for this field.",weight:0},{type:"number",input:!0,key:"timePicker.hourStep",label:"Hour Step Size",tooltip:"The number of hours to increment/decrement in the time picker.",weight:10},{type:"number",input:!0,key:"timePicker.minuteStep",label:"Minute Step Size",tooltip:"The number of minutes to increment/decrement in the time picker.",weight:20},{type:"checkbox",input:!0,key:"timePicker.showMeridian",label:"12 Hour Time (AM/PM)",tooltip:"Display time in 12 hour time with AM/PM.",weight:30}]},35733:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(82772),t.default=[{type:"checkbox",input:!0,key:"enableMinDateInput",label:"Use Input to add moment.js for minDate",persistent:!1,weight:10,tooltip:"Enables to use input for moment functions instead of calendar."},{type:"datetime",input:!0,key:"datePicker.minDate",label:"Use calendar to set minDate",skipMerge:!0,weight:10,tooltip:"Enables to use calendar to set date.",customConditional:function(e){var t=e.data,n=e.component;return!(n.datePicker&&n.datePicker.minDate&&-1!==n.datePicker.minDate.indexOf("moment")||t.enableMinDateInput)}},{type:"textfield",input:!0,enableTime:!1,key:"datePicker.minDate",skipMerge:!0,label:"Minimum Date",weight:10,tooltip:"The minimum date that can be picked. You can also use Moment.js functions. For example: \n \n moment().subtract(10, 'days')",customConditional:function(e){var t=e.data,n=e.component;return!(!n.datePicker||!n.datePicker.minDate||-1===n.datePicker.minDate.indexOf("moment"))||t.enableMinDateInput}},{type:"checkbox",input:!0,key:"enableMaxDateInput",label:"Use Input to add moment.js for maxDate",persistent:!1,weight:20,tooltip:"Enables to use input for moment functions instead of calendar."},{type:"datetime",input:!0,key:"datePicker.maxDate",skipMerge:!0,label:"Use calendar to set maxDate",weight:20,tooltip:"Enables to use calendar to set date.",customConditional:function(e){var t=e.data,n=e.component;return!(n.datePicker&&n.datePicker.maxDate&&-1!==n.datePicker.maxDate.indexOf("moment")||t.enableMaxDateInput)}},{type:"textfield",input:!0,enableTime:!1,key:"datePicker.maxDate",skipMerge:!0,label:"Maximum Date",tooltip:"The maximum date that can be picked. You can also use Moment.js functions. For example: \n \n moment().add(10, 'days')",weight:20,customConditional:function(e){var t=e.data,n=e.component;return!(!n.datePicker||!n.datePicker.maxDate||-1===n.datePicker.maxDate.indexOf("moment"))||t.enableMaxDateInput}}]},69403:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne&&(t.refs.day.value=t.refs.day.max),r(t.refs.month,"month")()})),this.addEventListener(this.refs.year,"input",r(this.refs.year,"year")),this.addEventListener(this.refs.input,this.info.changeEvent,(function(){return t.updateValue(null,{modified:!0})})),[this.refs.day,this.refs.month,this.refs.year].filter((function(e){return!!e})).forEach((function(e){w(O(v.prototype),"addFocusBlurEvents",t).call(t,e)}))),this.setValue(this.dataValue),this.disabled=this.shouldDisabled,n}},{key:"validateRequired",value:function(e,t){var n=this.parts,r=n.day,o=n.month,i=n.year;return!(this.dayRequired&&!r||this.monthRequired&&!o||this.yearRequired&&!i||(0,u.boolValue)(e)&&this.isEmpty(t))}},{key:"disabled",set:function(e){(function(e,t,n,r,o){if(!y(e,t,n,r||e)&&o)throw new Error("failed to set property")})(O(v.prototype),"disabled",e,this,!0),this.refs.year&&this.refs.month&&this.refs.day&&(e?(this.refs.year.setAttribute("disabled","disabled"),this.refs.month.setAttribute("disabled","disabled"),this.refs.day.setAttribute("disabled","disabled")):(this.refs.year.removeAttribute("disabled"),this.refs.month.removeAttribute("disabled"),this.refs.day.removeAttribute("disabled")))}},{key:"normalizeValue",value:function(e){if(!e||this.valueMask.test(e))return e;var t=[],n=e.split("/"),r=f(this.component.dayFirst?[0,1,2]:[1,0,2],3),o=r[0],i=r[1],a=r[2],u=this.component.defaultValue?this.component.defaultValue.split("/"):"",l=function(e,r){return t.push(e?n.shift():r)};return this.dayFirst&&l(this.showDay,u?u[o]:"00"),l(this.showMonth,u?u[i]:"00"),this.dayFirst||l(this.showDay,u?u[o]:"00"),l(this.showYear,u?u[a]:"0000"),t.join("/")}},{key:"setValueAt",value:function(e,t){if(!t||"Invalid date"===t)return null;var n,r=t.split("/");this.component.dayFirst&&(n=r.shift());var o=r.shift();this.component.dayFirst||(n=r.shift());var i=r.shift();this.refs.day&&this.showDay&&(this.refs.day.value="00"===n?"":parseInt(n,10)),this.refs.month&&this.showMonth&&(this.refs.month.value="00"===o?"":parseInt(o,10)),this.refs.year&&this.showYear&&(this.refs.year.value="0000"===i?"":parseInt(i,10))}},{key:"getFieldValue",value:function(e){var t=this.dataValue?this.dataValue.split("/"):[],n=0;switch(e){case"month":n=t[this.dayFirst?1:0];break;case"day":n=t[this.dayFirst?0:1];break;case"year":n=t[2]}return n=parseInt(n,10),!o.default.isNaN(n)&&o.default.isNumber(n)?n:0}},{key:"parts",get:function(){return{day:this.getFieldValue("day"),month:this.getFieldValue("month"),year:this.getFieldValue("year")}}},{key:"format",get:function(){var e="";return this.component.dayFirst&&this.showDay&&(e+="D/"),this.showMonth&&(e+="M/"),!this.component.dayFirst&&this.showDay&&(e+="D/"),this.showYear?e+="YYYY":e.length?e.substring(0,e.length-1):e}},{key:"getDate",value:function(e){var t,n,r,i=[],a=f(this.component.dayFirst?[0,1,2]:[1,0,2],3),u=a[0],l=a[1],s=a[2],c=e||this.component.defaultValue;return c&&(i=c.split("/").map((function(e){return parseInt(e,10)}))),this.showDay&&this.refs.day&&(t=parseInt(this.refs.day.value,10)),(void 0===t||o.default.isNaN(t))&&(t=i[u]&&!o.default.isNaN(i[u])?i[u]:0),this.showMonth&&this.refs.month&&(n=parseInt(this.refs.month.value,10)),(void 0===n||o.default.isNaN(n))&&(n=i[l]&&!o.default.isNaN(i[l])?i[l]:0),this.showYear&&this.refs.year&&(r=parseInt(this.refs.year.value)),(void 0===r||o.default.isNaN(r))&&(r=i[s]&&!o.default.isNaN(i[s])?i[s]:0),t||n||r?(t=this.showDay?t.toString().padStart(2,0):"",n=this.showMonth?n.toString().padStart(2,0):"",r=this.showYear?r.toString().padStart(4,0):"",this.component.dayFirst?"".concat(t).concat(this.showDay&&this.showMonth||this.showDay&&this.showYear?"/":"").concat(n).concat(this.showMonth&&this.showYear?"/":"").concat(r):"".concat(n).concat(this.showDay&&this.showMonth||this.showMonth&&this.showYear?"/":"").concat(t).concat(this.showDay&&this.showYear?"/":"").concat(r)):null}},{key:"date",get:function(){return this.getDate()}},{key:"validationValue",get:function(){return this.dataValue}},{key:"getValue",value:function(){return w(O(v.prototype),"getValue",this).call(this)||this.dataValue}},{key:"getValueAt",value:function(e){var t=this.date||this.emptyValue;return t?(this.refs.input[e].value=t,this.refs.input[e].value):(this.refs.input[e].value="",null)}},{key:"getValueAsString",value:function(e){return this.getDate(e)||""}},{key:"focus",value:function(e){if(e&&"string"==typeof e&&this.refs[e])this.refs[e].focus();else if(this.dayFirst&&this.showDay||!this.dayFirst&&!this.showMonth&&this.showDay){var t;null===(t=this.refs.day)||void 0===t||t.focus()}else if(this.dayFirst&&!this.showDay&&this.showMonth||!this.dayFirst&&this.showMonth){var n;null===(n=this.refs.month)||void 0===n||n.focus()}else if(!this.showDay&&!this.showDay&&this.showYear){var r;null===(r=this.refs.year)||void 0===r||r.focus()}}},{key:"restoreCaretPosition",value:function(){var e,t,n;if(null!==(e=this.root)&&void 0!==e&&e.currentSelection){var r=this.root.currentSelection,o=r.selection,i=r.index;if(this.refs[i]){var a=this.refs[i];/text|search|password|tel|url/i.test((null==(t=a)?void 0:t.type)||"")&&a.setSelectionRange.apply(a,function(e){if(Array.isArray(e))return p(e)}(n=o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||d(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}}}},{key:"isPartialDay",value:function(e){if(!e)return!1;var t=f(this.component.dayFirst?[0,1,2]:[1,0,2],3),n=t[0],r=t[1],o=t[2],i=e.split("/");return"00"===i[n]||"00"===i[r]||"0000"===i[o]}},{key:"getValidationFormat",value:function(){return this.dayFirst?"DD-MM-YYYY":"MM-DD-YYYY"}}])&&h(t.prototype,n),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),v}(a.default);t.default=_},51951:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"multiple",ignore:!0}]},86842:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{wieght:200,type:"select",datasrc:"values",key:"fields.day.type",label:"Type",data:{values:[{label:"Number",value:"number"},{label:"Select",value:"select"}]}},{weight:210,type:"textfield",input:!0,key:"fields.day.placeholder",label:"Placeholder",placeholder:"Day Placeholder",tooltip:"The placeholder text that will appear when Day field is empty."},{weight:215,type:"checkbox",label:"Hidden",tooltip:"Hide the Day part of the component.",key:"fields.day.hide",input:!0},{weight:214,type:"checkbox",label:"Day First",tooltip:"Display the Day field before the Month field.",key:"dayFirst",input:!0}]},84846:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"labelPosition",ignore:!0},{weight:15,type:"checkbox",label:"Hide Input Labels",tooltip:"Hide the labels of component inputs. This allows you to show the labels in the form builder, but not when it is rendered.",key:"hideInputLabels",input:!0},{type:"select",input:!0,key:"inputsLabelPosition",label:"Inputs Label Position",tooltip:"Position for the labels for inputs for this field.",weight:40,defaultValue:"top",dataSrc:"values",data:{values:[{label:"Top",value:"top"},{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Bottom",value:"bottom"}]}},{key:"placeholder",ignore:!0},{weight:213,type:"checkbox",label:"Use Locale Settings",tooltip:"Use locale settings to display day.",key:"useLocaleSettings",input:!0}]},65207:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{wieght:200,type:"select",datasrc:"values",key:"fields.month.type",label:"Type of input",data:{values:[{label:"Number",value:"number"},{label:"Select",value:"select"}]}},{weight:210,type:"textfield",input:!0,key:"fields.month.placeholder",label:"Placeholder",placeholder:"Month Placeholder",tooltip:"The placeholder text that will appear when Month field is empty."},{weight:215,type:"checkbox",label:"Hidden",tooltip:"Hide the Month part of the component.",key:"fields.month.hide",input:!0}]},6474:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"validate.required",ignore:!0},{key:"validate.unique",ignore:!0},{weight:0,type:"checkbox",label:"Require Day",tooltip:"A required field must be filled in before the form can be submitted.",key:"fields.day.required",input:!0},{weight:10,type:"checkbox",label:"Require Month",tooltip:"A required field must be filled in before the form can be submitted.",key:"fields.month.required",input:!0},{weight:20,type:"checkbox",label:"Require Year",tooltip:"A required field must be filled in before the form can be submitted.",key:"fields.year.required",input:!0},{weight:40,type:"textfield",label:"Minimum Day",placeholder:"yyyy-MM-dd",tooltip:"A minimum date that can be set. You can also use Moment.js functions. For example: \n \n moment().subtract(10, 'days')",key:"minDate",input:!0},{weight:30,type:"textfield",label:"Maximum Day",placeholder:"yyyy-MM-dd",tooltip:"A maximum day that can be set. You can also use Moment.js functions. For example: \n \n moment().add(10, 'days')",key:"maxDate",input:!0}]},2420:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{wieght:200,type:"select",datasrc:"values",key:"fields.year.type",label:"Type of input",data:{values:[{label:"Number",value:"number"},{label:"Select",value:"select"}]}},{weight:203,type:"number",input:!0,key:"fields.year.minYear",label:"Minimum Year",placeholder:"1900",tooltip:"The minimum year that can be entered."},{weight:204,type:"number",input:!0,key:"fields.year.maxYear",label:"Maximum Year",placeholder:"2030",tooltip:"The maximum year that can be entered."},{weight:210,type:"textfield",input:!0,key:"fields.year.placeholder",label:"Placeholder",placeholder:"Year Placeholder",tooltip:"The placeholder text that will appear when Year field is empty."},{weight:215,type:"checkbox",label:"Hidden",tooltip:"Hide the Year part of the component.",key:"fields.year.hide",input:!0}]},68489:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n'.concat(this.t("Do you want to clear data?"),'\n
    \n \n \n
    \n ")}},{key:"defaultRowTemplate",get:function(){return this.displayAsTable?O.defaultTableRowTemplate:O.defaultRowTemplate}},{key:"defaultHeaderTemplate",get:function(){return this.displayAsTable?O.defaultTableHeaderTemplate:O.defaultHeaderTemplate}},{key:"rowTemplate",get:function(){return l.Evaluator.noeval?this.displayAsTable?s.default.tableRow:s.default.row:this.displayAsTable?r.default.get(this.component,"templates.tableRow",this.defaultRowTemplate):r.default.get(this.component,"templates.row",this.defaultRowTemplate)}},{key:"headerTemplate",get:function(){return l.Evaluator.noeval?this.displayAsTable?s.default.tableHeader:s.default.header:this.displayAsTable?r.default.get(this.component,"templates.tableHeader",this.defaultHeaderTemplate):r.default.get(this.component,"templates.header",this.defaultHeaderTemplate)}},{key:"hasScopedChildren",get:function(){return!this.inlineEditMode}},{key:"defaultSchema",get:function(){return O.schema()}},{key:"emptyValue",get:function(){return[]}},{key:"editgridKey",get:function(){return"editgrid-".concat(this.key)}},{key:"rowRef",get:function(){return"".concat(this.editgridKey,"-row")}},{key:"rowElements",get:function(){return this.refs[this.rowRef]}},{key:"rowRefs",get:function(){return this.refs["editgrid-".concat(this.component.key,"-row")]}},{key:"addRowRef",get:function(){return"".concat(this.editgridKey,"-addRow")}},{key:"addRowElements",get:function(){return this.refs[this.addRowRef]}},{key:"saveRowRef",get:function(){return"".concat(this.editgridKey,"-saveRow")}},{key:"saveRowElements",get:function(){return this.refs[this.saveRowRef]}},{key:"cancelRowRef",get:function(){return"".concat(this.editgridKey,"-cancelRow")}},{key:"cancelRowElements",get:function(){return this.refs[this.cancelRowRef]}},{key:"inlineEditMode",get:function(){return this.component.inlineEdit}},{key:"saveEditMode",get:function(){return!this.inlineEditMode}},{key:"minLength",get:function(){return this.builderMode?0:r.default.get(this.component,"validate.minLength",0)}},{key:"data",get:function(){return this._data},set:function(e){this._data=e;var t=this.dataValue;(this.editRows||[]).forEach((function(e,n){t[n]||e.state===P.New||(t[n]={});var r=t[n]||{};e.data=r,e.components.forEach((function(e){e.data=r}))}))}},{key:"dataValue",get:function(){return _(j(O.prototype),"dataValue",this)||[]},set:function(e){!function(e,t,n,r,o){if(!w(e,t,n,r||e)&&o)throw new Error("failed to set property")}(j(O.prototype),"dataValue",e,this,!0)}},{key:"displayAsTable",get:function(){return this.component.displayAsTable}},{key:"iteratableRows",get:function(){return this.editRows}},{key:"defaultValue",get:function(){var e=_(j(O.prototype),"defaultValue",this),t=Array.isArray(e)?e:[];return r.default.times(this.minLength-t.length,(function(){return t.push({})})),t}},{key:"hasRemoveButtons",value:function(){return!this.component.disableAddingRemovingRows&&!this.options.readOnly&&!this.disabled&&this.fullMode&&this.dataValue.length>r.default.get(this.component,"validate.minLength",0)}},{key:"init",value:function(){var e=this;if(this.builderMode)return this.editRows=[],_(j(O.prototype),"init",this).call(this);this.components=this.components||[];var t=this.dataValue;!t.length&&this.component.openWhenEmpty?(this.editRows=[],this.createRow({},0)):this.editRows=t.map((function(t,n){return{components:e.lazyLoad?[]:e.createRowComponents(t,n),data:t,state:P.Saved,backup:null,error:null,rowIndex:n}})),this.prevHasAddButton=this.hasAddButton(),this.checkData(),this.setVariableTypeComponents(),this.variableTypeComponentsIndexes.length&&r.default.each(this.editRows||[],(function(t,n){return e.checkRowVariableTypeComponents(t,n)}))}},{key:"checkRowVariableTypeComponents",value:function(e,t){var n=e.components;r.default.some(this.variableTypeComponentsIndexes,(function(e){var t=n[e];return t.type!==t.component.type}))&&(e.components=this.createRowComponents(e.data,t,!0))}},{key:"setVariableTypeComponents",value:function(){var e=this;this.variableTypeComponentsIndexes=[],r.default.each(this.component.components,(function(t,n){t.typeChangeEnabled&&e.variableTypeComponentsIndexes.push(n)}))}},{key:"isOpen",value:function(e){return[P.New,P.Editing,P.Viewing].includes(e.state)}},{key:"isComponentVisibleInSomeRow",value:function(e){var t=this,n=this.editRows,o=[P.Saved,P.Editing,P.Draft],i=n.filter((function(e){return r.default.includes(o,e.state)}));this.visibleInHeader=this.visibleInHeader||[];var a=function(e,n){n||r.default.remove(t.visibleInHeader,(function(t){return t===e.key})),n&&!r.default.includes(t.visibleInHeader,e.key)&&t.visibleInHeader.push(e.key)};if(r.default.isEmpty(n)){var u,s=this.createRowComponents({},0);(0,l.eachComponent)(s,(function(t){t.component.key===e.key&&(u=t),t.checkConditions()}));var c=!u||u.visible;return h(this.components).forEach((function(e){return t.removeComponent(e,t.components)})),a(e,c),c}var f=r.default.get(this.component,"openWhenEmpty")&&1===n.length&&n[0].state===P.New;return r.default.isEmpty(n)||!r.default.isEmpty(i)||f?r.default.some(f?n:i,(function(n,o){var i;if(n.state===P.Editing)i=r.default.includes(t.visibleInHeader,e.key);else{var u=t.flattenComponents(o)[e.key];i=!u||u.visible,a(e,i)}return i})):r.default.includes(this.visibleInHeader,e.key)}},{key:"render",value:function(e){var t=this;if(this.builderMode)return _(j(O.prototype),"render",this).call(this);var n=this.dataValue,o=this.headerTemplate,i=this.t.bind(this),a=this.displayAsTable?"editgridTable":"editgrid";return _(j(O.prototype),"render",this).call(this,e||this.renderTemplate(a,{ref:{row:this.rowRef,addRow:this.addRowRef,saveRow:this.saveRowRef,cancelRow:this.cancelRowRef},header:this.renderString(o,{displayValue:function(e){return t.displayComponentValue(e,!0)},components:this.component.components,value:n,t:i}),footer:this.renderString(r.default.get(this.component,"templates.footer"),{components:this.component.components,value:n,t:i}),rows:this.editRows.map(this.renderRow.bind(this)),openRows:this.editRows.map((function(e){return t.isOpen(e)})),errors:this.editRows.map((function(e){return e.error})),hasAddButton:this.hasAddButton(),hasRemoveButtons:this.hasRemoveButtons()}))}},{key:"renderComponents",value:function(e){var t=(e=e||this.getComponents()).map((function(e){return e.render()})),n=this.displayAsTable&&this.prevHasAddButton?"tableComponents":"components";return this.renderTemplate(n,{children:t,components:e})}},{key:"attach",value:function(e){var t,n=this;if(this.builderMode)return _(j(O.prototype),"attach",this).call(this,e);this.loadRefs(e,(k(t={},this.addRowRef,"multiple"),k(t,this.saveRowRef,"multiple"),k(t,this.cancelRowRef,"multiple"),k(t,this.rowRef,"multiple"),t)),this.addRowElements.forEach((function(e){n.addEventListener(e,"click",(function(){return n.addRow()}))}));var o=0;this.rowElements.forEach((function(e,t){var i=n.editRows[t];null!=i&&i.isRowSelected&&e.classList.add("selected"),n.isOpen(i)?(n.attachComponents(e,i.components),n.addEventListener(n.saveRowElements[o],"click",(function(){return n.saveRow(t,!0)})),n.addEventListener(n.cancelRowElements[o],"click",(function(){return n.cancelRow(t)})),o++):[{className:"removeRow",event:"click",action:function(){return n.removeRow(t,!0)}},{className:"editRow",event:"click",action:function(){n.editRow(t).then((function(){if(n.component.rowDrafts){var e;n.validateRow(i,!1);var t=i.errors&&!!i.errors.length;n.component.modal&&t&&(null===(e=n.root)||void 0===e?void 0:e.submitted)&&(n.alert.showErrors(i.errors,!1),i.alerts=!0)}}))}},{className:"row",event:"click",action:function(){e.classList.toggle("selected");var r="editGridSelectRow";Array.from(e.classList).includes("selected")?i.isRowSelected=!0:(delete i.isRowSelected,r="editGridUnSelectRow"),n.emit(r,{component:n.component,data:n.dataValue[t]})}}].forEach((function(t){var o=t.className,i=t.event,a=t.action,u=e.getElementsByClassName(o);Array.prototype.forEach.call(u,(function(e){n.options.pdf&&r.default.intersection(e.classList,["editRow","removeRow"]).length?e.style.display="none":n.addEventListener(e,i,a)}))}))})),o?this.addClass(this.refs.component,"formio-component-".concat(this.component.type,"-row-open")):this.removeClass(this.refs.component,"formio-component-".concat(this.component.type,"-row-open"));var i=_(j(O.prototype),"attach",this).call(this,e);return this.loadRefs(e,{messageContainer:"single-scope"}),i}},{key:"flattenRowDataValue",value:function(e){var t=this,n={};return Object.keys(e).forEach((function(o){r.default.isObject(e[o])&&!r.default.isNil(e[o])?Object.assign(n,t.flattenRowDataValue(e[o])):n[o]=e[o]})),n}},{key:"isComponentVisibleInRow",value:function(e,t){var n=t[e.key];return!n||n.visible}},{key:"displayComponentValue",value:function(e,t){return!!(e.hasOwnProperty("tableView")&&!e.tableView||!t?r.default.includes(this.visibleInHeader,e.key):this.isComponentVisibleInSomeRow(e))}},{key:"renderRow",value:function(e,t){var n=this,r=this.dataValue;if(this.isOpen(e))return this.renderComponents(e.components);var o=this.flattenComponents(t),i=this.rowTemplate;return this.renderString(i,{row:r[t]||{},data:this.data,rowIndex:t,components:this.component.components,flattenedComponents:o,displayValue:function(e){return n.displayComponentValue(e)},isVisibleInRow:function(e){return n.isComponentVisibleInRow(e,o)},getView:function(e,t){var n,r,i=o[e.key],a=i?i.getView(t||i.dataValue):"",u=new RegExp("<(.*?)>");return"string"!=typeof a||!a.length||null!==(n=i.component)&&void 0!==n&&n.template||!u.test(a)||"html"===(null===(r=i.component)||void 0===r?void 0:r.inputFormat)?a:'')},state:this.editRows[t].state,t:this.t.bind(this)})}},{key:"eachComponent",value:function(e,t){r.default.each(this.getComponents(t),(function(t,n){if(!1===e(t,n))return!1}))}},{key:"restoreComponentsContext",value:function(){var e=this;this.getComponents().forEach((function(t){var n,r=e.dataValue[t.rowIndex],o=null===(n=e.editRows[t.rowIndex])||void 0===n?void 0:n.data;t.data=r||o}))}},{key:"flattenComponents",value:function(e){var t={};return this.everyComponent((function(e){t[e.component.flattenAs||e.key]=e}),e),t}},{key:"getComponents",value:function(e){var t;return this.editRows=this.editRows||[],this.builderMode?_(j(O.prototype),"getComponents",this).call(this):r.default.isNumber(e)?(null===(t=this.editRows[e])||void 0===t?void 0:t.components)||[]:this.editRows.reduce((function(e,t){return e.concat(t.components||[])}),[])}},{key:"destroy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.calculatedValue=void 0,_(j(O.prototype),"destroy",this).call(this,e)}},{key:"destroyComponents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.builderMode)return _(j(O.prototype),"destroyComponents",this).call(this);var n=this.getComponents(t).slice();n.forEach((function(t){return e.removeComponent(t,e.components)}))}},{key:"createRow",value:function(e,t){var n={components:this.createRowComponents(e,t),data:e,state:P.New,backup:null,error:null,rowIndex:t};return this.editRows.push(n),this.inlineEditMode&&this.dataValue.push(e),n}},{key:"addRow",value:function(){if(!this.options.readOnly){var e=this.editRows.length,t=this.createRow({},e);return t.state===P.New&&(this.emptyRow=(0,l.fastCloneDeep)(t.data)),this.inlineEditMode&&this.triggerChange(),this.emit("editGridAddRow",{component:this.component,row:t}),this.checkRow("checkData",null,{},t.data,t.components),this.component.modal?this.addRowModal(e):this.redraw(),t}}},{key:"addRowModal",value:function(e){var t=this,n=this.ce("div"),r=this.editRows[e];r.willBeSaved=!1;var o=r.components;n.innerHTML=this.renderComponents(o);var i=this.component.modal?this.createModal(n,{},(function(){return t.showDialog(e)})):void 0;return i.classList.add("editgrid-row-modal-".concat(this.id)),r.dialog=i,this.alert&&(this.alert.clear(),this.alert=null),this.alert=new u.default(i.refs.dialogContents,this),this.addEventListener(i,"close",(function(){r.willBeSaved||(t.editRows[e]&&t.editRows[e].state!==P.New&&t.editRows[e].components.forEach((function(e){e.setPristine(!0)})),t.cancelRow(e)),t.alert&&(t.alert.clear(),t.alert=null),delete r.confirmationDialog,delete r.dialog})),i.refs.dialogContents.appendChild(this.ce("button",{class:"btn btn-primary",onClick:function(){t.component.rowDrafts||r.components.forEach((function(e){return e.setPristine(!1)})),t.validateRow(r,!0)||t.component.rowDrafts?(r.willBeSaved=!0,i.close(),t.saveRow(e,!0)):(t.alert.showErrors(r.errors,!1),r.alerts=!0)}},this.component.saveRow||"Save")),this.attachComponents(n,o)}},{key:"showDialog",value:function(e){var t=this.editRows[e];if(t.state===P.New?r.default.isEqual(this.emptyRow,t.data):r.default.isEqual(t.backup,t.data))return Promise.resolve();var n=this.ce("div",{ref:"confirmationDialog"}),i=this.component.dialogTemplate||this.defaultDialogTemplate;n.innerHTML=i,n.refs={},this.loadRefs.call(n,n,{dialogHeader:"single",dialogCancelButton:"single",dialogYesButton:"single"});var a=this.createModal(n);a.classList.add("editgrid-row-modal-confirmation-".concat(this.id));var u,l=function(e){e.preventDefault(),a.close()},s=new o.default((function(e,t){u={resolve:e,reject:t}}));return this.addEventListener(n.refs.dialogYesButton,"click",(function(e){l(e),u.resolve()})),this.addEventListener(n.refs.dialogCancelButton,"click",(function(e){l(e),u.reject()})),t.confirmationDialog=a,s}},{key:"editRow",value:function(e){var t=this.editRows[e],n=t.state===P.Editing||t.state===P.New;if(!t||n)return o.default.resolve();t.prevState=t.state,t.state=this.options.readOnly?P.Viewing:P.Editing,this.lazyLoad&&0===t.components.length&&(t.components=this.createRowComponents(t.data,e));var r=(0,l.fastCloneDeep)(t.data);return this.inlineEditMode?t.backup=r:(t.backup=(0,l.fastCloneDeep)(t.data),t.data=r,this.restoreRowContext(t)),this.component.modal?this.addRowModal(e):this.redraw()}},{key:"clearErrors",value:function(e){var t=this.editRows[e];t&&Array.isArray(t.components)&&t.components.forEach((function(e){e.setPristine(!0),e.setCustomValidity("")}))}},{key:"cancelRow",value:function(e){if(!this.options.readOnly){var t=this.editRows[e];switch(t.state){case P.New:t.state=P.Removed,this.clearErrors(e),this.destroyComponents(e),this.inlineEditMode&&this.splice(e),this.editRows.splice(e,1),this.openWhenEmpty();break;case P.Editing:t.state=t.prevState,this.inlineEditMode&&(this.dataValue[e]=t.backup),t.data=t.backup,t.backup=null,this.restoreRowContext(t),this.clearErrors(e)}this.emit("editGridCancelRow",{instance:this,component:this.component,editRow:t}),this.checkValidity(null,!0),this.redraw(),this.component.rowDrafts&&this.checkValidity(this.data,!1)}}},{key:"saveRow",value:function(e,t){var n=this,r=this.editRows[e];if(!this.options.readOnly){this.component.rowDrafts||r.components.forEach((function(e){return e.setPristine(!1)}));var o=this.validateRow(r,!0);if(!this.component.rowDrafts&&!o)return!1;if(this.saveEditMode){var i,a,u=this.dataValue;switch(null!==(i=this.root)&&void 0!==i&&null!==(a=i.focusedComponent)&&void 0!==a&&a.component.typeChangeEnabled&&(this.root.focusedComponent=null),r.state){case P.New:var l=u.length;u.push(r.data),r.components.forEach((function(e){return e.rowIndex=l})),e!==l&&(this.editRows.splice(e,1),this.editRows.splice(l,0,r));break;case P.Editing:u[e]=r.data}}return r.state=this.component.rowDrafts&&!o?P.Draft:P.Saved,r.backup=null,this.updateValue(),this.emit("editGridSaveRow",{component:this.component,row:r.data,instance:this}),this.triggerChange({modified:t,noPristineChangeOnModified:t&&this.component.rowDrafts,isolateRow:!0}),this.component.rowDrafts&&r.components.forEach((function(e){return e.setPristine(n.pristine)})),this.checkValidity(null,!0),this.redraw(),r.alerts&&(r.alerts=!1),!0}}},{key:"beforeFocus",value:function(e){"beforeFocus"in this.parent&&this.parent.beforeFocus(this);var t=this.getRelativePath(e.path),n=(0,l.getArrayFromComponentPath)(t),o=n[0],i=n[0];this.editRows.forEach((function(e,t){e.rowIndex===o&&(i=t)})),r.default.isNumber(i)&&this.editRow(i)}},{key:"updateComponentsRowIndex",value:function(e,t){e.forEach((function(e,n){e.rowIndex=t,e.row="".concat(t,"-").concat(n)}))}},{key:"updateRowsComponents",value:function(e){var t=this;this.editRows.slice(e).forEach((function(n,r){t.updateComponentsRowIndex(n.components,e+r)}))}},{key:"baseRemoveRow",value:function(e){var t=this.editRows[e];return t.state=P.Removed,this.destroyComponents(e),t}},{key:"removeRow",value:function(e,t){this.options.readOnly||(this.clearErrors(e),this.baseRemoveRow(e),this.splice(e),this.emit("editGridDeleteRow",{index:e}),this.editRows.splice(e,1),this.openWhenEmpty(),this.updateRowsComponents(e),this.updateValue(),this.triggerChange({modified:t,noPristineChangeOnModified:t&&this.component.rowDrafts,isolateRow:!0}),this.checkValidity(null,!0),this.checkData(),this.redraw())}},{key:"createRowComponents",value:function(e,t,n){var o=this;if(this.components)for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;if(null!==(e=i.instance.root)&&void 0!==e&&e.id&&(null===(n=o.root)||void 0===n?void 0:n.id)!==i.instance.root.id?i.instance.root.triggerChange(r,i,a):o.component.modal||o.triggerRootChange(r,i,a),!o.inlineEditMode){var u=o.editRows[t];if(null!=u&&u.alerts)o.checkData(null,p(p({},r),{},{changed:i,rowIndex:t}),o.data);else if(u){var l=o.component.rowDrafts&&!o.shouldValidateDraft(u);o.checkRow("checkData",null,p(p({},r),{},{changed:i,silentCheck:l}),u.data,u.components,l)}o.variableTypeComponentsIndexes.length&&(o.checkRowVariableTypeComponents(u,t),o.redraw())}};var d=o.createComponent(r.default.assign({},c,{row:f.row}),f,e,null,n&&a?a[u]:null);return d.rowIndex=t,d.inEditGrid=!0,d}))}},{key:"hasOpenRows",value:function(){var e=this;return this.editRows.some((function(t){return e.isOpen(t)}))}},{key:"shouldValidateDraft",value:function(e){var t,n;return e.state===P.Draft&&!this.pristine&&!(null!==(t=this.root)&&void 0!==t&&t.pristine)&&!this.hasOpenRows()||(null===(n=this.root)||void 0===n?void 0:n.submitted)}},{key:"shouldValidateRow",value:function(e,t){return this.shouldValidateDraft(e)||e.state===P.Editing||e.alerts||t}},{key:"validateRow",value:function(e,t,n){var r,o=this,i=!0,a=h(this.errors);return this.shouldValidateRow(e,t)&&e.components.forEach((function(r){var a=o.component.rowDrafts&&!o.shouldValidateDraft(e)||n;i&=r.checkValidity(null,t,null,a)})),this.component.validate&&this.component.validate.row&&("true"!==(i=this.evaluate(this.component.validate.row,{valid:i,row:e.data},"valid",!0)).toString()?(e.error=i,i=!1):e.error=null,null===i&&(i="Invalid row validation for ".concat(this.key))),e.errors=i?null:this.errors.filter((function(e){return!a.includes(e)})),(!this.component.rowDrafts||null!==(r=this.root)&&void 0!==r&&r.submitted)&&this.showRowErrorAlerts(e,!!i),!!i}},{key:"showRowErrorAlerts",value:function(e,t){var n;e.alerts&&this.alert&&(null!==(n=e.errors)&&void 0!==n&&n.length&&!t?(this.alert.showErrors(e.errors,!1),e.alerts=!0):this.alert.clear())}},{key:"checkValidity",value:function(e,t,n,r){return e=e||this.rootValue,n=n||this.data,this.checkCondition(n,e)?this.checkComponentValidity(e,t,n,{silentCheck:r}):(this.setCustomValidity(""),!0)}},{key:"checkComponentValidity",value:function(e,t,n){var r,o,i=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},u=a.silentCheck,l=this.errors.length,s=_(j(O.prototype),"checkComponentValidity",this).call(this,e,t,n,a);if(!s&&!this.alert&&!this.hasOpenRows())return!1;if(this.shouldSkipValidation(e,t,n))return!0;var c,f=!0,d=!1;if(this.editRows.forEach((function(e,n){var r=i.validateRow(e,t,u);if(f&=r,i.rowRefs){var o=i.rowRefs[n];if(o){var a=o.querySelector(".editgrid-row-error");r||!a||i.component.rowDrafts&&!i.shouldValidateDraft(e)?a&&(a.textContent=""):(i.addClass(a,"help-block"),a.textContent=i.t(i.errorMessage("invalidRowError")))}}d|=t&&i.isOpen(e)})),!f)return u||this.component.rowDrafts&&(null===(c=this.root)||void 0===c||!c.submitted)||(this.setCustomValidity(this.t(this.errorMessage("invalidRowsError")),t),this.removeClass(this.element,"has-error")),!1;if(d&&this.saveEditMode)return this.setCustomValidity(this.t(this.errorMessage("unsavedRowsError")),t),!1;var p=this.invalid||this.invalidMessage(e,t);return(null===(r=this.errors)||void 0===r?void 0:r.length)!==l&&null!==(o=this.root)&&void 0!==o&&o.submitted&&!p?(this.setCustomValidity(p,t),this.root.showErrors()):this.setCustomValidity(p,t),s}},{key:"changeState",value:function(e,t){e||t.resetValue&&this.component.modalEdit?this.rebuild():this.redraw()}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e||(e=this.defaultValue),!Array.isArray(e)){if("object"!==f(e))return!1;e=[e]}var r=this.hasChanged(e,this.dataValue);n.noValidate=!r,this.parent&&this.parent.checkComponentConditions(),this.dataValue=e,this.dataValue.forEach((function(e,r){var o=t.editRows[r];o?(o.data=e,t.restoreRowContext(o,n),o.state=P.Saved,o.backup=null,o.error=null):t.editRows[r]={components:t.lazyLoad?[]:t.createRowComponents(e,r),data:e,state:P.Saved,backup:null,error:null}}));var o=this.dataValue.length;return this.editRows[o]&&this.editRows[o].state===P.New&&(o+=1),this.editRows.slice(o).forEach((function(e,n){return t.baseRemoveRow(o+n)})),this.editRows=this.editRows.slice(0,o),this.openWhenEmpty(),this.updateOnChange(n,r),this.checkData(),this.changeState(r,n),r}},{key:"openWhenEmpty",value:function(){var e=!this.dataValue.length&&this.component.openWhenEmpty;this.editRows.length||!e||this.builderMode||this.createRow({},0)}},{key:"restoreRowContext",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.components.forEach((function(r){r.data=e.data,t.setNestedValue(r,e.data,n)}))}},{key:"emptyRows",value:function(){var e=this;this.editRows.forEach((function(t,n){return e.destroyComponents(n)})),this.editRows=[]}},{key:"resetValue",value:function(){_(j(O.prototype),"resetValue",this).call(this),this.emptyRows()}}],a=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n\n {% util.eachComponent(components, function(component) { %}\n {% if (displayValue(component)) { %}\n
    {{ t(component.label) }}
    \n {% } %}\n {% }) %}\n '}},{key:"defaultTableHeaderTemplate",get:function(){return'\n \n {% util.eachComponent(components, function(component) { %}\n {% if (!component.hasOwnProperty(\'tableView\') || component.tableView) { %}\n {{ component.label }}\n {% } %}\n {% }) %}\n {% if (!instance.options.readOnly && !instance.disabled) { %}\n Actions\n {% } %}\n \n '}},{key:"defaultRowTemplate",get:function(){return'
    \n {% util.eachComponent(components, function(component) { %}\n {% if (displayValue(component)) { %}\n
    \n {{ isVisibleInRow(component) ? getView(component, row[component.key]) : \'\'}}\n
    \n {% } %}\n {% }) %}\n {% if (!instance.options.readOnly && !instance.disabled) { %}\n
    \n
    \n \n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\n \n {% } %}\n
    \n
    \n {% } %}\n
    '}},{key:"defaultTableRowTemplate",get:function(){return'\n {% util.eachComponent(components, function(component) { %}\n {% if (!component.hasOwnProperty(\'tableView\') || component.tableView) { %}\n \n {{ getView(component, row[component.key]) }}\n \n {% } %}\n {% }) %}\n {% if (!instance.options.readOnly && !instance.disabled) { %}\n \n
    \n \n {% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}\n \n {% } %}\n
    \n \n {% } %}\n '}}],n&&v(t.prototype,n),a&&v(t,a),Object.defineProperty(t,"prototype",{writable:!1}),O}(i.default);t.default=x,x.prototype.hasChanged=a.default.prototype.hasChanged},30923:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{type:"checkbox",input:!0,weight:105,key:"inlineEdit",label:"Inline Editing",tooltip:"Check this if you would like your changes within 'edit' mode to be committed directly to the submission object as that row is being changed"},{key:"defaultValue",ignore:!0},{key:"multiple",ignore:!0}]},58917:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(193))&&r.__esModule?r:{default:r},i=[{key:"placeholder",ignore:!0},{type:"checkbox",label:"Open First Row when Empty",key:"openWhenEmpty",tooltip:"Check this if you would like to open up the first row when the EditGrid is empty",weight:1e3,input:!0,conditional:{json:{"!==":[{var:"data.modal"},!0]}}},{type:"checkbox",label:"Disable Adding / Removing Rows",key:"disableAddingRemovingRows",tooltip:"Check if you want to hide Add Another button and Remove Row button",weight:1001,input:!0,clearOnHide:!1,calculateValue:"value = data.disableAddingRemovingRows;"},{type:"checkbox",label:"Display EditGrid as Table",key:"displayAsTable",tooltip:"use Table Template",weight:1002,input:!1,customConditional:function(){return!o.default.noeval}},{weight:1010,type:"textarea",input:!0,key:"conditionalAddButton",label:"Conditional Add Button",placeholder:"show = ...",tooltip:"Specify condition when Add Button should be displayed.",editor:"ace",as:"javascript",wysiwyg:{minLines:3}}];t.default=i},67930:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(193))&&r.__esModule?r:{default:r},i=[{type:"textarea",label:"Header Template",key:"templates.header",rows:5,editor:"ace",as:"handlebars",clearOnHide:!1,input:!0,placeholder:"/*** Lodash Template Code ***/",description:'Two available variables. "value" is the array of row data and "components" is the array of components in the grid.',tooltip:"This is the Lodash Template used to render the header of the Edit grid.",customConditional:function(e){var t=e.data;return(!o.default.noeval||o.default.protectedEval)&&!t.displayAsTable}},{type:"textarea",label:"Table Header Template",key:"templates.tableHeader",rows:6,editor:"ace",as:"handlebars",clearOnHide:!1,input:!0,placeholder:"/*** Lodash Template Code ***/",description:'Two available variables. "value" is the array of row data and "components" is the array of components in the grid.',tooltip:"This is the Lodash Template used to render the header of the Edit grid.",customConditional:function(e){var t=e.data;return(!o.default.noeval||o.default.protectedEval)&&t.displayAsTable}},{type:"textarea",label:"Row Template",key:"templates.row",rows:5,editor:"ace",as:"handlebars",clearOnHide:!1,input:!0,placeholder:"/*** Lodash Template Code ***/",description:'Three available variables. "row" is an object of one row\'s data, "components" is the array of components in the grid and "state" is current row\'s state (can be "draft" or "saved"). To add click events, add the classes "editRow" and "removeRow" to elements.',tooltip:"This is the Lodash Template used to render each row of the Edit grid.",customConditional:function(e){var t=e.data;return(!o.default.noeval||o.default.protectedEval)&&!t.displayAsTable}},{type:"textarea",label:"Table Row Template",key:"templates.tableRow",rows:5,editor:"ace",as:"handlebars",clearOnHide:!1,input:!0,placeholder:"/*** Lodash Template Code ***/",description:'Three available variables. "row" is an object of one row\'s data, "components" is the array of components in the grid and "state" is current row\'s state (can be "draft" or "saved"). To add click events, add the classes "editRow" and "removeRow" to elements.',tooltip:"This is the Lodash Template used to render each row of the Edit grid.",customConditional:function(e){var t=e.data;return(!o.default.noeval||o.default.protectedEval)&&t.displayAsTable}},{type:"textarea",label:"Footer Template",key:"templates.footer",rows:5,editor:"ace",as:"handlebars",input:!0,placeholder:"/*** Lodash Template Code ***/",description:'Two available variables. "value" is the array of row data and "components" is the array of components in the grid.',tooltip:"This is the Lodash Template used to render the footer of the Edit grid.",customConditional:function(){return!o.default.noeval||o.default.protectedEval}},{type:"textfield",input:!0,key:"rowClass",label:"Row CSS Class",placeholder:"Row CSS Class",tooltip:"CSS class to add to the edit row wrapper."},{type:"textfield",input:!0,key:"addAnother",label:"Add Another Text",placeholder:"Add Another",tooltip:"Set the text of the Add Another button."},{weight:70,type:"checkbox",label:"Display as Modal",tooltip:"Display a modal to add or edit entries in the table",key:"modal",input:!0},{type:"textfield",input:!0,key:"saveRow",label:"Save Row Text",placeholder:"Save",tooltip:"Set the text of the Save Row button."},{type:"textfield",input:!0,key:"removeRow",label:"Remove Row Text",placeholder:"Remove",tooltip:"Set the text of the remove Row button."}];t.default=i},83881:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{ignore:!0,key:"unique"},{weight:110,key:"validate.minLength",label:"Minimum Length",placeholder:"Minimum Length",type:"number",tooltip:"The minimum length requirement this field must meet.",input:!0},{weight:120,key:"validate.maxLength",label:"Maximum Length",placeholder:"Maximum Length",type:"number",tooltip:"The maximum length requirement this field must meet.",input:!0},{type:"checkbox",input:!0,weight:105,key:"rowDrafts",label:"Enable Row Drafts",tooltip:"Allow save rows even if their data is invalid. Errors will occur when try to submit with invalid rows."}]},85201:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.util.eachComponent(e.components,(function(r){n+="\n ",r.hasOwnProperty("tableView")&&!r.tableView||(n+='\n
    '+(null==(t=e.t(r.label))?"":t)+"
    \n "),n+="\n "})),n+="\n
    \n"}},41578:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(23370)),o=i(n(85201));function i(e){return e&&e.__esModule?e:{default:e}}var a={row:r.default,header:o.default};t.default=a},23370:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.util.eachComponent(e.components,(function(r){n+="\n ",r.hasOwnProperty("tableView")&&!r.tableView||(n+='\n
    \n '+(null==(t=e.getView(r,e.row[r.key]))?"":t)+"\n
    \n "),n+="\n "})),n+="\n ",e.self.options.readOnly||(n+='\n
    \n
    \n \n \n
    \n
    \n '),n+="\n
    \n"}},16659:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return e=l(d(h.prototype),"normalizeValue",this).call(this,e,t),this.options.server&&e&&(e=Array.isArray(e)?e.map((function(e){return e.toLowerCase()})):e.toLowerCase()),e}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function h(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){return void n(e)}u.done?t(l):Promise.resolve(l).then(r,o)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return new s.default((function(n){var r=e.ce("input",m({type:"file",style:"height: 0; width: 0; visibility: hidden;",tabindex:"-1"},t));document.body.appendChild(r),r.addEventListener("change",(function(){n(r.files),document.body.removeChild(r)}),!0),"function"==typeof r.trigger?r.trigger("click"):r.click()}))}},{key:"cameraMode",get:function(){return this._cameraMode},set:function(e){this._cameraMode=e,e?this.startVideo():this.stopVideo()}},{key:"useWebViewCamera",get:function(){return this.imageUpload&&x}},{key:"imageUpload",get:function(){return Boolean(this.component.image)}},{key:"browseOptions",get:function(){var e={};if(this.component.multiple&&(e.multiple=!0),!this.isMobile.any){var t=this.component.filePattern.trim()||"",n="image/*";!this.imageUpload||t&&"*"!==t?this.imageUpload&&!t.includes(n)?e.accept="".concat(n,",").concat(t):e.accept=t:e.accept=n}return e}},{key:"deleteFile",value:function(e){var t=this.component.options,n=void 0===t?{}:t;if(e&&["url","indexeddb"].includes(this.component.storage)){var r=this.fileService;if(r&&"function"==typeof r.deleteFile)r.deleteFile(e,n);else{var o=this.options.formio||this.root&&this.root.formio;o&&o.makeRequest("",e.url,"delete")}}}},{key:"attach",value:function(e){var t=this;this.loadRefs(e,{fileDrop:"single",fileBrowse:"single",galleryButton:"single",cameraButton:"single",takePictureButton:"single",toggleCameraMode:"single",videoPlayer:"single",fileLink:"multiple",removeLink:"multiple",fileStatusRemove:"multiple",fileImage:"multiple",fileType:"multiple",fileProcessingLoader:"single"}),this.refs.input=[];var n=k(j(w.prototype),"attach",this).call(this,e);if(this.refs.fileDrop){this.statuses.length||this.refs.fileDrop.removeAttribute("hidden");var r=this;this.addEventListener(this.refs.fileDrop,"dragover",(function(e){this.className="fileSelector fileDragOver",e.preventDefault()})),this.addEventListener(this.refs.fileDrop,"dragleave",(function(e){this.className="fileSelector",e.preventDefault()})),this.addEventListener(this.refs.fileDrop,"drop",(function(e){this.className="fileSelector",e.preventDefault(),r.upload(e.dataTransfer.files)}))}if(this.refs.fileBrowse&&this.addEventListener(this.refs.fileBrowse,"click",(function(e){e.preventDefault(),t.browseFiles(t.browseOptions).then((function(e){t.upload(e)}))})),this.refs.fileLink.forEach((function(e,n){t.addEventListener(e,"click",(function(e){e.preventDefault(),t.getFile(t.dataValue[n])}))})),this.refs.removeLink.forEach((function(e,n){t.addEventListener(e,"click",(function(e){var r=t.dataValue[n];t.deleteFile(r),e.preventDefault(),t.splice(n),t.redraw()}))})),this.refs.fileStatusRemove.forEach((function(e,n){t.addEventListener(e,"click",(function(e){e.preventDefault();var r=t.statuses[n];l.default.pull(t.filesUploading,r.originalName),r.abort&&r.abort(),t.statuses.splice(n,1),t.redraw()}))})),this.refs.galleryButton&&x&&this.addEventListener(this.refs.galleryButton,"click",(function(e){e.preventDefault(),x.getPicture((function(e){window.resolveLocalFileSystemURL(e,(function(e){e.file((function(e){var n=new FileReader;n.onloadend=function(n){var r=new Blob([new Uint8Array(n.target.result)],{type:e.type});r.name=e.name,t.upload([r])},n.readAsArrayBuffer(e)}))}))}),(function(e){console.error(e)}),{sourceType:x.PictureSourceType.PHOTOLIBRARY})})),this.refs.cameraButton&&x&&this.addEventListener(this.refs.cameraButton,"click",(function(e){e.preventDefault(),x.getPicture((function(e){window.resolveLocalFileSystemURL(e,(function(e){e.file((function(e){var n=new FileReader;n.onloadend=function(n){var r=new Blob([new Uint8Array(n.target.result)],{type:e.type});r.name=e.name,t.upload([r])},n.readAsArrayBuffer(e)}))}))}),(function(e){console.error(e)}),{sourceType:x.PictureSourceType.CAMERA,encodingType:x.EncodingType.PNG,mediaType:x.MediaType.PICTURE,saveToPhotoAlbum:!0,correctOrientation:!1})})),this.refs.takePictureButton&&this.addEventListener(this.refs.takePictureButton,"click",(function(e){e.preventDefault(),t.takePicture()})),this.refs.toggleCameraMode&&this.addEventListener(this.refs.toggleCameraMode,"click",(function(e){e.preventDefault(),t.cameraMode=!t.cameraMode,t.redraw()})),this.refs.fileType.forEach((function(e,n){t.dataValue[n].fileType=t.dataValue[n].fileType||t.component.fileTypes[0].label,t.addEventListener(e,"change",(function(e){e.preventDefault();var r=t.component.fileTypes.find((function(t){return t.value===e.target.value}));t.dataValue[n].fileType=r.label}))})),this.fileService){var o=[];this.filesReady=new s.default((function(e,n){t.filesReadyResolve=e,t.filesReadyReject=n})),this.refs.fileImage.forEach((function(e,n){o.push(t.loadImage(t.dataValue[n]).then((function(t){return e.src=t})))})),o.length?s.default.all(o).then((function(){t.filesReadyResolve()})).catch((function(){return t.filesReadyReject()})):this.filesReadyResolve()}return n}},{key:"fileSize",value:function(e,t,n,r,o){return"".concat((t=Math,n=t.log,o=n(e)/n(1024)|0,e/t.pow(1024,o)).toFixed(2)," ").concat(o?"".concat("kMGTPEZY"[--o],"B"):"Bytes")}},{key:"globStringToRegex",value:function(e){var t="",n=[];if((e=e.replace(/\s/g,"")).length>2&&"/"===e[0]&&"/"===e[e.length-1])t=e.substring(1,e.length-1);else{var r=e.split(",");if(r.length>1)for(var o=0;o|:\\-]","g"),"\\$&"),"$")).replace(/\\\*/g,".*").replace(/\\\?/g,"."))}return{regexp:t,excludes:n}}},{key:"translateScalars",value:function(e){if("string"==typeof e){if(e.search(/kb/i)===e.length-2)return parseFloat(1024*e.substring(0,e.length-2));if(e.search(/mb/i)===e.length-2)return parseFloat(1024*e.substring(0,e.length-2)*1024);if(e.search(/gb/i)===e.length-2)return parseFloat(1024*e.substring(0,e.length-2)*1024*1024);if(e.search(/b/i)===e.length-1)return parseFloat(e.substring(0,e.length-1));if(e.search(/s/i)===e.length-1)return parseFloat(e.substring(0,e.length-1));if(e.search(/m/i)===e.length-1)return parseFloat(60*e.substring(0,e.length-1));if(e.search(/h/i)===e.length-1)return parseFloat(3600*e.substring(0,e.length-1))}return e}},{key:"validatePattern",value:function(e,t){if(!t)return!0;var n=this.globStringToRegex(t),r=!0;if(n.regexp&&n.regexp.length){var o=new RegExp(n.regexp,"i");r=!l.default.isNil(e.type)&&o.test(e.type)||!l.default.isNil(e.name)&&o.test(e.name)}return n.excludes.reduce((function(t,n){var r=new RegExp(n,"i");return t&&(l.default.isNil(e.type)||!r.test(e.type))&&(l.default.isNil(e.name)||!r.test(e.name))}),r)}},{key:"validateMinSize",value:function(e,t){return e.size+.1>=this.translateScalars(t)}},{key:"validateMaxSize",value:function(e,t){return e.size-.1<=this.translateScalars(t)}},{key:"upload",value:function(e){var t=this;this.component.multiple||(this.statuses.length&&(this.statuses=[]),e=Array.prototype.slice.call(e,0,1)),this.component.storage&&e&&e.length&&(this.fileDropHidden=!0,Array.prototype.forEach.call(e,function(){var e,n=(e=p().mark((function e(n){var r,o,i,u,s,d,h,y,v,b,g,w,k,O,_,S,j,P,x,E,C,A,T,R;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(0,a.uniqueName)(n.name,t.component.fileNameTemplate,t.evalContext()),o=n.name?n.name.replaceAll("<","<").replaceAll(">",">"):n.name,i={abort:function(){return null},originalName:o,name:r,size:n.size,status:"info",message:t.t("Processing file. Please wait..."),hash:""},"true"!==t.root.form.submissionRevisions){e.next=12;break}return t.statuses.push(i),t.redraw(),u=new f.default,e.next=9,new Promise((function(e,r){t.emit("fileUploadingStart"),u.md5(n,(function(t,n){return t?r(t):e(n)}))}));case 9:s=e.sent,t.emit("fileUploadingEnd"),i.hash=s;case 12:if(t.filesUploading||(t.filesUploading=[]),d=t.filesUploading.some((function(e){return e===n.name})),t.filesUploading.push(n.name),h=t.dataValue.some((function(e){return e.originalName===n.name})),y=t.statuses.findIndex((function(e){return e.originalName===n.name&&"error"===e.status})),(h||d)&&(i.status="error",i.message=t.t("File with the same name is already ".concat(d?"being ":"","uploaded"))),-1!==y&&(t.statuses.splice(y,1),t.redraw()),t.component.filePattern&&!t.validatePattern(n,t.component.filePattern)&&(i.status="error",i.message=t.t("File is the wrong type; it must be {{ pattern }}",{pattern:t.component.filePattern})),t.component.fileMinSize&&!t.validateMinSize(n,t.component.fileMinSize)&&(i.status="error",i.message=t.t("File is too small; it must be at least {{ size }}",{size:t.component.fileMinSize})),t.component.fileMaxSize&&!t.validateMaxSize(n,t.component.fileMaxSize)&&(i.status="error",i.message=t.t("File is too big; it must be at most {{ size }}",{size:t.component.fileMaxSize})),v=t.interpolate(t.component.dir||""),(b=t.fileService)||(i.status="error",i.message=t.t("File Service not provided.")),"true"!==t.root.form.submissionRevisions&&(t.statuses.push(i),t.redraw()),"error"===i.status){e.next=62;break}if(t.component.privateDownload&&(n.private=!0),g=t.component,w=g.storage,k=g.options,O=void 0===k?{}:k,_=t.interpolate(t.component.url,{file:i}),S=null,j=null,t.root.everyComponent((function(e){var t,n;(null!==(t=e.component)&&void 0!==t&&t.submissionAccess||null!==(n=e.component)&&void 0!==n&&n.defaultPermission)&&(j=e.component.submissionAccess?e.component.submissionAccess:[{type:e.component.defaultPermission,roles:[]}]).forEach((function(t){S=["admin","write","create"].includes(t.type)?e.component.key:null}))})),P=t.component.fileKey||"file",x=S?t.currentForm.submission.data[S]._id:null,E=null,!t.root.options.fileProcessor){e.next=55;break}return e.prev=37,t.refs.fileProcessingLoader&&(t.refs.fileProcessingLoader.style.display="block"),C=(0,c.default)(t.fileService,t.root.options.fileProcessor),e.next=42,C(n,t.component.properties);case 42:E=e.sent,e.next=52;break;case 45:return e.prev=45,e.t0=e.catch(37),i.status="error",i.message=t.t("File processing has been failed."),t.fileDropHidden=!1,t.redraw(),e.abrupt("return");case 52:return e.prev=52,t.refs.fileProcessingLoader&&(t.refs.fileProcessingLoader.style.display="none"),e.finish(52);case 55:A=0,T=!(!t.component.useMultipartUpload||!t.component.multipart)&&m(m({},t.component.multipart),{},{progressCallback:function(e){A++,i.status="progress",i.progress=parseInt(100*A/e),delete i.message,t.redraw()},changeMessage:function(e){i.message=e,t.redraw()}}),i.message=t.t("Starting upload..."),t.redraw(),R=b.uploadFile(w,E||n,r,v,(function(e){i.status="progress",i.progress=parseInt(100*e.loaded/e.total),delete i.message,t.redraw()}),_,O,P,j,x,(function(){t.emit("fileUploadingStart",R)}),(function(e){return i.abort=e}),T).then((function(e){var n=t.statuses.indexOf(i);-1!==n&&t.statuses.splice(n,1),e.originalName=o,e.hash=i.hash,t.hasValue()||(t.dataValue=[]),t.dataValue.push(e),l.default.pull(t.filesUploading,e.originalName),t.fileDropHidden=!1,t.redraw(),t.triggerChange(),t.emit("fileUploadingEnd",R)})).catch((function(e){i.status="error",i.message="string"==typeof e?e:e.toString(),delete i.progress,t.fileDropHidden=!1,l.default.pull(t.filesUploading,n.name),t.redraw(),t.emit("fileUploadingEnd",R)})),e.next=63;break;case 62:t.filesUploading.splice(t.filesUploading.indexOf(n.name),1);case 63:case"end":return e.stop()}}),e,null,[[37,45,52,55]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){h(i,r,o,a,u,"next",e)}function u(e){h(i,r,o,a,u,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}()))}},{key:"getFile",value:function(e){var t=this.component.options,n=void 0===t?{}:t,r=this.fileService;if(!r)return alert("File Service not provided");this.component.privateDownload&&(e.private=!0),r.downloadFile(e,n).then((function(e){e&&(["base64","indexeddb"].includes(e.storage)?(0,u.default)(e.url,e.originalName||e.name,e.type):window.open(e.url,"_blank"))})).catch((function(e){alert(e)}))}},{key:"focus",value:function(){"beforeFocus"in this.parent&&this.parent.beforeFocus(this),this.refs.fileBrowse&&this.refs.fileBrowse.focus()}},{key:"destroy",value:function(){this.stopVideo(),k(j(w.prototype),"destroy",this).call(this)}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;nS3 Multipart Upload API is designed to improve the upload experience for larger objects (> 5GB).",conditional:{json:{"===":[{var:"data.storage"},"s3"]}}},{label:"Multipart Upload",tableView:!1,key:"multipart",type:"container",input:!0,components:[{label:"Part Size (MB)",applyMaskOn:"change",mask:!1,tableView:!1,delimiter:!1,requireDecimal:!1,inputFormat:"plain",truncateMultipleSpaces:!1,validate:{min:5,max:5e3},key:"partSize",type:"number",input:!0,defaultValue:500}],conditional:{json:{"===":[{var:"data.useMultipartUpload"},!0]}}},{type:"textfield",input:!0,key:"url",label:"Url",weight:10,placeholder:"Enter the url to post the files to.",tooltip:"See https://github.com/danialfarid/ng-file-upload#server-side for how to set up the server.",conditional:{json:{"===":[{var:"data.storage"},"url"]}}},{type:"textfield",input:!0,key:"options.indexeddb",label:"Database",weight:10,placeholder:"Enter the indexeddb database name",conditional:{json:{in:[{var:"data.storage"},["indexeddb"]]}}},{type:"textfield",input:!0,label:"Table",key:"options.indexeddbTable",weight:10,placeholder:"Enter the name for indexeddb table",conditional:{json:{in:[{var:"data.storage"},["indexeddb"]]}}},{type:"textarea",key:"options",label:"Custom request options",tooltip:"Pass your custom xhr options(optional)",rows:5,editor:"ace",input:!0,weight:15,placeholder:'{\n "withCredentials": true,\n "headers": {\n "Authorization": "Basic "\n }\n }',conditional:{json:{"===":[{var:"data.storage"},"url"]}}},{type:"textfield",input:!0,key:"fileKey",label:"File form-data key",weight:17,placeholder:"Enter the key name of a file for form data.",tooltip:"Key name that you would like to modify for the file while calling API request.",conditional:{json:{"===":[{var:"data.storage"},"url"]}}},{type:"textfield",input:!0,key:"dir",label:"Directory",placeholder:"(optional) Enter a directory for the files",tooltip:"This will place all the files uploaded in this field in the directory",weight:20,conditional:{json:{"!==":[{var:"data.storage"},"googledrive"]}}},{type:"textfield",input:!0,key:"dir",label:"Folder ID",placeholder:"(optional) Enter an ID of the folder for the files",tooltip:"This will place all the files uploaded in this field in the folder",weight:20,conditional:{json:{"===":[{var:"data.storage"},"googledrive"]}}},{type:"textfield",input:!0,key:"fileNameTemplate",label:"File Name Template",placeholder:'(optional) { {name} }-{ {guid} }"',tooltip:"Specify template for name of uploaded file(s). Regular template variables are available (`data`, `component`, `user`, `value`, `moment` etc.), also `fileName`, `guid` variables are available. `guid` part must be present, if not found in template, will be added at the end.",weight:25},{type:"checkbox",input:!0,key:"image",label:"Display as image(s)",tooltip:"Instead of a list of linked files, images will be rendered in the view.",weight:30},{type:"checkbox",input:!0,key:"uploadOnly",label:"Upload Only",tooltip:"When this is checked, will only allow you to upload file(s) and consequently the download, in this component, will be unavailable.",weight:33},{type:"checkbox",input:!0,key:"privateDownload",label:"Private Download",tooltip:"When this is checked, the file download will send a POST request to the download URL with the x-jwt-token header. This will allow your endpoint to create a Private download system.",weight:31,conditional:{json:{"===":[{var:"data.storage"},"url"]}}},{type:"textfield",input:!0,key:"imageSize",label:"Image Size",placeholder:"100",tooltip:"The image size for previewing images.",weight:40,conditional:{json:{"==":[{var:"data.image"},!0]}}},{type:"checkbox",input:!0,key:"webcam",label:"Enable web camera",tooltip:"This will allow using an attached camera to directly take a picture instead of uploading an existing file.",weight:32},{type:"textfield",input:!0,key:"webcamSize",label:"Webcam Width",placeholder:"320",tooltip:"The webcam size for taking pictures.",weight:38,conditional:{json:{"==":[{var:"data.webcam"},!0]}}},{type:"datagrid",input:!0,label:"File Types",key:"fileTypes",tooltip:"Specify file types to classify the uploads. This is useful if you allow multiple types of uploads but want to allow the user to specify which type of file each is.",weight:11,components:[{label:"Label",key:"label",input:!0,type:"textfield"},{label:"Value",key:"value",input:!0,type:"textfield"}]},{type:"textfield",input:!0,key:"filePattern",label:"File Pattern",placeholder:".jpg,video/*,application/pdf",tooltip:"See https://github.com/danialfarid/ng-file-upload#full-reference for how to specify file patterns.",weight:50},{type:"textfield",input:!0,key:"fileMinSize",label:"File Minimum Size",placeholder:"1MB",tooltip:"See https://github.com/danialfarid/ng-file-upload#full-reference for how to specify file sizes.",weight:60},{type:"textfield",input:!0,key:"fileMaxSize",label:"File Maximum Size",placeholder:"10MB",tooltip:"See https://github.com/danialfarid/ng-file-upload#full-reference for how to specify file sizes.",weight:70}];t.default=a},13415:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"unique",ignore:!0},{key:"validateOn",ignore:!0}]},44415:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return e.parentPath="".concat(this.path,".data."),e.events=this.createEmitter(),o.default.set(e,"buttonSettings.showSubmit",!1),this.options?(this.options.base&&(e.base=this.options.base),this.options.project&&(e.project=this.options.project),(this.options.readOnly||this.component.disabled)&&(e.readOnly=this.options.readOnly||this.component.disabled),this.options.breadcrumbSettings&&(e.breadcrumbSettings=this.options.breadcrumbSettings),this.options.buttonSettings&&(e.buttonSettings=o.default.clone(this.options.buttonSettings)),this.options.viewAsHtml&&(e.viewAsHtml=this.options.viewAsHtml),this.options.language&&(e.language=this.options.language),this.options.template&&(e.template=this.options.template),this.options.templates&&(e.templates=this.options.templates),this.options.renderMode&&(e.renderMode=this.options.renderMode),this.options.attachMode&&(e.attachMode=this.options.attachMode),this.options.iconset&&(e.iconset=this.options.iconset),this.options.fileService&&(e.fileService=this.options.fileService),this.options.onChange&&(e.onChange=this.options.onChange),this.options.preview&&(e.preview=this.options.preview),this.options.saveDraft&&(e.saveDraft=this.options.saveDraft),this.options.saveDraftThrottle&&(e.saveDraftThrottle=this.options.saveDraftThrottle),e):e}},{key:"render",value:function(){if(this.builderMode)return g(_(b.prototype),"render",this).call(this,this.component.label||"Nested form");var e=this.subForm?this.subForm.render():this.renderTemplate("loading");return g(_(b.prototype),"render",this).call(this,e)}},{key:"asString",value:function(e){return this.getValueAsString(e)}},{key:"getValueAsString",value:function(e,t){if(!e)return"No data provided";if(!e.data&&e._id)return e._id;if(!e.data||!Object.keys(e.data).length)return"No data provided";if(null!=t&&t.email){var n='\n \n \n ';return this.everyComponent((function(e){e.isInputComponent&&e.visible&&!e.skipInEmail&&(n+='\n \n \n \n \n "))}),h(h({},t),{},{fromRoot:!0})),n+="\n \n
    '.concat(e.label,'').concat(e.getView(e.dataValue,t),"
    \n "}return o.default.isEmpty(e)?"":"[Complex Data]"}},{key:"attach",value:function(e){var t=this;return this.builderMode?g(_(b.prototype),"attach",this).call(this,e):g(_(b.prototype),"attach",this).call(this,e).then((function(){return!t.isSubFormLazyLoad()||t.hasLoadedForm||t.subFormLoading||t.createSubForm(!0),t.subFormReady.then((function(){if(t.empty(e),t.options.builder)t.setContent(e,t.ce("div",{class:"text-muted text-center p-2"},t.text(t.formObj.title)));else{if(t.setContent(e,t.render()),t.subForm&&(t.isNestedWizard&&(e=t.root.element),t.subForm.attach(e),t.valueChanged=t.hasSetValue,t.valueChanged||"submitted"===t.dataValue.state?t.restoreValue():t.setDefaultValue()),!t.builderMode&&t.component.modalEdit){var n=!!t.componentModal&&t.componentModal.isOpened,r=n?t.componentModal.currentValue:t.dataValue;t.componentModal=new a.default(t,e,n,r),t.setOpenModalElement()}t.calculateValue()}}))}))}},{key:"detach",value:function(){this.subForm&&this.subForm.detach(),g(_(b.prototype),"detach",this).call(this)}},{key:"currentForm",get:function(){return this._currentForm},set:function(e){var t=this;this._currentForm=e,this.subForm&&this.subForm.getComponents().forEach((function(e){e.currentForm=t}))}},{key:"hasLoadedForm",get:function(){return this.formObj&&this.formObj.components&&Array.isArray(this.formObj.components)&&this.formObj.components.length}},{key:"isRevisionChanged",get:function(){return o.default.isNumber(this.subFormRevision)&&o.default.isNumber(this.formObj._vid)&&this.formObj._vid!==this.subFormRevision}},{key:"destroy",value:function(){this.subForm&&(this.subForm.destroy(),this.subForm=null,this.subFormReady=null),g(_(b.prototype),"destroy",this).call(this)}},{key:"redraw",value:function(){return this.subForm&&(this.subForm.form=this.formObj,this.setSubFormDisabled(this.subForm)),g(_(b.prototype),"redraw",this).call(this)}},{key:"everyComponent",value:function(){var e;this.subForm&&(e=this.subForm).everyComponent.apply(e,arguments)}},{key:"setSubFormDisabled",value:function(e){e.disabled=this.disabled}},{key:"updateSubWizards",value:function(e){var t,n,r=this;if(this.isNestedWizard&&null!==(t=this.root)&&void 0!==t&&t.subWizards&&"wizard"===(null==e||null===(n=e._form)||void 0===n?void 0:n.display)){var o=this.root.subWizards.findIndex((function(e){return e.component.form===r.component.form}));-1!==o?this.root.subWizards[o]=this:this.root.subWizards.push(this),this.emit("subWizardsUpdated",e)}}},{key:"createSubForm",value:function(e){var t=this;return this.subFormReady=this.loadSubForm(e).then((function(e){if(e)return(0,s.eachComponent)(e.components,(function(e){t.hideSubmitButton(e)})),t.subForm&&t.subForm.destroy(),new f.default(e,t.getSubOptions()).ready.then((function(e){return t.subForm=e,t.subForm.currentForm=t,t.subForm.parent=t,t.subForm.parentVisible=t.visible,t.subForm.on("change",(function(){t.subForm&&(t.dataValue=t.subForm.getValue(),t.triggerChange({noEmit:!0}))})),t.subForm.url=t.formSrc,t.subForm.nosubmit=!0,t.subForm.root=t.root,t.subForm.localRoot=t.isNestedWizard?t.localRoot:t.subForm,t.parent&&(t.subForm.draftEnabled=t.parent.draftEnabled,t.subForm.savingDraft=t.parent.savingDraft),t.restoreValue(),t.valueChanged=t.hasSetValue,t.onChange(),t.subForm}))})).then((function(e){return t.updateSubWizards(e),e})),this.subFormReady}},{key:"hideSubmitButton",value:function(e){"button"===e.type&&("submit"===e.action||!e.action)&&(e.hidden=!0)}},{key:"loadSubForm",value:function(e){var t,n=this;return this.builderMode||this.isHidden()||this.isSubFormLazyLoad()&&!e?l.default.resolve():!this.hasLoadedForm||this.isRevisionChanged||this.options.pdf&&null!==(t=this.component)&&void 0!==t&&t.useOriginalRevision&&o.default.isNull(this.subForm)&&!this.subFormLoading?this.formSrc?(this.subFormLoading=!0,new c.GlobalFormio(this.formSrc).loadForm({params:{live:1}}).then((function(e){return n.formObj=e,n.options.pdf&&n.component.useOriginalRevision&&(n.formObj.display="form"),n.subFormLoading=!1,e})).catch((function(e){return console.log(e),null}))):l.default.resolve():(this.root&&this.root.form&&this.root.form.config&&!this.formObj.config&&(this.formObj.config=this.root.form.config),l.default.resolve(this.formObj))}},{key:"subFormData",get:function(){var e;return(null===(e=this.dataValue)||void 0===e?void 0:e.data)||{}}},{key:"checkComponentValidity",value:function(e,t,n,r){var o=(r=r||{}).silentCheck||!1;return this.subForm?this.subForm.checkValidity(this.subFormData,t,null,o):g(_(b.prototype),"checkComponentValidity",this).call(this,e,t,n,r)}},{key:"checkComponentConditions",value:function(e,t,n){var r=this,o=g(_(b.prototype),"checkComponentConditions",this).call(this,e,t,n);return o?this.subForm?this.subForm.checkConditions(this.subFormData):(this.subFormReady&&this.subFormReady.then((function(){if(r.subForm)return r.subForm.checkConditions(r.subFormData)})),o):o}},{key:"calculateValue",value:function(e,t,n){return this.subForm?this.subForm.calculateValue(this.subFormData,t):g(_(b.prototype),"calculateValue",this).call(this,e,t,n)}},{key:"setPristine",value:function(e){g(_(b.prototype),"setPristine",this).call(this,e),this.subForm&&this.subForm.setPristine(e)}},{key:"shouldSubmit",get:function(){return this.subFormReady&&(!this.component.hasOwnProperty("reference")||this.component.reference)&&!this.isHidden()}},{key:"getSubFormData",value:function(){return"pdf"===o.default.get(this.subForm,"form.display")?this.subForm.getSubmission():l.default.resolve(this.dataValue)}},{key:"submitSubForm",value:function(e){var t=this;return this.shouldSubmit?this.subFormReady.then((function(){return t.subForm?(t.subForm.nosubmit=!1,t.subForm.submitForm().then((function(e){return t.subForm.loading=!1,t.subForm.showAllErrors=!1,t.dataValue=e.submission,t.dataValue})).catch((function(n){return t.subForm.showAllErrors=!0,e?(t.subForm.onSubmissionError(n),l.default.reject(n)):{}}))):t.dataValue})):this.getSubFormData()}},{key:"beforePage",value:function(e){var t=this;return e?this.submitSubForm(!0).then((function(){return g(_(b.prototype),"beforePage",t).call(t,e)})):g(_(b.prototype),"beforePage",this).call(this,e)}},{key:"beforeSubmit",value:function(){var e,t=this,n=this.dataValue;return!(n&&n._id&&n.form)||null!==(e=this.subForm)&&void 0!==e&&e.wizard?this.submitSubForm(!1).then((function(){return t.dataValue})).then((function(){return g(_(b.prototype),"beforeSubmit",t).call(t)})):(this.dataValue=n,l.default.resolve(this.dataValue))}},{key:"isSubFormLazyLoad",value:function(){var e,t;return"wizard"===(null===(e=this.root)||void 0===e||null===(t=e._form)||void 0===t?void 0:t.display)&&this.component.lazyLoad}},{key:"isHidden",value:function(){return!this.visible||!g(_(b.prototype),"checkConditions",this).call(this,this.rootValue)}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=g(_(b.prototype),"setValue",this).call(this,e,n);if(this.valueChanged=!0,this.subForm){var i,a=e._frid?"_frid":"_vid",u=this.useOriginalRevision&&(o.default.isNumber(e[a])||o.default.isNumber(e._fvid))&&o.default.isNumber(null===(i=this.subForm.form)||void 0===i?void 0:i[a])&&e._fvid!==this.subForm.form[a];u?(this.setFormRevision(e._frid||e._fvid),this.createSubForm().then((function(){t.attach(t.element)}))):this.setSubFormValue(e,n)}return r}},{key:"setSubFormValue",value:function(e,t){if(e&&e._id&&this.subForm.formio&&o.default.isEmpty(e.data)){var n=e.form||this.formObj.form||this.component.form,r="".concat(this.subForm.formio.formsUrl,"/").concat(n,"/submission/").concat(e._id);this.subForm.setUrl(r,this.options),this.subForm.loadSubmission().catch((function(t){console.error("Unable to load subform submission ".concat(e._id,":"),t)}))}else this.subForm.setValue(e,t)}},{key:"isEmpty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dataValue;return null===e||o.default.isEqual(e,this.emptyValue)||this.areAllComponentsEmpty(null==e?void 0:e.data)&&!(null!=e&&e._id)}},{key:"areAllComponentsEmpty",value:function(e){var t=!0;return this.subForm?this.subForm.everyComponent((function(n){var r=o.default.get(e,n.key);t&=n.isEmpty(r)})):t=!1,t}},{key:"getValue",value:function(){return this.subForm?this.subForm.getValue():this.dataValue}},{key:"errors",get:function(){var e=g(_(b.prototype),"errors",this);return this.subForm&&(e=e.concat(this.subForm.errors)),e}},{key:"updateSubFormVisibility",value:function(){this.subForm&&(this.subForm.parentVisible=this.visible)}},{key:"isNestedWizard",get:function(){var e,t,n,r,o;return"wizard"===(null===(e=this.subForm)||void 0===e||null===(t=e._form)||void 0===t?void 0:t.display)&&"wizard"===(null===(n=this.parent)||void 0===n||null===(r=n.parent)||void 0===r||null===(o=r._form)||void 0===o?void 0:o.display)}},{key:"visible",get:function(){return g(_(b.prototype),"visible",this)},set:function(e){var t=this,n=this.isNestedWizard;if(this._visible!==e){if(this._visible=e,!this.subForm&&e)return this.createSubForm(),this.subFormReady.then((function(){t.updateSubFormVisibility(),t.clearOnHide()})),void this.redraw();this.updateSubFormVisibility(),this.clearOnHide(),n?this.rebuild():this.redraw()}!e&&n&&this.root.redraw()}},{key:"parentVisible",get:function(){return g(_(b.prototype),"parentVisible",this)},set:function(e){var t=this;if(this._parentVisible!==e){if(this._parentVisible=e,this.clearOnHide(),!this.subForm&&e)return this.createSubForm(),this.subFormReady.then((function(){t.updateSubFormVisibility()})),void this.redraw();this.updateSubFormVisibility(),this.redraw()}}},{key:"isInternalEvent",value:function(e){switch(e){case"focus":case"blur":case"componentChange":case"componentError":case"error":case"formLoad":case"languageChanged":case"render":case"checkValidity":case"initialized":case"submit":case"submitButton":case"nosubmit":case"updateComponent":case"submitDone":case"submissionDeleted":case"requestDone":case"nextPage":case"prevPage":case"wizardNavigationClicked":case"updateWizardNav":case"restoreDraft":case"saveDraft":case"saveComponent":case"pdfUploaded":return!0;default:return!1}}},{key:"createEmitter",value:function(){var e=new u.default,t=e.emit,n=this;return e.emit=function(e){for(var r=e.replace("".concat(n.options.namespace,"."),""),o=arguments.length,i=new Array(o>1?o-1:0),a=1;a

    Example:

    value = data.firstName + " " + data.lastName;

    ','

    Example:

    {"cat": [{"var": "data.firstName"}, " ", {"var": "data.lastName"}]}
    '),o.default.javaScriptValue("Calculated Value","calculateValue","calculateValue",130,"

    Example:

    value = data.a + data.b + data.c;

    ",'

    Example:

    {"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}

    Click here for an example

    '),{weight:140,type:"checkbox",label:"Clear Value When Hidden",key:"clearOnHide",defaultValue:!0,tooltip:"When a field is hidden, clear the value.",input:!0}];t.default=i},70838:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"labelPosition",ignore:!0},{key:"placeholder",ignore:!0},{key:"description",ignore:!0},{key:"tooltip",ignore:!0},{key:"tabIndex",ignore:!0},{key:"autofocus",ignore:!0}]},5318:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(69826),n(41539),t.default=[{type:"select",input:!0,dataSrc:"url",data:{url:"/form?limit=1000000&select=_id,title,display"},searchField:"title__regex",template:"{{ item.title }}",valueProperty:"_id",authenticate:!0,label:"Form",key:"form",weight:10,lazyLoad:!1,tooltip:"The form to load within this form component.",validate:{required:!0}},{label:"Lazy Load",inputType:"checkbox",defaultValue:!0,clearOnHide:!0,errorLabel:"",key:"lazyLoad",type:"checkbox",tooltip:"if it is checked, the subform is loaded after navigation to the page with this component within the wizard.",input:!0,customConditional:function(e){var t,n,r,o,i=e.instance,a=e.data,u=null===(t=i.root)||void 0===t||null===(n=t.getComponent("form"))||void 0===n?void 0:n.defaultDownloadedResources.find((function(e){return e._id===a.form})),l="wizard";return(null===(r=i.options)||void 0===r||null===(o=r.editForm)||void 0===o?void 0:o.display)===l&&u&&u.display!==l}},{type:"select",input:!0,dataSrc:"url",data:{url:"/form/{{ data.form }}/v"},searchField:"title__regex",template:"{{ item._vid }}",valueProperty:"_id",authenticate:!0,label:"Form Revision",key:"revision",weight:10,lazyLoad:!0,tooltip:"You can lock the nested form to a specific revision by choosing the revision number here.",customConditional:"show = !!data.form"},{type:"checkbox",input:!0,weight:19,key:"useOriginalRevision",label:"Use Original Revision while Submissions Viewing",tooltip:"Using this option will make form load the original revision (the one which was used to make a submission) when viewing a submission."},{type:"checkbox",input:!0,weight:20,key:"reference",label:"Save as reference",tooltip:"Using this option will save this field as a reference and link its value to the value of the origin record."}]},45574:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return this.updateValue(e,t)}},{key:"getValue",value:function(){return this.dataValue}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n]+)>)/g,"").trim())return" ".concat(this.component.content," ");var e=i.default.get(this.root,"submission",{}),t=this.component.content?this.interpolate(this.component.content,{metadata:e.metadata||{},submission:e,data:this.rootValue,row:this.data}):"";return this.sanitize(t,this.shouldSanitizeValue)}},{key:"singleTags",get:function(){return["br","img","hr"]}},{key:"checkRefreshOn",value:function(e){s(p(y.prototype),"checkRefreshOn",this).call(this,e),!this.builderMode&&this.component.refreshOnChange&&this.element&&!i.default.isUndefined(e)&&(i.default.isBoolean(e)&&e||!i.default.isEmpty(e))&&this.conditionallyVisible(this.data,this.row)&&this.setContent(this.element,this.renderContent())}},{key:"renderContent",value:function(){var e=this,t=i.default.get(this.root,"submission",{});return this.renderTemplate("html",{component:this.component,tag:this.component.tag,attrs:(this.component.attrs||[]).map((function(n){return{attr:n.attr,value:e.interpolate(n.value,{metadata:t.metadata||{},submission:t,data:e.rootValue,row:e.data})}})),content:this.content,singleTags:this.singleTags})}},{key:"render",value:function(){return s(p(y.prototype),"render",this).call(this,this.renderContent())}},{key:"attach",value:function(e){return this.loadRefs(e,{html:"single"}),s(p(y.prototype),"attach",this).call(this,e)}}])&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),y}(o.default);t.default=h},97234:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"labelPosition",ignore:!0},{key:"placeholder",ignore:!0},{key:"description",ignore:!0},{key:"tooltip",ignore:!0},{key:"hideLabel",ignore:!0},{key:"autofocus",ignore:!0},{key:"disabled",ignore:!0},{key:"tabindex",ignore:!0},{key:"tableView",ignore:!0},{type:"textfield",input:!0,key:"tag",weight:50,label:"HTML Tag",placeholder:"HTML Element Tag",tooltip:"The tag of this HTML element."},{type:"textfield",input:!0,key:"className",weight:60,label:"CSS Class",placeholder:"CSS Class",tooltip:"The CSS class for this HTML element."},{type:"datagrid",input:!0,label:"Attributes",key:"attrs",tooltip:"The attributes for this HTML element. Only safe attributes are allowed, such as src, href, and title.",weight:70,components:[{label:"Attribute",key:"attr",input:!0,type:"textfield"},{label:"Value",key:"value",input:!0,type:"textfield"}]},{type:"textarea",input:!0,editor:"ace",rows:10,as:"html",label:"Content",tooltip:"The content of this HTML element.",defaultValue:'
    Content
    ',key:"content",weight:80},{weight:85,type:"checkbox",label:"Refresh On Change",tooltip:"Rerender the field whenever a value on the form changes.",key:"refreshOnChange",input:!0}]},75367:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"logic",components:[{key:"actions",components:[{key:"actionPanel",components:[{data:{json:[{label:"Hidden",value:"hidden",type:"boolean"},{label:"Required",value:"validate.required",type:"boolean"},{label:"Disabled",value:"disabled",type:"boolean"},{label:"Label",value:"label",type:"string"},{label:"Title",value:"title",type:"string"},{label:"Tooltip",value:"tooltip",type:"string"},{label:"Description",value:"description",type:"string"},{label:"Placeholder",value:"placeholder",type:"string"},{label:"CSS Class",value:"className",type:"string"},{label:"Container Custom Class",value:"customClass",type:"string"},{label:"Content",value:"content",type:"string",component:"content"}]},key:"property"},{type:"textarea",editor:"ace",rows:10,as:"html",label:"Content",tooltip:"The content of this HTML element.",defaultValue:'
    Content
    ',key:"content",weight:30,input:!0,customConditional:function(e){return"property"===e.row.type&&e.row.hasOwnProperty("property")&&"string"===e.row.property.type&&"content"===e.row.property.component}}]}]}]}]},15178:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=X(n(78621)),o=X(n(83696)),i=X(n(37784)),a=X(n(67559)),u=X(n(64430)),l=X(n(72801)),s=X(n(20787)),c=X(n(37419)),f=X(n(29147)),d=X(n(56742)),p=X(n(93560)),h=X(n(54263)),y=X(n(34160)),m=X(n(1870)),v=X(n(15734)),b=X(n(99184)),g=X(n(58192)),w=X(n(11621)),k=X(n(13089)),O=X(n(63820)),_=X(n(99606)),S=X(n(68093)),j=X(n(57700)),P=X(n(50919)),x=X(n(24561)),E=X(n(67329)),C=X(n(99495)),A=X(n(40996)),T=X(n(95548)),R=X(n(40736)),M=X(n(55089)),D=X(n(44311)),I=X(n(30210)),L=X(n(66572)),V=X(n(14224)),N=X(n(59024)),F=X(n(14051)),B=X(n(55655)),U=X(n(26135)),z=X(n(53700)),q=X(n(16186)),H=X(n(6610)),W=X(n(8745)),K=X(n(8948)),Y=X(n(5570)),G=X(n(37978)),$=X(n(12151)),J=X(n(86267));function X(e){return e&&e.__esModule?e:{default:e}}var Z={address:r.default,base:u.default,component:u.default,componentmodal:l.default,button:o.default,checkbox:i.default,columns:a.default,container:s.default,content:c.default,currency:f.default,datagrid:d.default,datamap:p.default,datetime:h.default,day:y.default,editgrid:m.default,email:v.default,input:O.default,field:S.default,multivalue:_.default,list:j.default,fieldset:b.default,file:g.default,form:w.default,hidden:k.default,htmlelement:P.default,nested:x.default,nesteddata:E.default,nestedarray:C.default,number:A.default,panel:T.default,password:R.default,phoneNumber:M.default,radio:D.default,recaptcha:I.default,resource:L.default,select:N.default,selectboxes:V.default,signature:F.default,survey:B.default,table:U.default,tabs:z.default,tags:q.default,textarea:H.default,textfield:W.default,time:K.default,tree:Y.default,unknown:G.default,url:$.default,well:J.default};t.default=Z},1512:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{};return g(k(m.prototype),"setValueAt",this).call(this,e,this.formatValue(this.parseValue(t)),n)}},{key:"parseValue",value:function(e){"string"==typeof e&&(e=e.split(this.delimiter).join("").replace(this.decimalSeparator,"."));var t=parseFloat(e);return a.default.isNaN(t)?null:String(t).replace(".",this.decimalSeparator)}},{key:"formatValue",value:function(e){return this.component.requireDecimal&&e&&!e.includes(this.decimalSeparator)?"".concat(e).concat(this.decimalSeparator).concat(a.default.repeat("0",this.decimalLimit)):this.component.requireDecimal&&e&&e.includes(this.decimalSeparator)?"".concat(e).concat(a.default.repeat("0",this.decimalLimit-e.split(this.decimalSeparator)[1].length)):e}},{key:"focus",value:function(){var e=this.refs.input[0];e&&(g(k(m.prototype),"focus",this).call(this),e.setSelectionRange(0,e.value.length))}},{key:"getMaskedValue",value:function(e){return(e=null===e?"0":e.toString()).includes(".")&&"."!==this.decimalSeparator&&(e=e.replace(".",this.decimalSeparator)),(0,i.conformToMask)(this.formatValue(e),this.numberMask).conformedValue}},{key:"getValueAsString",value:function(e,t){var n=this;return e||0===e?(e=this.getWidgetValueAsString(e,t),Array.isArray(e)?e.map((function(e){return n.getMaskedValue(e)})).join(", "):this.getMaskedValue(e)):""}},{key:"addFocusBlurEvents",value:function(e){var t=this;g(k(m.prototype),"addFocusBlurEvents",this).call(this,e),this.addEventListener(e,"blur",(function(){e.value=t.getValueAsString(t.formatValue(t.parseValue(e.value)))}))}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;nYou must assign the next variable with the API key of the next page.

    \n

    The global variable data is provided, and allows you to access the data of any form component, by using its API key.

    \n

    Also moment library is available, and allows you to manipulate dates in a convenient way.

    \n
    Example
    next = data.addComment ? 'page3' : 'page4';
    \n","\n

    Submission data is available as JsonLogic variables, with the same api key as your components.

    \n")),{},{customConditional:function(e){var t=!1;if("wizard"===e.instance.options.editForm.display){var n=e.instance.options.editForm.components,r=e.instance.options.editComponent;n&&r&&(t=n.some((function(e){var t=(0,a.default)((0,u.default)(e),(0,u.default)(r))||[];return t.push("components"),(0,o.default)((0,i.default)(e,t),(0,i.default)(r,t))})))}return t}})];t.default=p},74893:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(5212),n(41539);var r=u(n(18446)),o=u(n(57557)),i=u(n(91966)),a=u(n(3674));function u(e){return e&&e.__esModule?e:{default:e}}var l=[{key:"labelPosition",ignore:!0},{key:"placeholder",ignore:!0},{key:"description",ignore:!0},{key:"autofocus",ignore:!0},{key:"tableView",ignore:!0},{key:"label",hidden:!0,calculateValue:function(e){return e.data.title}},{key:"tabindex",hidden:!0},{weight:1,type:"textfield",input:!0,placeholder:"Panel Title",label:"Title",key:"title",tooltip:"The title text that appears in the header of this panel."},{weight:20,type:"textarea",input:!0,key:"tooltip",label:"Tooltip",placeholder:"To add a tooltip to this field, enter text here.",tooltip:"Adds a tooltip to the side of this field."},{weight:30,type:"select",input:!0,label:"Theme",key:"theme",dataSrc:"values",data:{values:[{label:"Default",value:"default"},{label:"Primary",value:"primary"},{label:"Info",value:"info"},{label:"Success",value:"success"},{label:"Danger",value:"danger"},{label:"Warning",value:"warning"}]}},{weight:40,type:"fieldset",input:!1,components:[{type:"select",input:!0,label:"Breadcrumb Type",key:"breadcrumb",dataSrc:"values",data:{values:[{label:"Default",value:"default"},{label:"Condensed",value:"condensed"},{label:"Hidden",value:"none"}]}},{input:!0,type:"checkbox",label:"Allow click on Breadcrumb",key:"breadcrumbClickable",defaultValue:!0,conditional:{json:{"!==":[{var:"data.breadcrumb"},"none"]}}},{input:!0,type:"checkbox",label:"Allow Previous",key:"allowPrevious",defaultValue:!1,tooltip:"Determines if the breadcrumb bar is clickable or not for visited tabs.",conditional:{json:{"===":[{var:"data.breadcrumbClickable"},!1]}}},{weight:50,label:"Panel Navigation Buttons",optionsLabelPosition:"right",values:[{label:"Previous",value:"previous"},{label:"Cancel",value:"cancel"},{label:"Next",value:"next"}],inline:!0,type:"selectboxes",key:"buttonSettings",input:!0,inputType:"checkbox",defaultValue:{previous:!0,cancel:!0,next:!0}},{weight:55,label:"Navigate Wizard on Enter",type:"checkbox",key:"navigateOnEnter",input:!0,inputType:"checkbox",defaultValue:!1,tooltip:"Use the Enter key to go forward through pages."},{weight:56,label:"Save on Enter",type:"checkbox",key:"saveOnEnter",input:!0,inputType:"checkbox",defaultValue:!1,tooltip:"Use the Enter key to submit form on last page."},{weight:60,label:"Scroll up on page opening",type:"checkbox",key:"scrollToTop",input:!0,inputType:"checkbox",defaultValue:!1,tooltip:"Scroll to the top of the wizard page when user navigates to it"}],customConditional:function(e){var t=!1;if("wizard"===e.instance.options.editForm.display){var n=e.instance.options.editForm.components,u=e.instance.options.editComponent;n&&u&&(t=n.some((function(e){var t=(0,i.default)((0,a.default)(e),(0,a.default)(u))||[];return t.push("components"),(0,r.default)((0,o.default)(e,t),(0,o.default)(u,t))})))}return t}},{weight:650,type:"checkbox",label:"Collapsible",tooltip:"If checked, this will turn this Panel into a collapsible panel.",key:"collapsible",input:!0},{weight:651,type:"checkbox",label:"Initially Collapsed",tooltip:"Determines the initial collapsed state of this Panel.",key:"collapsed",input:!0,conditional:{json:{"===":[{var:"data.collapsible"},!0]}}}];t.default=l},93268:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n\n \n \n '.concat(e.maskName,'\n ').concat(e.value,"\n \n \n \n "):s(p(y.prototype),"getValueAsString",this).call(this,e,t)}}])&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),y}(o.default);t.default=h},24482:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"validate.minLength",ignore:!0},{key:"validate.maxLength",ignore:!0},{key:"validate.pattern",ignore:!0},{key:"validate.minWords",ignore:!0},{key:"validate.maxWords",ignore:!0}]},20481:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n3&&void 0!==arguments[3]?arguments[3]:{};e=e||this.rootValue,n=n||this.data;var i=o.async,a=void 0!==i&&i;if(!a)return m(w(y.prototype),"checkComponentValidity",this).call(this,e,t,n,o);var u=n[this.component.key];return u&&u.token?u.success?this.hook("validateReCaptcha",u.token,(function(){return l.default.resolve(!0)})).then((function(e){return e})).catch((function(e){return r.setCustomValidity(e.message||e),!1})):(this.setCustomValidity("ReCAPTCHA: Token validation error"),l.default.resolve(!1)):(this.setCustomValidity("ReCAPTCHA: Token is not specified in submission"),l.default.resolve(!1))}},{key:"normalizeValue",value:function(e){return this.recaptchaResult?this.recaptchaResult:e}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n{{ item.data }}"}].concat(t))}},{key:"builderInfo",get:function(){return{title:"Resource",icon:"files-o",weight:90,documentation:"/userguide/form-building/form-components#resource",schema:h.schema()}}}],(n=[{key:"init",value:function(){l(d(h.prototype),"init",this).call(this),this.component.dataSrc="resource",this.component.data={resource:this.component.resource}}},{key:"defaultSchema",get:function(){return h.schema()}}])&&u(t.prototype,n),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),h}(i.default);t.default=p},18577:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{key:"resourceInfo",weight:-10,type:"htmlelement",tag:"div",className:"alert alert-danger",content:"This component has been deprecated and will be removed in a future version of Formio.js."},{type:"select",input:!0,dataSrc:"url",data:{url:"/form?type=resource&limit=1000000&select=_id,title"},authenticate:!0,template:"{{ item.title }}",valueProperty:"_id",label:"Resource",key:"resource",weight:50,tooltip:"The resource to be used with this field."},{type:"tags",input:!0,key:"selectFields",label:"Select Fields",tooltip:"The properties on the resource to return as part of the options. If left blank, all properties will be returned.",placeholder:"Enter the fields to select.",weight:51},{type:"tags",input:!0,key:"searchFields",label:"Search Fields",tooltip:"A list of search filters based on the fields of the resource. See the Resource.js documentation for the format of these filters.",placeholder:"The fields to query on the server",weight:52},{type:"textfield",input:!0,key:"filter",label:"Filter Query",weight:53,description:"The filter query for results.",tooltip:"Use this to provide additional filtering using query parameters."},{type:"textfield",input:!0,key:"sort",label:"Sort Query",weight:53,description:"The sort query for results",tooltip:"Use this to provide additional sorting using query parameters"},{type:"textarea",input:!0,key:"template",label:"Item Template",editor:"ace",as:"html",rows:3,weight:53,tooltip:"The HTML template for the result data items."},{type:"checkbox",input:!0,weight:54,key:"addResource",label:"Add Resource",tooltip:"Allows to create a new resource while entering a submission.",conditional:{json:{"===":[{var:"data.dataSrc"},"resource"]}}},{type:"textfield",label:"Add Resource Label",key:"addResourceLabel",tooltip:"Set the text of the Add Resource button.",placeholder:"Add Resource",weight:55,input:!0,conditional:{json:{and:[{"===":[{var:"data.dataSrc"},"resource"]},{"!!":{var:"data.addResource"}}]}}}]},24120:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,s.getRandomComponentId)();if(!o.default.isNil(t)){var i=this.component.idPath?this.component.idPath.split(".").reduceRight((function(e,t){return w({},t,e)}),r):{},a=p({value:this.getOptionValue(e),label:t},i),u=!!this.component.uniqueOptions&&!!this.selectOptions.find((function(e){return o.default.isEqual(e.value,a.value)}));if(!u&&(e&&this.selectOptions.push(a),this.refs.selectContainer&&"html5"===this.component.widget)){a.value&&o.default.isObject(a.value)&&o.default.isEmpty(a.value)&&(a.value="");var l=document.createElement("div");l.innerHTML=this.sanitize(this.renderTemplate("selectOption",{selected:o.default.isEqual(this.getOptionValue(this.dataValue),a.value),option:a,attrs:n,id:r,useId:(""===this.valueProperty||this.isEntireObjectDisplay())&&o.default.isObject(e)&&r}),this.shouldSanitizeValue).trim(),a.element=l.firstChild,this.refs.selectContainer.appendChild(a.element)}}}},{key:"addValueOptions",value:function(e){var t=this;e=e||[];var n=!1,r=this.dataValue;if(this.options.pdf&&!e.length&&"url"===this.component.dataSrc&&this.valueProperty&&(r=Array.isArray(r)?r.map((function(e){return o.default.set({},t.valueProperty,e)})):o.default.set({},this.valueProperty,r)),!this.selectOptions.length){var i=Array.isArray(r)&&this.component.multiple?r:[r];(n=this.addCurrentChoices(i,e))||this.component.multiple||this.addPlaceholder()}return n}},{key:"disableInfiniteScroll",value:function(){this.downloadedResources&&(this.downloadedResources.serverCount=this.downloadedResources.length,this.serverCount=this.downloadedResources.length)}},{key:"setItems",value:function(e,t){var n,r,i,a=this;if(this.selectItems=e,"string"==typeof e)try{e=JSON.parse(e)}catch(t){console.warn(t.message),e=[]}if(this.component.onSetItems){var u="function"==typeof this.component.onSetItems?this.component.onSetItems(this,e):this.evaluate(this.component.onSetItems,{items:e},"items");u&&(e=u)}if(!this.choices&&this.refs.selectContainer&&this.empty(this.refs.selectContainer),this.component.selectValues&&(e=o.default.get(e,this.component.selectValues,e)||[]),this.itemsFromUrl){i=!!this.isSelectURL&&o.default.isEqual(e,this.downloadedResources);var l=this.component.limit>e.length,s=i&&this.downloadedResources&&this.downloadedResources.length===e.length;l?this.disableInfiniteScroll():s?this.selectOptions=[]:this.serverCount=e.serverCount}if(this.isScrollLoading&&e)i||(this.downloadedResources=this.downloadedResources?this.downloadedResources.concat(e):e),this.downloadedResources.serverCount=e.serverCount||this.downloadedResources.serverCount;else if(this.downloadedResources=e||[],this.selectOptions=[],!o.default.isEmpty(this.dataValue)&&this.component.idPath){var c=o.default.get(this.dataValue,this.component.idPath,null),f=!o.default.isNil(c)&&e.find((function(e){return o.default.get(e,a.component.idPath)===c}));f&&this.setValue(f)}if(t||this.addValueOptions(e),"html5"!==this.component.widget||this.component.placeholder||this.addOption(null,""),o.default.each(e,(function(e,t){if(!(a.root&&a.root.options.editForm&&a.root.options.editForm._id&&a.root.options.editForm._id===e._id)){var n=a.selectValueAndLabel(e);a.addOption(n.value,n.label,{},o.default.get(e,a.component.idPath,String(t)))}})),this.choices?this.choices.setChoices(this.selectOptions,"value","label",!0):this.loading,this.isScrollLoading=!1,this.loading=!1,!t||!(null===(n=this.choices)||void 0===n||null===(r=n.input)||void 0===r?void 0:r.isFocussed))if(!this.isEmpty()||this.isRemoveButtonPressed)this.setValue(this.dataValue,{noUpdateEvent:!0});else if(this.shouldAddDefaultValue&&!this.options.readOnly){var d=this.defaultValue;this.isEmpty(d)||this.setValue(d)}this.itemsLoadedResolve()}},{key:"getSingleItemValueForHTMLMode",value:function(e){var t,n=null===(t=this.selectOptions)||void 0===t?void 0:t.find((function(t){var n=t.value;return o.default.isEqual(n,e)}));return n&&n.label||e}},{key:"itemValueForHTMLMode",value:function(e){var t=this;return this.isHtmlRenderMode()?Array.isArray(e)?e.map((function(e){return Array.isArray(e)?t.itemValueForHTMLMode(e):t.getSingleItemValueForHTMLMode(e)})).join(", "):this.getSingleItemValueForHTMLMode(e):O(P(k.prototype),"itemValueForHTMLMode",this).call(this,e)}},{key:"defaultValue",get:function(){var e=O(P(k.prototype),"defaultValue",this);return e||!1!==this.component.defaultValue&&0!==this.component.defaultValue||(e=this.component.defaultValue),e}},{key:"loadingError",get:function(){return!this.component.refreshOn&&!this.component.refreshOnBlur&&this.networkError}},{key:"loadItems",value:function(e,t,n,r,a,u){var l=this;if(r=r||{},!this.shouldLoad||!this.itemsFromUrl&&this.options.readOnly)return this.isScrollLoading=!1,this.loading=!1,void this.itemsLoadedResolve();var s=parseInt(this.component.minSearch,10);if(this.component.searchField&&s>0&&(!t||t.length0&&void 0!==arguments[0]?arguments[0]:this.dataValue;return O(P(k.prototype),"isEmpty",this).call(this,e)||void 0===e}},{key:"refresh",value:function(e,t){var n=t.instance;this.component.clearOnRefresh&&n&&!n.pristine&&this.setValue(this.emptyValue),this.updateItems(null,!0)}},{key:"additionalResourcesAvailable",get:function(){return o.default.isNil(this.serverCount)||this.serverCount>this.downloadedResources.length}},{key:"serverCount",get:function(){return this.isFromSearch?this.searchServerCount:this.defaultServerCount},set:function(e){this.isFromSearch?this.searchServerCount=e:this.defaultServerCount=e}},{key:"downloadedResources",get:function(){return this.isFromSearch?this.searchDownloadedResources:this.defaultDownloadedResources},set:function(e){this.isFromSearch?this.searchDownloadedResources=e:this.defaultDownloadedResources=e}},{key:"addPlaceholder",value:function(){this.component.placeholder&&this.addOption("",this.component.placeholder,{placeholder:!0})}},{key:"activate",value:function(){!this.loading&&this.active||this.setLoadingItem(),this.active||(this.activated=!0,this.triggerUpdate())}},{key:"setLoadingItem",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.choices?e?this.choices.setChoices([{value:"".concat(this.id,"-loading"),label:"Loading...",disabled:!0}],"value","label"):this.choices.setChoices([{value:"",label:''),disabled:!0}],"value","label",!0):"url"!==this.component.dataSrc&&"resource"!==this.component.dataSrc||this.addOption("",this.t("loading..."))}},{key:"active",get:function(){return!this.component.lazyLoad||this.activated}},{key:"render",value:function(){var e=this.inputInfo;return e.attr=e.attr||{},e.multiple=this.component.multiple,O(P(k.prototype),"render",this).call(this,this.wrapElement(this.renderTemplate("select",{input:e,selectOptions:"",index:null})))}},{key:"wrapElement",value:function(e){return this.component.addResource&&!this.options.readOnly?this.renderTemplate("resourceAdd",{element:e}):e}},{key:"choicesOptions",value:function(){var e=!this.component.hasOwnProperty("searchEnabled")||this.component.searchEnabled,t=this.t(this.component.placeholder,{_userInput:!0}),n=this.component.customOptions||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){console.warn(e.message),n={}}var r={maxPatternLength:1e3,distance:1e3};return p({removeItemButton:!this.component.disabled&&o.default.get(this.component,"removeItemButton",!0),itemSelectText:"",classNames:{containerOuter:"choices form-group formio-choices",containerInner:this.transform("class","form-control ui fluid selection dropdown")},addItemText:!1,allowHTML:!0,placeholder:!!this.component.placeholder,placeholderValue:t,noResultsText:this.t("No results found"),noChoicesText:this.t("No choices to choose from"),searchPlaceholderValue:this.t("Type to search"),shouldSort:!1,position:this.component.dropdown||"auto",searchEnabled:e,searchChoices:!this.component.searchField,searchFields:o.default.get(this,"component.searchFields",["label"]),shadowRoot:this.root?this.root.shadowRoot:null,fuseOptions:this.component.useExactSearch?p({tokenize:!0,matchAllTokens:!0},r):Object.assign({},o.default.get(this,"component.fuseOptions",{}),p({include:"score",threshold:o.default.get(this,"component.selectThreshold",.3)},r)),valueComparer:o.default.isEqual,resetScrollPosition:!1},n)}},{key:"attach",value:function(e){var t,n,a,l=this,s=O(P(k.prototype),"attach",this).call(this,e);this.loadRefs(e,{selectContainer:"single",addResource:"single",autocompleteInput:"single"});var c=this.refs.autocompleteInput;c&&this.addEventListener(c,"change",(function(e){l.setValue(e.target.value)}));var f=this.refs.selectContainer;if(f){if(this.addEventListener(f,this.inputInfo.changeEvent,(function(){return l.updateValue(null,{modified:!0})})),this.attachRefreshOnBlur(),"html5"===this.component.widget)return this.addFocusBlurEvents(f),this.triggerUpdate(null,!0),this.visible&&this.setItems(this.selectItems||[]),this.focusableElement=f,this.addEventListener(f,"focus",(function(){return l.update()})),void this.addEventListener(f,"keydown",(function(e){var t=e.key;["Backspace","Delete"].includes(t)&&l.setValue(l.emptyValue)}));var d=f.tabIndex;this.addPlaceholder(),f.setAttribute("dir",this.i18next.dir()),null!==(t=this.choices)&&void 0!==t&&null!==(n=t.containerOuter)&&void 0!==n&&null!==(a=n.element)&&void 0!==a&&a.parentNode&&this.choices.destroy();var p=this.choicesOptions();if(r&&(this.choices=new r(f,p),this.selectOptions&&this.selectOptions.length&&this.choices.setChoices(this.selectOptions,"value","label",!0),this.component.multiple?this.focusableElement=this.choices.input.element:(this.focusableElement=this.choices.containerInner.element,this.choices.containerOuter.element.setAttribute("tabIndex","-1"),this.addEventListener(this.choices.containerOuter.element,"focus",(function(){return l.focusableElement.focus()}))),this.addFocusBlurEvents(this.focusableElement),this.itemsFromUrl&&!this.component.noRefreshOnScroll&&(this.scrollList=this.choices.choiceList.element,this.addEventListener(this.scrollList,"scroll",(function(){return l.onScroll()}))),p.removeItemButton&&this.addEventListener(f,"removeItem",(function(){l.isRemoveButtonPressed=!0}))),window&&this.choices&&this.shouldPositionDropdown&&this.addEventListener(window.document,"scroll",(function(){l.positionDropdown(!0)}),!1,!0),this.focusableElement.setAttribute("tabIndex",d),this.component.searchField){this.choices&&this.choices.input&&this.choices.input.element&&this.addEventListener(this.choices.input.element,"input",(function(e){l.isFromSearch=!!e.target.value,e.target.value?(l.serverCount=null,l.downloadedResources=[]):l.triggerUpdate()})),this.addEventListener(f,"choice",(function(){l.component.multiple&&"resource"===l.component.dataSrc&&l.isFromSearch&&l.triggerUpdate(),l.isFromSearch=!1}));var y=this.component.searchField&&(this.isSelectResource||this.isSelectURL)?1e3*(0===this.component.searchDebounce?0:this.component.searchDebounce||this.defaultSchema.searchDebounce):0;this.addEventListener(f,"search",o.default.debounce((function(e){var t;t=e,l.triggerUpdate(t.detail.value),l.positionDropdown()}),y)),this.addEventListener(f,"stopSearch",(function(){return l.triggerUpdate()})),this.addEventListener(f,"hideDropdown",(function(){l.choices&&l.choices.input&&l.choices.input.element&&(l.choices.input.element.value=""),l.updateItems(null,!0)}))}return this.addEventListener(f,"showDropdown",(function(){l.update(),l.positionDropdown()})),this.shouldPositionDropdown&&this.addEventListener(f,"highlightChoice",(function(){l.positionDropdown()})),this.choices&&p.placeholderValue&&this.choices._isSelectOneElement&&(this.addPlaceholderItem(p.placeholderValue),this.addEventListener(f,"removeItem",(function(){l.addPlaceholderItem(p.placeholderValue)}))),this.addValueOptions(),this.setChoicesValue(this.dataValue),this.isSelectResource&&this.refs.addResource&&this.addEventListener(this.refs.addResource,"click",(function(e){e.preventDefault();var t=l.ce("div"),n=l.createModal(t),r=o.default.get(l.root,"formio.projectUrl",i.GlobalFormio.getProjectUrl()),a="".concat(r,"/form/").concat(l.component.data.resource);new u.default(t,a,{}).ready.then((function(e){e.on("submit",(function(e){var t=l.valueProperty?o.default.get(e,l.valueProperty):e;l.component.multiple&&(t=[].concat(h(l.dataValue),[t])),l.setValue(t),l.triggerUpdate(),n.close()}))}))})),this.disabled=this.shouldDisabled,this.triggerUpdate(),s}}},{key:"setDropdownPosition",value:function(){var e,t,n,r,i=null===(e=this.choices)||void 0===e||null===(t=e.dropdown)||void 0===t?void 0:t.element,a=null===(n=this.choices)||void 0===n||null===(r=n.containerOuter)||void 0===r?void 0:r.element;if(i&&a){var u=a.getBoundingClientRect(),l=a.classList.contains("is-flipped");o.default.assign(i.style,{top:"".concat(l?u.top-i.offsetHeight:u.top+u.height,"px"),left:"".concat(u.left,"px"),width:"".concat(u.width,"px"),position:"fixed",bottom:"unset",right:"unset"})}}},{key:"hasDataGridAncestor",value:function(e){return!(!(e=e||this).inDataGrid&&"datagrid"!==e.type)||!!e.parent&&this.hasDataGridAncestor(e.parent)}},{key:"positionDropdown",value:function(e){var t,n=this;this.shouldPositionDropdown&&this.choices&&(null!==(t=this.choices.dropdown)&&void 0!==t&&t.isActive||!e)&&(this.setDropdownPosition(),this.itemsLoaded.then((function(){n.setDropdownPosition()})))}},{key:"isLoadingAvailable",get:function(){return!this.isScrollLoading&&this.additionalResourcesAvailable}},{key:"onScroll",value:function(){this.isLoadingAvailable&&(this.isScrollLoading=!0,this.setLoadingItem(!0),this.triggerUpdate(this.choices.input.element.value))}},{key:"attachRefreshOnBlur",value:function(){var e=this;this.component.refreshOnBlur&&this.on("blur",(function(t){e.checkRefreshOn([{instance:t,value:t.dataValue}],{fromBlur:!0})}))}},{key:"addPlaceholderItem",value:function(e){this.choices._store.activeItems.length||this.choices._addItem({value:e,label:e,choiceId:0,groupId:-1,customProperties:null,placeholder:!0,keyCode:null})}},{key:"update",value:function(){"custom"===this.component.dataSrc&&this.updateCustomItems(),this.activate()}},{key:"disabled",get:function(){return O(P(k.prototype),"disabled",this)},set:function(e){g(P(k.prototype),"disabled",e,this,!0),this.choices&&(e?(this.setDisabled(this.choices.containerInner.element,!0),this.focusableElement.removeAttribute("tabIndex"),this.choices.disable()):(this.setDisabled(this.choices.containerInner.element,!1),this.focusableElement.setAttribute("tabIndex",this.component.tabindex||0),this.choices.enable()))}},{key:"visible",get:function(){return O(P(k.prototype),"visible",this)},set:function(e){e&&!this._visible!=!e&&this.triggerUpdate(),g(P(k.prototype),"visible",e,this,!0)}},{key:"addCurrentChoices",value:function(e,t,n){var r=this;if(!e)return!1;var i=[],a=e.reduce((function(e,a){if(!a||o.default.isEmpty(a))return e;var u=!1,l=t===r.selectOptions;return t&&t.length&&o.default.each(t,(function(e){if(e._id&&a._id&&e._id===a._id)return u=!0,!1;var t=n?e.value:r.itemValue(e,l);return!(u|=o.default.isEqual(t,a))})),u?u||e:(i.push(r.selectValueAndLabel(a)),!0)}),!1);return i.length&&(this.choices&&this.choices.setChoices(i,"value","label"),i.map((function(e){r.addOption(e.value,e.label)}))),a}},{key:"getValueAsString",value:function(e,t){var n=this;return this.component.multiple&&Array.isArray(e)?e.map((function(e){return n.asString(e,t)})).join(", "):this.asString(e,t)}},{key:"getValue",value:function(){if(this.viewOnly||this.loading||!this.component.lazyLoad&&!this.selectOptions.length||!this.element)return this.dataValue;var e=this.emptyValue;if(this.choices)e=this.choices.getValue(!0),!this.component.multiple&&this.component.placeholder&&e===this.t(this.component.placeholder,{_userInput:!0})&&(e=this.emptyValue);else if(this.refs.selectContainer){if(e=this.refs.selectContainer.value,""===this.valueProperty||this.isEntireObjectDisplay()){if(""===e)return{};var t=this.selectOptions[e]||this.selectOptions.find((function(t){return t.id===e}));t&&o.default.isObject(t.value)&&(e=t.value)}}else e=this.dataValue;return null==e&&(e=""),e}},{key:"redraw",value:function(){var e=O(P(k.prototype),"redraw",this).call(this);return this.triggerUpdate(),e}},{key:"normalizeSingleValue",value:function(e,t){var n=this;if(!o.default.isNil(e)){var r=o.default.isObject(e);if(r&&0===Object.keys(e).length)return e;if(t){var i,a=this.component.reference&&null!=e&&e._id?e._id.toString():e,u=!r||this.component.reference;if(a&&u&&this.templateData&&this.templateData[a]&&null!==(i=this.root)&&void 0!==i&&i.submission){var l=this.root.submission;l.metadata||(l.metadata={}),l.metadata.selectData||(l.metadata.selectData={});var s=this.templateData[a];if(this.component.multiple){s={};var c=this.dataValue;c&&o.default.isArray(c)&&c.length&&c.forEach((function(e){var t=n.component.reference?e._id.toString():e;s[t]=n.templateData[t]})),s[e]=this.templateData[e]}o.default.set(l.metadata.selectData,this.path,s)}}var f=this.component.dataType||"auto",d={value:e,number:function(){var t=Number(this.value),n=e.toString()===t.toString();return!Number.isNaN(t)&&Number.isFinite(t)&&""!==e&&n&&(this.value=t),this},boolean:function(){return!o.default.isString(this.value)||"true"!==this.value.toLowerCase()&&"false"!==this.value.toLowerCase()||(this.value="true"===this.value.toLowerCase()),this},string:function(){return this.value=String(this.value),this},object:function(){return this},auto:function(){return o.default.isObject(this.value)?this.value=this.object().value:this.value=this.string().number().boolean().value,this}};try{return d[f]().value}catch(t){return console.warn("Failed to normalize value",t),e}}}},{key:"normalizeValue",value:function(e){var t=this;return this.component.multiple&&Array.isArray(e)?e.map((function(e){return t.normalizeSingleValue(e,!0)})):O(P(k.prototype),"normalizeValue",this).call(this,this.normalizeSingleValue(e,!0))}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.dataValue;if("html5"===this.component.widget&&(o.default.isEqual(e,r)||o.default.isEqual(r,{})&&o.default.isEqual(n,{}))&&!n.fromSubmission)return!1;var i=this.updateValue(e,n);e=this.dataValue;var a=!this.isEmpty(r),u=!this.isEmpty(e);if(this.component.multiple&&Array.isArray(e)?e=e.map((function(e){return"boolean"==typeof e||"number"==typeof e?e.toString():e})):"boolean"!=typeof e&&"number"!=typeof e||(e=e.toString()),this.isHtmlRenderMode()&&n&&n.fromSubmission&&i)return this.itemsLoaded.then((function(){t.redraw()})),i;if(this.loading)return i;if(this.isInitApiCallNeeded(u)){this.loading=!0,this.lazyLoadInit=!0;var l=this.component.searchField||this.component.valueProperty;return this.triggerUpdate(o.default.get(e.data||e,l,e),!0),i}return this.itemsLoaded.then((function(){t.addValueOptions(),t.setChoicesValue(e,a,n)})),i}},{key:"isInitApiCallNeeded",value:function(e){return this.component.lazyLoad&&!this.lazyLoadInit&&!this.active&&!this.selectOptions.length&&e&&this.shouldInitialLoad&&this.visible&&(this.component.searchField||this.component.valueProperty)}},{key:"setChoicesValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=!this.isEmpty(e)||n.fromSubmission;if(t=void 0===t||t,this.choices)if(r){this.choices.removeActiveItems();var i=Array.isArray(e)&&this.component.multiple?e:[e];this.addCurrentChoices(i,this.selectOptions,!0)||this.choices.setChoices(this.selectOptions,"value","label",!0),this.choices.setChoiceByValue(i)}else(t||n.resetValue)&&this.choices.removeActiveItems();else if(r){var a=Array.isArray(e)?e:[e];if(!o.default.isEqual(this.dataValue,this.defaultValue)&&this.selectOptions.length<2||this.selectData&&n.fromSubmission){var u=this.selectValueAndLabel(this.dataValue),l=u.value,s=u.label;this.addOption(l,s)}o.default.each(this.selectOptions,(function(e){o.default.each(a,(function(t){if(""===e.value&&(e.value={}),o.default.isEqual(t,e.value)&&e.element)return e.element.selected=!0,e.element.setAttribute("selected","selected"),!1}))}))}else o.default.each(this.selectOptions,(function(e){e.element&&(e.element.selected=!1,e.element.removeAttribute("selected"))}))}},{key:"itemsLoaded",get:function(){return this._itemsLoaded||l.default.resolve()},set:function(e){this._itemsLoaded=e}},{key:"validateValueAvailability",value:function(e,t){var n=this;if(!(0,s.boolValue)(e)||!t)return!0;var r=this.getOptionsValues();return!!r&&(o.default.isObject(t)?-1!==r.findIndex((function(e){return function(e){var r=n.normalizeSingleValue(e,!0);if(!o.default.isObject(r))return!1;try{return JSON.stringify(r)===JSON.stringify(t)}catch(e){return console.warn.error("Error while comparing items",e),!1}}(e)})):-1!==r.findIndex((function(e){return n.normalizeSingleValue(e)===t})))}},{key:"getOptionValue",value:function(e){return o.default.isObject(e)&&this.isEntireObjectDisplay()?this.normalizeSingleValue(e):o.default.isObject(e)&&(this.valueProperty||"resource"!==this.component.key)?e:o.default.isObject(e)&&!this.valueProperty?this.interpolate(this.component.template,{item:e}).replace(/<\/?[^>]+(>|$)/g,""):o.default.isNull(e)?this.emptyValue:String(this.normalizeSingleValue(e))}},{key:"getOptionsValues",value:function(){var e=this,t=[];switch(this.component.dataSrc){case"values":t=this.component.data.values;break;case"json":t=this.component.data.json;break;case"custom":t=this.getCustomItems()}if("string"==typeof t)try{t=JSON.parse(t)}catch(e){console.warn(e.message),t=[]}if(Array.isArray(t))return t.map((function(t){return e.getOptionValue(e.itemValue(t))}))}},{key:"deleteValue",value:function(){this.setValue("",{noUpdateEvent:!0}),this.unset()}},{key:"validateMultiple",value:function(){return!1}},{key:"isBooleanOrNumber",value:function(e){return"number"==typeof e||"boolean"==typeof e}},{key:"getNormalizedValues",value:function(){var e=this;if(this.component&&this.component.data&&this.component.data.values)return this.component.data.values.map((function(t){return{label:t.label,value:String(e.normalizeSingleValue(t.value))}}))}},{key:"asString",value:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=function(e,t){return t?(Array.isArray(e)?e.forEach((function(e){return e[t]=e[t].toString()})):e[t]=e[t].toString(),e):(n.isBooleanOrNumber(e)&&(e=e.toString()),Array.isArray(e)&&e.some((function(e){return n.isBooleanOrNumber(e)}))&&(e=e.map((function(e){n.isBooleanOrNumber(e)&&(e=e.toString())}))),e)};if(e=i(e=null!==(t=e)&&void 0!==t?t:this.getValue()),["values","custom"].includes(this.component.dataSrc)&&!this.asyncCustomValues()){var a,u="values"===this.component.dataSrc?{items:i(this.getNormalizedValues(),"value"),valueProperty:"value"}:{items:i(this.getCustomItems(),this.valueProperty),valueProperty:this.valueProperty},l=u.items,c=u.valueProperty,f=function(){var t=o.default.find(l,[c,e]),r=n.defaultSchema.data.values||[];return o.default.isEqual(t,r[0])?"-":t};e=this.component.multiple&&Array.isArray(e)?o.default.filter(l,(function(t){return e.includes(t.value)})):c?null!==(a=f())&&void 0!==a?a:{value:e,label:e}:e}if(o.default.isString(e))return e;var d=function(e){var t=n.itemTemplate(e);return r.csv&&t?(0,s.unescapeHTML)(t):t};if(Array.isArray(e)){var p=[];return e.forEach((function(e){return p.push(d(e))})),"resource"===this.component.dataSrc&&p.length>0?p.join(", "):p.length>0?p.join("
    "):"-"}return this.isEntireObjectDisplay()&&o.default.isObject(e)?JSON.stringify(e):o.default.isNil(e)?"-":d(e)}},{key:"detach",value:function(){var e,t;this.off("blur"),this.choices&&(null!==(e=this.choices.containerOuter)&&void 0!==e&&null!==(t=e.element)&&void 0!==t&&t.parentNode&&this.choices.destroy(),this.choices=null),O(P(k.prototype),"detach",this).call(this)}},{key:"focus",value:function(){this.focusableElement&&(O(P(k.prototype),"focus",this).call(this),this.focusableElement.focus())}},{key:"setErrorClasses",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.element;O(P(k.prototype),"setErrorClasses",this).call(this,e,t,n,r,o),this.choices?O(P(k.prototype),"setErrorClasses",this).call(this,[this.choices.containerInner.element],t,n,r,o):O(P(k.prototype),"setErrorClasses",this).call(this,[this.refs.selectContainer],t,n,r,o)}}],c=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n {\n var item = {};\n _.each(templateKeys, k => _.set(item, k, _.get(i, k)));\n return item;\n })\n "),t}})}},{key:"savedValueTypes",value:function(e){var t=s.componentValueTypes.boolean,n=s.componentValueTypes.string,r=s.componentValueTypes.number,o=s.componentValueTypes.object,i=s.componentValueTypes.array,a=e.dataType,u=e.reference;return(0,s.getComponentSavedTypes)(e)||(u?[o]:"object"===a?[o,i]:s.componentValueTypes[a]?[s.componentValueTypes[a]]:[t,n,r,o,i])}}],n&&v(t.prototype,n),c&&v(t,c),Object.defineProperty(t,"prototype",{writable:!1}),k}(a.default);t.default=x},12832:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92087);var r=n(82531),o=[{key:"dataSrc",data:{values:[{label:"Values",value:"values"},{label:"URL",value:"url"},{label:"Resource",value:"resource"},{label:"Custom",value:"custom"},{label:"Raw JSON",value:"json"}]}},{type:"textfield",weight:10,input:!0,key:"indexeddb.database",label:"Database name",tooltip:"The name of the indexeddb database.",conditional:{json:{"===":[{var:"data.dataSrc"},"indexeddb"]}}},{type:"textfield",input:!0,key:"indexeddb.table",label:"Table name",weight:16,tooltip:"The name of table in the indexeddb database.",conditional:{json:{"===":[{var:"data.dataSrc"},"indexeddb"]}}},{type:"textarea",as:"json",editor:"ace",weight:18,input:!0,key:"indexeddb.filter",label:"Row Filter",tooltip:"Filter table items that match the object.",defaultValue:{},conditional:{json:{"===":[{var:"data.dataSrc"},"indexeddb"]}}},{type:"textarea",as:"json",editor:"ace",weight:10,input:!0,key:"data.json",label:"Data Source Raw JSON",tooltip:"A valid JSON array to use as a data source.",description:'
    Example:
    ["apple", "banana", "orange"].
    Example 2:
    [{"name": "John", "email": "john.doe@test.com"}, {"name": "Jane", "email": "jane.doe@test.com"}].
    ',conditional:{json:{"===":[{var:"data.dataSrc"},"json"]}}},{type:"checkbox",input:!0,label:"Lazy Load Data",key:"lazyLoad",tooltip:"When set, this will not fire off the request to the URL until this control is within focus. This can improve performance if you have many Select dropdowns on your form where the API's will only fire when the control is activated.",weight:11,conditional:{json:{and:[{in:[{var:"data.dataSrc"},["resource","url"]]},{"!==":[{var:"data.widget"},"html5"]}]}}},{type:"datagrid",input:!0,label:"Data Source Values",key:"data.values",tooltip:"Values to use as the data source. Labels are shown in the select field. Values are the corresponding values saved with the submission.",weight:10,reorder:!0,defaultValue:[{label:"",value:""}],components:[{label:"Label",key:"label",input:!0,type:"textfield"},{label:"Value",key:"value",input:!0,type:"textfield",allowCalculateOverride:!0,calculateValue:"value = _.camelCase(row.label);"}],conditional:{json:{"===":[{var:"data.dataSrc"},"values"]}}},{type:"select",input:!0,dataSrc:"url",data:{url:"/form?type=resource&limit=1000000&select=_id,title"},authenticate:!0,template:"{{ item.title }}",valueProperty:"_id",clearOnHide:!1,label:"Resource",key:"data.resource",lazyLoad:!1,weight:10,tooltip:"The resource to be used with this field.",conditional:{json:{"===":[{var:"data.dataSrc"},"resource"]}}},{type:"textfield",input:!0,label:"Data Path",key:"selectValues",weight:12,description:"The object path to the iterable items.",tooltip:"The property within the source data, where iterable items reside. For example: results.items or results[0].items",conditional:{json:{"===":[{var:"data.dataSrc"},"url"]}}},{type:"select",input:!0,label:"Value Property",key:"valueProperty",skipMerge:!0,clearOnHide:!0,tooltip:"The field to use as the value.",weight:11,refreshOn:"data.resource",template:"{{ item.label }}",valueProperty:"key",dataSrc:"url",lazyLoad:!1,onSetItems:function(e,t){var n="resource"===t.type?[{label:"{Entire Object}",key:"data"}]:[];return(0,r.eachComponent)(t.components,(function(e,t){e.input&&n.push({label:e.label||e.key,key:"data.".concat(t)})})),n},onChange:function(e){if(e&&e.flags&&e.flags.modified){var t=e.instance.data.valueProperty,n="{{ item.".concat(t||"data"," }}"),r=t?"".concat(t,"__regex"):"";e.instance.root.getComponent("template").setValue(n),e.instance.root.getComponent("searchField").setValue(r)}},data:{url:"/form/{{ data.data.resource }}"},conditional:{json:{and:[{"===":[{var:"data.dataSrc"},"resource"]},{"!==":[{var:"data.reference"},!0]},{var:"data.data.resource"}]}}},{type:"select",input:!0,label:"Storage Type",key:"dataType",clearOnHide:!0,tooltip:"The type to store the data. If you select something other than autotype, it will force it to that type.",weight:12,template:"{{ item.label }}",dataSrc:"values",data:{values:[{label:"Autotype",value:"auto"},{label:"String",value:"string"},{label:"Number",value:"number"},{label:"Boolean",value:"boolean"},{label:"Object",value:"object"}]}},{type:"textfield",input:!0,key:"idPath",weight:12,label:"ID Path",placeholder:"id",tooltip:"Path to the select option id."},{type:"textfield",input:!0,label:"Select Fields",key:"selectFields",tooltip:"The properties on the resource to return as part of the options. Separate property names by commas. If left blank, all properties will be returned.",placeholder:"Comma separated list of fields to select.",weight:14,conditional:{json:{and:[{"===":[{var:"data.dataSrc"},"resource"]},{"===":[{var:"data.valueProperty"},""]}]}}},{type:"checkbox",input:!0,key:"disableLimit",label:"Disable limiting response",tooltip:"When enabled the request will not include the limit and skip options in the query string",weight:15,conditional:{json:{"===":[{var:"data.dataSrc"},"url"]}}},{type:"textfield",input:!0,key:"searchField",label:"Search Query Name",weight:16,description:"Name of URL query parameter",tooltip:"The name of the search querystring parameter used when sending a request to filter results with. The server at the URL must handle this query parameter.",conditional:{json:{in:[{var:"data.dataSrc"},["url","resource"]]}}},{type:"number",input:!0,key:"searchDebounce",label:"Search request delay",weight:16,description:"The delay (in seconds) before the search request is sent.",tooltip:"The delay in seconds before the search request is sent, measured from the last character input in the search field.",validate:{min:0,customMessage:"",json:"",max:1},delimiter:!1,requireDecimal:!1,encrypted:!1,defaultValue:.3,conditional:{json:{in:[{var:"data.dataSrc"},["url","resource"]]}}},{type:"number",input:!0,key:"minSearch",weight:17,label:"Minimum Search Length",tooltip:"The minimum amount of characters they must type before a search is made.",defaultValue:0,conditional:{json:{and:[{"===":[{var:"data.dataSrc"},"url"]},{"!=":[{var:"data.searchField"},""]}]}}},{type:"textfield",input:!0,key:"filter",label:"Filter Query",weight:18,description:"The filter query for results.",tooltip:"Use this to provide additional filtering using query parameters.",conditional:{json:{in:[{var:"data.dataSrc"},["url","resource"]]}}},{type:"textfield",input:!0,key:"sort",label:"Sort Query",weight:18,description:"The sort query for results",tooltip:"Use this to provide additional sorting using query parameters",conditional:{json:{in:[{var:"data.dataSrc"},["url","resource"]]}}},{type:"number",input:!0,key:"limit",label:"Limit",weight:18,description:"Maximum number of items to view per page of results.",tooltip:"Use this to limit the number of items to request or view.",clearOnHide:!1,conditional:{json:{and:[{in:[{var:"data.dataSrc"},["url","resource"]]},{"!==":[{var:"data.disableLimit"},!0]}]}}},{type:"textarea",input:!0,key:"data.custom",label:"Custom Values",editor:"ace",rows:10,weight:14,placeholder:"values = data['mykey'] or values = Promise.resolve(['myValue'])",tooltip:"Write custom code to return the value options or a promise with value options. The form data object is available.",conditional:{json:{"===":[{var:"data.dataSrc"},"custom"]}}},{type:"select",input:!0,key:"refreshOn",label:"Refresh Options On",weight:19,tooltip:"Refresh data when another field changes.",dataSrc:"custom",valueProperty:"value",data:{custom:function(e){var t=[];return t.push({label:"Any Change",value:"data"}),e.utils.eachComponent(e.instance.options.editForm.components,(function(n,r){n.key!==e.data.key&&t.push({label:n.label||n.key,value:r})})),t}},conditional:{json:{in:[{var:"data.dataSrc"},["url","resource","values","custom"]]}}},{type:"select",input:!0,key:"refreshOnBlur",label:"Refresh Options On Blur",weight:19,tooltip:"Refresh data when another field is blured.",dataSrc:"custom",valueProperty:"value",data:{custom:function(e){var t=[];return t.push({label:"Any Change",value:"data"}),e.utils.eachComponent(e.instance.options.editForm.components,(function(n,r){n.key!==e.data.key&&t.push({label:n.label||n.key,value:r})})),t}},conditional:{json:{in:[{var:"data.dataSrc"},["url","resource","values"]]}}},{type:"checkbox",input:!0,weight:20,key:"clearOnRefresh",label:"Clear Value On Refresh Options",defaultValue:!1,tooltip:"When the Refresh On field is changed, clear this components value.",conditional:{json:{in:[{var:"data.dataSrc"},["url","resource","values","custom"]]}}},{type:"checkbox",input:!0,weight:21,key:"searchEnabled",label:"Enable Static Search",defaultValue:!0,tooltip:"When checked, the select dropdown will allow for searching within the static list of items provided."},{type:"checkbox",input:!0,weight:21,key:"noRefreshOnScroll",label:"Disable Options Refresh When Scrolling",defaultValue:!1,tooltip:"When checked, the select with search input won't perform new api requests when scrolling through the list of options.",conditional:{json:{and:[{in:[{var:"data.dataSrc"},["url","resource"]]},{"===":[{var:"data.searchEnabled"},!0]}]}}},{label:"Search Threshold",mask:!1,tableView:!0,alwaysEnabled:!1,type:"number",input:!0,key:"selectThreshold",validate:{min:0,customMessage:"",json:"",max:1},delimiter:!1,requireDecimal:!1,encrypted:!1,defaultValue:.3,weight:22,tooltip:"At what point does the match algorithm give up. A threshold of 0.0 requires a perfect match, a threshold of 1.0 would match anything."},{type:"checkbox",input:!0,weight:23,key:"addResource",label:"Add Resource",tooltip:"Allows to create a new resource while entering a submission.",conditional:{json:{"===":[{var:"data.dataSrc"},"resource"]}}},{type:"textfield",label:"Add Resource Label",key:"addResourceLabel",tooltip:"Set the text of the Add Resource button.",placeholder:"Add Resource",weight:24,input:!0,conditional:{json:{and:[{"===":[{var:"data.dataSrc"},"resource"]},{"!!":{var:"data.addResource"}}]}}},{type:"checkbox",input:!0,weight:25,key:"reference",label:"Save as reference",tooltip:"Using this option will save this field as a reference and link its value to the value of the origin record.",conditional:{json:{"===":[{var:"data.dataSrc"},"resource"]}}},{type:"checkbox",input:!0,weight:27,key:"readOnlyValue",label:"Read Only Value",tooltip:"Check this if you would like to show just the value when in Read Only mode."},{type:"textarea",as:"json",editor:"ace",weight:28,input:!0,key:"customOptions",label:"Choices.js options",tooltip:"A raw JSON object to use as options for the Select component (Choices JS).",defaultValue:{}},{type:"checkbox",input:!0,weight:29,key:"useExactSearch",label:"Use exact search",tooltip:"Disables search algorithm threshold."}];t.default=o},47158:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{type:"select",input:!0,weight:20,tooltip:"Select the type of widget you'd like to use.",key:"widget",defaultValue:"choicesjs",label:"Widget Type",dataSrc:"values",data:{values:[{label:"ChoicesJS",value:"choicesjs"},{label:"HTML 5",value:"html5"}]}},{weight:1230,type:"checkbox",label:"Unique Options",tooltip:"Display only unique dropdown options.",key:"uniqueOptions",input:!0}]},47446:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{weight:50,type:"checkbox",label:"Perform server validation of remote value",tooltip:"Check this if you would like for the server to perform a validation check to ensure the selected value is an available option. This requires a Search query to ensure a record is found.",key:"validate.select",input:!0,conditional:{json:{var:"data.searchField"}}},{weight:52,type:"checkbox",label:"Allow only available values",tooltip:"Check this if you would like to perform a validation check to ensure the selected value is an available option (only for synchronous values).",key:"validate.onlyAvailableItems",input:!0,conditional:{json:{in:[{var:"data.dataSrc"},["values","json","custom"]]}}}]},99966:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:this.dataValue,t=!0;for(var n in e)if(e.hasOwnProperty(n)&&e[n]){t=!1;break}return t}},{key:"getValue",value:function(){if(this.viewOnly||!this.refs.input||!this.refs.input.length)return this.dataValue;var e={};return r.default.each(this.refs.input,(function(t){e[t.value]=!!t.checked})),e}},{key:"normalizeValue",value:function(e){var t=this;"object"!==c(e=e||{})&&(e="string"==typeof e?s({},e,!0):{}),Array.isArray(e)&&r.default.each(e,(function(t){e[t]=!0}));var n=r.default.keys(r.default.pickBy(e,(function(e){return e})));if(this.isSelectURL&&this.templateData&&r.default.every(n,(function(e){return t.templateData[e]}))){var o=this.root.submission;o.metadata.selectData||(o.metadata.selectData={});var i=[];n.forEach((function(e){return i.push(t.templateData[e])})),r.default.set(o.metadata.selectData,this.path,i)}return e}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.updateValue(e,t);return e=this.dataValue,this.isHtmlRenderMode()?n&&this.redraw():r.default.each(this.refs.input,(function(t){r.default.isUndefined(e[t.value])&&(e[t.value]=!1),t.checked=!!e[t.value]})),n}},{key:"getValueAsString",value:function(e){return e?this.isSelectURL?(0,r.default)(e).pickBy((function(e){return e})).keys().join(", "):(0,r.default)(this.component.values||[]).filter((function(t){return e[t.value]})).map("label").join(", "):""}},{key:"setSelectedClasses",value:function(){var e=this;if(this.refs.wrapper){var t=this.dataValue,n=Object.keys(t);this.refs.wrapper.forEach((function(o,i){var a=n[i],u=e.refs.input[i];(null==u?void 0:u.value.toString())!==a&&(a=n.find((function(e){return(null==u?void 0:u.value.toString())===e})));var l=t[a];l&&a||e.isSelectURL&&!e.shouldLoad&&e.listData&&-1!==r.default.findIndex(e.selectData,e.listData[i])?(e.addClass(o,e.optionSelectedClass),u.setAttribute("checked","true")):!l&&a&&(e.removeClass(o,e.optionSelectedClass),u.removeAttribute("checked"))}))}}},{key:"setInputsDisabled",value:function(e,t){this.refs.input&&this.refs.input.forEach((function(n){(t&&!n.checked||!t)&&(n.disabled=e)}))}},{key:"checkComponentValidity",value:function(e,t,n,r){var o=this,i=this.component.validate.minSelectedCount,a=this.component.validate.maxSelectedCount,u=this.isValid(e,t);if((a||i)&&!this.shouldSkipValidation(e,t,n)){var l=Object.keys(this.validationValue).reduce((function(e,t){return o.validationValue[t]&&e++,e}),0);if(a&&l>=a?this.setInputsDisabled(!0,!0):a&&!this.shouldDisabled&&this.setInputsDisabled(!1),!u&&a&&l>a){var s=this.t(this.component.maxSelectedCountMessage||"You can only select up to {{maxCount}} items.",{maxCount:a});return this.setCustomValidity(s,t),!1}if(!u&&i&&l1&&void 0!==arguments[1]?arguments[1]:{},n=m(w(y.prototype),"setValue",this).call(this,e,t);return this.refs.signatureImage&&(this.options.readOnly||this.disabled)&&(this.refs.signatureImage.setAttribute("src",e),this.showCanvas(!1)),this.signaturePad&&(e?n&&this.triggerChange():this.signaturePad.clear()),this.signaturePad&&this.dataValue&&this.signaturePad.isEmpty()&&this.setDataToSigaturePad(),n}},{key:"showCanvas",value:function(e){e?(this.refs.canvas&&(this.refs.canvas.style.display="inherit"),this.refs.signatureImage&&(this.refs.signatureImage.style.display="none")):(this.refs.canvas&&(this.refs.canvas.style.display="none"),this.refs.signatureImage&&(this.refs.signatureImage.style.display="inherit",this.refs.signatureImage.style.maxHeight="100%"))}},{key:"onDisabled",value:function(){this.showCanvas(!m(w(y.prototype),"disabled",this)),this.signaturePad&&(m(w(y.prototype),"disabled",this)?(this.signaturePad.off(),this.refs.refresh&&this.refs.refresh.classList.add("disabled"),this.refs.signatureImage&&this.dataValue&&this.refs.signatureImage.setAttribute("src",this.dataValue)):(this.signaturePad.on(),this.refs.refresh&&this.refs.refresh.classList.remove("disabled")))}},{key:"checkSize",value:function(e,t){if(this.refs.padBody&&(e||this.refs.padBody&&this.refs.padBody.offsetWidth!==this.currentWidth)){this.scale=e?t:this.scale,this.currentWidth=this.refs.padBody.offsetWidth;var n=this.currentWidth*this.scale,r=this.ratio?n/this.ratio:this.refs.padBody.offsetHeight*this.scale,o=this.ratio?r:this.refs.padBody.offsetHeight*this.scale;this.refs.canvas.width=n,this.refs.canvas.height=r>o?o:r,this.refs.canvas.style.maxWidth="".concat(this.currentWidth*this.scale,"px"),this.refs.canvas.style.maxHeight="".concat(o,"px");var i=this.refs.canvas.getContext("2d");i.setTransform(1,0,0,1,0,0),i.scale(1/this.scale,1/this.scale),i.fillStyle=this.signaturePad.backgroundColor,i.fillRect(0,0,this.refs.canvas.width,this.refs.canvas.height),this.signaturePad.clear(),this.dataValue&&this.setDataToSigaturePad(),this.showCanvas(!0)}}},{key:"renderElement",value:function(e,t){return this.renderTemplate("signature",{element:m(w(y.prototype),"renderElement",this).call(this,e,t),required:u.default.get(this.component,"validate.required",!1)})}},{key:"hasModalSaveButton",get:function(){return!1}},{key:"getModalPreviewTemplate",value:function(){return this.renderTemplate("modalPreview",{previewText:this.dataValue?""):this.t("Click to Sign")})}},{key:"attach",value:function(e){var t=this;this.loadRefs(e,{canvas:"single",refresh:"single",padBody:"single",signatureImage:"single"});var n=m(w(y.prototype),"attach",this).call(this,e);return this.refs.refresh&&this.options.readOnly&&this.refs.refresh.classList.add("disabled"),this.refs.canvas&&(this.signaturePad=new o.default(this.refs.canvas,{minWidth:this.component.minWidth,maxWidth:this.component.maxWidth,penColor:this.component.penColor,backgroundColor:this.component.backgroundColor}),this.signaturePad.addEventListener("endStroke",(function(){return t.setValue(t.signaturePad.toDataURL())})),this.refs.signatureImage.setAttribute("src",this.signaturePad.toDataURL()),this.onDisabled(),this.refs.padBody&&(this.refs.padBody.style.maxWidth||(this.refs.padBody.style.maxWidth="100%"),this.builderMode||this.options.preview||(this.observer=new i.default((function(){t.checkSize()})),this.observer.observe(this.refs.padBody)),this.addEventListener(window,"resize",u.default.debounce((function(){return t.checkSize()}),10)),setTimeout(function e(){this.refs.padBody&&this.refs.padBody.offsetWidth?this.checkSize():setTimeout(e.bind(this),20)}.bind(this),20))),this.addEventListener(this.refs.refresh,"click",(function(e){e.preventDefault(),t.showCanvas(!0),t.signaturePad.clear(),t.setValue(t.defaultValue)})),this.setValue(this.dataValue),n}},{key:"detach",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.signaturePad&&this.signaturePad.off(),this.signaturePad=null,this.currentWidth=0,m(w(y.prototype),"detach",this).call(this)}},{key:"getValueAsString",value:function(e){return u.default.isUndefined(e)&&this.inDataTable?"":e?"Yes":"No"}},{key:"focus",value:function(){this.refs.padBody.focus()}},{key:"setDataToSigaturePad",value:function(){this.signaturePad.fromDataURL(this.dataValue,{ratio:1,width:this.refs.canvas.width,height:this.refs.canvas.height})}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return!1;o.default.each(this.component.questions,(function(n){o.default.each(t.refs.input,(function(r){r.name===t.getInputName(n)&&(r.checked=r.value===e[n.value])}))}));var r=this.updateValue(e,n);return r&&this.isHtmlRenderMode()&&this.redraw(),r}},{key:"emptyValue",get:function(){return{}}},{key:"defaultValue",get:function(){var e=y(g(h.prototype),"defaultValue",this);if(e&&!o.default.isObject(e)&&this.component.values.some((function(t){return t.value===e}))){var t={};return this.component.questions.forEach((function(n){t[n.value]=e})),t}return e}},{key:"getValue",value:function(){var e=this;if(this.viewOnly||!this.refs.input||!this.refs.input.length)return this.dataValue;var t={};return o.default.each(this.component.questions,(function(n){o.default.each(e.refs.input,(function(r){if(r.checked&&r.name===e.getInputName(n))return t[n.value]=r.value,!1}))})),t}},{key:"disabled",get:function(){return y(g(h.prototype),"disabled",this)},set:function(e){(function(e,t,n,r,o){if(!d(e,t,n,r||e)&&o)throw new Error("failed to set property")})(g(h.prototype),"disabled",e,this,!0),o.default.each(this.refs.input,(function(e){e.disabled=!0}))}},{key:"validateRequired",value:function(e,t){return!(0,a.boolValue)(e)||this.component.questions.reduce((function(e,n){return e&&Boolean(t[n.value])}),!0)}},{key:"getInputName",value:function(e){return"".concat(this.options.name,"[").concat(e.value,"]")}},{key:"getValueAsString",value:function(e,t){var n=this;if(null!=t&&t.email){var r='\n \n \n \n \n \n \n \n \n ';return o.default.forIn(e,(function(e,t){var i=o.default.find(n.component.questions,["value",t]),a=o.default.find(n.component.values,["value",e]);i&&a&&(r+='\n \n \n \n \n "))})),r+="
    QuestionValue
    '.concat(i.label,'').concat(a.label,"
    "}if(o.default.isPlainObject(e)){var i=this.component,a=i.values,u=void 0===a?[]:a,l=i.questions,s=void 0===l?[]:l;return o.default.isEmpty(e)?"":o.default.map(e,(function(e,t){var n=o.default.get(o.default.find(u,(function(t){return o.default.isEqual(t.value,e)})),"label",e),r=o.default.get(o.default.find(s,(function(e){return o.default.isEqual(e.value,t)})),"label",t);return"".concat(r,": ").concat(n)})).join("; ")}return y(g(h.prototype),"getValueAsString",this).call(this,e,t)}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n4&&void 0!==arguments[4]?arguments[4]:this.element;this.component.modalEdit&&y(v(m.prototype),"setErrorClasses",this).call(this,e,t,n,r,i),e.forEach((function(e){o.addClass(e,"is-invalid"),"openModal"!==e.getAttribute("ref")&&(o.options.highlightErrors?o.addClass(e,"tab-error"):o.addClass(e,"has-error"))}))}},{key:"clearErrorClasses",value:function(e){var t=this;if(!this.options.server&&this.rendered){if(this.component.modalEdit){var n=Array.isArray(e)||e instanceof NodeList?this.element:e;y(v(m.prototype),"clearErrorClasses",this).call(this,n)}(e=Array.isArray(e)||e instanceof NodeList?e:[e]).forEach((function(e){t.removeClass(e,"is-invalid"),t.removeClass(e,"tab-error"),t.removeClass(e,"has-error")}))}}},{key:"handleTabsValidation",value:function(){if(this.refs[this.tabLinkKey]&&this.refs[this.tabLinkKey].length&&this.tabs.length){this.clearErrorClasses(this.refs[this.tabLinkKey]);var e=this.tabs.reduce((function(e,t,n){return t.some((function(e){return!!e.error}))?[].concat(u(e),[n]):e}),[]);if(e.length){var t=u(this.refs[this.tabLinkKey]).filter((function(t,n){return e.includes(n)}));this.setErrorClasses(t)}}}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},r=m(w(y.prototype),"setValue",this).call(this,e,n);if(this.choices){var o=this.dataValue;if(this.choices.removeActiveItems(),o){"string"==typeof o&&(o=o.split(this.delimiter).filter((function(e){return e})));var i=Array.isArray(o)?o:[o];this.choices.setValue(i.map((function(e){return t.sanitize(e,t.shouldSanitizeValue)})))}}return r}},{key:"disabled",get:function(){return m(w(y.prototype),"disabled",this)},set:function(e){(function(e,t,n,r,o){if(!p(e,t,n,r||e)&&o)throw new Error("failed to set property")})(w(y.prototype),"disabled",e,this,!0),this.choices&&(e?this.choices.disable():this.choices.enable())}},{key:"focus",value:function(){this.refs.input&&this.refs.input.length&&this.refs.input[0].parentNode.lastChild.focus()}},{key:"getValueAsString",value:function(e){if(!e)return"";if(Array.isArray(e))return e.join("".concat(this.delimiter||","," "));var t=e.toString();return this.sanitize(t,this.shouldSanitizeValue)}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n"},{weight:22,type:"number",input:!0,key:"maxTags",label:"Max Tags",defaultValue:0,tooltip:"The maximum amount of tags that can be added. 0 for infinity."},{weight:24,type:"select",input:!0,key:"storeas",label:"Store As",dataSrc:"values",data:{values:[{label:"String (CSV)",value:"string"},{label:"Array of Tags",value:"array"}]}}]},3611:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n");return this.renderTemplate("well",{children:o,nestedKey:this.key,value:e})}return this.renderTemplate("input",{prefix:this.prefix,suffix:this.suffix,input:n,value:e,index:t})}},{key:"autoExpand",get:function(){return this.component.autoExpand}},{key:"updateEditorValue",value:function(e,t){t=this.getConvertedValue(this.trimBlanks(t));var n=this.dataValue;if(this.component.multiple&&Array.isArray(n)){var r=i.default.clone(n);r[e]=t,t=r}i.default.isEqual(t,n)||i.default.isEmpty(t)&&i.default.isEmpty(n)||this.updateValue(t,{modified:!this.autoModified},e),this.autoModified=!1}},{key:"attachElement",value:function(e,t){var n=this;if(this.autoExpand&&(this.isPlain||this.options.readOnly||this.options.htmlView)&&"TEXTAREA"===e.nodeName&&this.addAutoExpanding(e,t),this.options.readOnly)return e;this.component.wysiwyg&&!this.component.editor&&(this.component.editor="ckeditor");var r=i.default.isEmpty(this.component.wysiwyg)?this.wysiwygDefault[this.component.editor]||this.wysiwygDefault.default:this.component.wysiwyg;return this.editorsReady[t]=new a.default((function(o){switch(n.component.editor){case"ace":r||(r={}),r.mode=n.component.as?"ace/mode/".concat(n.component.as):"ace/mode/javascript",n.addAce(e,r,(function(e){return n.updateEditorValue(t,e)})).then((function(e){n.editors[t]=e;var r=n.dataValue;return r=n.component.multiple&&Array.isArray(r)?r[t]:r,e.setValue(n.setConvertedValue(r,t)),o(e),e})).catch((function(e){return console.warn(e)}));break;case"quill":(r.hasOwnProperty("toolbarGroups")||r.hasOwnProperty("toolbar"))&&(console.warn("The WYSIWYG settings are configured for CKEditor. For this renderer, you will need to use configurations for the Quill Editor. See https://quilljs.com/docs/configuration for more information."),r=n.wysiwygDefault.quill),n.addQuill(e,r,(function(){return n.updateEditorValue(t,n.editors[t].root.innerHTML)})).then((function(e){if(n.editors[t]=e,n.component.isUploadEnabled){var r=n;e.getModule("uploader").options.handler=function(){for(var e,t=arguments.length,n=new Array(t),o=0;o2&&void 0!==arguments[2]?arguments[2]:{};if(f(y(v.prototype),"setValueAt",this).call(this,e,t,r),this.editorsReady[e]){var o=function(r){return function(o){if(!r.skipWysiwyg)switch(n.autoModified=!0,n.component.editor){case"ace":o.setValue(n.setConvertedValue(t,e));break;case"quill":if(n.component.isUploadEnabled)n.setAsyncConvertedValue(t).then((function(e){var t=o.clipboard.convert({html:e});o.setContents(t)}));else{var i=n.setConvertedValue(t,e),a=o.clipboard.convert({html:i});o.setContents(a)}break;case"ckeditor":o.data.set(n.setConvertedValue(t,e))}}};this.editorsReady[e].then(o(i.default.clone(r)))}}},{key:"setValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.isPlain||this.options.readOnly||this.disabled?(e=this.component.multiple&&Array.isArray(e)?e.map((function(e,n){return t.setConvertedValue(e,n)})):this.setConvertedValue(e),f(y(v.prototype),"setValue",this).call(this,e,n)):(n.skipWysiwyg=(""!==e||!n.resetValue)&&i.default.isEqual(e,this.getValue()),f(y(v.prototype),"setValue",this).call(this,e,n))}},{key:"setContent",value:function(e,t,n){f(y(v.prototype),"setContent",this).call(this,e,t,n,{addAttr:["allow","allowfullscreen","frameborder","scrolling"],addTags:["iframe"]})}},{key:"setReadOnlyValue",value:function(e,t){t=t||0,(this.options.readOnly||this.disabled)&&this.refs.input&&this.refs.input[t]&&("plain"===this.component.inputFormat?this.refs.input[t].innerText=this.isPlain?e:this.interpolate(e,{},{noeval:!0}):this.setContent(this.refs.input[t],this.isPlain?e:this.interpolate(e,{},{noeval:!0}),this.shouldSanitizeValue))}},{key:"isJsonValue",get:function(){return this.component.as&&"json"===this.component.as}},{key:"setConvertedValue",value:function(e,t){if(this.isJsonValue&&!i.default.isNil(e))try{e=JSON.stringify(e,null,2)}catch(e){console.warn(e)}return i.default.isString(e)||(e=""),this.setReadOnlyValue(e,t),e}},{key:"setAsyncConvertedValue",value:function(e){if(this.isJsonValue&&e)try{e=JSON.stringify(e,null,2)}catch(e){console.warn(e)}i.default.isString(e)||(e="");var t=(new DOMParser).parseFromString(e,"text/html"),n=t.getElementsByTagName("img");return n.length?this.setImagesUrl(n).then((function(){return e=t.getElementsByTagName("body")[0].innerHTML})):a.default.resolve(e)}},{key:"setImagesUrl",value:function(e){var t=this;return a.default.all(i.default.map(e,(function(e){var n;try{n=JSON.parse(e.getAttribute("alt"))}catch(e){console.warn(e)}return t.fileService.downloadFile(n).then((function(t){e.setAttribute("src",t.url)}))})))}},{key:"addAutoExpanding",value:function(e,t){var n=null,r=null,o=function(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t},a=function(){0!==e.scrollHeight&&function(t,r){for(var o=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&o.push({node:t.parentNode,scrollTop:t.parentNode.scrollTop}),t=t.parentNode;e.style.height="",e.style.height="".concat(e.scrollHeight+n,"px"),o.forEach((function(e){e.node.scrollTop=e.scrollTop}))}(e)},u=i.default.debounce((function(){a();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),i=e.offsetHeight;i0&&void 0!==arguments[0]?arguments[0]:this.dataValue;return f(y(v.prototype),"isEmpty",this).call(this,this.trimBlanks(e))}},{key:"defaultValue",get:function(){var e=f(y(v.prototype),"defaultValue",this);return"quill"!==this.component.editor||e||(e="


    "),e}},{key:"getConvertedValue",value:function(e){if(this.isJsonValue&&e)try{e=JSON.parse(e)}catch(e){}return e}},{key:"detach",value:function(){var e=this;this.editors.forEach((function(e){e.destroy&&e.destroy()})),this.editors=[],this.editorsReady=[],this.updateSizes.forEach((function(t){return e.removeEventListener(window,"resize",t)})),this.updateSizes=[],f(y(v.prototype),"detach",this).call(this)}},{key:"getValue",value:function(){return this.isPlain?this.getConvertedValue(f(y(v.prototype),"getValue",this).call(this)):this.dataValue}},{key:"focus",value:function(){var e=this;switch(f(y(v.prototype),"focus",this).call(this),this.component.editor){case"ckeditor":var t;null===(t=this.editorsReady[0])||void 0===t||t.then((function(){var t,n;null!==(t=e.editors[0].editing)&&void 0!==t&&null!==(n=t.view)&&void 0!==n&&n.focus&&e.editors[0].editing.view.focus(),e.element.scrollIntoView()})).catch((function(e){console.warn("An editor did not initialize properly when trying to focus:",e)}));break;case"ace":var n;null===(n=this.editorsReady[0])||void 0===n||n.then((function(){e.editors[0].focus(),e.element.scrollIntoView()})).catch((function(e){console.warn("An editor did not initialize properly when trying to focus:",e)}));break;case"quill":var r;null===(r=this.editorsReady[0])||void 0===r||r.then((function(){e.editors[0].focus()})).catch((function(e){console.warn("An editor did not initialize properly when trying to focus:",e)}))}}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;nhttps://github.com/danialfarid/ng-file-upload#server-side for how to set up the server.",conditional:{json:{"===":[{var:"data.uploadStorage"},"url"]}}},{type:"textarea",key:"uploadOptions",label:"Image Upload Custom request options",tooltip:"Pass your custom xhr options(optional)",rows:5,editor:"ace",input:!0,weight:415.4,placeholder:'{\n "withCredentials": true\n }',conditional:{json:{"===":[{var:"data.uploadStorage"},"url"]}}},{type:"textfield",input:!0,key:"uploadDir",label:"Image Upload Directory",placeholder:"(optional) Enter a directory for the files",tooltip:"This will place all the files uploaded in this field in the directory",weight:415.5,conditional:{json:{"===":[{var:"data.isUploadEnabled"},!0]}}},{type:"textfield",key:"fileKey",input:!0,label:"File form-data Key",tooltip:"Key name that you would like to modify for the file while calling API request.",rows:5,weight:415.6,placeholder:"Enter the key name of a file for form data.",conditional:{json:{and:[{"===":[{var:"data.editor"},"quill"]},{"===":[{var:"data.isUploadEnabled"},!0]},{"===":[{var:"data.uploadStorage"},"url"]}]}}},{type:"select",input:!0,key:"as",label:"Save As",dataSrc:"values",tooltip:"This setting determines how the value should be entered and stored in the database.",clearOnHide:!0,data:{values:[{label:"String",value:"string"},{label:"JSON",value:"json"},{label:"HTML",value:"html"}]},conditional:{json:{or:[{"===":[{var:"data.editor"},"quill"]},{"===":[{var:"data.editor"},"ace"]}]}},weight:416},{type:"textarea",input:!0,editor:"ace",rows:10,as:"json",label:"Editor Settings",tooltip:"Enter the WYSIWYG editor JSON configuration.",key:"wysiwyg",customDefaultValue:function(e,t,n,r,o){return o?o.wysiwygDefault:""},conditional:{json:{or:[{"===":[{var:"data.editor"},"ace"]},{"===":[{var:"data.editor"},"ckeditor"]},{"===":[{var:"data.editor"},"quill"]}]}},weight:417}];t.default=a},94799:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{weight:125,key:"validate.minWords",label:"Minimum Word Length",placeholder:"Minimum Word Length",type:"number",tooltip:"The minimum amount of words that can be added to this field.",input:!0},{weight:126,key:"validate.maxWords",label:"Maximum Word Length",placeholder:"Maximum Word Length",type:"number",tooltip:"The maximum amount of words that can be added to this field.",input:!0}]},53983:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};if(e&&"object"===f(e)||(e={value:e,maskName:this.component.inputMasks[0].label}),!e.value){var n=t.noDefault?this.emptyValue:this.defaultValue;e.value=Array.isArray(n)?n[0]:n}return e}},{key:"normalizeValue",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.isMultipleMasksField?Array.isArray(e)?g(k(m.prototype),"normalizeValue",this).call(this,e.map((function(e){return t.maskValue(e,n)}))):g(k(m.prototype),"normalizeValue",this).call(this,this.maskValue(e,n)):g(k(m.prototype),"normalizeValue",this).call(this,e)}},{key:"setValueAt",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.isMultipleMasksField)return g(k(m.prototype),"setValueAt",this).call(this,e,t,n);var r=(t=this.maskValue(t,n)).value||"",a=this.refs.mask?this.refs.mask[e]:null,u=this.refs.select?this.refs.select[e]:null,l=this.getMaskPattern(t.maskName);if(!(a&&u&&l))return g(k(m.prototype),"setValueAt",this).call(this,e,r,n);var s=this.placeholderChar;a.value=(0,o.conformToMask)(r,i.getInputMask(l),{placeholderChar:s}).conformedValue,u.value=t.maskName}},{key:"unmaskValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.component.displayMask,n=i.getInputMask(t,this.placeholderChar);return i.unmaskValue(e,n,this.placeholderChar)}},{key:"getValueAt",value:function(e){if(!this.isMultipleMasksField){var t,n,r=g(k(m.prototype),"getValueAt",this).call(this,e),o=this.component.inputMask,i=this.component.displayMask;return o&&!i||i===o?r:i&&!o?this.unmaskValue(r,i):null!==(t=this.refs.valueMaskInput)&&void 0!==t&&t.mask?(this.refs.valueMaskInput.mask.textMaskInputElement.update(r),null===(n=this.refs.valueMaskInput)||void 0===n?void 0:n.value):r}var a=this.refs.mask?this.refs.mask[e]:null,u=this.refs.select?this.refs.select[e]:null;return{value:a?a.value:void 0,maskName:u?u.value:void 0}}},{key:"isHtmlRenderMode",value:function(){return g(k(m.prototype),"isHtmlRenderMode",this).call(this)||(this.options.readOnly||this.disabled)&&"html"===this.component.inputFormat&&"textfield"===this.type}},{key:"isEmpty",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dataValue;return this.isMultipleMasksField?g(k(m.prototype),"isEmpty",this).call(this,e)||(this.component.multiple?0===e.length:!e.maskName||!e.value):g(k(m.prototype),"isEmpty",this).call(this,(e||"").toString().trim())}},{key:"truncateMultipleSpaces",value:function(e){return e?e.trim().replace(/\s{2,}/g," "):e}},{key:"validationValue",get:function(){var e=g(k(m.prototype),"validationValue",this);return e&&this.component.truncateMultipleSpaces?this.truncateMultipleSpaces(e):e}},{key:"beforeSubmit",value:function(){var e=this,t=this.dataValue;return this.component.truncateMultipleSpaces&&t?(t=this.truncateMultipleSpaces(t),this.dataValue=t,a.default.resolve(t).then((function(){return g(k(m.prototype),"beforeSubmit",e).call(e)}))):a.default.resolve(t)}},{key:"getValueAsString",value:function(e,t){return null!=t&&t.email&&this.visible&&!this.skipInEmail&&u.default.isObject(e)?'\n \n \n \n \n \n \n \n
    '.concat(e.maskName,'').concat(e.value,"
    \n "):(e&&"plain"===this.component.inputFormat&&/<[^<>]+>/g.test(e)&&(e=e.replaceAll("<","<").replaceAll(">",">")),g(k(m.prototype),"getValueAsString",this).call(this,e,t))}}],l=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n{{ item.label }}",data:{values:[{value:"plain",label:"Plain"},{value:"html",label:"HTML"},{value:"raw",label:"Raw (Insecure)"}]},defaultValue:"plain",input:!0},{weight:200,type:"radio",label:"Text Case",key:"case",tooltip:"When data is entered, you can change the case of the value.",input:!0,values:[{value:"mixed",label:"Mixed (Allow upper and lower case)"},{value:"uppercase",label:"Uppercase"},{value:"lowercase",label:"Lowercase"}]},{weight:205,type:"checkbox",input:!0,key:"truncateMultipleSpaces",label:"Truncate Multiple Spaces"}]},58054:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(22457)),o=i(n(96486));function i(e){return e&&e.__esModule?e:{default:e}}var a=[{weight:400,type:"select",input:!0,key:"widget.type",label:"Widget",placeholder:"Select a widget",tooltip:"The widget is the display UI used to input the value of the field.",defaultValue:"input",onChange:function(e){e.data.widget=o.default.pick(e.data.widget,"type")},dataSrc:"values",data:{values:[{label:"Input Field",value:"input"},{label:"Calendar Picker",value:"calendar"}]},conditional:{json:{"===":[{var:"data.type"},"textfield"]}}},{weight:405,type:"textarea",key:"widget",label:"Widget Settings",refreshOn:"wiget.type",clearOnHide:!1,calculateValue:function(e){var t=e.instance.calculatedValue,n=e.data.widget.type;if(o.default.isEmpty(o.default.omit(e.data.widget,"type"))||o.default.isEmpty(o.default.omit(t,"type"))){if(t&&!t.type)return e.data.widget;var i=e.instance._currentForm.options.editComponent.widget;if(i&&!o.default.isEmpty(o.default.omit(i,"type"))&&n===i.type)return o.default.omit(i,"language");if(n)return o.default.omit(r.default[n].defaultSettings,"language")}return e.data.widget},input:!0,rows:5,editor:"ace",as:"json",conditional:{json:{"!==":[{var:"data.widget.type"},"input"]}}},{weight:410,type:"textfield",input:!0,key:"inputMask",label:"Input Mask",tooltip:"An input mask helps the user with input by ensuring a predefined format.

    9: numeric
    a: alphabetical
    *: alphanumeric

    Example telephone mask: (999) 999-9999

    See the jquery.inputmask documentation for more information.",customConditional:function(e){return!e.data.allowMultipleMasks}},{weight:410,type:"textfield",input:!0,key:"displayMask",label:"Display Mask",tooltip:"A display mask helps to display the input in a readable way, this won't affect the value which will be saved (to affect both view and saved value, delete Display Mask and use Input Mask).

    9: numeric
    a: alphabetical
    *: alphanumeric

    Example telephone mask: (999) 999-9999

    See the jquery.inputmask documentation for more information.",customConditional:function(e){return!e.data.allowMultipleMasks}},{weight:410,type:"select",input:!0,key:"applyMaskOn",label:"Apply Mask On",tooltip:"Select the type of applying mask.",defaultValue:"change",dataSrc:"values",data:{values:[{label:"Change",value:"change"},{label:"Blur",value:"blur"}]},customConditional:function(e){return!e.data.allowMultipleMasks}},{weight:411,type:"textfield",input:!0,key:"inputMaskPlaceholderChar",label:"Input Mask Placeholder Char",tooltip:"You can specify a char which will be used as a placeholder in the field.
    E.g., ˍ
    Make note that placeholder char will be replaced by a space if it is used inside the mask",validation:{maxLength:1},customConditional:function(e){return e.data.inputMask||e.data.displayMask}},{weight:413,type:"checkbox",input:!0,key:"allowMultipleMasks",label:"Allow Multiple Masks"},{weight:1350,type:"checkbox",input:!0,key:"spellcheck",defaultValue:!0,label:"Allow Spellcheck"},{weight:417,type:"datagrid",input:!0,key:"inputMasks",label:"Input Masks",customConditional:function(e){return!0===e.data.allowMultipleMasks},reorder:!0,components:[{type:"textfield",key:"label",label:"Label",input:!0},{type:"textfield",key:"mask",label:"Mask",input:!0}]},{weight:320,type:"textfield",input:!0,key:"prefix",label:"Prefix"},{weight:330,type:"textfield",input:!0,key:"suffix",label:"Suffix"},{weight:700,type:"textfield",input:!0,key:"autocomplete",label:"Autocomplete",placeholder:"on",tooltip:"Indicates whether input elements can by default have their values automatically completed by the browser. See the MDN documentation on autocomplete for more information."},{weight:1300,type:"checkbox",label:"Hide Input",tooltip:"Hide the input in the browser. This does not encrypt on the server. Do not use for passwords.",key:"mask",input:!0},{weight:1200,type:"checkbox",label:"Show Word Counter",tooltip:"Show a live count of the number of words.",key:"showWordCount",input:!0},{weight:1201,type:"checkbox",label:"Show Character Counter",tooltip:"Show a live count of the number of characters.",key:"showCharCount",input:!0}];t.default=a},64082:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=[{weight:110,key:"validate.minLength",label:"Minimum Length",placeholder:"Minimum Length",type:"number",tooltip:"The minimum length requirement this field must meet.",input:!0},{weight:120,key:"validate.maxLength",label:"Maximum Length",placeholder:"Maximum Length",type:"number",tooltip:"The maximum length requirement this field must meet.",input:!0},{weight:125,key:"validate.minWords",label:"Minimum Word Length",placeholder:"Minimum Word Length",type:"number",tooltip:"The minimum amount of words that can be added to this field.",input:!0},{weight:126,key:"validate.maxWords",label:"Maximum Word Length",placeholder:"Maximum Word Length",type:"number",tooltip:"The maximum amount of words that can be added to this field.",input:!0},{weight:130,key:"validate.pattern",label:"Regular Expression Pattern",placeholder:"Regular Expression Pattern",type:"textfield",tooltip:"The regular expression pattern test that the field value must pass before the form can be submitted.",input:!0}]},65105:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},i=r.data,u=void 0===i?{}:i,l=r.children,s=void 0===l?[]:l,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f=c.checkNode,d=c.createComponents,p=c.isNew,h=void 0===p||p,y=c.removeComponents,m=c.parentPath,v=void 0===m?"":m;a(this,e),this.parent=t,this.previousData={},this.persistentData=o.default.cloneDeep(u),this.new=h,this.createComponents=d,this.checkNode=f,this.removeComponents=y,this.revertAvailable=!1,this.editing=!1,this.collapsed=!1,this.components=[],this.children=[],this.parentPath=v,this.resetData(),this.children=s.map((function(t,r){return new e(n,t,{checkNode:f,createComponents:d,isNew:!1,removeComponents:y,parentPath:n.getChildrenPath(r)})}))}var t,n;return t=e,(n=[{key:"value",get:function(){return this.new?null:{data:o.default.cloneDeep(this.persistentData),children:this.children.filter((function(e){return!e.new})).map((function(e){return e.value}))}}},{key:"isRoot",get:function(){return null===this.parent}},{key:"changing",get:function(){return this.new||this.editing}},{key:"hasChangingChildren",get:function(){return this.changin||this.children.some((function(e){return e.hasChangingChildren}))}},{key:"hasData",get:function(){return!o.default.isEmpty(this.persistentData)}},{key:"hasChildren",get:function(){return Array.isArray(this.children)&&this.children.length>0}},{key:"getChildrenPath",value:function(e){return this.parentPath?"".concat(this.parentPath,".children[").concat(e,"]"):""}},{key:"eachChild",value:function(e){return e(this),this.children.forEach((function(t){return t.eachChild(e)})),this}},{key:"getComponents",value:function(){return this.children.reduce((function(e,t){return e.concat(t.getComponents())}),this.components)}},{key:"validateNode",value:function(){var e=this,t=!0;return this.getComponents().forEach((function(n){n.setPristine(!1),t&=n.checkValidity(null,!1,e.persistentData)})),t}},{key:"addChild",value:function(){if(this.new)return null;var t=new e(this,{},{checkNode:this.checkNode,createComponents:this.createComponents,isNew:!0,removeComponents:this.removeComponents,parentPath:this.getChildrenPath(this.children.length)});return this.children=this.children.concat(t),t}},{key:"removeChild",value:function(e){return this.new||(this.children=this.children.filter((function(t){return t!==e}))),this}},{key:"edit",value:function(){return this.new?this:(this.editing=!0,this.resetData())}},{key:"save",value:function(){var e=this.validateNode();return this.changing&&e&&(this.new?this.new=!1:(this.editing=!1,this.revertAvailable=!0),this.commitData()),e}},{key:"cancel",value:function(){return this.new?this.remove():this.editing&&(this.editing=!1,this.resetData()),this}},{key:"remove",value:function(){return this.parent.removeChild(this),this.parent=null,this.clearComponents(),this}},{key:"revert",value:function(){return this.revertAvailable?(this.data=this.previousData,this.commitData()):this}},{key:"commitData",value:function(){return this.previousData=this.persistentData,this.persistentData=o.default.cloneDeep(this.data),this.clearComponents(),this}},{key:"resetData",value:function(){return this.data=o.default.cloneDeep(this.persistentData),this.updateComponentsContext(),this}},{key:"updateComponentsContext",value:function(){return this.changing?this.instantiateComponents():this.clearComponents(),this}},{key:"instantiateComponents",value:function(){var e=this;this.components=this.createComponents(this.data,this),this.components.forEach((function(t){if(e.parentPath){var n=e.calculateComponentPath(t);t.path=n}})),this.checkNode(this)}},{key:"clearComponents",value:function(){this.removeComponents(this.components),this.components=[]}},{key:"calculateComponentPath",value:function(e){var t="";return e.component.key&&(t="".concat(this.parentPath,".data.").concat(e.component.key)),t}}])&&u(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=l},69561:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.hasChildren&&!e.collapsed?this.renderChildNodes(e.children,!t):[],r=e.changing?this.renderEdit(e):this.renderView(e);return this.renderTemplate("tree",{odd:t,childNodes:n,content:r,node:e})}},{key:"renderChildNodes",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;return t.map((function(t){return e.renderTree(t,n)}))}},{key:"renderEdit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.renderTemplate("treeEdit",{children:this.renderComponents(e.components),node:e})}},{key:"renderView",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.renderTemplate("treeView",{values:this.viewComponents.map((function(t){return t.data=e.data,t.checkComponentConditions(e.data),t.getView(t.dataValue)})),nodeData:e.data,node:e})}},{key:"attach",value:function(e){return this.builderMode?b(O(v.prototype),"attach",this).call(this,e):(this.loadRefs(e,{root:"single"}),s.default.all([b(O(v.prototype),"attach",this).call(this,e),this.attachNode(this.refs.root,this.treeRoot)]))}},{key:"attachNode",value:function(e,t){if(!e)return s.default.resolve();var n=s.default.resolve(),r=s.default.resolve();return t.refs=o.default.reduce(e.children,(function(e,t){return t.hasAttribute("ref")?d(d({},e),{},m({},t.getAttribute("ref"),t)):e}),{}),t.refs.content&&(this.attachActions(t),n=this.attachComponents(t)),t.refs.childNodes&&(r=this.attachChildren(t)),s.default.all([n,r])}},{key:"attachActions",value:function(e){var t,n=this;e.editing||this.loadRefs.call(e,e.refs.content,{addChild:"single",editNode:"single",removeNode:"single",revertNode:"single",toggleNode:"single"}),this.loadRefs.call(e,(null===(t=e.refs.content.children[0])||void 0===t?void 0:t.children[1])||e.refs.content,{cancelNode:"single",saveNode:"single"}),e.refs.addChild&&this.addEventListener(e.refs.addChild,"click",(function(){n.addChild(e)})),e.refs.cancelNode&&this.addEventListener(e.refs.cancelNode,"click",(function(){n.cancelNode(e)})),e.refs.editNode&&this.addEventListener(e.refs.editNode,"click",(function(){n.editNode(e)})),e.refs.removeNode&&this.addEventListener(e.refs.removeNode,"click",(function(){n.removeNode(e)})),e.refs.revertNode&&this.addEventListener(e.refs.revertNode,"click",(function(){n.revertNode(e)})),e.refs.saveNode&&this.addEventListener(e.refs.saveNode,"click",(function(){n.saveNode(e)})),e.refs.toggleNode&&this.addEventListener(e.refs.toggleNode,"click",(function(){n.toggleNode(e)}))}},{key:"attachComponents",value:function(e){if(this.builderMode){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:{},n=this.updateValue(e,t);return this.setRoot(),n}},{key:"addChild",value:function(e){var t=this;this.options.readOnly||e.new||this.hook("tree.addChild",{parent:e,component:this},(function(){var n=e.addChild();return t.redraw(),n}))}},{key:"cancelNode",value:function(e){var t=this;this.options.readOnly||this.hook("tree.cancelNode",{node:e,component:this},(function(){return e.isRoot?e.persistentData&&!o.default.isEmpty(e.persistentData)?(e.cancel(),t.redraw()):t.removeRoot():(e.cancel(),t.redraw()),e}))}},{key:"editNode",value:function(e){var t=this;this.options.readOnly||e.new||this.hook("tree.editNode",{node:e,component:this},(function(){return e.edit(),t.redraw(),e}))}},{key:"removeNode",value:function(e){var t=this;this.options.readOnly||e.new||this.hook("tree.removeNode",{node:e,component:this},(function(){return e.isRoot?t.removeRoot():(e.remove(),t.updateTree()),e}))}},{key:"revertNode",value:function(e){var t=this;!this.options.readOnly&&e.revertAvailable&&this.hook("tree.revertNode",{node:e,component:this},(function(){return e.revert(),t.updateTree(),e}))}},{key:"saveNode",value:function(e){var t=this;this.options.readOnly||this.hook("tree.saveNode",{node:e,component:this},(function(){return e.save()&&t.updateTree(),e}))}},{key:"toggleNode",value:function(e){var t=this;this.hook("tree.toggleNode",{node:e,component:this},(function(){return e.collapsed=!e.collapsed,t.redraw(),e}))}},{key:"removeRoot",value:function(){this.options.readOnly||(this.dataValue=this.defaultValue,this.setRoot(),this.redraw())}},{key:"setRoot",value:function(){var e=this.getValue();this.treeRoot=new l.default(null,e,{isNew:!!this.builderMode||!e.data,createComponents:this.createComponents.bind(this),checkNode:this.checkNode.bind(this,this.data),removeComponents:this.removeComponents,parentPath:this.isDefaultValueComponent?this.path||this.component.key:null}),this.hook("tree.setRoot",{root:this.treeRoot,component:this}),this.redraw()}},{key:"getValue",value:function(){return this.dataValue||{}}},{key:"updateTree",value:function(){this.updateValue(this.treeRoot.value),this.redraw()}},{key:"checkData",value:function(e,t,n){return this.checkNode(e,this.treeRoot,t,n)}},{key:"checkNode",value:function(e,t,n,r){var o=this;return t.children.reduce((function(t,i){return o.checkNode(e,i,n,r)&&t}),b(O(v.prototype),"checkData",this).call(this,e,n,t.data,t.components)&&!t.editing&&!t.new)}},{key:"getComponents",value:function(){return this.treeRoot&&(this.isDefaultValueComponent||!this.isDefaultValueComponent&&!this.builderMode)?this.treeRoot.getComponents():b(O(v.prototype),"getComponents",this).call(this)}},{key:"getValueAsString",value:function(e,t){if(null!=t&&t.email){var n="";return n+=function e(t){var n,r,o='\n \n \n ';return o+="\n \n ",o+=Object.keys(t.data).map((function(e){return'\n \n \n \n ",o+="\n \n
    '.concat(e,'\n ').concat(t.data[e],"\n
    \n ")})),0!==(null===(n=t.children)||void 0===n?void 0:n.length)&&(null===(r=t.children)||void 0===r||r.forEach((function(t){o+=e(t)}))),o+="\n
    \n "}(e),n}return b(O(v.prototype),"getValueAsString",this).call(this,e,t)}}],r=[{key:"schema",value:function(){for(var e=arguments.length,t=new Array(e),n=0;ncustom component documentation.',type:"htmlelement",weight:5},{type:"textarea",as:"json",editor:"ace",weight:10,input:!0,key:"componentJson",label:"Custom Element JSON",tooltip:"Enter the JSON for this custom element."}]},81541:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:"".concat(o.default.getApiUrl(),"/externalModules.js"),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"externalModules";o.default.requireLibrary(t,t,e,!0).then((function(e){o.default.use(e)}))},o.default.Components=u.default,o.default.Templates=s.default,o.default.Builders=a.default,o.default.Utils=g.default,o.default.Form=b.default,o.default.Displays=l.default,o.default.Providers=c.default,o.default.Rules=f.default,o.default.Widgets=v.default,o.default.Evaluator=w.default,o.default.Conjunctions=d.default,o.default.Operators=p.default,o.default.QuickRules=h.default,o.default.Transformers=y.default,o.default.ValueSources=m.default,o.default.AllComponents=i.default,o.default.Licenses=k.default,o.default.Formio=o.default,o.default.Components.setComponents(i.default);var S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"===_(e))for(var n=0,i=Object.keys(e);n1&&void 0!==arguments[1]?arguments[1]:{};(e=r.default.isArray(e)?e:[e]).forEach((function(e){Array.isArray(e)?e.forEach((function(e){return S(e,t)})):S(e,t)}))}},68204:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(6701))&&r.__esModule?r:{default:r},i={lng:"en",nsSeparator:"::",keySeparator:".|.",pluralSeparator:"._.",contextSeparator:"._.",resources:{en:{translation:(0,n(82531).fastCloneDeep)(o.default)}}};t.default=i},69078:function(e,t,n){"use strict";n(69070),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r,o=(r=n(96486))&&r.__esModule?r:{default:r};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var n=0;n=s)for(;s>>0,"object"===r(e[o])?e[o].baseVal=a.join(" "):e[o]=a.join(" "),f())},i.remove=function(){d.apply(i,t=arguments);for(var t,n={},s=0,c=[];s>>0,"object"===r(e[o])?e[o].baseVal=a.join(" "):e[o]=a.join(" "),f()},i.toggle=function(e,n){return d.apply(i,[e]),t!==n?n?(i.add(e),!0):(i.remove(e),!1):u[e]?(i.remove(e),!1):(i.add(e),!0)},i}}();"DOMTokenList"in e&&(!("classList"in(l=document.createElement("x")))||!l.classList.toggle("x",!1)&&!l.className)||("DOMTokenList"in(u=e)&&u.DOMTokenList&&(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg")||document.createElementNS("http://www.w3.org/2000/svg","svg").classList instanceof DOMTokenList)||(u.DOMTokenList=s),function(){var e=document.createElement("span");"classList"in e&&(e.classList.toggle("x",!1),e.classList.contains("x")&&(e.classList.constructor.prototype.toggle=function(e){var n=arguments[1];if(n===t){var r=!this.contains(e);return this[r?"add":"remove"](e),r}return this[(n=!!n)?"add":"remove"](e),n}))}(),function(){var e=document.createElement("span");if("classList"in e&&(e.classList.add("a","b"),!e.classList.contains("b"))){var t=e.classList.constructor.prototype.add;e.classList.constructor.prototype.add=function(){for(var e=arguments,n=arguments.length,r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};l(this,e),this.beforeMergeOptions(t),this.options=o.default.merge({},this.defaultOptions,t)}var t,n,r;return t=e,n=[{key:"beforeMergeOptions",value:function(){}},{key:"defaultOptions",get:function(){return{}}},{key:"queryProperty",get:function(){return"query"}},{key:"responseProperty",get:function(){return null}},{key:"displayValueProperty",get:function(){return null}},{key:"serialize",value:function(e){return o.default.toPairs(e).map((function(e){var t,n,r=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],l=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,n)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],i=r[1];return"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(i))})).join("&")}},{key:"getRequestOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o.default.merge({},this.options,e)}},{key:"getRequestUrl",value:function(){throw new Error("Method AddressProvider#getRequestUrl(options) is abstract.")}},{key:"makeRequest",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i.GlobalFormio.makeStaticRequest(this.getRequestUrl(e),"GET",null,{noToken:!0})}},{key:"search",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRequestOptions(n),i=r.params=r.params||{};return i[this.queryProperty]=e,this.makeRequest(r).then((function(e){return t.responseProperty?o.default.get(e,t.responseProperty,[]):e}))}},{key:"getDisplayValue",value:function(e){return this.displayValueProperty?o.default.get(e,this.displayValueProperty,""):String(e)}}],r=[{key:"name",get:function(){return"address"}},{key:"displayName",get:function(){return"Address"}}],n&&s(t.prototype,n),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.AddressProvider=c},25823:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.params;return"https://atlas.microsoft.com/search/address/json?".concat(this.serialize(t))}}],r=[{key:"name",get:function(){return"azure"}},{key:"displayName",get:function(){return"Azure Maps"}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),d}(n(6542).AddressProvider);t.AzureAddressProvider=s},45555:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.params,n=e.url;return"".concat(n,"?").concat(this.serialize(t))}}],r=[{key:"name",get:function(){return"custom"}},{key:"displayName",get:function(){return"Custom"}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),p}(n(6542).AddressProvider);t.CustomAddressProvider=f},7763:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(12419),n(78011),n(69070),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.GoogleAddressProvider=void 0,n(73210),n(89554),n(41539),n(54747),n(5212),n(68304),n(24812),n(30489);var o=n(19161),i=l(n(96486)),a=n(6542),u=l(n(91459));function l(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};s(this,y),(t=h.call(this,n)).setAutocompleteOptions();var r="https://maps.googleapis.com/maps/api/js?v=quarterly&libraries=places&callback=googleMapsCallback";return null!==(e=n.params)&&void 0!==e&&e.key&&(r+="&key=".concat(n.params.key)),o.GlobalFormio.requireLibrary(t.getLibraryName(),"google.maps.places",r),t}return t=y,r=[{key:"name",get:function(){return"google"}},{key:"displayName",get:function(){return"Google Maps"}}],(n=[{key:"displayValueProperty",get:function(){return"formattedPlace"}},{key:"alternativeDisplayValueProperty",get:function(){return"formatted_address"}},{key:"autocompleteOptions",get:function(){return this._autocompleteOptions},set:function(e){this._autocompleteOptions=e}},{key:"setAutocompleteOptions",value:function(){var e=i.default.get(this.options,"params.autocompleteOptions",{});i.default.isObject(e)||(e={}),this.addRequiredProviderOptions(e),this.autocompleteOptions=e}},{key:"beforeMergeOptions",value:function(e){this.convertRegionToAutocompleteOption(e)}},{key:"getLibraryName",value:function(){return"googleMaps"}},{key:"convertRegionToAutocompleteOption",value:function(e){var t=e,n=i.default.get(t,"params.region","");if(n&&!i.default.has(e,"params.autocompleteOptions")){var r={UK:"GB"};r[n=n.toUpperCase().trim()]&&(n=r[n]),i.default.set(t,"params.autocompleteOptions.componentRestrictions.country",[n])}}},{key:"getRequiredAddressProperties",value:function(){return["address_components","formatted_address","geometry","place_id","plus_code","types"]}},{key:"addRequiredProviderOptions",value:function(e){var t=this.getRequiredAddressProperties();i.default.isArray(e.fields)&&e.fields.length>0&&e.fields.forEach((function(e){t.some((function(t){return e===t}))||t.push(e)})),e.fields=t}},{key:"filterPlace",value:function(e){e=e||{};var t={};return this.autocompleteOptions&&this.autocompleteOptions.fields.forEach((function(n){e[n]&&(t[n]=e[n])})),t}},{key:"attachAutocomplete",value:function(e,t,n){var r=this;o.GlobalFormio.libraryReady(this.getLibraryName()).then((function(){var o=new google.maps.places.Autocomplete(e,r.autocompleteOptions);o.addListener("place_changed",(function(){var a=r.filterPlace(o.getPlace());a.formattedPlace=i.default.get(o,"gm_accessors_.place.se.formattedPrediction",a[r.alternativeDisplayValueProperty]),n(a,e,t)}))}))}},{key:"search",value:function(){return u.default.resolve()}},{key:"makeRequest",value:function(){return u.default.resolve()}},{key:"getDisplayValue",value:function(e){var t=i.default.has(e,this.displayValueProperty)?this.displayValueProperty:this.alternativeDisplayValueProperty;return i.default.get(e,t,"")}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),y}(a.AddressProvider);t.GoogleAddressProvider=h},21680:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.params;return"https://nominatim.openstreetmap.org/search?".concat(this.serialize(t))}}],r=[{key:"name",get:function(){return"nominatim"}},{key:"displayName",get:function(){return"OpenStreetMap Nominatim"}}],n&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),d}(n(6542).AddressProvider);t.NominatimAddressProvider=s},56499:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(96649),n(96078),n(82526),n(41817),n(41539),n(9653),n(69070),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(68309);var o,i=n(25823),a=n(45555),u=n(7763),l=n(21680);function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===r(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=(s(o={},i.AzureAddressProvider.name,i.AzureAddressProvider),s(o,a.CustomAddressProvider.name,a.CustomAddressProvider),s(o,u.GoogleAddressProvider.name,u.GoogleAddressProvider),s(o,l.NominatimAddressProvider.name,l.NominatimAddressProvider),o);t.default=c},49452:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={}},10695:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=((r=n(89738))&&r.__esModule?r:{default:r}).default;t.default=o},82302:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(68309);var r,o=(r=n(91459))&&r.__esModule?r:{default:r};t.default=function(e,t){return function(n,r){return new o.default((function(o,i){var a=new XMLHttpRequest;a.onerror=function(e){e.networkError=!0,i(e)},a.onabort=function(e){e.networkError=!0,i(e)},a.onload=function(){if(a.status>=200&&a.status<300){var e=a.getResponseHeader("Content-Type")||n.type;o(new File([a.response],n.name,{type:e}))}else i(a.response||"Unable to process file")},a.onabort=i,a.open("POST",t.url);var u=e.getToken();u&&a.setRequestHeader("x-jwt-token",u),a.responseType="arraybuffer";var l=new FormData;l.append("file",n),l.append("processorOptions",JSON.stringify(t.options||{})),l.append("options",JSON.stringify(r||{})),a.send(l)}))}}},64666:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92222),n(73210),n(68309);var r,o=(r=n(3975))&&r.__esModule?r:{default:r},i=function(e){return{uploadFile:function(t,n,r,i,a,u,l,s,c,f){return o.default.upload(e,"azure",(function(e,n){return e.openAndSetHeaders("PUT",n.url),e.setRequestHeader("Content-Type",t.type),e.setRequestHeader("x-ms-blob-type","BlockBlob"),t}),t,n,r,i,s,c,f).then((function(){return{storage:"azure",name:o.default.path([r,n]),size:t.size,type:t.type,groupPermissions:s,groupId:c}}))},downloadFile:function(t){return e.makeRequest("file","".concat(e.formUrl,"/storage/azure?name=").concat(o.default.trim(t.name)),"GET")}}};i.title="Azure File Services";var a=i;t.default=a},52174:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=(r=n(91459))&&r.__esModule?r:{default:r},i=function(){return{title:"Base64",name:"base64",uploadFile:function(e,t){var n=this,r=new FileReader;return new o.default((function(o,i){r.onload=function(n){var r=n.target.result;o({storage:"base64",name:t,url:r,size:e.size,type:e.type})},r.onerror=function(){return i(n)},r.readAsDataURL(e)}))},downloadFile:function(e){return o.default.resolve(e)}}};i.title="Base64";var a=i;t.default=a},37771:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92222);var r,o=(r=n(91459))&&r.__esModule?r:{default:r},i=n(3975),a=function(e){return{uploadFile:function(t,n,r,a,u,l,s,c,f,d){return new o.default((function(o,u){var l=new XMLHttpRequest;"function"==typeof a&&(l.upload.onprogress=a),"function"==typeof d&&d((function(){return l.abort()}));var s=new FormData;s.append("name",n),s.append("dir",r),s.append("file",t),l.onerror=function(e){e.networkError=!0,u(e)},l.onload=function(){if(l.status>=200&&l.status<300){var e=JSON.parse(l.response);e.storage="googledrive",e.size=t.size,e.type=t.type,e.groupId=f,e.groupPermissions=c,o(e)}else u(l.response||"Unable to upload file")},l.onabort=u,l.open("POST","".concat(e.formUrl,"/storage/gdrive")),(0,i.setXhrHeaders)(e,l);var p=e.getToken();p&&l.setRequestHeader("x-jwt-token",p),l.send(s)}))},downloadFile:function(t){var n=e.getToken();return t.url="".concat(e.formUrl,"/storage/gdrive?fileId=").concat(t.id,"&fileName=").concat(t.originalName).concat(n?"&x-jwt-token=".concat(n):""),o.default.resolve(t)}}};a.title="Google Drive";var u=a;t.default=u},34198:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(52174)),o=s(n(87527)),i=s(n(64666)),a=s(n(7433)),u=s(n(3769)),l=s(n(37771));function s(e){return e&&e.__esModule?e:{default:e}}var c={base64:r.default,s3:o.default,url:a.default,azure:i.default,indexeddb:u.default,googledrive:l.default};t.default=c},3769:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(68309);var r,o=n(67429),i=(r=n(91459))&&r.__esModule?r:{default:r},a=function(){return{title:"indexedDB",name:"indexeddb",uploadFile:function(e,t,n,r,a,u){var l=this;if("indexedDB"in window)return new i.default((function(e){var t=indexedDB.open(u.indexeddb,3);t.onsuccess=function(t){var n=t.target.result;e(n)},t.onupgradeneeded=function(e){e.target.result.createObjectStore(u.indexeddbTable)}})).then((function(t){var n=new FileReader;return new i.default((function(r,i){n.onload=function(){var n=new Blob([e],{type:e.type}),i=(0,o.v4)(n),l={id:i,data:n,name:e.name,size:e.size,type:e.type,url:a},s=t.transaction([u.indexeddbTable],"readwrite");s.objectStore(u.indexeddbTable).put(l,i).onerror=function(e){console.log("error storing data"),console.error(e)},s.oncomplete=function(){r({storage:"indexeddb",name:e.name,size:e.size,type:e.type,url:a,id:i})}},n.onerror=function(){return i(l)},n.readAsDataURL(e)}))}));console.log("This browser doesn't support IndexedDB")},downloadFile:function(e,t){var n=this;return new i.default((function(e){indexedDB.open(t.indexeddb,3).onsuccess=function(t){var n=t.target.result;e(n)}})).then((function(r){return new i.default((function(o,i){var a=r.transaction([t.indexeddbTable],"readonly"),u=a.objectStore(t.indexeddbTable).get(e.id);u.onsuccess=function(){a.oncomplete=function(){var t=u.result,r=new File([u.result.data],e.name,{type:u.result.type}),a=new FileReader;a.onload=function(n){t.url=n.target.result,t.storage=e.storage,o(t)},a.onerror=function(){return i(n)},a.readAsDataURL(r)}},u.onerror=function(){return i(n)}}))}))},deleteFile:function(e,t){var n=this;return new i.default((function(e){indexedDB.open(t.indexeddb,3).onsuccess=function(t){var n=t.target.result;e(n)}})).then((function(r){return new i.default((function(o,i){var a=r.transaction([t.indexeddbTable],"readwrite"),u=a.objectStore(t.indexeddbTable).delete(e.id);u.onsuccess=function(){a.oncomplete=function(){var e=u.result;o(e)}},u.onerror=function(){return i(n)}}))}))}}};a.title="IndexedDB";var u=a;t.default=u},87527:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(69070),n(82526),n(41817),n(32165),n(66992),n(78783),n(33948),n(72443),n(39341),n(73706),n(10408),n(78011),n(30489),n(68309),n(68304),n(65069),n(96649),n(96078),n(9653),n(57327),n(38880),n(49337),n(33321),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(79753),n(89554),n(41539),n(54747),n(47941),n(88674),n(74916),n(4723),n(47042),n(92222),n(73210);var o=u(n(91459)),i=u(n(3975)),a=n(99887);function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function d(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){return void n(e)}u.done?t(l):Promise.resolve(l).then(r,o)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){d(i,r,o,a,u,"next",e)}function u(e){d(i,r,o,a,u,"throw",e)}a(void 0)}))}}var h=window.AbortController||n(65988);function y(e){return{uploadFile:function(t,n,r,o,u,l,s,c,d,y,m){var v=this;return p(f().mark((function u(){var l,s;return f().wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return l=function(){var e=p(f().mark((function e(o,u,l){var s,c,d,p,y;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.data.fileName=n,u.data.key=i.default.path([u.data.key,r,n]),!u.signed){e.next=29;break}if(!m||!Array.isArray(u.signed)){e.next=23;break}return s=new h,c=s.signal,"function"==typeof l&&l((function(){return s.abort()})),e.prev=7,e.next=10,v.uploadParts(t,u.signed,u.data.headers,u.partSizeActual,m,c);case 10:return d=e.sent,e.next=13,(0,a.withRetries)(v.completeMultipartUpload,[u,d,m],3);case 13:return e.abrupt("return");case 16:throw e.prev=16,e.t0=e.catch(7),s.abort(),v.abortMultipartUpload(u),e.t0;case 21:e.next=27;break;case 23:return o.openAndSetHeaders("PUT",u.signed),o.setRequestHeader("Content-Type",t.type),Object.keys(u.data.headers).forEach((function(e){o.setRequestHeader(e,u.data.headers[e])})),e.abrupt("return",t);case 27:e.next=34;break;case 29:for(y in p=new FormData,u.data)p.append(y,u.data[y]);return p.append("file",t),o.openAndSetHeaders("POST",u.url),e.abrupt("return",p);case 34:case"end":return e.stop()}}),e,null,[[7,16]])})));return function(t,n,r){return e.apply(this,arguments)}}(),u.next=3,i.default.upload(e,"s3",l,t,n,r,o,c,d,y,m);case 3:return s=u.sent,u.abrupt("return",{storage:"s3",name:n,bucket:s.bucket,key:s.data.key,url:i.default.path([s.url,s.data.key]),acl:s.data.acl,size:t.size,type:t.type});case 5:case"end":return u.stop()}}),u)})))()},completeMultipartUpload:function(t,n,r){return p(f().mark((function o(){var i,a,u,l;return f().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return i=r.changeMessage,a=e.getToken(),i("Completing AWS S3 multipart upload..."),o.next=5,fetch("".concat(e.formUrl,"/storage/s3/multipart/complete"),{method:"POST",headers:s({"Content-Type":"application/json"},a?{"x-jwt-token":a}:{}),body:JSON.stringify({parts:n,uploadId:t.uploadId,key:t.key})});case 5:return u=o.sent,o.next=8,u.text();case 8:if(l=o.sent,u.ok){o.next=11;break}throw new Error(l||u.statusText);case 11:if(null==l||!l.match(/Error/)){o.next=13;break}throw new Error(l);case 13:case"end":return o.stop()}}),o)})))()},abortMultipartUpload:function(t){var n=t.uploadId,r=t.key,o=e.getToken();fetch("".concat(e.formUrl,"/storage/s3/multipart/abort"),{method:"POST",headers:s({"Content-Type":"application/json"},o?{"x-jwt-token":o}:{}),body:JSON.stringify({uploadId:n,key:r})}).catch((function(e){return console.error("Error while aborting multipart upload:",e)}))},uploadParts:function(e,t,n,r,i,a){var u=i.changeMessage,l=i.progressCallback;u("Chunking and uploading parts to AWS S3...");for(var s=[],c=function(o){var i=o*r,u=(o+1)*r,c=o=200&&c.status<300){var e={};try{e=(e="string"==typeof c.response?JSON.parse(c.response):{})&&e.data?e.data:e}catch(t){e={}}var r=e.hasOwnProperty("url")?e.url:"".concat(c.responseURL,"/").concat(n);r&&"/"===r[0]&&(r="".concat(t).concat(r)),i({url:r,data:e})}else s(c.response||"Unable to upload file")},c.onerror=function(){return s(c)},c.onabort=function(){return s(c)};var h=t+(t.indexOf("?")>-1?"&":"?");for(var y in r)h+="".concat(y,"=").concat(r[y],"&");"&"===h[h.length-1]&&(h=h.substr(0,h.length-1)),c.open("POST",h),f&&c.setRequestHeader("Content-Type","application/json");var m=e.getToken();if(m&&c.setRequestHeader("x-jwt-token",m),a){var v="string"==typeof a?JSON.parse(a):a;for(var b in v)if("headers"===b){var g=v.headers;for(var w in g)c.setRequestHeader(w,g[w])}else c[b]=v[b]}c.send(f?o:d)}))};return{title:"Url",name:"url",uploadFile:function(n,r,o,i,u,l,s,c,f,d){var p=function(c){var f;return t(u,r,{baseUrl:encodeURIComponent(e.projectUrl),project:c?c.project:"",form:c?c._id:""},(f={},a(f,s,n),a(f,"name",r),a(f,"dir",o),f),l,i,d).then((function(t){return t.data=t.data||{},t.data.baseUrl=e.projectUrl,t.data.project=c?c.project:"",t.data.form=c?c._id:"",{storage:"url",name:r,url:t.url,size:n.size,type:n.type,data:t.data}}))};return n.private&&e.formId?e.loadForm().then((function(e){return p(e)})):p()},deleteFile:function(e){return new i.default((function(t,n){var r=new XMLHttpRequest;r.open("DELETE",e.url,!0),r.onload=function(){r.status>=200&&r.status<300?t("File deleted"):n(r.response||"Unable to delete file")},r.send(null)}))},downloadFile:function(n){return n.private?(e.submissionId&&n.data&&(n.data.submission=e.submissionId),t(n.url,n.name,{},JSON.stringify(n)).then((function(e){return e.data}))):i.default.resolve(n)}}};u.title="Url";var l=u;t.default=l},99887:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var o=t&&t.prototype instanceof h?t:h,a=Object.create(o.prototype),u=new x(r||[]);return i(a,"_invoke",{value:_(e,n,u)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var p={};function h(){}function y(){}function m(){}var v={};c(v,u,(function(){return this}));var b=Object.getPrototypeOf,g=b&&b(b(E([])));g&&g!==t&&n.call(g,u)&&(v=g);var w=m.prototype=h.prototype=Object.create(v);function k(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function o(i,a,u,l){var s=d(e[i],e,a);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==r(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,u,l)}),(function(e){o("throw",e,u,l)})):t.resolve(f).then((function(e){c.value=e,u(c)}),(function(e){return o("throw",e,u,l)}))}l(s.arg)}var a;i(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return a=a?a.then(r,r):r()}})}function _(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=d(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=d(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function E(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function i(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==u[2]?u[2]:3,a=u.length>3&&void 0!==u[3]?u[3]:null,r){e.next=4;break}throw new Error(a);case 4:return e.abrupt("return",t.apply(void 0,i(n)).catch((function(){return s(t,n,r-1,a)})));case 5:case"end":return e.stop()}}),e)}))),c.apply(this,arguments)}n(79753),n(82526),n(41817),n(32165),n(66992),n(78783),n(33948),n(91038),n(47042),n(68309),n(74916),n(69070),n(72443),n(39341),n(73706),n(10408),n(78011),n(30489),n(89554),n(54747),n(68304),n(65069),Object.defineProperty(t,"__esModule",{value:!0}),t.withRetries=s,n(41539),n(88674)},3975:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(96649),n(96078),n(82526),n(41817),n(9653),n(69070),n(47941),n(38880),n(89554),n(54747),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),n(72443),n(39341),n(73706),n(10408),n(78011),n(30489),n(68309),n(68304),n(65069),n(47042),Object.defineProperty(t,"__esModule",{value:!0}),t.setXhrHeaders=t.default=void 0,n(69600),n(21249),n(57327),n(41539),n(73210),n(88674),n(92222);var o=a(n(91459)),i=a(n(92742));function a(e){return e&&e.__esModule?e:{default:e}}function u(){u=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var i=t&&t.prototype instanceof h?t:h,a=Object.create(i.prototype),u=new x(r||[]);return o(a,"_invoke",{value:_(e,n,u)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var p={};function h(){}function y(){}function m(){}var v={};c(v,a,(function(){return this}));var b=Object.getPrototypeOf,g=b&&b(b(E([])));g&&g!==t&&n.call(g,a)&&(v=g);var w=m.prototype=h.prototype=Object.create(v);function k(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function i(o,a,u,l){var s=d(e[o],e,a);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==r(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,u,l)}),(function(e){i("throw",e,u,l)})):t.resolve(f).then((function(e){c.value=e,u(c)}),(function(e){return i("throw",e,u,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return a=a?a.then(r,r):r()}})}function _(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=d(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=d(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function E(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t=200&&l.status<300)a(n);else if(504===l.status){var e=new Error("Network request failed");e.networkError=!0,u(e)}else u(l.response||"Unable to upload file")},l.send(e)})).catch(u)}))}},h=p;t.default=h},51508:function(e,t,n){"use strict";n(69070),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r=i(n(75146)),o=i(n(96486));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(e,t){for(var n=0;n\n ',e.component.disableClearIcon||(n+='\n \n '),n+="\n \n"}return n+="\n",e.self.manualModeEnabled&&(n+='\n
    \n \n
    \n"),n+="\n",e.self.manualMode&&(n+='\n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n"),n+"\n"}},87302:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.displayValue?n+=null==(t=e.displayValue)?"":t:n+="-",n+"
    \n"}},45284:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(4295)),o=i(n(87302));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},34801:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+="'+(null==(t=e.t("errorListHotkey"))?"":t)+"\n "),n+"\n\n"}},75284:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(34801))&&r.__esModule?r:{default:r}).default};t.default=o},3824:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n '+(null==(t=e.form)?"":t)+"\n
    \n
    \n"}},15590:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(3824))&&r.__esModule?r:{default:r}).default};t.default=o},6e4:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.disableBuilderActions||(n+='\n
    \n \n \n
    \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n '),n+"\n "+(null==(t=e.html)?"":t)+"\n\n"}},14943:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(6e4))&&r.__esModule?r:{default:r}).default};t.default=o},15858:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n '+(null==(t=e.html)?"":t)+"\n
    \n"}},89298:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(15858))&&r.__esModule?r:{default:r}).default};t.default=o},47995:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n

    '+(null==(t=e.t(e.componentInfo.title,{_userInput:!0}))?"":t)+" "+(null==(t=e.t("Component"))?"":t)+"

    \n
    \n ",e.helplinks&&(n+='\n \n "),n+='\n
    \n
    \n
    \n ",e.preview||(n+='\n
    \n \n \n \n
    \n "),n+="\n
    \n ",e.preview&&(n+='\n
    \n
    \n
    \n

    '+(null==(t=e.t("Preview"))?"":t)+'

    \n
    \n
    \n
    \n '+(null==(t=e.preview)?"":t)+"\n
    \n
    \n
    \n ",e.componentInfo.help&&(n+='\n
    \n '+(null==(t=e.t(e.componentInfo.help))?"":t)+"\n
    \n "),n+='\n
    \n \n \n \n
    \n
    \n "),n+"\n
    \n"}},74798:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(47995))&&r.__esModule?r:{default:r}).default};t.default=o},72807:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'\n '+(null==(t=e.t("Drag and Drop a form component"))?"":t)+"\n\n"}},65181:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(72807))&&r.__esModule?r:{default:r}).default};t.default=o},42904:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n \n
    \n ',e.groups.forEach((function(e){n+="\n "+(null==(t=e)?"":t)+"\n "})),n+="\n
    \n
    \n"}},98953:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(42904))&&r.__esModule?r:{default:r}).default};t.default=o},96746:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n
    \n \n '+(null==(t=e.t(e.group.title,{_userInput:!0}))?"":t)+'\n \n
    \n
    \n \n
    \n ',e.group.componentOrder.length||e.subgroups.length?(n+="\n ",!e.group.componentOrder||e.group.componentOrder.forEach((function(r){n+='\n \n ',e.group.components[r].icon&&(n+='\n \n '),n+="\n "+(null==(t=e.t(e.group.components[r].title,{_userInput:!0}))?"":t)+"\n \n "})),n+="\n "+(null==(t=e.subgroups.join(""))?"":t)+"\n "):n+="\n
    "+(null==(t=e.t("No Matches Found"))?"":t)+"
    \n ",n+="\n
    \n
    \n\n"}},31440:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(96746))&&r.__esModule?r:{default:r}).default};t.default=o},41737:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n \n
    \n '+(null==(t=e.form)?"":t)+"\n
    \n
    \n
    \n"}},19838:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(41737))&&r.__esModule?r:{default:r}).default};t.default=o},26982:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+="<"+(null==(t=e.input.type)?"":t)+'\n ref="button"\n ',e.input.attr)n+="\n "+(null==(t=r)?"":t)+'="'+(null==(t=e.input.attr[r])?"":t)+'"\n ';return n+="\n ",e.component.description&&(n+='\n aria-describedby="d-'+(null==(t=e.instance.id)?"":t)+"-"+(null==(t=e.component.key)?"":t)+'"\n '),n+="\n>\n",e.component.leftIcon&&(n+=' '),n+="\n"+(null==(t=e.input.content)?"":t)+"\n",e.component.tooltip&&(n+='\n \n'),n+="\n",e.component.rightIcon&&(n+=' '),n+"\n\n
    \n \n
    \n'}},35858:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"\n"}},40707:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(26982)),o=i(n(35858));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},18952:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+='
    \n \n ",e.component.tooltip&&(n+='\n \n '),n+"\n
    \n"}},24609:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n
    ',e.checked?n+="True":n+="False",n+"
    \n"}},28569:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(18952)),o=i(n(24609));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},89199:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.component.columns.forEach((function(r,o){n+='\n
    \n '+(null==(t=e.columnComponents[o])?"":t)+"\n
    \n"})),n+="\n"}},36567:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(89199))&&r.__esModule?r:{default:r}).default};t.default=o},8404:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.visible&&(n+="\n "+(null==(t=e.children)?"":t)+'\n
    \n '),n+"\n
    \n"}},28857:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(8404))&&r.__esModule?r:{default:r}).default};t.default=o},64229:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n
    \n
    \n
    '+(null==(t=e.t(e.component.label))?"":t)+(null==(t=e.self.isIE()?", dialog":"")?"":t)+"\n ",e.options.vpat?n+='\n \n ':n+='\n \n ',n+='\n
    \n ',e.visible&&(n+="\n "+(null==(t=e.children)?"":t)+"\n "),n+='\n
    \n ',e.options.vpat&&(n+='\n \n "),n+'\n \n
    \n
    \n
    \n \n
    \n
    \n'}},6311:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(64229))&&r.__esModule?r:{default:r}).default};t.default=o},16499:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+((null==(t=e.children.join(""))?"":t)+"\n")}},16056:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(16499))&&r.__esModule?r:{default:r}).default};t.default=o},46441:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n '+(null==(t=e.children)?"":t)+"\n
    \n"}},64401:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(46441))&&r.__esModule?r:{default:r}).default};t.default=o},25486:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={"border-default":"","formio-tab-panel-active":"active","formio-tab-link-active":"active","formio-tab-link-container-active":"active","formio-form-error":"formio-error-wrapper has-message","formio-form-alert":"alert alert-danger","formio-label-error":"","formio-input-error":"","formio-alert-danger":"alert alert-danger","formio-alert-success":"alert alert-success","formio-alert-warning":"alert alert-warning","formio-modal-cancel-button":"btn btn-danger formio-dialog-button","formio-modal-confirm-button":"btn btn-primary formio-dialog-button"}},79025:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n '+(null==(t=r.hideLabel?"":e.t(r.label||r.title,{_userInput:!0}))?"":t)+"\n ",r.tooltip&&(n+=' '),n+="\n \n "})),n+="\n ",e.hasExtraColumn&&(n+='\n \n "),n+="\n \n \n "),n+='\n \n ',e.rows.forEach((function(r,o){n+="\n ",e.hasGroups&&e.groups[o]&&(n+='\n \n '+(null==(t=e.groups[o].label)?"":t)+"\n \n "),n+='\n \n ',e.component.reorder&&(n+='\n \n '),n+="\n ",e.columns.forEach((function(o){n+='\n \n "})),n+="\n ",e.hasExtraColumn&&(n+="\n ",e.hasRemoveButtons&&(n+='\n \n '),n+="\n ",e.canAddColumn&&(n+='\n \n "),n+="\n "),n+="\n \n "})),n+="\n \n ",!e.builder&&e.hasAddButton&&e.hasBottomSubmit&&(n+='\n \n \n \n \n \n "),n+="\n
    \n '+(null==(t=e.t("Add/Remove"))?"":t)+"\n ",!e.builder&&e.hasAddButton&&e.hasTopSubmit&&(n+='\n \n "),n+="\n
    \n \n \n "+(null==(t=r[o.key])?"":t)+"\n \n \n \n '+(null==(t=e.placeholder)?"":t)+"\n
    \n \n
    \n"}},79822:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n ',e.hasHeader&&(n+="\n \n \n ",e.columns.forEach((function(r){n+='\n \n "})),n+="\n \n \n "),n+="\n \n ",e.rows.forEach((function(r){n+="\n \n ",e.columns.forEach((function(o){n+='\n \n "})),n+="\n \n "})),n+="\n \n
    \n '+(null==(t=r.hideLabel?"":e.t(r.label||r.title,{_userInput:!0}))?"":t)+"\n ",r.tooltip&&(n+=' '),n+="\n
    \n '+(null==(t=r[o.key])?"":t)+"\n
    \n"}},27915:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(79025)),o=i(n(79822));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},62796:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n "),n+="\n
    "+(null==(t=e.day)?"":t)+"
    \n
    \n "),n+="\n ",e.showMonth&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+="\n ",!e.dayFirst&&e.showDay&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+="\n ",e.showYear&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+'\n\n\n'}},11594:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(62796))&&r.__esModule?r:{default:r}).default};t.default=o},63645:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'
    \n
    \n \n
    \n'}},10158:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(63645))&&r.__esModule?r:{default:r}).default};t.default=o},9665:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
      \n ',e.header&&(n+='\n
    • \n '+(null==(t=e.header)?"":t)+"\n
    • \n "),n+="\n ",e.rows.forEach((function(r,o){n+='\n
    • \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n
      \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
      \n "),n+='\n
      \n
      \n '+(null==(t=e.errors[o])?"":t)+"\n
      \n
      \n
    • \n "})),n+="\n ",e.footer&&(n+='\n \n "),n+="\n
    \n",!e.readOnly&&e.hasAddButton&&(n+='\n\n"),n+="\n"}},46248:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
      \n ',e.header&&(n+='\n
    • \n '+(null==(t=e.header)?"":t)+"\n
    • \n "),n+="\n ",e.rows.forEach((function(r,o){n+='\n
    • \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n
      \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
      \n "),n+='\n
      \n
      \n '+(null==(t=e.errors[o])?"":t)+"\n
      \n
      \n
    • \n "})),n+="\n ",e.footer&&(n+='\n \n "),n+="\n
    \n"}},21838:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(9665)),o=i(n(46248));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},82064:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n \n ',e.header&&(n+='\n \n '+(null==(t=e.header)?"":t)+"\n \n "),n+='\n \n ',e.rows.forEach((function(r,o){n+='\n \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n \n "),n+="\n ",e.errors[o]&&(n+='\n \n "),n+="\n \n "})),n+="\n \n ",e.footer&&(n+="\n \n \n "+(null==(t=e.footer)?"":t)+"\n \n \n "),n+="\n
    \n
    \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
    \n
    \n
    \n
    \n '+(null==(t=e.errors[o])?"":t)+"\n
    \n
    \n
    \n
    \n
    \n",!e.readOnly&&e.hasAddButton&&(n+='\n\n"),n+="\n"}},84940:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n \n ',e.header&&(n+='\n \n '+(null==(t=e.header)?"":t)+"\n \n "),n+='\n \n ',e.rows.forEach((function(r,o){n+='\n \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n \n "),n+="\n ",e.errors[o]&&(n+='\n \n "),n+="\n \n "})),n+="\n \n ",e.footer&&(n+="\n \n \n "+(null==(t=e.footer)?"":t)+"\n \n \n "),n+="\n
    \n
    \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
    \n
    \n
    \n
    \n '+(null==(t=e.errors[o])?"":t)+"\n
    \n
    \n
    \n
    \n
    \n"}},5342:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(82064)),o=i(n(84940));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},92161:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+="

    "+(null==(t=e.t("error"))?"":t)+"\n ",e.options.vpat&&(n+='\n \n '),n+="\n

    \n
      \n ",e.errors.forEach((function(e){n+='\n
    • \n \n '+(null==(t=e.message)?"":t)+"\n \n
    • \n "})),n+="\n
    \n"}},21337:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(92161))&&r.__esModule?r:{default:r}).default};t.default=o},21193:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.label.hidden||(n+='\n
    \n '+(null==(t=e.labelMarkup)?"":t)+"\n
    \n "),n+="\n\n ",e.label.hidden&&e.label.className&&e.component.validate.required&&(n+='\n
    \n \n
    \n '),n+='\n\n
    \n '+(null==(t=e.element)?"":t)+"\n
    \n
    \n\n",e.component.description&&(n+='\n
    '+(null==(t=e.t(e.component.description,{_userInput:!0}))?"":t)+"
    \n"),n+"\n"}},81336:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.label.hidden||"bottom"===e.label.labelPosition||(n+="\n "+(null==(t=e.labelMarkup)?"":t)+"\n"),n+="\n\n",e.label.hidden&&e.label.className&&e.component.validate.required&&(n+='\n \n'),n+="\n\n"+(null==(t=e.element)?"":t)+"\n\n",e.label.hidden||"bottom"!==e.label.labelPosition||(n+="\n "+(null==(t=e.labelMarkup)?"":t)+"\n"),n+="\n",e.component.description&&(n+='\n
    '+(null==(t=e.t(e.component.description,{_userInput:!0}))?"":t)+"
    \n"),n+"\n"}},77703:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(81336)),o=i(n(21193));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,align:o.default};t.default=a},3677:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+="
    \n ",e.component.legend&&(n+='\n \n '+(null==(t=e.t(e.component.legend,{_userInput:!0}))?"":t)+"\n ",e.component.tooltip&&(n+='\n \n '),n+="\n \n "),n+="\n ",e.collapsed||(n+='\n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n "),n+"\n
    \n"}},2619:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(3677))&&r.__esModule?r:{default:r}).default};t.default=o},99748:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.options.vpat&&(n+='\n \n'),n+="\n",e.self.imageUpload?(n+="\n
    \n ",e.files.forEach((function(r){n+='\n
    \n \n '+(null==(t=r.originalName||r.name)?\n ',e.disabled||(n+='\n \n '),n+="\n \n
    \n "})),n+="\n
    \n"):(n+="\n ",e.options.vpat&&(n+="\n
    "+(null==(t=e.component.filePattern&&"*"!==e.component.filePattern?e.t("Allowed file types: ")+e.component.filePattern:"Any file types are allowed")?"":t)+"
    \n "),n+='\n
      \n \n ",e.files.forEach((function(r){n+='\n
    • \n
      \n ',e.disabled||(n+='\n
      \n '),n+='\n
      \n '+(null==(t=e.t("Press to open "))?"":t)+""+(null==(t=r.originalName||r.name)?"":t)+"\n \n ",n+='\n
      \n
      '+(null==(t=e.fileSize(r.size))?"":t)+"
      \n ",e.self.hasTypes&&!e.disabled&&(n+='\n
      \n \n
      \n "),n+="\n ",e.self.hasTypes&&e.disabled&&(n+='\n
      '+(null==(t=r.fileType)?"":t)+"
      \n "),n+="\n
      \n
    • \n "})),n+="\n
    \n"),n+="\n",e.disabled||!e.component.multiple&&e.files.length||(n+="\n ",e.self.useWebViewCamera?n+='\n
    \n \n \n
    \n ":e.self.cameraMode?n+='\n
    \n \n
    \n \n \n ":(n+='\n \n '),n+="\n"),n+="\n",e.statuses.forEach((function(r){n+='\n
    \n
    \n
    '+(null==(t=r.originalName)?"":t)+'\n \n '+(null==(t=e.t("Remove button. Press to remove "+r.originalName||0))?"":t)+'\n '+(null==(t=r.message?r.message.replace(";","."):"")?"":t)+'\n \n
    \n
    '+(null==(t=e.fileSize(r.size))?"":t)+'
    \n
    \n
    \n
    \n ',"progress"===r.status?n+='\n
    \n
    \n '+(null==(t=r.progress)?"":t)+"% "+(null==(t=e.t("Complete"))?"":t)+"\n
    \n
    \n ":"error"===r.status?n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ":n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ",n+="\n
    \n
    \n
    \n"})),n+="\n",e.component.storage&&!e.support.hasWarning||(n+='\n
    \n ',e.component.storage||(n+="\n

    "+(null==(t=e.t("No storage has been set for this field. File uploads are disabled until storage is set up."))?"":t)+"

    \n "),n+="\n ",e.support.filereader||(n+="\n

    "+(null==(t=e.t("File API & FileReader API not supported."))?"":t)+"

    \n "),n+="\n ",e.support.formdata||(n+="\n

    "+(null==(t=e.t("XHR2's FormData is not supported."))?"":t)+"

    \n "),n+="\n ",e.support.progress||(n+="\n

    "+(null==(t=e.t("XHR2's upload progress isn't supported."))?"":t)+"

    \n "),n+="\n
    \n"),n+="\n"}},10910:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(99748))&&r.__esModule?r:{default:r}).default};t.default=o},80692:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+="<"+(null==(t=e.tag)?"":t)+' class="formio-component-htmlelement '+(null==(t=e.component.className)?"":t)+'" ref="html"\n ',e.attrs.forEach((function(e){n+="\n "+(null==(t=e.attr)?"":t)+'="'+(null==(t=e.value)?"":t)+'"\n '})),n+="\n>"+(null==(t=e.t(e.content))?"":t),e.singleTags&&-1!==e.singleTags.indexOf(e.tag)||(n+=""),n+="\n"}},28209:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(80692))&&r.__esModule?r:{default:r}).default};t.default=o},72663:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+''+(null==(t=e.content)?"":t)+"\n"}},34885:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(72663))&&r.__esModule?r:{default:r}).default};t.default=o},64968:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(92222),t.default=function(e,t,n){if("fa"===e)switch(t){case"save":t="download";break;case"zoom-in":t="search-plus";break;case"zoom-out":t="search-minus";break;case"question-sign":t="question-circle";break;case"remove-circle":t="times-circle-o";break;case"new-window":t="window-restore";break;case"move":t="arrows";break;case"time":t="clock-o"}return n?"".concat(e," ").concat(e,"-").concat(t," ").concat(e,"-spin"):"".concat(e," ").concat(e,"-").concat(t)}},5508:function(e,t,n){"use strict";n(69070),n(47941),n(57327),n(38880),n(89554),n(54747),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(83710),n(41539),n(39714),n(96649),n(96078),n(82526),n(41817),n(9653);var r=pe(n(45284)),o=pe(n(15590)),i=pe(n(14943)),a=pe(n(89298)),u=pe(n(74798)),l=pe(n(65181)),s=pe(n(98953)),c=pe(n(31440)),f=pe(n(19838)),d=pe(n(40707)),p=pe(n(28569)),h=pe(n(36567)),y=pe(n(28857)),m=pe(n(6311)),v=pe(n(16056)),b=pe(n(42142)),g=pe(n(64401)),w=pe(n(27915)),k=pe(n(11594)),O=pe(n(10158)),_=pe(n(21838)),S=pe(n(5342)),j=pe(n(77703)),P=pe(n(2619)),x=pe(n(10910)),E=pe(n(28209)),C=pe(n(34885)),A=pe(n(64968)),T=pe(n(98781)),R=pe(n(59811)),M=pe(n(38304)),D=pe(n(97028)),I=pe(n(56105)),L=pe(n(40822)),V=pe(n(75441)),N=pe(n(20073)),F=pe(n(44857)),B=pe(n(87505)),U=pe(n(5392)),z=pe(n(32878)),q=pe(n(2265)),H=pe(n(40486)),W=pe(n(24628)),K=pe(n(80247)),Y=pe(n(80411)),G=pe(n(36236)),$=pe(n(58830)),J=pe(n(3246)),X=pe(n(4287)),Z=pe(n(40708)),Q=pe(n(67741)),ee=pe(n(75401)),te=pe(n(1)),ne=pe(n(29304)),re=pe(n(56429)),oe=pe(n(13380)),ie=pe(n(41345)),ae=pe(n(187)),ue=pe(n(88057)),le=pe(n(75273)),se=pe(n(24376)),ce=pe(n(25486)),fe=pe(n(21337)),de=pe(n(75284));function pe(e){return e&&e.__esModule?e:{default:e}}function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function me(e){for(var t=1;t'+(null==(t=e.input.content)?"":t)+"\n ",e.hasValueMaskInput&&(n+='\n \n '),n+="\n"}return n+="\n",(e.component.editor||e.component.wysiwyg)&&(n+='\n
    \n'),n+="\n","datetime"===e.component.type&&(n+='\n\n'),n+="\n",e.suffix&&(n+='\n
    \n \n ',e.suffix instanceof HTMLElement?n+="\n "+(null==(t=e.t(e.suffix.outerHTML,{_userInput:!0}))?"":t)+"\n ":n+="\n "+(null==(t=e.t(e.suffix,{_userInput:!0}))?"":t)+"\n ",n+="\n \n
    \n"),n+="\n",(e.prefix||e.suffix)&&(n+="\n \n"),n+="\n",(e.component.showCharCount||e.component.showWordCount)&&(n+='\n
    \n ',e.component.showCharCount&&(n+='\n \n '),n+="\n ",e.component.showWordCount&&(n+='\n \n '),n+="\n
    \n"),n+"\n"}},19423:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.value?n+=null==(t=e.value)?"":t:n+="-",n+"
    \n"}},98781:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(62247)),o=i(n(19423));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},2025:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n '+(null==(t=e.t(e.component.label,{_userInput:!0}))?"":t)+"\n ","number"!==e.component.type&&"phoneNumber"!==e.component.type&&"currency"!==e.component.type||(n+='\n , '+(null==(t=e.t("numeric only"))?"":t)+",\n "),n+="\n ",e.component.tooltip&&(n+='\n \n '),n+"\n\n"}},59811:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(2025))&&r.__esModule?r:{default:r}).default};t.default=o},76904:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'
    \n
    \n
    \n
    \n
    \n'}},38304:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(76904))&&r.__esModule?r:{default:r}).default};t.default=o},71956:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"Loading...\n"}},97028:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(71956))&&r.__esModule?r:{default:r}).default};t.default=o},31597:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n'}},56105:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(31597))&&r.__esModule?r:{default:r}).default};t.default=o},46742:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.message)?"":t)+"
    \n"}},40822:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(46742))&&r.__esModule?r:{default:r}).default};t.default=o},47190:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n\n\n '+(null==(t=e.previewText)?"":t)+'\n\n
    \n '+(null==(t=e.messages)?"":t)+"\n
    \n"}},44857:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(47190))&&r.__esModule?r:{default:r}).default};t.default=o},34585:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n
    \n \n '+(null==(t=e.t("Close"))?"":t)+'\n \n
    \n
    \n
    \n'}},75441:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(34585))&&r.__esModule?r:{default:r}).default};t.default=o},16160:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n \n \n \n
    '+(null==(t=e.content)?"":t)+"
    \n
    \n"}},20073:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(16160))&&r.__esModule?r:{default:r}).default};t.default=o},31737:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n '+(null==(t=e.element)?"":t)+"\n \n ",e.disabled||(n+='\n \n \n \n '),n+"\n\n"}},5392:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(31737))&&r.__esModule?r:{default:r}).default};t.default=o},47935:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n '+(null==(t=e.rows)?"":t)+"\n ",e.disabled||(n+='\n \n \n \n "),n+"\n \n
    \n \n
    \n"}},32878:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(47935))&&r.__esModule?r:{default:r}).default};t.default=o},33793:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+='\n '+(null==(t=e.label)?"":t)+"\n "})),n+='\n \n \n \n ',e.component.collapsible&&(n+='\n \n '),n+="\n ",e.component.hideLabel&&!e.builder||(n+="\n "+(null==(t=e.t(e.component.title,{_userInput:!0}))?"":t)+"\n "),n+="\n ",e.component.tooltip&&(n+='\n \n '),n+="\n \n \n "),n+="\n ",e.collapsed&&!e.builder||(n+='\n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n "),n+"\n\n"}},2265:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(47760))&&r.__esModule?r:{default:r}).default};t.default=o},52342:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n\t\n\t\t\n\t\n\t\n\t\t\n\t\n
    \n '+(null==(t=e.submitButton)?"":t)+"\n
    \n"}},40486:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(52342))&&r.__esModule?r:{default:r}).default};t.default=o},67384:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n\t
    \n '+(null==(t=e.form)?"":t)+"\n
    \n
    \n"}},24628:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(67384))&&r.__esModule?r:{default:r}).default};t.default=o},47733:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n

    '+(null==(t=e.t("Upload a PDF File"))?"":t)+'

    \n \n
    \n \n '+(null==(t=e.t("Drop pdf to start, or"))?"":t)+' '+(null==(t=e.t("browse"))?"":t)+'\n \n \n
    \n
    \n\n
    \n
    \n\n'}},80247:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(47733))&&r.__esModule?r:{default:r}).default};t.default=o},36564:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n \n "})),n+="\n\n"}},92635:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,(n+='
    \n ')+"\n "+(null==(t=e.values.filter((function(t){return e.value===t.value||"object"==typeof e.value&&e.value.hasOwnProperty(t.value)&&e.value[t.value]})).map((function(t){return e.t(t.label,{_userInput:!0})})).join(", "))?"":t)+"\n
    \n"}},80411:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(36564)),o=i(n(92635));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},59464:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'\n \n \n \n \n \n \n \n \n
    \n '+(null==(t=e.element)?"":t)+'\n
    \n \n
    \n"}},36236:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(59464))&&r.__esModule?r:{default:r}).default};t.default=o},99291:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+=''+(null==(t=e.selectOptions)?"":t)+'\n\n'}},29645:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.value?n+=null==(t=e.self.itemValueForHTMLMode(e.value))?"":t:n+="-",n+"
    \n"}},58830:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(99291)),o=i(n(29645));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},37040:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+="\n"}},89741:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.selected&&(n+=null==(t=e.t(e.option.label,{_userInput:!0}))?"":t),n+"\n"}},3246:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(37040)),o=i(n(89741));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},66272:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+=(null==(t=e.element)?"":t)+'\n\n \n \n \n \n ',e.required&&(n+='\n \n '),n+='\n \n\n',e.component.footer&&(n+='\n \n"),n+"\n"}},47044:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'\n'}},4287:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(66272)),o=i(n(47044));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},79419:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n \n \n ',e.component.values.forEach((function(r){n+='\n \n "})),n+="\n \n \n \n ",e.component.questions.forEach((function(r){n+="\n \n \n ",e.component.values.forEach((function(o){n+='\n \n '})),n+="\n \n "})),n+="\n \n
    \n '+(null==(t=e.t(r.label,{_userInput:!0}))?"":t)+"\n ",r.tooltip&&(n+='\n \n '),n+="\n
    \n "+(null==(t=e.t(r.label))?"":t)+"\n ",r.tooltip&&(n+='\n \n '),n+="\n \n \n
    \n"}},80188:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n ',e.component.questions.forEach((function(r){n+="\n \n \n \n \n "})),n+="\n \n
    "+(null==(t=e.t(r.label))?"":t)+"\n ",e.component.values.forEach((function(o){n+="\n ",e.value&&e.value.hasOwnProperty(r.value)&&e.value[r.value]===o.value&&(n+="\n "+(null==(t=e.t(o.label))?"":t)+"\n "),n+="\n "})),n+="\n
    \n"}},40708:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(79419)),o=i(n(80188));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},61915:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.component.components.forEach((function(r,o){n+='\n
    \n
    \n

    '+(null==(t=e.t(r.label,{_userInput:!0}))?"":t)+'

    \n
    \n \n '+(null==(t=e.tabComponents[o])?"":t)+"\n
    \n \n"})),n+="\n"}},78395:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n \n
    \n ",e.component.components.forEach((function(r,o){n+='\n \n '+(null==(t=e.tabComponents[o])?"":t)+"\n
    \n "})),n+="\n\n"}},67741:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(61915)),o=i(n(78395));function i(e){return e&&e.__esModule?e:{default:e}}var a={flat:r.default,form:o.default};t.default=a},13381:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n ",e.component.header&&e.component.header.length>0&&(n+="\n \n \n ",e.component.header.forEach((function(r){n+="\n \n "})),n+="\n \n \n "),n+="\n \n ",e.tableComponents.forEach((function(r,o){n+='\n \n ',r.forEach((function(r,i){n+='\n \n "})),n+="\n \n
    '+(null==(t=e.t(e.component.label))?"":t)+"
    "+(null==(t=e.t(r))?"":t)+"
    \n "})),n+="\n
    \n"}},75401:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(13381))&&r.__esModule?r:{default:r}).default};t.default=o},81863:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.children.forEach((function(e){n+='\n \n '+(null==(t=e)?"":t)+"\n \n"})),n+="\n"}},42142:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(81863))&&r.__esModule?r:{default:r}).default};t.default=o},45568:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.node.isRoot?n+='\n
    \n':n+='\n
  • \n',n+="\n ",e.content&&(n+='\n
    \n '+(null==(t=e.content)?"":t)+"\n
    \n "),n+="\n ",e.childNodes&&e.childNodes.length&&(n+='\n
      \n '+(null==(t=e.childNodes.join(""))?"":t)+"\n
    \n "),n+="\n",e.node.isRoot?n+="\n
  • \n":n+="\n \n",n+"\n"}},1:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(45568))&&r.__esModule?r:{default:r}).default};t.default=o},62720:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    '+(null==(t=e.children)?"":t)+"
    \n ",e.readOnly||(n+='\n
    \n \n \n
    \n "),n+"\n
    \n"}},29304:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=o(n(62720));function o(e){return e&&e.__esModule?e:{default:e}}var i={treeView:{form:o(n(26062)).default},treeEdit:{form:r.default}};t.default=i},26062:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.values.forEach((function(e){n+='\n
    \n '+(null==(t=e)?"":t)+"\n
    \n "})),n+='\n
    \n
    \n ',e.node.hasChildren&&(n+='\n \n "),n+="\n ",e.readOnly||(n+='\n \n \n \n ",e.node.revertAvailable&&(n+='\n \n "),n+="\n "),n+="\n
    \n
    \n
    \n"}},50332:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.t(e.component.title,{_userInput:!0}))?"":t)+"
    \n"}},83946:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.children)?"":t)+"
    \n"}},56429:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(83946)),o=i(n(50332));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,builder:o.default};t.default=a},80643:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n
    \n"}},13380:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(80643))&&r.__esModule?r:{default:r}).default};t.default=o},7349:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.t(e.component.title,{_userInput:!0}))?"":t)+"
    \n"}},77090:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n ',"wizardHeaderVertical"===e.wizardHeaderType?(n+='\n
    \n ',"right"!==e.wizardHeaderLocation&&(n+='\n
    \n '+(null==(t=e.wizardHeader)?"":t)+"\n
    \n "),n+='\n
    \n '+(null==(t=e.components)?"":t)+"\n
    \n ","right"===e.wizardHeaderLocation&&(n+='\n
    \n '+(null==(t=e.wizardHeader)?"":t)+"\n
    \n "),n+='\n
    \n
    \n '+(null==(t=e.wizardNav)?"":t)+"\n
    \n "):n+="\n "+(null==(t=e.wizardHeader)?"":t)+'\n
    \n '+(null==(t=e.components)?"":t)+"\n
    \n "+(null==(t=e.wizardNav)?"":t)+"\n ",n+"\n
    \n
    \n"}},41345:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(77090)),o=i(n(7349));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,builder:o.default};t.default=a},29864:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},187:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(29864))&&r.__esModule?r:{default:r}).default};t.default=o},47626:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},88057:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(47626))&&r.__esModule?r:{default:r}).default};t.default=o},9289:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},75273:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(9289))&&r.__esModule?r:{default:r}).default};t.default=o},38054:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
      \n ',e.buttonOrder.forEach((function(r){n+="\n ","cancel"===r&&e.buttons.cancel&&(n+='\n
    • \n \n
    • \n "),n+="\n ","previous"===r&&e.buttons.previous&&(n+='\n
    • \n \n
    • \n "),n+="\n ","next"===r&&e.buttons.next&&(n+='\n
    • \n \n
    • \n "),n+="\n ","submit"===r&&e.buttons.submit&&(n+="\n
    • \n ",e.disableWizardSubmit?n+='\n \n ":n+='\n \n ",n+="\n
    • \n "),n+="\n "})),n+="\n
    \n"}},24376:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(38054))&&r.__esModule?r:{default:r}).default};t.default=o},14086:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n \n ',e.groups.forEach((function(e){n+="\n "+(null==(t=e)?"":t)+"\n "})),n+="\n
    \n"}},4778:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(14086))&&r.__esModule?r:{default:r}).default};t.default=o},52601:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n
    \n \n '+(null==(t=e.t(e.group.title,{_userInput:!0}))?"":t)+'\n \n
    \n
    \n \n
    \n ',e.group.componentOrder.length||e.subgroups.length?(n+="\n ",!e.group.componentOrder||e.group.componentOrder.forEach((function(r){n+='\n \n ',e.group.components[r].icon&&(n+='\n \n '),n+="\n "+(null==(t=e.t(e.group.components[r].title,{_userInput:!0}))?"":t)+"\n \n "})),n+="\n "+(null==(t=e.subgroups.join(""))?"":t)+"\n "):n+="\n
    "+(null==(t=e.t("No Matches Found"))?"":t)+"
    \n ",n+="\n
    \n
    \n\n"}},53195:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(52601))&&r.__esModule?r:{default:r}).default};t.default=o},95514:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n \n
    \n '+(null==(t=e.form)?"":t)+"\n
    \n
    \n
    \n"}},85646:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(95514))&&r.__esModule?r:{default:r}).default};t.default=o},26216:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n
    \n
    \n
    '+(null==(t=e.t(e.component.label))?"":t)+(null==(t=e.self.isIE()?", dialog":"")?"":t)+"\n ",e.options.vpat?n+='\n \n ':n+='\n \n ',n+='\n
    \n ',e.visible&&(n+="\n "+(null==(t=e.children)?"":t)+"\n "),n+='\n
    \n ',e.options.vpat&&(n+='\n \n "),n+'\n \n
    \n
    \n
    \n \n
    \n
    \n'}},42126:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(26216))&&r.__esModule?r:{default:r}).default};t.default=o},94909:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={"form-group":"formio-form-group"}},82849:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n '+(null==(t=r.hideLabel?"":e.t(r.label||r.title,{_userInput:!0}))?"":t)+"\n ",r.tooltip&&(n+=' '),n+="\n \n "})),n+="\n ",e.hasExtraColumn&&(n+='\n \n "),n+="\n \n \n "),n+='\n \n ',e.rows.forEach((function(r,o){n+="\n ",e.hasGroups&&e.groups[o]&&(n+='\n \n '+(null==(t=e.groups[o].label)?"":t)+"\n \n "),n+='\n \n ',e.component.reorder&&(n+='\n \n '),n+="\n ",e.columns.forEach((function(o){n+='\n \n "})),n+="\n ",e.hasExtraColumn&&(n+="\n ",e.hasRemoveButtons&&(n+='\n \n '),n+="\n ",e.canAddColumn&&(n+='\n \n "),n+="\n "),n+="\n \n "})),n+="\n \n ",!e.builder&&e.hasAddButton&&e.hasBottomSubmit&&(n+='\n \n \n \n \n \n "),n+="\n
    \n '+(null==(t=e.t("Add/Remove"))?"":t)+"\n ",!e.builder&&e.hasAddButton&&e.hasTopSubmit&&(n+='\n \n "),n+="\n
    \n \n \n "+(null==(t=r[o.key])?"":t)+"\n \n \n \n '+(null==(t=e.placeholder)?"":t)+"\n
    \n \n
    \n"}},99622:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(82849))&&r.__esModule?r:{default:r}).default};t.default=o},44749:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'
    \n
    \n \n
    \n'}},43705:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(44749))&&r.__esModule?r:{default:r}).default};t.default=o},2034:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.options.vpat&&(n+='\n \n'),n+="\n",e.self.imageUpload?(n+="\n
    \n ",e.files.forEach((function(r){n+='\n
    \n \n '+(null==(t=r.originalName||r.name)?\n ',e.disabled||(n+='\n \n '),n+="\n \n
    \n "})),n+="\n
    \n"):(n+="\n ",e.options.vpat&&(n+="\n
    "+(null==(t=e.component.filePattern&&"*"!==e.component.filePattern?e.t("Allowed file types: ")+e.component.filePattern:"Any file types are allowed")?"":t)+"
    \n "),n+='\n
      \n \n ",e.files.forEach((function(r){n+='\n
    • \n
      \n ',e.disabled||(n+='\n
      \n '),n+='\n
      \n '+(null==(t=e.t("Press to open "))?"":t)+""+(null==(t=r.originalName||r.name)?"":t)+"\n \n ",n+='\n
      \n
      '+(null==(t=e.fileSize(r.size))?"":t)+"
      \n ",e.self.hasTypes&&!e.disabled&&(n+='\n
      \n \n
      \n "),n+="\n ",e.self.hasTypes&&e.disabled&&(n+='\n
      '+(null==(t=r.fileType)?"":t)+"
      \n "),n+="\n
      \n
    • \n "})),n+="\n
    \n"),n+="\n",e.disabled||!e.component.multiple&&e.files.length||(n+="\n ",e.self.useWebViewCamera?n+='\n
    \n \n \n
    \n ":e.self.cameraMode?n+='\n
    \n \n
    \n \n \n ":(n+='\n \n '),n+="\n"),n+="\n",e.statuses.forEach((function(r){n+='\n
    \n
    \n
    '+(null==(t=r.originalName)?"":t)+'\n \n '+(null==(t=e.t("Remove button. Press to remove "+r.originalName||0))?"":t)+'\n '+(null==(t=r.message?r.message.replace(";","."):"")?"":t)+'\n \n
    \n
    '+(null==(t=e.fileSize(r.size))?"":t)+'
    \n
    \n
    \n
    \n ',"progress"===r.status?n+='\n
    \n
    \n '+(null==(t=r.progress)?"":t)+"% "+(null==(t=e.t("Complete"))?"":t)+"\n
    \n
    \n ":"error"===r.status?n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ":n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ",n+="\n
    \n
    \n
    \n"})),n+="\n",e.component.storage&&!e.support.hasWarning||(n+='\n
    \n ',e.component.storage||(n+="\n

    "+(null==(t=e.t("No storage has been set for this field. File uploads are disabled until storage is set up."))?"":t)+"

    \n "),n+="\n ",e.support.filereader||(n+="\n

    "+(null==(t=e.t("File API & FileReader API not supported."))?"":t)+"

    \n "),n+="\n ",e.support.formdata||(n+="\n

    "+(null==(t=e.t("XHR2's FormData is not supported."))?"":t)+"

    \n "),n+="\n ",e.support.progress||(n+="\n

    "+(null==(t=e.t("XHR2's upload progress isn't supported."))?"":t)+"

    \n "),n+="\n
    \n"),n+="\n"}},79719:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(2034))&&r.__esModule?r:{default:r}).default};t.default=o},66248:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(83710),n(41539),n(39714);var r=m(n(4778)),o=m(n(53195)),i=m(n(85646)),a=m(n(42126)),u=m(n(99622)),l=m(n(43705)),s=m(n(79719)),c=m(n(38158)),f=m(n(94785)),d=m(n(11293)),p=m(n(19594)),h=m(n(28705)),y=m(n(94909));function m(e){return e&&e.__esModule?e:{default:e}}var v={transform:function(e,t){return t&&"class"===e&&this.cssClasses.hasOwnProperty(t.toString())?this.cssClasses[t.toString()]:t},builderSidebar:r.default,builderSidebarGroup:o.default,builderWizard:i.default,componentModal:a.default,datagrid:u.default,dialog:l.default,file:s.default,input:c.default,label:f.default,modalPreview:d.default,radio:p.default,table:h.default,cssClasses:y.default};t.default=v},44274:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";if(Array.prototype.join,(e.prefix||e.suffix)&&(n+='\n
    \n '),n+="\n ",e.prefix&&(n+='\n
    \n ',e.prefix instanceof HTMLElement?n+="\n "+(null==(t=e.t(e.prefix.outerHTML,{_userInput:!0}))?"":t)+"\n ":n+="\n "+(null==(t=e.t(e.prefix,{_userInput:!0}))?"":t)+"\n ",n+="\n
    \n "),n+="\n ",!e.component.editor&&!e.component.wysiwyg){for(var r in n+="\n <"+(null==(t=e.input.type)?"":t)+'\n ref="'+(null==(t=e.input.ref?e.input.ref:"input")?"":t)+'"\n ',e.input.attr)n+="\n "+(null==(t=r)?"":t)+'="'+(null==(t=e.input.attr[r])?"":t)+'"\n ';n+='\n id="'+(null==(t=e.instance.id)?"":t)+"-"+(null==(t=e.component.key)?"":t)+'"\n aria-labelledby="l-'+(null==(t=e.instance.id)?"":t)+"-"+(null==(t=e.component.key)?"":t)+" ",e.component.description&&(n+="d-"+(null==(t=e.instance.id)?"":t)+"-"+(null==(t=e.component.key)?"":t)),n+='"\n aria-required="'+(null==(t="input"!==e.input.ref&&e.input.ref?e.component.fields&&e.component.fields[e.input.ref]&&e.component.fields[e.input.ref].required||!1:e.component.validate.required)?"":t)+'"\n >'+(null==(t=e.input.content)?"":t)+"\n ",e.hasValueMaskInput&&(n+='\n \n '),n+="\n"}return n+="\n",(e.component.editor||e.component.wysiwyg)&&(n+='\n
    \n'),n+="\n","datetime"===e.component.type&&(n+='\n\n'),n+="\n",e.suffix&&(n+='\n
    \n ',e.suffix instanceof HTMLElement?n+="\n "+(null==(t=e.t(e.suffix.outerHTML,{_userInput:!0}))?"":t)+"\n ":n+="\n "+(null==(t=e.t(e.suffix,{_userInput:!0}))?"":t)+"\n ",n+="\n
    \n"),n+="\n",(e.prefix||e.suffix)&&(n+="\n
    \n"),n+="\n",(e.component.showCharCount||e.component.showWordCount)&&(n+='\n
    \n ',e.component.showCharCount&&(n+='\n \n '),n+="\n ",e.component.showWordCount&&(n+='\n \n '),n+="\n
    \n"),n+"\n"}},39221:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.value?n+=null==(t=e.value)?"":t:n+="-",n+"
    \n"}},38158:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(n(44274)),o=i(n(39221));function i(e){return e&&e.__esModule?e:{default:e}}var a={form:r.default,html:o.default};t.default=a},92293:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n '+(null==(t=e.t(e.component.label,{_userInput:!0}))?"":t)+"\n ","number"!==e.component.type&&"phoneNumber"!==e.component.type&&"currency"!==e.component.type||(n+='\n , '+(null==(t=e.t("numeric only"))?"":t)+",\n "),n+="\n ",e.component.tooltip&&(n+='\n \n '),n+"\n\n"}},94785:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(92293))&&r.__esModule?r:{default:r}).default};t.default=o},25770:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n\n\n '+(null==(t=e.previewText)?"":t)+'\n\n
    \n '+(null==(t=e.messages)?"":t)+"\n
    \n"}},11293:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(25770))&&r.__esModule?r:{default:r}).default};t.default=o},12892:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n \n "})),n+="\n\n"}},19594:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(12892))&&r.__esModule?r:{default:r}).default};t.default=o},81809:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n ",e.component.header&&e.component.header.length>0&&(n+="\n \n \n ",e.component.header.forEach((function(r){n+="\n \n "})),n+="\n \n \n "),n+="\n \n ",e.tableComponents.forEach((function(r,o){n+='\n \n ',r.forEach((function(r,i){n+='\n \n "})),n+="\n \n
    '+(null==(t=e.t(e.component.label))?"":t)+"
    "+(null==(t=e.t(r))?"":t)+"
    \n "})),n+="\n
    \n"}},28705:function(e,t,n){"use strict";var r;n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o={form:((r=n(81809))&&r.__esModule?r:{default:r}).default};t.default=o},75146:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=u(n(5508)),o=u(n(66248)),i=u(n(81575)),a=u(n(95295));function u(e){return e&&e.__esModule?e:{default:e}}var l={bootstrap:r.default,bootstrap3:i.default.templates.bootstrap3,bootstrap5:o.default,semantic:a.default.templates.semantic};t.default=l},6701:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={unsavedRowsError:"Please save all rows before proceeding.",invalidRowsError:"Please correct invalid rows before proceeding.",invalidRowError:"Invalid row. Please correct it or delete.",alertMessageWithLabel:"{{label}}: {{message}}",alertMessage:"{{message}}",complete:"Submission Complete",error:"Please fix the following errors before submitting.",errorListHotkey:"Press Ctrl + Alt + X to go back to the error list.",errorsListNavigationMessage:"Click to navigate to the field with following error.",submitError:"Please check the form and correct all errors before submitting.",required:"{{field}} is required",unique:"{{field}} must be unique",array:"{{field}} must be an array",array_nonempty:"{{field}} must be a non-empty array",nonarray:"{{field}} must not be an array",select:"{{field}} contains an invalid selection",pattern:"{{field}} does not match the pattern {{pattern}}",minLength:"{{field}} must have at least {{length}} characters.",maxLength:"{{field}} must have no more than {{length}} characters.",minWords:"{{field}} must have at least {{length}} words.",maxWords:"{{field}} must have no more than {{length}} words.",min:"{{field}} cannot be less than {{min}}.",max:"{{field}} cannot be greater than {{max}}.",maxDate:"{{field}} should not contain date after {{- maxDate}}",minDate:"{{field}} should not contain date before {{- minDate}}",maxYear:"{{field}} should not contain year greater than {{maxYear}}",minYear:"{{field}} should not contain year less than {{minYear}}",invalid_email:"{{field}} must be a valid email.",invalid_url:"{{field}} must be a valid url.",invalid_regex:"{{field}} does not match the pattern {{regex}}.",invalid_date:"{{field}} is not a valid date.",invalid_day:"{{field}} is not a valid day.",mask:"{{field}} does not match the mask.",valueIsNotAvailable:"{{ field }} is an invalid value.",stripe:"{{stripe}}",month:"Month",day:"Day",year:"Year",january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December",next:"Next",previous:"Previous",cancel:"Cancel",submit:"Submit Form",confirmCancel:"Are you sure you want to cancel?",saveDraftInstanceError:"Cannot save draft because there is no formio instance.",saveDraftAuthError:"Cannot save draft unless a user is authenticated.",restoreDraftInstanceError:"Cannot restore draft because there is no formio instance.",saveDraftError:"Unable to save draft.",restoreDraftError:"Unable to restore draft.",time:"Invalid time",cancelButtonAriaLabel:"Cancel button. Click to reset the form",previousButtonAriaLabel:"Previous button. Click to go back to the previous tab",nextButtonAriaLabel:"Next button. Click to go to the next tab",submitButtonAriaLabel:"Submit Form button. Click to submit the form"}},62604:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(41539),n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),t.ZP=void 0,n(92222),n(24812),n(32564),n(74916),n(68304),n(30489);var o,i=(o=n(57062))&&o.__esModule?o:{default:o};function a(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t-1:0),o=1;ol&&(i=a.greater(l,t),u=!1)}if(o&&e.isValid()){var s=(0,r.default)(o,t);e0&&void 0!==arguments[0]?arguments[0]:{},n=t.value;return o.default.isArray(n)?o.default.some(n,(function(n){return e.execute(u(u({},t),{},{value:n}))})):this.execute(t)}}],r=[{key:"operatorKey",get:function(){return""}},{key:"displayedName",get:function(){return""}},{key:"requireValue",get:function(){return!0}}],n&&s(t.prototype,n),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=f},93928:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(41539),n(12419),n(78011),n(69070),n(96649),n(96078),n(82526),n(41817),n(9653),n(47941),n(57327),n(38880),n(89554),n(54747),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(68304),n(24812),n(30489);var o=a(n(70943)),i=a(n(30381));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"isAfter",n=e.value,r=e.instance,o=e.conditionComponentPath;if(!n)return!1;var i=null;if(r&&r.root&&(i=r.root.getComponent(o)),i&&i.isPartialDay&&i.isPartialDay(n))return!1;var a=this.getFormattedDates(l(l({},e),{},{conditionTriggerComponent:i})),u=a.date,s=a.comparedDate;return u[t](s)}}],r=[{key:"operatorKey",get:function(){return"dateGreaterThan"}},{key:"displayedName",get:function(){return"Greater Than"}}],n&&f(t.prototype,n),r&&f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.default);t.default=m},39094:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o;function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;nn}}])&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),p}(o.default);t.default=d},77085:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(41539),n(12419),n(78011),n(69070),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(68304),n(24812),n(30489);var o=a(n(70943)),i=a(n(96486));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;nn||i.default.isEqual(t,n))}}])&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),p}(o.default);t.default=d},23723:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(41539),n(12419),n(78011),n(69070),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(26699),n(32023),n(68304),n(24812),n(30489);var o=a(n(70943)),i=a(n(96486));function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n-1;(n||i.tree||!d)&&(c=t(i,f,e));var p=function(){return i.key&&!["panel","table","well","columns","fieldset","tabs","form"].includes(i.type)&&(["datagrid","container","editgrid","address","dynamicWizard","datatable","tagpad"].includes(i.type)||i.tree)?f:i.key&&"form"===i.type?"".concat(f,".data"):r};c||(u?i.columns.forEach((function(e){return b(e.components,t,n,p(),o?i:null)}),!0):l?i.rows.forEach((function(e){Array.isArray(e)&&e.forEach((function(e){return b(e.components,t,n,p(),o?i:null)}),!0)})):s&&b(i.components,t,n,p(),o?i:null,!0))}})),e.noRecurse&&delete e.noRecurse}}function g(e,t){if((0,l.default)(t))return e.key===t||e.path===t;var n=!1;return(0,u.default)(t,(function(t,o){if(!(n=(0,r.default)(e,o)===t))return!1})),n}function w(e,t){var n=[];return b(e,(function(e){g(e,t)&&n.push(e)}),!0),n}function k(e,t,n,r){if(e){if(n=n||[],!t)return r(e);e.forEach((function(o,i){var a=n.slice();a.push(i),o&&(o.hasOwnProperty("columns")&&Array.isArray(o.columns)&&(a.push("columns"),o.columns.forEach((function(e,n){var o=a.slice();o.push(n),o.push("components"),k(e.components,t,o,r)}))),o.hasOwnProperty("rows")&&Array.isArray(o.rows)&&(a.push("rows"),o.rows.forEach((function(e,n){var o=a.slice();o.push(n),e.forEach((function(e,n){var i=o.slice();i.push(n),i.push("components"),k(e.components,t,i,r)}))}))),o.hasOwnProperty("components")&&Array.isArray(o.components)&&(a.push("components"),k(o.components,t,a,r)),o.key===t&&r(o,a,e))}))}}function O(e,t){var n=t.pop();0!==t.length&&(e=(0,r.default)(e,t)),e.splice(n,1)}function _(e){return parseFloat((0,l.default)(e)?e.replace(/[^\de.+-]/gi,""):e)}},55666:function(e,t,n){"use strict";n(4129),n(69070),n(38880),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(82526),n(41817),n(41539),n(32165),n(66992),n(78783),n(33948);var r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var l=a?Object.getOwnPropertyDescriptor(e,u):null;l&&(l.get||l.set)?Object.defineProperty(r,u,l):r[u]=e[u]}return r.default=e,n&&n.set(e,r),r}(n(82531));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}"object"===(void 0===n.g?"undefined":i(n.g))&&(n.g.FormioUtils=r);var a=r;t.default=a},52013:function(e,t,n){"use strict";n(69070),Object.defineProperty(t,"__esModule",{value:!0}),t.lodashOperators=void 0,t.lodashOperators=["chunk","compact","concat","difference","differenceBy","differenceWith","drop","dropRight","dropRightWhile","dropWhile","findIndex","findLastIndex","first","flatten","flattenDeep","flattenDepth","fromPairs","head","indexOf","initial","intersection","intersectionBy","intersectionWith","join","last","lastIndexOf","nth","slice","sortedIndex","sortedIndexBy","sortedIndexOf","sortedLastIndex","sortedLastIndexBy","sortedLastIndexOf","sortedUniq","sortedUniqBy","tail","take","takeRight","takeRightWhile","takeWhile","union","unionBy","unionWith","uniq","uniqBy","uniqWith","unzip","unzipWith","without","xor","xorBy","xorWith","zip","zipObject","zipObjectDeep","zipWith","countBy","every","filter","find","findLast","flatMap","flatMapDeep","flatMapDepth","groupBy","includes","invokeMap","keyBy","map","orderBy","partition","reduce","reduceRight","reject","sample","sampleSize","shuffle","size","some","sortBy","now","flip","negate","overArgs","partial","partialRight","rearg","rest","spread","castArray","clone","cloneDeep","cloneDeepWith","cloneDeep","conformsTo","eq","gt","gte","isArguments","isArray","isArrayBuffer","isArrayLike","isArrayLikeObject","isBoolean","isBuffer","isDate","isElement","isEmpty","isEqual","isEqualWith","isError","isFinite","isFunction","isInteger","isLength","isMap","isMatch","isMatchWith","isNaN","isNative","isNil","isNull","isNumber","isObject","isObjectLike","isPlainObject","isRegExp","isSafeInteger","isSet","isString","isSymbol","isTypedArray","isUndefined","isWeakMap","isWeakSet","lt","lte","toArray","toFinite","toInteger","toLength","toNumber","toPlainObject","toSafeInteger","toString","add","ceil","divide","floor","max","maxBy","mean","meanBy","min","minBy","multiply","round","subtract","sum","sumBy","clamp","inRange","random","at","entries","entriesIn","findKey","findLastKey","functions","functionsIn","get","has","hasIn","invert","invertBy","invoke","keys","keysIn","mapKeys","mapValues","omit","omitBy","pick","pickBy","result","toPairs","toPairsIn","transform","values","valuesIn","camelCase","capitalize","deburr","endsWith","escape","escapeRegExp","kebabCase","lowerCase","lowerFirst","pad","padEnd","padStart","parseInt","repeat","replace","snakeCase","split","startCase","startsWith","toLower","toUpper","trim","trimEnd","trimStart","truncate","unescape","upperCase","upperFirst","words","cond","conforms","constant","defaultTo","flow","flowRight","identity","iteratee","matches","matchesProperty","method","methodOf","nthArg","over","overEvery","overSome","property","propertyOf","range","rangeRight","stubArray","stubFalse","stubObject","stubString","stubTrue","times","toPath","uniqueId"]},82531:function(e,t,n){"use strict";n(82526),n(41817),n(32165),n(78783),n(91038),n(69070),n(47941),Object.defineProperty(t,"__esModule",{value:!0});var r={evaluate:!0,getRandomComponentId:!0,getPropertyValue:!0,getElementRect:!0,boolValue:!0,isMongoId:!0,checkCalculated:!0,checkSimpleConditional:!0,getComponentActualValue:!0,checkCustomConditional:!0,checkJsonConditional:!0,checkCondition:!0,checkTrigger:!0,setActionProperty:!0,unescapeHTML:!0,convertStringToHTMLElement:!0,uniqueName:!0,guid:!0,getDateSetting:!0,isValidDate:!0,currentTimezone:!0,offsetDate:!0,zonesLoaded:!0,shouldLoadZones:!0,loadZones:!0,momentDate:!0,formatDate:!0,formatOffset:!0,getLocaleDateFormatInfo:!0,convertFormatToFlatpickr:!0,convertFormatToMoment:!0,convertFormatToMask:!0,getInputMask:!0,unmaskValue:!0,matchInputMask:!0,getNumberSeparators:!0,getNumberDecimalLimit:!0,getCurrencyAffixes:!0,fieldData:!0,delay:!0,iterateKey:!0,uniqueKey:!0,bootstrapVersion:!0,unfold:!0,firstNonNil:!0,withSwitch:!0,observeOverload:!0,getContextComponents:!0,getContextButtons:!0,translateHTMLTemplate:!0,sanitize:!0,fastCloneDeep:!0,interpolate:!0,isInputComponent:!0,getArrayFromComponentPath:!0,hasInvalidComponent:!0,getStringFromComponentPath:!0,round:!0,getIEBrowserVersion:!0,getBrowserInfo:!0,getComponentPathWithoutIndicies:!0,getComponentPath:!0,getDataParentComponent:!0,isPromise:!0,isInsideScopingComponent:!0,getFocusableElements:!0,componentValueTypes:!0,getComponentSavedTypes:!0,getItemTemplateKeys:!0,isSelectResourceWithObjectValue:!0,_:!0,jsonLogic:!0,moment:!0,Evaluator:!0,ConditionOperators:!0};Object.defineProperty(t,"ConditionOperators",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"Evaluator",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o.default}}),t.boolValue=function(e){return o.default.isBoolean(e)?e:o.default.isString(e)?"true"===e.toLowerCase():!!e},t.bootstrapVersion=function(e){return e.bootstrap?e.bootstrap:"function"==typeof $&&"function"==typeof $().collapse?parseInt($.fn.collapse.Constructor.VERSION.split(".")[0],10):0},t.checkCalculated=function(e,t,n){e.calculateValue&&o.default.set(n,e.key,w(e.calculateValue,{value:void 0,data:t?t.data:n,row:n,util:this,component:e},"value"))},t.checkCondition=function(e,t,n,r,i){var a=e.customConditional,u=e.conditional;return a?S(0,a,t,n,r,"show",!0,i):u&&(u.when||o.default.some(u.conditions||[],(function(e){return e.component&&e.operator})))?O(e,u,t=P(e,t,i),n,i):!u||!u.json||j(e,u.json,t,n,r,!0)},t.checkCustomConditional=S,t.checkJsonConditional=j,t.checkSimpleConditional=O,t.checkTrigger=function(e,t,n,r,o,i){if(!t[t.type])return!1;switch(t.type){case"simple":return n=P(e,n,i,t.simple),O(e,t.simple,n,r,i);case"javascript":return S(0,t.javascript,n,r,o,"result",!1,i);case"json":return j(e,t.json,n,r,o,!1)}return!1},t.componentValueTypes=void 0,t.convertFormatToFlatpickr=function(e){return e.replace(/Z/g,"").replace(/y/g,"Y").replace("YYYY","Y").replace("YY","y").replace("MMMM","F").replace(/M/g,"n").replace("nnn","M").replace("nn","m").replace(/d/g,"j").replace(/jj/g,"d").replace("EEEE","l").replace("EEE","D").replace("HH","H").replace("hh","G").replace("mm","i").replace("ss","S").replace(/a/g,"K")},t.convertFormatToMask=function(e){return e.replace(/M{4}/g,"MM").replace(/M{3}/g,"***").replace(/e/g,"Q").replace(/[ydhmsHMG]/g,"9").replace(/a/g,"AA")},t.convertFormatToMoment=R,t.convertStringToHTMLElement=function(e,t){return(new window.DOMParser).parseFromString(e,"text/html").body.querySelector(t)},t.currentTimezone=E,t.delay=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length,r=new Array(n>2?n-2:0),o=2;o0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/\[\d+\]/,"")},t.getComponentSavedTypes=function(e){var t=e||{};return!0!==t.persistent?[]:t.multiple?[z.array]:null},t.getContextButtons=function(e){var t=[];return e.utils.eachComponent(e.instance.options.editForm.components,(function(e){"button"===e.type&&t.push({label:"".concat(e.key," (").concat(e.label,")"),value:e.key})})),t},t.getContextComponents=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=[];return e.utils.eachComponent(e.instance.options.editForm.components,(function(i,a){var u=!t||!i.tree;i.key!==e.data.key&&u&&!o.default.includes(n,i.type)&&r.push({label:"".concat(i.label||i.key," (").concat(a,")"),value:a})})),r},t.getCurrencyAffixes=function(e){var t=e.currency,n=void 0===t?"USD":t,r=e.decimalLimit,o=e.decimalSeparator,i=e.lang,a="(.*)?".concat(100..toLocaleString(i));r&&(a+="".concat("."===o?"\\.":o).concat((0).toLocaleString(i),"{").concat(r,"}")),a+="(.*)?";var u=100..toLocaleString(i,{style:"currency",currency:n,useGrouping:!0,maximumFractionDigits:r||0,minimumFractionDigits:r||0}).replace(".",o).match(new RegExp(a));return{prefix:(null==u?void 0:u[1])||"",suffix:(null==u?void 0:u[2])||""}},t.getDataParentComponent=U,t.getDateSetting=function(e){if(o.default.isNil(e)||o.default.isNaN(e)||""===e)return null;if(e instanceof Date)return e;if("function"==typeof e.toDate)return e.isValid()?e.toDate():null;var t="string"!=typeof e||-1===e.indexOf("moment(")?(0,u.default)(e):null;if(t&&t.isValid())return t.toDate();t=null;try{var n=p.default.evaluator("return ".concat(e,";"),"moment")(u.default);"string"==typeof n?t=(0,u.default)(n):"function"==typeof n.toDate?t=(0,u.default)(n.toDate().toUTCString()):n instanceof Date&&(t=(0,u.default)(n))}catch(e){return null}return t&&t.isValid()?t.toDate():null},t.getElementRect=function(e){var t=window.getComputedStyle(e,null);return{x:k(t,"left"),y:k(t,"top"),width:k(t,"width"),height:k(t,"height")}},t.getFocusableElements=function(e){return e.querySelectorAll("button:not([disabled]), input:not([disabled]), select:not([disabled]),\n textarea:not([disabled]), button:not([disabled]), [href]")},t.getIEBrowserVersion=function(){var e=F(),t=e.ie,n=e.version;return t?n:null},t.getInputMask=function(e,t){if(e instanceof Array)return e;var n=[];n.numeric=!0;for(var r=0;r1&&t.push(n[1])})),t},t.getLocaleDateFormatInfo=function(e){var t={},n=new Date(2017,11,21).toLocaleDateString(e);return t.dayFirst=n.slice(0,2)===21..toString(),t},t.getNumberDecimalLimit=function(e,t){if(o.default.has(e,"decimalLimit"))return o.default.get(e,"decimalLimit");var n=t||20,r=o.default.get(e,"validate.step","any");if("any"!==r){var i=r.toString().split(".");i.length>1&&(n=i[1].length)}return n},t.getNumberSeparators=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en",t=12345.6789.toLocaleString(e),n=t.match(/..(.)...(.)../);return n?{delimiter:n.length>1?n[1]:",",decimalSeparator:n.length>2?n[2]:"."}:{delimiter:",",decimalSeparator:"."}},t.getPropertyValue=k,t.getRandomComponentId=function(){return"e".concat(Math.random().toString(36).substring(7))},t.getStringFromComponentPath=function(e){if(!o.default.isArray(e))return e;var t="";return e.forEach((function(e,n){o.default.isNumber(e)?t+="[".concat(e,"]"):t+=0===n?e:".".concat(e)})),t},t.guid=x,t.hasInvalidComponent=function e(t){return t.getComponents().some((function(t){return o.default.isArray(t.components)?e(t):t.error}))},t.interpolate=void 0,t.isInputComponent=function(e){if(!1===e.input||!0===e.input)return e.input;switch(e.type){case"htmlelement":case"content":case"columns":case"fieldset":case"panel":case"table":case"tabs":case"well":case"button":return!1;default:return!0}},t.isInsideScopingComponent=function e(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!n&&null!=t&&t.hasScopedChildren)return!0;var r=U(t);return!(null==r||!r.hasScopedChildren)||!(null==r||!r.parent)&&e(r.parent,!1)},t.isMongoId=function(e){return e.toString().match(/^[0-9a-fA-F]{24}$/)},t.isPromise=function(e){return e&&e.then&&"function"==typeof e.then&&"[object Promise]"===Object.prototype.toString.call(e)},t.isSelectResourceWithObjectValue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.reference,n=e.dataSrc,r=e.valueProperty;return t||"resource"===n&&(!r||"data"===r)},t.isValidDate=function(e){return o.default.isDate(e)&&!o.default.isNaN(e.getDate())},t.iterateKey=M,Object.defineProperty(t,"jsonLogic",{enumerable:!0,get:function(){return a.default}}),t.loadZones=T,t.matchInputMask=function(e,t){if(!t)return!0;if(e.length>t.length)return!1;for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?50:n,o=t.delay,i=void 0===o?500:o,a=0,u=0,l=function(){return a=0};return function(){if(0!==u&&(clearTimeout(u),u=0),u=setTimeout(l,i),(a+=1)>=r)return clearTimeout(u),l(),e()}},t.offsetDate=C,t.round=function(e,t){return o.default.isNumber(e)?e.toFixed(t):e},t.sanitize=function(e,t){if("function"!=typeof f.default.sanitize)return e;var n={ADD_ATTR:["ref","target"],USE_PROFILES:{html:!0}};return t.sanitizeConfig&&Array.isArray(t.sanitizeConfig.addAttr)&&t.sanitizeConfig.addAttr.length>0&&t.sanitizeConfig.addAttr.forEach((function(e){n.ADD_ATTR.push(e)})),t.sanitizeConfig&&Array.isArray(t.sanitizeConfig.addTags)&&t.sanitizeConfig.addTags.length>0&&(n.ADD_TAGS=t.sanitizeConfig.addTags),t.sanitizeConfig&&Array.isArray(t.sanitizeConfig.allowedTags)&&t.sanitizeConfig.allowedTags.length>0&&(n.ALLOWED_TAGS=t.sanitizeConfig.allowedTags),t.sanitizeConfig&&Array.isArray(t.sanitizeConfig.allowedAttrs)&&t.sanitizeConfig.allowedAttrs.length>0&&(n.ALLOWED_ATTR=t.sanitizeConfig.allowedAttrs),t.sanitizeConfig&&t.sanitizeConfig.allowedUriRegex&&(n.ALLOWED_URI_REGEXP=t.sanitizeConfig.allowedUriRegex),t.sanitizeConfig&&Array.isArray(t.sanitizeConfig.addUriSafeAttr)&&t.sanitizeConfig.addUriSafeAttr.length>0&&(n.ADD_URI_SAFE_ATTR=t.sanitizeConfig.addUriSafeAttr),f.default.sanitize(e,n)},t.setActionProperty=function(e,t,n,r,i,a){var u=t.property.value;switch(t.property.type){case"boolean":var l=o.default.get(e,u,!1).toString(),s=t.state.toString();l!==s&&o.default.set(e,u,"true"===s);break;case"string":var c={data:i,row:r,component:e,result:n},f=t.property.component?t[t.property.component]:t.text,d=o.default.get(e,u,""),h=a&&a.interpolate?a.interpolate(f,c):p.default.interpolate(f,c);h!==d&&o.default.set(e,u,h)}return e},t.shouldLoadZones=A,t.translateHTMLTemplate=function(e,t){if(!/<[^>]*>/.test(e))return t(e);var n=document.createElement("div");return n.innerHTML=e,n.innerText&&n.children.length?(N(n,t),n.innerHTML):e},t.unescapeHTML=function(e){return"undefined"!=typeof window&&"DOMParser"in window?(new window.DOMParser).parseFromString(e,"text/html").documentElement.textContent:e},t.unfold=D,t.uniqueKey=function(e,t){for(var n=t;e.hasOwnProperty(n);)n=M(n);return n},t.uniqueName=function(e,t,n){(t=t||"{{fileName}}-{{guid}}").includes("{{guid}}")||(t="".concat(t,"-{{guid}}"));var r=e.split("."),i=r.slice(0,r.length-1).join("."),a=r.length>1?".".concat(o.default.last(r)):"";return i=i.substr(0,100),n=Object.assign(n||{},{fileName:i,guid:x()}),"".concat(p.default.interpolate(t,n)).concat(a).replace(/[^0-9a-zA-Z.\-_ ]/g,"-")},t.unmaskValue=function(e,t,n){if(!t||!e||e.length>t.length)return e;for(var r=e.split(""),i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n]*>(.*?)<\/a>/g);if(o&&o.length){if(1===o.length&&o[0].length===e.innerHTML.length)return e.innerHTML.replace(n,r);var i=o.map((function(e){var n=document.createElement("a");return n.innerHTML=e,V(n,t)}));return"".concat(r," (").concat(i.join(", "),")")}return e.innerText.replace(n,r)}return e.innerHTML}function N(e,t){var n,r=e.children.length&&(function(e){if(Array.isArray(e))return m(e)}(n=e.children)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r&&r.every((function(e){return 0===e.children.length&&L.some((function(t){return e.nodeName===t}))}));!r||o?e.innerHTML=V(e,t):r.forEach((function(e){return N(e,t)}))}function F(){var e={};if("undefined"==typeof window)return e;var t=window.navigator.userAgent.toLowerCase(),n=/(edge|edg)\/([\w.]+)/.exec(t)||/(opr)[/]([\w.]+)/.exec(t)||/(yabrowser)[ /]([\w.]+)/.exec(t)||/(chrome)[ /]([\w.]+)/.exec(t)||/(iemobile)[/]([\w.]+)/.exec(t)||/(version)(applewebkit)[ /]([\w.]+).*(safari)[ /]([\w.]+)/.exec(t)||/(webkit)[ /]([\w.]+).*(version)[ /]([\w.]+).*(safari)[ /]([\w.]+)/.exec(t)||/(webkit)[ /]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ /]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[],r={browser:n[5]||n[3]||n[1]||"",version:n[4]||n[2]||"0"};return r.browser&&(e[r.browser]=!0,e.version=parseInt(r.version,10)),(e.chrome||e.opr||e.safari||e.edg||e.yabrowser)&&(e.isWebkit=!0),(e.rv||e.iemobile)&&(e.ie=!0),e.edg&&(e.edge=!0),e.opr&&(e.opera=!0),e}function B(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e&&e.key&&"wizard"!==(null==e||null===(t=e._form)||void 0===t?void 0:t.display)?(n=e.isInputComponent||!0===e.input?"".concat(e.key).concat(n?".":"").concat(n):n,B(e.parent,n)):n}function U(e){if(e){var t=e.parent;return t&&(t.isInputComponent||t.input)?t:U(t)}}var z={number:"number",string:"string",boolean:"boolean",array:"array",object:"object",date:"date",any:"any"};t.componentValueTypes=z},24897:function(e,t,n){"use strict";n(69070),n(47941),n(57327),n(38880),n(89554),n(54747),n(49337),n(33321),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r,o=(r=n(64753))&&r.__esModule?r:{default:r};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{};m(this,e),this.config=r.default.defaults(t,e.config),this.validators={required:{key:"validate.required",method:"validateRequired",hasLabel:!0,message:function(e){return e.t(e.errorMessage("required"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){if(!(0,o.boolValue)(t)||e.isValueHidden())return!0;var r=e.validators.some((function(e){return"calendar"===e}));return!n&&r&&e.widget.enteredDate?!this.validators.calendar.check.call(this,e,t,n):!e.isEmpty(n)}},onlyAvailableItems:{key:"validate.onlyAvailableItems",method:"validateValueAvailability",hasLabel:!0,message:function(e){return e.t(e.errorMessage("valueIsNotAvailable"),{field:e.errorLabel,data:e.data})},check:function(e,t){return!(0,o.boolValue)(t)}},unique:{key:"validate.unique",hasLabel:!0,message:function(e){return e.t(e.errorMessage("unique"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){var i=this;return!(0,o.boolValue)(t)||!!(!n||r.default.isObjectLike(n)&&r.default.isEmpty(n))||!this.config.db||new a.default((function(t){var a,u=i.config.form,l=i.config.submission,s="data.".concat(e.path),c=function(e,t,n){var o=n.split(/\[\d+\]?./),i=n;if(o.length>1){i=o.shift();var a={};r.default.reduce(o,(function(t,n,i){var u=i===o.length-1,l=r.default.get(a,t,a),s="$elemMatch['".concat(n,"']");return r.default.set(l,s,u?e:{}),t?"".concat(t,".").concat(s):s}),""),t[i]=a}else t[i]=e},f={form:u._id},d={};r.default.isString(n)?e.component.dbIndex?c(n,f,s):"email"===e.component.type||"textfield"===e.component.type&&"[A-Za-z0-9]+"===(null===(a=e.component.validate)||void 0===a?void 0:a.pattern)?(c(n,f,s),d={collation:{locale:"en",strength:2}}):c({$regex:new RegExp("^".concat((0,o.escapeRegExCharacters)(n),"$")),$options:"i"},f,s):r.default.isPlainObject(n)&&n.address&&n.address.address_components&&n.address.place_id?c({$regex:new RegExp("^".concat((0,o.escapeRegExCharacters)(n.address.place_id),"$")),$options:"i"},f,"".concat(s,".address.place_id")):r.default.isArray(n)?c({$all:n},f,s):(r.default.isObject(n)||r.default.isNumber(n))&&c({$eq:n},f,s),f.deleted={$eq:null},f.state="submitted";var p=function(n,r){return n?t(!1):r?l._id&&r._id.toString()===l._id?void t(!0):(e.conflictId=r._id.toString(),t(!1)):t(!0)};i.config.db.findOne(f,null,d,(function(e,t){if(!e||!d.collation)return p(e,t);delete f[s],c({$regex:new RegExp("^".concat((0,o.escapeRegExCharacters)(n),"$")),$options:"i"},f,s),i.config.db.findOne(f,p)}))})).catch((function(){return!1}))}},multiple:{key:"validate.multiple",hasLabel:!0,message:function(e){var t=(0,o.boolValue)(e.component.multiple)||Array.isArray(e.emptyValue),n=e.component.validate.required,r=t?n?"array_nonempty":"array":"nonarray";return e.t(e.errorMessage(r),{field:e.errorLabel,data:e.data})},check:function(e,t,n){if(!e.validateMultiple())return!0;var i=(0,o.boolValue)(t),a=Array.isArray(e.emptyValue),u=Array.isArray(n),l=e.component.validate.required;return i?u?!l||!!n.length:!!r.default.isNil(n)&&!l:a||!u}},select:{key:"validate.select",hasLabel:!0,message:function(e){return e.t(e.errorMessage("select"),{field:e.errorLabel,data:e.data})},check:function(e,t,n,i,a,u,l){if(!(0,o.boolValue)(t))return!0;if(!n||r.default.isEmpty(n))return!0;if(!l)return!0;var s=e.component,c={url:t,method:"GET",qs:{},json:!0,headers:{}};if(r.default.isBoolean(c.url)){if(c.url=!!c.url,!c.url||"url"!==s.dataSrc||!s.data.url||!s.searchField)return!0;c.url=s.data.url,c.qs[s.searchField]=n,s.filter&&(c.url+=(c.url.includes("?")?"&":"?")+s.filter),s.selectFields&&(c.qs.select=s.selectFields)}return!c.url||(c.url=(0,o.interpolate)(c.url,{data:e.data}),c.url+=(c.url.includes("?")?"&":"?")+r.default.chain(c.qs).map((function(e,t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e))})).join("&").value(),s.data&&s.data.headers&&r.default.each(s.data.headers,(function(e){e.key&&(c.headers[e.key]=e.value)})),s.authenticate&&this.config.token&&(c.headers["x-jwt-token"]=this.config.token),g(new k(c.url,{headers:new w(c.headers)})).then((function(e){return!!e.ok&&e.json()})).then((function(e){return e&&e.length})).catch((function(){return!1})))}},min:{key:"validate.min",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("min"),{field:e.errorLabel,min:parseFloat(t),data:e.data})},check:function(e,t,n){var r=parseFloat(t),o=parseFloat(n);return!(!Number.isNaN(r)&&!Number.isNaN(o))||o>=r}},max:{key:"validate.max",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("max"),{field:e.errorLabel,max:parseFloat(t),data:e.data})},check:function(e,t,n){var r=parseFloat(t),o=parseFloat(n);return!(!Number.isNaN(r)&&!Number.isNaN(o))||o<=r}},minSelectedCount:{key:"validate.minSelectedCount",message:function(e,t){return e.component.minSelectedCountMessage?e.component.minSelectedCountMessage:e.t(e.errorMessage("minSelectedCount"),{minCount:parseFloat(t),data:e.data})},check:function(e,t,n){var r=parseFloat(t);if(!r)return!0;var o=Object.keys(n).reduce((function(e,t){return n[t]&&e++,e}),0);return!o||o>=r}},maxSelectedCount:{key:"validate.maxSelectedCount",message:function(e,t){return e.component.maxSelectedCountMessage?e.component.maxSelectedCountMessage:e.t(e.errorMessage("maxSelectedCount"),{minCount:parseFloat(t),data:e.data})},check:function(e,t,n){var r=parseFloat(t);return!r||Object.keys(n).reduce((function(e,t){return n[t]&&e++,e}),0)<=r}},minLength:{key:"validate.minLength",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("minLength"),{field:e.errorLabel,length:t,data:e.data})},check:function(e,t,n){var r=parseInt(t,10);return!(n&&r&&"string"==typeof n&&!e.isEmpty(n))||n.length>=r}},maxLength:{key:"validate.maxLength",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("maxLength"),{field:e.errorLabel,length:t,data:e.data})},check:function(e,t,n){var r=parseInt(t,10);return!r||"string"!=typeof n||n.length<=r}},maxWords:{key:"validate.maxWords",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("maxWords"),{field:e.errorLabel,length:t,data:e.data})},check:function(e,t,n){var r=parseInt(t,10);return!r||"string"!=typeof n||n.trim().split(/\s+/).length<=r}},minWords:{key:"validate.minWords",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("minWords"),{field:e.errorLabel,length:t,data:e.data})},check:function(e,t,n){var r=parseInt(t,10);return!r||!n||"string"!=typeof n||n.trim().split(/\s+/).length>=r}},email:{hasLabel:!0,message:function(e){return e.t(e.errorMessage("invalid_email"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){return!n||/^(([^<>()[\]\\.,;:\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,}))$/.test(n)}},url:{hasLabel:!0,message:function(e){return e.t(e.errorMessage("invalid_url"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){return!n||/^(?:(?:(?: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.test(n)&&!/^(([^<>()[\]\\.,;:\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,}))$/.test(n)}},date:{hasLabel:!0,message:function(e){return e.t(e.errorMessage("invalid_date"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){return!n||"Invalid date"!==n&&"Invalid Date"!==n&&("string"==typeof n&&(n=new Date(n)),n instanceof Date==1&&"Invalid Date"!==n.toString())}},day:{hasLabel:!0,message:function(e){return e.t(e.errorMessage("invalid_day"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){if(!n)return!0;var r=p(e.dayFirst?[0,1,2]:[1,0,2],3),o=r[0],i=r[1],a=r[2],u=n.split("/").map((function(e){return parseInt(e,10)})),l=u[o],s=u[i],c=u[a],f=function(e,t){switch(e){case 1:case 3:case 5:case 7:case 8:case 10:case 12:default:return 31;case 4:case 6:case 9:case 11:return 30;case 2:return function(e){return!(e%400&&(!(e%100)||e%4))}(t)?29:28}}(s,c);return!(l<0||l>f||s<0||s>12||c<0||c>9999)}},pattern:{key:"validate.pattern",hasLabel:!0,message:function(e,t){return e.t(r.default.get(e,"component.validate.patternMessage",e.errorMessage("pattern")),{field:e.errorLabel,pattern:t,data:e.data})},check:function(e,t,n){return!!e.isEmpty(n)||(!t||new RegExp("^".concat(t,"$")).test(n))}},json:{key:"validate.json",check:function(e,t,n,r,o,i){if(!t)return!0;var a=e.evaluate(t,{data:r,row:i,rowIndex:o,input:n});return null===a||a}},mask:{key:"inputMask",hasLabel:!0,message:function(e){return e.t(e.errorMessage("mask"),{field:e.errorLabel,data:e.data})},check:function(e,t,n){var r;if(e.isMultipleMasksField){var i=n?n.maskName:void 0,a=e.getMaskByName(i);a&&(r=a),n=n?n.value:n}else r=t;return r=r?(0,o.getInputMask)(r):null,!(n&&r&&!e.skipMaskValidation)||(r=r.map((function(t){return t===e.placeholderChar?" ":t})),(0,o.matchInputMask)(n,r))}},custom:{key:"validate.custom",message:function(e){return e.t(e.errorMessage("custom"),{field:e.errorLabel,data:e.data})},check:function(e,t,n,r,o,i){if(!t)return!0;var a=e.evaluate(t,{valid:!0,data:r,rowIndex:o,row:i,input:n},"valid",!0);return null===a||a}},maxDate:{key:"maxDate",hasLabel:!0,message:function(e,t){var n=(0,o.getDateSetting)(t);return e.t(e.errorMessage("maxDate"),{field:e.errorLabel,maxDate:(0,i.default)(n).format(e.format)})},check:function(e,t,n){if(e.isPartialDay&&e.isPartialDay(n))return!0;var a=e.getValidationFormat?(0,i.default)(n,e.getValidationFormat()):(0,i.default)(n),u=(0,o.getDateSetting)(t);return!!r.default.isNull(u)||(u.setHours(0,0,0,0),a.isBefore(u)||a.isSame(u))}},minDate:{key:"minDate",hasLabel:!0,message:function(e,t){var n=(0,o.getDateSetting)(t);return e.t(e.errorMessage("minDate"),{field:e.errorLabel,minDate:(0,i.default)(n).format(e.format)})},check:function(e,t,n){if(e.isPartialDay&&e.isPartialDay(n))return!0;var a=e.getValidationFormat?(0,i.default)(n,e.getValidationFormat()):(0,i.default)(n),u=(0,o.getDateSetting)(t);return!!r.default.isNull(u)||(u.setHours(0,0,0,0),a.isAfter(u)||a.isSame(u))}},minYear:{key:"minYear",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("minYear"),{field:e.errorLabel,minYear:t})},check:function(e,t,n){var r=t,o=/\d{4}$/.exec(n);return o=o?o[0]:null,!+r||!+o||+o>=+r}},maxYear:{key:"maxYear",hasLabel:!0,message:function(e,t){return e.t(e.errorMessage("maxYear"),{field:e.errorLabel,maxYear:t})},check:function(e,t,n){var r=t,o=/\d{4}$/.exec(n);return o=o?o[0]:null,!+r||!+o||+o<=+r}},calendar:{key:"validate.calendar",messageText:"",hasLabel:!0,message:function(e){return e.t(e.errorMessage(this.validators.calendar.messageText),{field:e.errorLabel,maxDate:(0,i.default)(e.dataValue).format(e.format)})},check:function(e,t,n,r,a){this.validators.calendar.messageText="";var u=e.getWidget(a);if(!u)return!0;var s=u.settings,c=u.enteredDate,f=s.minDate,d=s.maxDate,p=s.format,h=[(0,o.convertFormatToMoment)(p)];if(h[0].match(/M{3,}/g)&&h.push(h[0].replace(/M{3,}/g,"MM")),!n&&c){var y=(0,l.checkInvalidDate)(c,h,f,d),m=y.message,v=y.result;if(!v)return this.validators.calendar.messageText=m,v}return n&&c?(0,i.default)(n).format()!==(0,i.default)(c,h,!0).format()&&c.match(/_/gi)?(this.validators.calendar.messageText=l.CALENDAR_ERROR_MESSAGES.INCOMPLETE,!1):(u.enteredDate="",!0):void 0}},time:{key:"validate.time",messageText:"Invalid time",hasLabel:!0,message:function(e){return e.t(e.errorMessage(this.validators.time.messageText),{field:e.errorLabel})},check:function(e,t,n){return!!e.isEmpty(n)||(0,i.default)(n,e.component.format).isValid()}},availableValueProperty:{key:"validate.availableValueProperty",method:"validateValueProperty",messageText:"Invalid Value Property",hasLabel:!0,message:function(e){return e.t(e.errorMessage(this.validators.availableValueProperty.messageText),{field:e.errorLabel})},check:function(e,t,n){return"url"!==e.component.dataSrc||!r.default.isUndefined(n)&&!r.default.isObject(n)}}}}var t,n;return t=e,n=[{key:"checkValidator",value:function(e,t,n,r,o,i,u,l){var s,c=this;s=t.method&&"function"==typeof e[t.method]?e[t.method](n,r,o,i,u,l):t.check.call(this,e,n,r,o,i,u,l);var f=function(r){return"string"==typeof r?r:!r&&t.message?t.message.call(c,e,n,i,u):""};return l?a.default.resolve(s).then(f):f(s)}},{key:"validate",value:function(e,t,n,i,u,l,s,c,f){if(!c)return!1;var d=this.validators[t],p=r.default.get(f||e.component,d.key,null),h=this.checkValidator(e,d,p,n,i,u,l,s),y=function(i){if(i){var a,l={message:(0,o.unescapeHTML)(r.default.get(i,"message",i)),level:"warning"===r.default.get(i,"level")?"warning":"error",path:(0,o.getArrayFromComponentPath)(e.path||""),context:{validator:t,hasLabel:d.hasLabel,setting:p,key:e.key,label:e.label,value:n,index:u,input:null===(a=e.refs.input)||void 0===a?void 0:a[u]}};return"unique"===t&&e.conflictId&&(l.conflictId=e.conflictId),l}return!1};return s?a.default.resolve(h).then(y):y(h)}},{key:"checkComponent",value:function(e,t,n){var o,i=this,u=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s="undefined"!=typeof process&&"node"===r.default.get(process,"release.name")&&!r.default.defaultTo(e.component.persistent,!0);if(s||!1===e.component.validate)return l?a.default.resolve([]):[];t=t||e.rootValue,n=n||e.data;var c=e.component.multiple&&Array.isArray(e.validationValue)?e.validationValue:[e.validationValue],f=e.conditionallyVisible(),p=[];null!=e&&null!==(o=e.addons)&&void 0!==o&&o.length&&c.forEach((function(t){e.addons.forEach((function(e){e.checkValidity(t)||p.push.apply(p,d(e.errors||[]))}))}));var h=r.default.get(e,"component.validations"),y=[];if(h&&Array.isArray(h)&&h.length){var m=r.default.chain(h).groupBy((function(e){return e.mode})).value();if(e.calculateCondition){u=!0;var v=r.default.chain(m.ui).filter("active").groupBy((function(e){return e.group||null})).value(),b=v.null||[];delete v.null,b.forEach((function(t){var n=t.condition,r=t.message,o=t.severity;e.calculateCondition(n)||y.push({level:o||"error",message:e.t(r),componentInstance:e})})),r.default.forEach(v,(function(t){r.default.forEach(t,(function(t){var n=t.condition,r=t.message,o=t.severity;if(!e.calculateCondition(n))return y.push({level:o||"error",message:e.t(r),componentInstance:e}),!1}))}))}else y=this.checkValidations(e,h,t,n,c,l);e.validators.includes("custom")&&m.js&&r.default.each(m.js,(function(o){y.push(r.default.map(c,(function(r,a){return i.validate(e,"custom",r,t,a,n,l,f,o)})))})),e.validators.includes("json")&&m.json&&r.default.each(m.json,(function(o){y.push(r.default.map(c,(function(r,a){return i.validate(e,"json",r,t,a,n,l,f,o)})))}))}var g=r.default.get(e,"component.validate.custom"),w=r.default.get(e,"component.validate.customMessage"),k=(0,r.default)(e.validators).chain().map((function(o){return i.validators.hasOwnProperty(o)?"required"!==o||c.length?r.default.map(c,(function(r,a){return i.validate(e,o,r,t,a,n,l,f)})):[i.validate(e,o,null,t,0,n,l,f)]:{message:'Validator for "'.concat(o,'" is not defined'),level:"warning",context:{validator:o,key:e.key,label:e.label}}})).flatten().value();e.component.validate=e.component.validate||{},e.component.validate.unique=e.component.unique,k.push(this.validate(e,"unique",e.validationValue,t,0,t,l,f)),e.component.validate.multiple=e.component.multiple,k.push(this.validate(e,"multiple",e.validationValue,t,0,t,l,f)),k.push.apply(k,p),k.push.apply(k,d(y));var O=function(o){return o=(0,r.default)(o).chain().flatten().compact().value(),(w||g)&&r.default.each(o,(function(r){r.message=e.t(w||r.message,{field:e.errorLabel,data:t,row:n,error:r}),r.context.hasLabel=!1})),u?o:r.default.reject(o,(function(e){return"warning"===e.level}))};return l?a.default.all(k).then(O):O(k)}},{key:"checkValidations",value:function(e,t,n,r,o,i){var a=this,u=t.map((function(t){return a.checkRule(e,t,n,r,o,i)})).reduce((function(e,t){return t?[].concat(d(e),d(t)):e}),[]).filter((function(e){return e})).reduce((function(e,t){return e[t.context.validator]=t,e}),{});return Object.values(u)}},{key:"checkRule",value:function(e,t,n,r,o,i){var a=s.default.getRule(t.rule),u=[];if(a){var l=new a(e,t.settings,this.config);o.map((function(o,a){var s=l.check(o,n,r,i);!0!==s&&u.push({level:t.level||"error",message:e.t(t.message||l.defaultMessage,{settings:t.settings,field:e.errorLabel,data:n,row:r,error:s}),context:{key:e.key,index:a,label:e.label,validator:t.rule}})}))}return 0!==u.length&&u}},{key:"check",get:function(){return this.checkComponent}},{key:"get",value:function(){r.default.get.call(this,arguments)}},{key:"each",value:function(){r.default.each.call(this,arguments)}},{key:"has",value:function(){r.default.has.call(this,arguments)}}],n&&v(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.ValidationChecker=O,O.config={db:null,token:null,form:null,submission:null};var _=new O;t.default=_},4338:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);nd||isNaN(c)||c<0||c>12||isNaN(f)||f<0||f>9999)}}])&&a(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),h}(p)},81365:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n()[\]\\.,;:\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,}))$/.test(e)}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(d)},58788:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n=t}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(d)},36056:function(e,t,n){"use strict";n(69070),n(68304),n(24812),n(30489),n(12419),n(78011),n(32165),n(66992),n(78783),n(33948),n(92222),n(96649),n(96078),n(82526),n(41817),n(41539),n(9653);var r=n(82531),o=a(n(30381)),i=a(n(96486));function a(e){return e&&e.__esModule?e:{default:e}}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n=t}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(d)},17579:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n=t}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(d)},40535:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n=+t}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(d)},49561:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n()[\]\\.,;:\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,}))$/.test(e)}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),p}(d)},64753:function(e,t,n){"use strict";var r=n(480),o=n(31266),i=n(22762),a=n(81365),u=n(58788),l=n(35239),s=n(54266),c=n(89017),f=n(93942),d=n(40177),p=n(43117),h=n(36056),y=n(24391),m=n(17579),v=n(49561),b=n(86947),g=n(71912),w=n(18754),k=n(68135),O=n(40535),_=n(18722),S=n(30173);e.exports={custom:r,date:o,day:i,email:a,json:u,mask:l,max:s,maxDate:c,maxLength:f,maxWords:d,min:p,minDate:h,minLength:y,minWords:m,pattern:v,required:b,select:g,unique:w,url:k,minYear:O,maxYear:_,time:S}},87892:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=2&&"en"!==i)return o.GlobalFormio.requireLibrary("flatpickr-".concat(i),"flatpickr-".concat(i),"".concat(o.GlobalFormio.cdn["flatpickr-formio"],"/l10n/flatpickr-").concat(i,".js"),!0).then((function(){return n.initFlatpickr(t)}));n.initFlatpickr(t)}}))})).catch((function(e){console.warn(e)}))}},{key:"disableWeekends",get:function(){return function(e){return 0===e.getDay()||6===e.getDay()}}},{key:"disableWeekdays",get:function(){var e=this;return function(t){return!e.disableWeekends(t)}}},{key:"disableFunction",get:function(){var e=this;return function(t){return e.evaluate("return ".concat(e.settings.disableFunction),{date:t})}}},{key:"timezone",get:function(){return this.componentInstance.getTimezone(this.settings)}},{key:"defaultSettings",get:function(){return h.defaultSettings}},{key:"addSuffix",value:function(e){var t=this;return this.addEventListener(e,"click",(function(){setTimeout((function(){t.calendar&&(!t.calendar.isOpen&&Date.now()-t.closedOn>200?t.calendar.open():t.calendar.isOpen&&t.calendar.close())}),0)})),e}},{key:"disabled",set:function(e){(function(e,t,n,r,o){if(!p(e,t,n,r||e)&&o)throw new Error("failed to set property")})(w(h.prototype),"disabled",e,this,!0),this.calendar&&(e?this.calendar._input.setAttribute("disabled","disabled"):this.calendar._input.removeAttribute("disabled"),this.calendar.close(),this.calendar.redraw())}},{key:"input",get:function(){return this.calendar?this.calendar.altInput:null}},{key:"disabledDates",get:function(){return this.settings.disabledDates?this.settings.disabledDates.split(",").map((function(e){var t=/\d{4}-\d{2}-\d{2}/g,n=e.match(t);if(n&&n.length)return 1===n.length?e.match(t)[0]:{from:e.match(t)[0],to:e.match(t)[1]}})):[]}},{key:"localeFormat",get:function(){var e="";return this.settings.enableDate&&(e+=this.defaultFormat.date),this.settings.enableTime&&(e+=this.defaultFormat.time),e}},{key:"dateTimeFormat",get:function(){return this.settings.useLocaleSettings?this.localeFormat:(0,a.convertFormatToFlatpickr)(this.dateFormat)}},{key:"dateFormat",get:function(){return l.default.get(this.settings,"format",k)}},{key:"getDateValue",value:function(e,t,n){return n?(0,a.momentDate)(e,this.valueFormat,this.timezone).format((0,a.convertFormatToMoment)(t)):(0,u.default)(e).format((0,a.convertFormatToMoment)(t))}},{key:"getValue",value:function(){if(!this.calendar)return m(w(h.prototype),"getValue",this).call(this);var e=this.calendar.selectedDates;return e&&e.length?e[0]instanceof Date?this.getDateValue(e[0],this.valueFormat,"date"===this.settings.saveAs):"Invalid Date":m(w(h.prototype),"getValue",this).call(this)}},{key:"isValueISO8601",value:function(e){return e&&"string"==typeof e&&e.match(/-[0-9]{2}T[0-9]{2}:/)}},{key:"setValue",value:function(e){var t="text"===this.settings.saveAs;if(!this.calendar)return e=e?(0,a.formatDate)(this.timezonesUrl,e,(0,a.convertFormatToMoment)(this.settings.format),this.timezone,(0,a.convertFormatToMoment)(this.valueMomentFormat)):e,m(w(h.prototype),"setValue",this).call(this,e);var n=this.loadZones();e?t||!this.settings.readOnly||n?this.isValueISO8601(e)?this.calendar.setDate(e,!1):this.calendar.setDate((0,u.default)(e,this.valueMomentFormat).toDate(),!1):this.calendar.setDate((0,a.momentDate)(e,this.valueFormat,this.timezone).format(),!1):this.calendar.clear(!1)}},{key:"getValueAsString",value:function(e,t){var n=t||this.dateFormat,r=this.calendar?this.valueFormat:this.settings.dateFormat;return"text"===this.settings.saveAs&&this.componentInstance.parent&&!this.settings.readOnly?(0,u.default)(e,(0,a.convertFormatToMoment)(r)).format((0,a.convertFormatToMoment)(r)):(0,a.formatDate)(this.timezonesUrl,e,n,this.timezone,(0,a.convertFormatToMoment)(r))}},{key:"setErrorClasses",value:function(e){this.input&&(e?(this.addClass(this.input,"is-invalid"),this.input.setAttribute("aria-invalid","true")):(this.removeClass(this.input,"is-invalid"),this.input.setAttribute("aria-invalid","false")))}},{key:"validationValue",value:function(e){return"string"==typeof e?new Date(e):e.map((function(e){return new Date(e)}))}},{key:"isCalendarElement",value:function(e){var t,n,r,o,i;return!e||!(null===(t=this.calendar)||void 0===t||null===(n=t.config)||void 0===n||null===(r=n.appendTo)||void 0===r||!r.contains(e))||(null===(o=this.calendar)||void 0===o||null===(i=o.calendarContainer)||void 0===i?void 0:i.contains(e))}},{key:"initFlatpickr",value:function(e){var t=this;if(this.calendar=new e(this._input,f(f({},this.settings),{},{disableMobile:!0})),this.calendar.altInput.addEventListener("input",(function(e){t.settings.allowInput&&t.settings.currentValue!==e.target.value&&(t.settings.manualInputValue=e.target.value,t.settings.isManuallyOverriddenValue=!0,t.settings.currentValue=e.target.value),""===e.target.value&&t.calendar.selectedDates.length>0?(t.settings.wasDefaultValueChanged=!0,t.settings.defaultValue=e.target.value,t.calendar.clear()):t.settings.wasDefaultValueChanged=!1})),this.settings.readOnly||l.default.some(["MMMM"],(function(e){return l.default.includes(t.settings.format,e)}))||this.setInputMask(this.calendar._input,(0,a.convertFormatToMask)(this.settings.format)),_){var n=this.calendar._handlers.find((function(e){var n=e.event,r=e.element;return"blur"===n&&r===t.calendar._input}));this.calendar._input.removeEventListener("blur",n.handler),this.addEventListener(this.calendar._input,"blur",(function(e){var n=t.settings.shadowRoot?t.settings.shadowRoot.activeElement:document.activeElement,r=e.relatedTarget?e.relatedTarget:n;e.target===t.calendar._input&&!t.isCalendarElement(r)&&t.calendar.setDate(t.calendar._input.value,!0,e.target===t.calendar.altInput?t.calendar.config.altFormat:t.calendar.config.dateFormat)}))}this.addEventListener(this.calendar._input,"blur",(function(e){var n=t.settings.shadowRoot?t.settings.shadowRoot.activeElement:document.activeElement,r=e.relatedTarget?e.relatedTarget:n;if(_&&!r||t.isCalendarElement(r)){if(!t.calendar.input.value&&t.calendar.config.noCalendar){var o,i,l,s,c=(0,u.default)({hour:null===(o=t.calendar)||void 0===o||null===(i=o.config)||void 0===i?void 0:i.defaultHour,minute:null===(l=t.calendar)||void 0===l||null===(s=l.config)||void 0===s?void 0:s.defaultMinute}).toDate();t.calendar.setDate(c,!0,t.settings.format)}}else{var f=t.calendar.input.value,d=f?(0,u.default)(t.calendar.input.value,(0,a.convertFormatToMoment)(t.valueFormat)).toDate():f;t.calendar.setDate(d,!0,t.settings.altFormat)}})),this.addEventListener(this.calendar.altInput,"keydown",(function(e){13===e.keyCode&&t.calendar.isOpen&&(t.calendar.close(),e.stopPropagation())})),this.setValue(this.componentValue)}},{key:"initShortcutButtonsPlugin",value:function(e){var t=this;this.settings.plugins=[e({button:this.component.shortcutButtons.map((function(e){return{label:e.label,attributes:e.attribute}})),onClick:function(e){var n=t.component.shortcutButtons[e].onClick,r=t.evaluate(n,{date:new Date},"date");t.calendar.setDate(r,!0)}})]}},{key:"componentValue",get:function(){var e=this.componentInstance.dataValue;return Array.isArray(e)&&(e=e[this.valueIndex]),e}},{key:"getFlatpickrFormatDate",value:function(e){var t=this;return function(n,r){return t.settings.readOnly&&r===t.settings.altFormat?!t.settings.enableTime||t.loadZones()?e.formatDate(n,r):new Date(t.getValue()).toString()===n.toString()?(0,a.formatOffset)(t.timezonesUrl,e.formatDate.bind(e),new Date(t.componentValue),r,t.timezone):(0,a.formatOffset)(t.timezonesUrl,e.formatDate.bind(e),n,r,t.timezone):e.formatDate(n,r)}}},{key:"destroy",value:function(){m(w(h.prototype),"destroy",this).call(this),this.calendar&&this.calendar.destroy()}}])&&d(t.prototype,n),r&&d(t,r),Object.defineProperty(t,"prototype",{writable:!1}),h}(i.default);t.default=S},581:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n(41539),n(12419),n(78011),n(69070),n(74819),n(38880),n(96649),n(96078),n(82526),n(41817),n(9653),n(32165),n(66992),n(78783),n(33948),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(19601),n(24812),n(68304),n(30489);var o=u(n(96486)),i=u(n(34558)),a=u(n(91459));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){for(var n=0;n"+(null==(t=e.message)?"":t)+"\n"}},2101:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(68286);t.default={form:r.default}},83787:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n '+(null==(t=e.form)?"":t)+"\n
    \n
    \n"}},48433:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(83787);t.default={form:r.default}},85539:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.disableBuilderActions||(n+='\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n '),n+"\n "+(null==(t=e.html)?"":t)+"\n
    \n"}},7581:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(85539);t.default={form:r.default}},82097:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n '+(null==(t=e.html)?"":t)+"\n
    \n"}},2434:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(82097);t.default={form:r.default}},17894:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n

    '+(null==(t=e.t(e.componentInfo.title,{_userInput:!0}))?"":t)+" "+(null==(t=e.t("Component"))?"":t)+"

    \n
    \n ",e.helplinks&&(n+='\n \n"),n+='\n
    \n
    \n
    \n ",e.preview||(n+='\n
    \n \n \n \n
    \n "),n+="\n
    \n ",e.preview&&(n+='\n
    \n
    \n
    \n

    '+(null==(t=e.t("Preview"))?"":t)+'

    \n
    \n
    \n
    \n '+(null==(t=e.preview)?"":t)+"\n
    \n
    \n
    \n ",e.componentInfo.help&&(n+='\n
    \n '+(null==(t=e.componentInfo.help)?"":t)+"\n
    \n "),n+='\n
    \n \n \n \n
    \n
    \n "),n+"\n
    \n"}},58809:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17894);t.default={form:r.default}},41852:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'\n '+(null==(t=e.t("Drag and Drop a form component"))?"":t)+"\n\n"}},59624:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(41852);t.default={form:r.default}},70307:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n \n
    \n ',e.groups.forEach((function(e){n+="\n "+(null==(t=e)?"":t)+"\n "})),n+="\n
    \n
    \n"}},92470:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(70307);t.default={form:r.default}},74913:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n
    \n \n '+(null==(t=e.t(e.group.title,{_userInput:!0}))?"":t)+'\n \n
    \n
    \n \n
    \n ',e.group.componentOrder.length||e.subgroups.length?(n+="\n ",e.group.componentOrder.forEach((function(r){n+='\n \n ',e.group.components[r].icon&&(n+='\n \n '),n+="\n "+(null==(t=e.t(e.group.components[r].title,{_userInput:!0}))?"":t)+"\n \n "})),n+="\n "+(null==(t=e.subgroups.join(""))?"":t)+"\n "):n+="\n
    "+(null==(t=e.t("No Matches Found"))?"":t)+"
    \n ",n+="\n
    \n
    \n\n\n"}},64959:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(74913);t.default={form:r.default}},86227:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.component.columns.forEach((function(r,o){n+='\n
    \n '+(null==(t=e.columnComponents[o])?"":t)+"\n
    \n"})),n+="\n"}},7569:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86227);t.default={form:r.default}},51382:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"formio-tab-panel-active":"active","formio-tab-link-active":"active","formio-tab-link-container-active":"active"}},70897:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n '+(null==(t=r.hideLabel?"":e.t(r.label||r.title,{_userInput:!0}))?"":t)+"\n ",r.tooltip&&(n+=' '),n+="\n \n "})),n+="\n ",e.hasExtraColumn&&(n+="\n \n "),n+="\n \n \n "),n+='\n \n ',e.rows.forEach((function(r,o){n+="\n ",e.hasGroups&&e.groups[o]&&(n+='\n \n '+(null==(t=e.groups[o].label)?"":t)+"\n \n "),n+='\n \n ',e.component.reorder&&(n+='\n \n '),n+="\n ",e.columns.forEach((function(o){n+='\n \n "})),n+="\n ",e.hasExtraColumn&&(n+="\n ",e.hasRemoveButtons&&(n+='\n \n '),n+="\n ",e.canAddColumn&&(n+='\n \n "),n+="\n "),n+="\n \n "})),n+="\n \n ",e.hasAddButton&&e.hasBottomSubmit&&(n+='\n \n \n \n \n \n "),n+="\n
    \n ",!e.builder&&e.hasAddButton&&e.hasTopSubmit&&(n+='\n \n "),n+="\n
    \n \n \n '+(null==(t=r[o.key])?"":t)+"\n \n \n \n '+(null==(t=e.placeholder)?"":t)+"\n
    \n \n
    \n"}},5118:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){var n,r="";return Array.prototype.join,r+='\n ',hasHeader&&(r+="\n \n \n ",columns.forEach((function(e){r+='\n \n "})),r+="\n \n \n "),r+="\n \n ",rows.forEach((function(e){r+="\n \n ",columns.forEach((function(t){r+='\n \n "})),r+="\n \n "})),r+="\n \n
    \n '+(null==(n=e.hideLabel?"":t(e.label||e.title))?"":n)+"\n ",e.tooltip&&(r+=' '),r+="\n
    \n '+(null==(n=e[t.key])?"":n)+"\n
    \n"}},14714:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(70897),o=n(5118);t.default={form:r.default,html:o.default}},97842:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.dayFirst&&e.showDay&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+="\n ",e.showMonth&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+="\n ",!e.dayFirst&&e.showDay&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+="\n ",e.showYear&&(n+='\n
    \n ',e.component.hideInputLabels||(n+='\n
    \n "),n+'\n
    \n\n'}},11024:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(97842);t.default={form:r.default}},44033:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'
    \n
    \n
    \n
    \n \n
    \n
    \n'}},95371:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(44033);t.default={form:r.default}},61424:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
      \n ',e.header&&(n+='\n
    • \n '+(null==(t=e.header)?"":t)+"\n
    • \n "),n+="\n ",e.rows.forEach((function(r,o){n+='\n
    • \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n
      \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
      \n "),n+='\n
      \n
      \n '+(null==(t=e.errors[o])?"":t)+"\n
      \n
      \n
    • \n "})),n+="\n ",e.footer&&(n+='\n \n "),n+="\n
    \n",!e.readOnly&&e.hasAddButton&&(n+='\n\n"),n+="\n"}},47456:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
      \n ',e.header&&(n+='\n
    • \n '+(null==(t=e.header)?"":t)+"\n
    • \n "),n+="\n ",e.rows.forEach((function(r,o){n+='\n
    • \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n
      \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
      \n "),n+='\n
      \n
      \n '+(null==(t=e.errors[o])?"":t)+"\n
      \n
      \n
    • \n "})),n+="\n ",e.footer&&(n+='\n \n "),n+="\n
    \n"}},43614:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(61424),o=n(47456);t.default={form:r.default,html:o.default}},44787:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+="

    "+(null==(t=e.t("error"))?"":t)+"

    \n
      \n ",e.errors.forEach((function(r){n+='\n '+(null==(t=r.message)?"":t)+"\n "})),n+="\n
    \n"}},40079:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(44787);t.default={form:r.default}},96735:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.label.hidden||(n+='\n
    \n '+(null==(t=e.labelMarkup)?"":t)+"\n
    \n "),n+="\n\n ",e.label.hidden&&e.label.className&&e.component.validate.required&&(n+='\n
    \n \n
    \n '),n+='\n\n
    \n '+(null==(t=e.element)?"":t)+"\n
    \n
    \n\n",e.component.description&&(n+='\n
    '+(null==(t=e.t(e.component.description,{_userInput:!0}))?"":t)+"
    \n"),n+"\n"}},63646:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.label.hidden||"bottom"===e.label.labelPosition||(n+="\n "+(null==(t=e.labelMarkup)?"":t)+"\n"),n+="\n\n",e.label.hidden&&e.label.className&&e.component.validate.required&&(n+='\n \n'),n+="\n\n"+(null==(t=e.element)?"":t)+"\n",e.label.hidden||"bottom"!==e.label.labelPosition||(n+="\n "+(null==(t=e.labelMarkup)?"":t)+"\n"),n+="\n",e.component.description&&(n+='\n
    '+(null==(t=e.t(e.component.description,{_userInput:!0}))?"":t)+"
    \n"),n+"\n"}},20798:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(96735),o=n(63646);t.default={align:r.default,form:o.default}},65526:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.self.imageUpload?(n+="\n
    \n ",e.files.forEach((function(r){n+='\n
    \n \n '+(null==(t=r.originalName||r.name)?\n ',e.disabled||(n+='\n \n '),n+="\n \n
    \n "})),n+="\n
    \n"):(n+='\n
      \n \n ",e.files.forEach((function(r){n+='\n
    • \n
      \n ',e.disabled||(n+='\n
      \n '),n+='\n
      '+(null==(t=r.originalName||r.name)?"":t)+"\n ",n+='\n
      \n
      '+(null==(t=e.fileSize(r.size))?"":t)+"
      \n ",e.self.hasTypes&&!e.disabled&&(n+='\n
      \n \n
      \n "),n+="\n ",e.self.hasTypes&&e.disabled&&(n+='\n
      '+(null==(t=r.fileType)?"":t)+"
      \n "),n+="\n
      \n
    • \n "})),n+="\n
    \n"),n+="\n",e.disabled||!e.component.multiple&&e.files.length||(n+="\n ",e.self.useWebViewCamera?n+='\n
    \n \n \n
    \n ":e.self.cameraMode?n+='\n
    \n \n
    \n \n \n ":(n+='\n
    \n '+(null==(t=e.t("Drop files to attach,"))?"":t)+"\n ",e.self.imageUpload&&e.component.webcam&&(n+='\n '+(null==(t=e.t("Use Camera,"))?"":t)+"\n "),n+="\n "+(null==(t=e.t("or"))?"":t)+' '+(null==(t=e.t("browse"))?"":t)+"\n
    \n "),n+="\n"),n+="\n",e.statuses.forEach((function(r){n+='\n
    \n
    \n
    '+(null==(t=r.originalName)?"":t)+'
    \n
    '+(null==(t=e.fileSize(r.size))?"":t)+'
    \n
    \n
    \n
    \n ',"progress"===r.status?n+='\n
    \n
    \n '+(null==(t=r.progress)?"":t)+"% "+(null==(t=e.t("Complete"))?"":t)+"\n
    \n
    \n ":"error"===r.status?n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ":n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ",n+="\n
    \n
    \n
    \n"})),n+="\n",e.component.storage&&!e.support.hasWarning||(n+='\n
    \n ',e.component.storage||(n+="\n

    "+(null==(t=e.t("No storage has been set for this field. File uploads are disabled until storage is set up."))?"":t)+"

    \n "),n+="\n ",e.support.filereader||(n+="\n

    "+(null==(t=e.t("File API & FileReader API not supported."))?"":t)+"

    \n "),n+="\n ",e.support.formdata||(n+="\n

    "+(null==(t=e.t("XHR2's FormData is not supported."))?"":t)+"

    \n "),n+="\n ",e.support.progress||(n+="\n

    "+(null==(t=e.t("XHR2's upload progress isn't supported."))?"":t)+"

    \n "),n+="\n
    \n"),n}},66565:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(65526);t.default={form:r.default}},18320:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+''+(null==(t=e.content)?"":t)+"\n"}},3429:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18320);t.default={form:r.default}},42260:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if("fa"===e)switch(t){case"save":t="download";break;case"zoom-in":t="search-plus";break;case"zoom-out":t="search-minus";break;case"question-sign":t="question-circle";break;case"remove-circle":t="times-circle-o";break;case"new-window":t="window-restore";break;case"move":t="arrows"}return n?e+" "+e+"-"+t+" "+e+"-spin":e+" "+e+"-"+t}},65441:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(91033),o=n(48433),i=n(7581),a=n(2434),u=n(58809),l=n(59624),s=n(92470),c=n(64959),f=n(7569),d=n(51382),p=n(14714),h=n(11024),y=n(95371),m=n(43614),v=n(20798),b=n(66565),g=n(3429),w=n(42260),k=n(55691),O=n(17875),_=n(35284),S=n(49074),j=n(36786),P=n(8609),x=n(3499),E=n(12477),C=n(96950),A=n(61659),T=n(92882),R=n(80710),M=n(634),D=n(83980),I=n(95722),L=n(45546),V=n(68497),N=n(72065),F=n(48866),B=n(16299),U=n(2101),z=n(40079);t.default={transform:function(e,t){return t&&"class"===e&&this.cssClasses.hasOwnProperty(t.toString())?this.cssClasses[t.toString()]:t},handleBuilderSidebarScroll:function(e){e.scrollResizeObserver&&e.scrollResizeObserver.disconnect(),e.scrollResizeObserver=new r.default((function(){setTimeout((function(){var t=e.refs,n=t.form,r=t.sidebar,o=n&&n.parentNode&&n.parentNode.clientHeight,i=r&&r.clientHeight,a=r&&r.parentNode&&r.parentNode.style;a&&o&&i&&(a.height=Math.max(i+20,o)+"px")}))})),e.scrollResizeObserver.observe(e.refs.form),e.scrollResizeObserver.observe(e.refs.sidebar)},clearBuilderSidebarScroll:function(e){e.scrollResizeObserver&&(e.scrollResizeObserver.disconnect(),e.scrollResizeObserver=null)},defaultIconset:"glyphicon",iconClass:w.default,cssClasses:d.default,builder:o.default,builderComponent:i.default,builderComponents:a.default,builderEditForm:u.default,builderPlaceholder:l.default,builderSidebar:s.default,builderSidebarGroup:c.default,columns:f.default,datagrid:p.default,day:h.default,dialog:y.default,editgrid:m.default,field:v.default,file:b.default,icon:g.default,input:k.default,label:O.default,message:_.default,modaldialog:S.default,modaledit:j.default,multiValueRow:P.default,multiValueTable:x.default,panel:E.default,radio:C.default,resourceAdd:A.default,signature:T.default,survey:R.default,tab:M.default,table:D.default,well:I.default,wizard:L.default,wizardHeader:V.default,wizardHeaderClassic:N.default,wizardHeaderVertical:F.default,wizardNav:B.default,errorsList:z.default,alert:U.default}},25169:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";if(Array.prototype.join,(e.prefix||e.suffix)&&(n+='\n
    \n '),n+="\n ",e.prefix&&(n+='\n
    \n ',e.prefix instanceof HTMLElement?n+="\n "+(null==(t=e.t(e.prefix.outerHTML,{_userInput:!0}))?"":t)+"\n ":n+="\n "+(null==(t=e.t(e.prefix,{_userInput:!0}))?"":t)+"\n ",n+="\n
    \n "),n+="\n ",!e.component.editor&&!e.component.wysiwyg){for(var r in n+="\n <"+(null==(t=e.input.type)?"":t)+'\n ref="'+(null==(t=e.input.ref?e.input.ref:"input")?"":t)+'"\n ',e.input.attr)n+="\n "+(null==(t=r)?"":t)+'="'+(null==(t=e.input.attr[r])?"":t)+'"\n ';n+='\n id="'+(null==(t=e.instance.id)?"":t)+"-"+(null==(t=e.component.key)?"":t)+'"\n >'+(null==(t=e.input.content)?"":t)+"\n ",e.hasValueMaskInput&&(n+='\n \n '),n+="\n"}return n+="\n",(e.component.editor||e.component.wysiwyg)&&(n+='\n
    \n'),n+="\n",e.suffix&&(n+='\n
    \n ',e.suffix instanceof HTMLElement?n+="\n "+(null==(t=e.t(e.suffix.outerHTML,{_userInput:!0}))?"":t)+"\n ":n+="\n "+(null==(t=e.t(e.suffix,{_userInput:!0}))?"":t)+"\n ",n+="\n
    \n"),n+="\n",(e.prefix||e.suffix)&&(n+="\n
    \n"),n+="\n",e.component.showCharCount&&(n+='\n\n'),n+="\n",e.component.showWordCount&&(n+='\n\n'),n+"\n"}},81944:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.value?n+=null==(t=e.value)?"":t:n+="-",n+"
    \n"}},55691:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(25169),o=n(81944);t.default={form:r.default,html:o.default}},83340:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n ',e.label.hidden||(n+="\n "+(null==(t=e.t(e.component.label,{_userInput:!0}))?"":t)+"\n ",e.component.tooltip&&(n+='\n \n '),n+="\n "),n+"\n\n"}},17875:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(83340);t.default={form:r.default}},68059:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'

    '+(null==(t=e.message)?"":t)+"

    \n"}},35284:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(68059);t.default={form:r.default}},64375:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n
    \n \n '+(null==(t=e.t("Close"))?"":t)+'\n \n
    \n
    \n
    \n'}},49074:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(64375);t.default={form:r.default}},90685:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n \n \n \n
    '+(null==(t=e.content)?"":t)+"
    \n
    \n"}},36786:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(90685);t.default={form:r.default}},1948:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n '+(null==(t=e.element)?"":t)+"\n \n ",e.disabled||(n+='\n \n \n \n '),n+"\n\n"}},8609:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1948);t.default={form:r.default}},48021:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n '+(null==(t=e.rows)?"":t)+"\n ",e.disabled||(n+='\n \n \n \n "),n+"\n \n
    \n \n
    \n"}},3499:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(48021);t.default={form:r.default}},16094:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',(!e.component.hideLabel||e.builder||e.component.collapsible||e.component.tooltip)&&(n+='\n
    \n

    \n ',e.component.collapsible&&(n+='\n \n '),n+="\n ",e.component.hideLabel&&!e.builder||(n+="\n "+(null==(t=e.t(e.component.title,{_userInput:!0}))?"":t)+"\n "),n+="\n ",e.component.tooltip&&(n+='\n \n '),n+="\n

    \n
    \n "),n+="\n ",e.collapsed&&!e.builder||(n+='\n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n "),n+"\n
    \n"}},12477:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16094);t.default={form:r.default}},22159:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.values.forEach((function(r){for(var o in n+='\n
    \n \n
    \n "})),n+="\n
    \n"}},31152:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,(n+='
    \n ')+"\n "+(null==(t=e.values.filter((function(t){return e.value===t.value||"object"==typeof e.value&&e.value.hasOwnProperty(t.value)&&e.value[t.value]})).map((function(t){return e.t(t.label,{_userInput:!0})})).join(", "))?"":t)+"\n
    \n"}},96950:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22159),o=n(31152);t.default={form:r.default,html:o.default}},72264:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'\n \n \n \n \n \n \n \n \n
    \n '+(null==(t=e.element)?"":t)+'\n
    \n \n
    \n"}},61659:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(72264);t.default={form:r.default}},16866:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+=(null==(t=e.element)?"":t)+'\n\n\n \n \n \n \n ',e.required&&(n+='\n \n '),n+='\n \n\n',e.component.footer&&(n+='\n \n"),n+"\n"}},96141:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'\n'}},92882:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16866),o=n(96141);t.default={form:r.default,html:o.default}},40207:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n \n \n ',e.component.values.forEach((function(r){n+='\n \n "})),n+="\n \n \n \n ",e.component.questions.forEach((function(r){n+="\n \n \n ",e.component.values.forEach((function(o){n+='\n \n '})),n+="\n \n "})),n+="\n \n
    \n '+(null==(t=e.t(r.label))?"":t)+"\n ",r.tooltip&&(n+='\n \n '),n+="\n
    \n "+(null==(t=e.t(r.label))?"":t)+"\n ",r.tooltip&&(n+='\n \n '),n+="\n \n \n
    \n"}},55754:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n ',e.component.questions.forEach((function(r){n+="\n \n \n \n \n "})),n+="\n \n
    "+(null==(t=e.t(r.label))?"":t)+"\n ",e.component.values.forEach((function(o){n+="\n ",e.value&&e.value.hasOwnProperty(r.value)&&e.value[r.value]===o.value&&(n+="\n "+(null==(t=e.t(o.label))?"":t)+"\n "),n+="\n "})),n+="\n
    \n"}},80710:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(40207),o=n(55754);t.default={form:r.default,html:o.default}},87603:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.component.components.forEach((function(r,o){n+='\n
    \n
    \n

    '+(null==(t=e.t(r.label,{_userInput:!0}))?"":t)+'

    \n
    \n
    \n '+(null==(t=e.tabComponents[o])?"":t)+"\n
    \n
    \n"})),n+="\n"}},17469:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n \n
    \n ',e.component.components.forEach((function(r,o){n+='\n
    '+(null==(t=e.tabComponents[o])?"":t)+"
    \n "})),n+="\n
    \n
    \n"}},634:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(87603),o=n(17469);t.default={flat:r.default,form:o.default}},94957:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n ',e.component.header&&e.component.header.length>0&&(n+="\n \n \n ",e.component.header.forEach((function(r){n+="\n \n "})),n+="\n \n \n "),n+="\n \n ",e.tableComponents.forEach((function(r,o){n+='\n \n ',r.forEach((function(r,i){n+='\n \n "})),n+="\n \n
    "+(null==(t=e.t(r,{_userInput:!0}))?"":t)+"
    \n "})),n+="\n
    \n"}},83980:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(94957);t.default={form:r.default}},25378:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n
    \n"}},95722:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(25378);t.default={form:r.default}},55040:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.t(e.component.title,{_userInput:!0}))?"":t)+"
    \n"}},24088:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n ',"wizardHeaderVertical"===e.wizardHeaderType?n+='\n
    \n
    \n '+(null==(t=e.wizardHeader)?"":t)+'\n
    \n
    \n '+(null==(t=e.components)?"":t)+'\n
    \n
    \n
    \n '+(null==(t=e.wizardNav)?"":t)+"\n
    \n ":n+=" \n "+(null==(t=e.wizardHeader)?"":t)+'\n
    \n '+(null==(t=e.components)?"":t)+"\n
    \n "+(null==(t=e.wizardNav)?"":t)+"\n ",n+" \n
    \n
    "}},45546:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(55040),o=n(24088);t.default={form:o.default,builder:r.default}},38917:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},68497:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(38917);t.default={form:r.default}},18760:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},72065:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18760);t.default={form:r.default}},34611:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},48866:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(34611);t.default={form:r.default}},81201:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
      \n ',e.buttons.cancel&&(n+='\n
    • \n \n
    • \n "),n+="\n ",e.buttons.previous&&(n+='\n
    • \n \n
    • \n "),n+="\n ",e.buttons.next&&(n+='\n
    • \n \n
    • \n "),n+="\n ",e.buttons.submit&&(n+='\n
    • \n \n
    • \n "),n+"\n
    \n"}},16299:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(81201);t.default={form:r.default}},68531:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(65441);t.default={bootstrap3:r.default}},57062:function(e){var t;window,t=()=>(()=>{"use strict";var e={282:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clearChoices=t.activateChoices=t.filterChoices=t.addChoice=void 0;var r=n(883);t.addChoice=function(e){var t=e.value,n=e.label,o=e.id,i=e.groupId,a=e.disabled,u=e.elementId,l=e.customProperties,s=e.placeholder,c=e.keyCode;return{type:r.ACTION_TYPES.ADD_CHOICE,value:t,label:n,id:o,groupId:i,disabled:a,elementId:u,customProperties:l,placeholder:s,keyCode:c}},t.filterChoices=function(e){return{type:r.ACTION_TYPES.FILTER_CHOICES,results:e}},t.activateChoices=function(e){return void 0===e&&(e=!0),{type:r.ACTION_TYPES.ACTIVATE_CHOICES,active:e}},t.clearChoices=function(){return{type:r.ACTION_TYPES.CLEAR_CHOICES}}},783:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addGroup=void 0;var r=n(883);t.addGroup=function(e){var t=e.value,n=e.id,o=e.active,i=e.disabled;return{type:r.ACTION_TYPES.ADD_GROUP,value:t,id:n,active:o,disabled:i}}},464:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.highlightItem=t.removeItem=t.addItem=void 0;var r=n(883);t.addItem=function(e){var t=e.value,n=e.label,o=e.id,i=e.choiceId,a=e.groupId,u=e.customProperties,l=e.placeholder,s=e.keyCode;return{type:r.ACTION_TYPES.ADD_ITEM,value:t,label:n,id:o,choiceId:i,groupId:a,customProperties:u,placeholder:l,keyCode:s}},t.removeItem=function(e,t){return{type:r.ACTION_TYPES.REMOVE_ITEM,id:e,choiceId:t}},t.highlightItem=function(e,t){return{type:r.ACTION_TYPES.HIGHLIGHT_ITEM,id:e,highlighted:t}}},137:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setIsLoading=t.resetTo=t.clearAll=void 0;var r=n(883);t.clearAll=function(){return{type:r.ACTION_TYPES.CLEAR_ALL}},t.resetTo=function(e){return{type:r.ACTION_TYPES.RESET_TO,state:e}},t.setIsLoading=function(e){return{type:r.ACTION_TYPES.SET_IS_LOADING,isLoading:e}}},373:function(e,t,n){var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o=0?this._store.getGroupById(o):null;return this._store.dispatch((0,s.highlightItem)(n,!0)),t&&this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:n,value:a,label:l,groupValue:c&&c.value?c.value:null}),this},e.prototype.unhighlightItem=function(e){if(!e||!e.id)return this;var t=e.id,n=e.groupId,r=void 0===n?-1:n,o=e.value,i=void 0===o?"":o,a=e.label,u=void 0===a?"":a,l=r>=0?this._store.getGroupById(r):null;return this._store.dispatch((0,s.highlightItem)(t,!1)),this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:t,value:i,label:u,groupValue:l&&l.value?l.value:null}),this},e.prototype.highlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.highlightItem(t)})),this},e.prototype.unhighlightAll=function(){var e=this;return this._store.items.forEach((function(t){return e.unhighlightItem(t)})),this},e.prototype.removeActiveItemsByValue=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.value===e})).forEach((function(e){return t._removeItem(e)})),this},e.prototype.removeActiveItems=function(e){var t=this;return this._store.activeItems.filter((function(t){return t.id!==e})).forEach((function(e){return t._removeItem(e)})),this},e.prototype.removeHighlightedItems=function(e){var t=this;return void 0===e&&(e=!1),this._store.highlightedActiveItems.forEach((function(n){t._removeItem(n),e&&t._triggerChange(n.value)})),this},e.prototype.showDropdown=function(e){var t=this;return this.dropdown.isActive||requestAnimationFrame((function(){t.dropdown.show(),t.containerOuter.open(t.dropdown.distanceFromTopWindow,t.dropdown.height),!e&&t._canSearch&&t.input.focus(),t.passedElement.triggerEvent(d.EVENTS.showDropdown,{})})),this},e.prototype.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame((function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(d.EVENTS.hideDropdown,{})})),this):this},e.prototype.getValue=function(e){void 0===e&&(e=!1);var t=this._store.activeItems.reduce((function(t,n){var r=e?n.value:n;return t.push(r),t}),[]);return this._isSelectOneElement?t[0]:t},e.prototype.setValue=function(e){var t=this;return this.initialised?(e.forEach((function(e){return t._setChoiceOrItem(e)})),this):this},e.prototype.setChoiceByValue=function(e){var t=this;return!this.initialised||this._isTextElement||(Array.isArray(e)?e:[e]).forEach((function(e){return t._findAndSelectChoiceByValue(e)})),this},e.prototype.setChoices=function(e,t,n,r){var o=this;if(void 0===e&&(e=[]),void 0===t&&(t="value"),void 0===n&&(n="label"),void 0===r&&(r=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof t||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(r&&this.clearChoices(),"function"==typeof e){var i=e(this);if("function"==typeof Promise&&i instanceof Promise)return new Promise((function(e){return requestAnimationFrame(e)})).then((function(){return o._handleLoadingState(!0)})).then((function(){return i})).then((function(e){return o.setChoices(e,t,n,r)})).catch((function(e){o.config.silent||console.error(e)})).then((function(){return o._handleLoadingState(!1)})).then((function(){return o}));if(!Array.isArray(i))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof i));return this.setChoices(i,t,n,!1)}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),e.forEach((function(e){if(e.choices)o._addGroup({id:e.id?parseInt("".concat(e.id),10):null,group:e,valueKey:t,labelKey:n});else{var r=e;o._addChoice({value:r[t],label:r[n],isSelected:!!r.selected,isDisabled:!!r.disabled,placeholder:!!r.placeholder,customProperties:r.customProperties})}})),this._stopLoading(),this},e.prototype.clearChoices=function(){return this._store.dispatch((0,u.clearChoices)()),this},e.prototype.clearStore=function(){return this._store.dispatch((0,c.clearAll)()),this},e.prototype.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch((0,u.activateChoices)(!0))),this},e.prototype._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var e=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,t=this._isSelectElement,n=this._currentState.items!==this._prevState.items;e&&(t&&this._renderChoices(),n&&this._renderItems(),this._prevState=this._currentState)}},e.prototype._renderChoices=function(){var e=this,t=this._store,n=t.activeGroups,r=t.activeChoices,o=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame((function(){return e.choiceList.scrollToTop()})),n.length>=1&&!this._isSearching){var i=r.filter((function(e){return!0===e.placeholder&&-1===e.groupId}));i.length>=1&&(o=this._createChoicesFragment(i,o)),o=this._createGroupsFragment(n,r,o)}else r.length>=1&&(o=this._createChoicesFragment(r,o));if(o.childNodes&&o.childNodes.length>0){var a=this._store.activeItems,u=this._canAddItem(a,this.input.value);if(u.response)this.choiceList.append(o),this._highlightChoice();else{var l=this._getTemplate("notice",u.notice);this.choiceList.append(l)}}else{var s=void 0;l=void 0,this._isSearching?(l="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,s=this._getTemplate("notice",l,"no-results")):(l="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,s=this._getTemplate("notice",l,"no-choices")),this.choiceList.append(s)}},e.prototype._renderItems=function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)},e.prototype._createGroupsFragment=function(e,t,n){var r=this;return void 0===n&&(n=document.createDocumentFragment()),this.config.shouldSort&&e.sort(this.config.sorter),e.forEach((function(e){var o=function(e){return t.filter((function(t){return r._isSelectOneElement?t.groupId===e.id:t.groupId===e.id&&("always"===r.config.renderSelectedChoices||!t.selected)}))}(e);if(o.length>=1){var i=r._getTemplate("choiceGroup",e);n.appendChild(i),r._createChoicesFragment(o,n,!0)}})),n},e.prototype._createChoicesFragment=function(e,t,n){var o=this;void 0===t&&(t=document.createDocumentFragment()),void 0===n&&(n=!1);var i=this.config,a=i.renderSelectedChoices,u=i.searchResultLimit,l=i.renderChoiceLimit,s=this._isSearching?h.sortByScore:this.config.sorter,c=function(e){if("auto"!==a||o._isSelectOneElement||!e.selected){var n=o._getTemplate("choice",e,o.config.itemSelectText);t.appendChild(n)}},f=e;"auto"!==a||this._isSelectOneElement||(f=e.filter((function(e){return!e.selected})));var d=f.reduce((function(e,t){return t.placeholder?e.placeholderChoices.push(t):e.normalChoices.push(t),e}),{placeholderChoices:[],normalChoices:[]}),p=d.placeholderChoices,y=d.normalChoices;(this.config.shouldSort||this._isSearching)&&y.sort(s);var m=f.length,v=this._isSelectOneElement?r(r([],p,!0),y,!0):y;this._isSearching?m=u:l&&l>0&&!n&&(m=l);for(var b=0;b=r){var a=o?this._searchChoices(e):0;this.passedElement.triggerEvent(d.EVENTS.search,{value:e,resultCount:a})}else i&&(this._isSearching=!1,this._store.dispatch((0,u.activateChoices)(!0)))}},e.prototype._canAddItem=function(e,t){var n=!0,r="function"==typeof this.config.addItemText?this.config.addItemText(t):this.config.addItemText;if(!this._isSelectOneElement){var o=(0,h.existsInArray)(e,t);this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(n=!1,r="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&o&&n&&(n=!1,r="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText(t):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&n&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(t)&&(n=!1,r="function"==typeof this.config.customAddItemText?this.config.customAddItemText(t):this.config.customAddItemText)}return{response:n,notice:r}},e.prototype._searchChoices=function(e){var t="string"==typeof e?e.trim():e,n="string"==typeof this._currentValue?this._currentValue.trim():this._currentValue;if(t.length<1&&t==="".concat(n," "))return 0;var o=this._store.searchableChoices,i=t,l=Object.assign(this.config.fuseOptions,{keys:r([],this.config.searchFields,!0),includeMatches:!0}),s=new a.default(o,l).search(i);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,u.filterChoices)(s)),s.length},e.prototype._addEventListeners=function(){var e=this.config.shadowRoot||document.documentElement;e.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},e.prototype._removeEventListeners=function(){var e=this.config.shadowRoot||document.documentElement;e.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},e.prototype._onKeyDown=function(e){var t=e.keyCode,n=this._store.activeItems,r=this.input.isFocussed,o=this.dropdown.isActive,i=this.itemList.hasChildren(),a=String.fromCharCode(t),u=/[^\x00-\x1F]/.test(a),l=d.KEY_CODES.BACK_KEY,s=d.KEY_CODES.DELETE_KEY,c=d.KEY_CODES.ENTER_KEY,f=d.KEY_CODES.A_KEY,p=d.KEY_CODES.ESC_KEY,h=d.KEY_CODES.UP_KEY,y=d.KEY_CODES.DOWN_KEY,m=d.KEY_CODES.PAGE_UP_KEY,v=d.KEY_CODES.PAGE_DOWN_KEY;switch(this._isTextElement||o||!u||(this.showDropdown(),this.input.isFocussed||(this.input.value+=e.key.toLowerCase())),t){case f:return this._onSelectKey(e,i);case c:return this._onEnterKey({event:e,activeItems:n,hasActiveDropdown:o});case p:return this._onEscapeKey(o);case h:case m:case y:case v:return this._onDirectionKey({event:e,hasActiveDropdown:o});case s:case l:return this._onDeleteKey(e,n,r)}},e.prototype._onKeyUp=function(e){var t=e.target,n=e.keyCode,r=this.input.value,o=this._store.activeItems,i=this._canAddItem(o,r),a=d.KEY_CODES.BACK_KEY,l=d.KEY_CODES.DELETE_KEY;if(this._isTextElement)if(i.notice&&r){var s=this._getTemplate("notice",i.notice);this.dropdown.element.innerHTML=s.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else{var c=(n===a||n===l)&&t&&!t.value,f=!this._isTextElement&&this._isSearching,p=this._canSearch&&i.response;c&&f?(this._isSearching=!1,this._store.dispatch((0,u.activateChoices)(!0))):p&&this._handleSearch(this.input.rawValue)}this._canSearch=this.config.searchEnabled},e.prototype._onSelectKey=function(e,t){var n=e.ctrlKey,r=e.metaKey;(n||r)&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e.prototype._onEnterKey=function(e){var t=e.event,n=e.activeItems,r=e.hasActiveDropdown,o=t.target,i=d.KEY_CODES.ENTER_KEY,a=o&&o.hasAttribute("data-button");if(this._isTextElement&&o&&o.value){var u=this.input.value;this._canAddItem(n,u).response&&(this.hideDropdown(!0),this._addItem({value:u}),this._triggerChange(u),this.clearInput())}if(a&&(this._handleButtonAction(n,o),t.preventDefault()),r){var l=this.dropdown.getChild(".".concat(this.config.classNames.highlightedState));l&&(n[0]&&(n[0].keyCode=i),this._handleChoiceAction(n,l)),t.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),t.preventDefault())},e.prototype._onEscapeKey=function(e){e&&(this.hideDropdown(!0),this.containerOuter.focus())},e.prototype._onDirectionKey=function(e){var t=e.event,n=e.hasActiveDropdown,r=t.keyCode,o=t.metaKey,i=d.KEY_CODES.DOWN_KEY,a=d.KEY_CODES.PAGE_UP_KEY,u=d.KEY_CODES.PAGE_DOWN_KEY;if(n||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var l=r===i||r===u?1:-1,s="[data-choice-selectable]",c=void 0;if(o||r===u||r===a)c=l>0?this.dropdown.element.querySelector("".concat(s,":last-of-type")):this.dropdown.element.querySelector(s);else{var f=this.dropdown.element.querySelector(".".concat(this.config.classNames.highlightedState));c=f?(0,h.getAdjacentEl)(f,s,l):this.dropdown.element.querySelector(s)}c&&((0,h.isScrolledIntoView)(c,this.choiceList.element,l)||this.choiceList.scrollToChildElement(c,l),this._highlightChoice(c)),t.preventDefault()}},e.prototype._onDeleteKey=function(e,t,n){var r=e.target;this._isSelectOneElement||r.value||!n||(this._handleBackspace(t),e.preventDefault())},e.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(t)&&((t===this.containerOuter.element||t===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()),this._wasTap=!0},e.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(b&&this.choiceList.element.contains(t)){var n=this.choiceList.element.firstElementChild,r="ltr"===this._direction?e.offsetX>=n.offsetWidth:e.offsetX0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},e.prototype._onFocus=function(e){var t,n=this,r=e.target;r&&this.containerOuter.element.contains(r)&&((t={})[d.TEXT_TYPE]=function(){r===n.input.element&&n.containerOuter.addFocusState()},t[d.SELECT_ONE_TYPE]=function(){n.containerOuter.addFocusState(),r===n.input.element&&n.showDropdown(!0)},t[d.SELECT_MULTIPLE_TYPE]=function(){r===n.input.element&&(n.showDropdown(!0),n.containerOuter.addFocusState())},t)[this.passedElement.element.type]()},e.prototype._onBlur=function(e){var t,n=this,r=e.target;if(r&&this.containerOuter.element.contains(r)&&!this._isScrollingOnIe){var o=this._store.activeItems.some((function(e){return e.highlighted}));((t={})[d.TEXT_TYPE]=function(){r===n.input.element&&(n.containerOuter.removeFocusState(),o&&n.unhighlightAll(),n.hideDropdown(!0))},t[d.SELECT_ONE_TYPE]=function(){n.containerOuter.removeFocusState(),(r===n.input.element||r===n.containerOuter.element&&!n._canSearch)&&n.hideDropdown(!0)},t[d.SELECT_MULTIPLE_TYPE]=function(){r===n.input.element&&(n.containerOuter.removeFocusState(),n.hideDropdown(!0),o&&n.unhighlightAll())},t)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},e.prototype._onFormReset=function(){this._store.dispatch((0,c.resetTo)(this._initialState))},e.prototype._highlightChoice=function(e){var t=this;void 0===e&&(e=null);var n=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(n.length){var r=e;Array.from(this.dropdown.element.querySelectorAll(".".concat(this.config.classNames.highlightedState))).forEach((function(e){e.classList.remove(t.config.classNames.highlightedState),e.setAttribute("aria-selected","false")})),r?this._highlightPosition=n.indexOf(r):(r=n.length>this._highlightPosition?n[this._highlightPosition]:n[n.length-1])||(r=n[0]),r.classList.add(this.config.classNames.highlightedState),r.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(d.EVENTS.highlightChoice,{el:r}),this.dropdown.isActive&&(this.input.setActiveDescendant(r.id),this.containerOuter.setActiveDescendant(r.id))}},e.prototype._addItem=function(e){var t=e.value,n=e.label,r=void 0===n?null:n,o=e.choiceId,i=void 0===o?-1:o,a=e.groupId,u=void 0===a?-1:a,l=e.customProperties,c=void 0===l?{}:l,f=e.placeholder,p=void 0!==f&&f,h=e.keyCode,y=void 0===h?-1:h,m="string"==typeof t?t.trim():t,v=this._store.items,b=r||m,g=i||-1,w=u>=0?this._store.getGroupById(u):null,k=v?v.length+1:1;this.config.prependValue&&(m=this.config.prependValue+m.toString()),this.config.appendValue&&(m+=this.config.appendValue.toString()),this._store.dispatch((0,s.addItem)({value:m,label:b,id:k,choiceId:g,groupId:u,customProperties:c,placeholder:p,keyCode:y})),this._isSelectOneElement&&this.removeActiveItems(k),this.passedElement.triggerEvent(d.EVENTS.addItem,{id:k,value:m,label:b,customProperties:c,groupValue:w&&w.value?w.value:null,keyCode:y})},e.prototype._removeItem=function(e){var t=e.id,n=e.value,r=e.label,o=e.customProperties,i=e.choiceId,a=e.groupId,u=a&&a>=0?this._store.getGroupById(a):null;t&&i&&(this._store.dispatch((0,s.removeItem)(t,i)),this.passedElement.triggerEvent(d.EVENTS.removeItem,{id:t,value:n,label:r,customProperties:o,groupValue:u&&u.value?u.value:null}))},e.prototype._addChoice=function(e){var t=e.value,n=e.label,r=void 0===n?null:n,o=e.isSelected,i=void 0!==o&&o,a=e.isDisabled,l=void 0!==a&&a,s=e.groupId,c=void 0===s?-1:s,f=e.customProperties,d=void 0===f?{}:f,p=e.placeholder,h=void 0!==p&&p,y=e.keyCode,m=void 0===y?-1:y;if(null!=t){var v=this._store.choices,b=r||t,g=v?v.length+1:1,w="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(g);this._store.dispatch((0,u.addChoice)({id:g,groupId:c,elementId:w,value:t,label:b,disabled:l,customProperties:d,placeholder:h,keyCode:m})),i&&this._addItem({value:t,label:b,choiceId:g,customProperties:d,placeholder:h,keyCode:m})}},e.prototype._addGroup=function(e){var t=this,n=e.group,r=e.id,o=e.valueKey,i=void 0===o?"value":o,a=e.labelKey,u=void 0===a?"label":a,s=(0,h.isType)("Object",n)?n.choices:Array.from(n.getElementsByTagName("OPTION")),c=r||Math.floor((new Date).valueOf()*Math.random()),f=!!n.disabled&&n.disabled;s?(this._store.dispatch((0,l.addGroup)({value:n.label,id:c,active:!0,disabled:f})),s.forEach((function(e){var n=e.disabled||e.parentNode&&e.parentNode.disabled;t._addChoice({value:e[i],label:(0,h.isType)("Object",e)?e[u]:e.innerHTML,isSelected:e.selected,isDisabled:n,groupId:c,customProperties:e.customProperties,placeholder:e.placeholder})}))):this._store.dispatch((0,l.addGroup)({value:n.label,id:n.id,active:!1,disabled:n.disabled}))},e.prototype._getTemplate=function(e){for(var t,n=[],o=1;o{Object.defineProperty(t,"__esModule",{value:!0});var r=n(799),o=n(883),i=function(){function e(e){var t=e.element,n=e.type,r=e.classNames,o=e.position;this.element=t,this.classNames=r,this.type=n,this.position=o,this.isOpen=!1,this.isFlipped=!1,this.isFocussed=!1,this.isDisabled=!1,this.isLoading=!1,this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}return e.prototype.addEventListeners=function(){this.element.addEventListener("focus",this._onFocus),this.element.addEventListener("blur",this._onBlur)},e.prototype.removeEventListeners=function(){this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},e.prototype.shouldFlip=function(e,t,n){if("number"!=typeof e)return!1;var r=!1;return"auto"===this.position?(r=!window.matchMedia("(min-height: ".concat(e+1,"px)")).matches)&&n.getBoundingClientRect().top-t<0&&(r=!1):"top"===this.position&&(r=!0),r},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype.open=function(e,t){this.element.classList.add(this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e,t,this.element)&&(this.element.classList.add(this.classNames.flippedState),this.isFlipped=!0)},e.prototype.close=function(){this.element.classList.remove(this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(this.element.classList.remove(this.classNames.flippedState),this.isFlipped=!1)},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.addFocusState=function(){this.element.classList.add(this.classNames.focusState)},e.prototype.removeFocusState=function(){this.element.classList.remove(this.classNames.focusState)},e.prototype.enable=function(){this.element.classList.remove(this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===o.SELECT_ONE_TYPE&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},e.prototype.disable=function(){this.element.classList.add(this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===o.SELECT_ONE_TYPE&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},e.prototype.wrap=function(e){(0,r.wrap)(e,this.element)},e.prototype.unwrap=function(e){this.element.parentNode&&(this.element.parentNode.insertBefore(e,this.element),this.element.parentNode.removeChild(this.element))},e.prototype.addLoadingState=function(){this.element.classList.add(this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},e.prototype.removeLoadingState=function(){this.element.classList.remove(this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}();t.default=i},217:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){var t=e.element,n=e.type,r=e.classNames;this.element=t,this.classNames=r,this.type=n,this.isActive=!1}return Object.defineProperty(e.prototype,"distanceFromTopWindow",{get:function(){return this.element.getBoundingClientRect().bottom},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.element.getBoundingClientRect().height},enumerable:!1,configurable:!0}),e.prototype.getChild=function(e){return this.element.querySelector(e)},e.prototype.show=function(){return this.element.classList.add(this.classNames.activeState),this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this},e.prototype.hide=function(){return this.element.classList.remove(this.classNames.activeState),this.element.setAttribute("aria-expanded","false"),this.isActive=!1,this},e}();t.default=n},520:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WrappedSelect=t.WrappedInput=t.List=t.Input=t.Container=t.Dropdown=void 0;var o=r(n(217));t.Dropdown=o.default;var i=r(n(613));t.Container=i.default;var a=r(n(11));t.Input=a.default;var u=r(n(624));t.List=u.default;var l=r(n(541));t.WrappedInput=l.default;var s=r(n(982));t.WrappedSelect=s.default},11:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(799),o=n(883),i=function(){function e(e){var t=e.element,n=e.type,r=e.classNames,o=e.preventPaste;this.element=t,this.type=n,this.classNames=r,this.preventPaste=o,this.isFocussed=this.element.isEqualNode(document.activeElement),this.isDisabled=t.disabled,this._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}return Object.defineProperty(e.prototype,"placeholder",{set:function(e){this.element.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return(0,r.sanitise)(this.element.value)},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.element.value},enumerable:!1,configurable:!0}),e.prototype.addEventListeners=function(){this.element.addEventListener("paste",this._onPaste),this.element.addEventListener("input",this._onInput,{passive:!0}),this.element.addEventListener("focus",this._onFocus,{passive:!0}),this.element.addEventListener("blur",this._onBlur,{passive:!0})},e.prototype.removeEventListeners=function(){this.element.removeEventListener("input",this._onInput),this.element.removeEventListener("paste",this._onPaste),this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},e.prototype.focus=function(){this.isFocussed||this.element.focus()},e.prototype.blur=function(){this.isFocussed&&this.element.blur()},e.prototype.clear=function(e){return void 0===e&&(e=!0),this.element.value&&(this.element.value=""),e&&this.setWidth(),this},e.prototype.setWidth=function(){var e=this.element,t=e.style,n=e.value,r=e.placeholder;t.minWidth="".concat(r.length+1,"ch"),t.width="".concat(n.length+1,"ch")},e.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},e.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e.prototype._onInput=function(){this.type!==o.SELECT_ONE_TYPE&&this.setWidth()},e.prototype._onPaste=function(e){this.preventPaste&&e.preventDefault()},e.prototype._onFocus=function(){this.isFocussed=!0},e.prototype._onBlur=function(){this.isFocussed=!1},e}();t.default=i},624:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(883),o=function(){function e(e){var t=e.element;this.element=t,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}return e.prototype.clear=function(){this.element.innerHTML=""},e.prototype.append=function(e){this.element.appendChild(e)},e.prototype.getChild=function(e){return this.element.querySelector(e)},e.prototype.hasChildren=function(){return this.element.hasChildNodes()},e.prototype.scrollToTop=function(){this.element.scrollTop=0},e.prototype.scrollToChildElement=function(e,t){var n=this;if(e){var r=this.element.offsetHeight,o=this.element.scrollTop+r,i=e.offsetHeight,a=e.offsetTop+i,u=t>0?this.element.scrollTop+a-o:e.offsetTop;requestAnimationFrame((function(){n._animateScroll(u,t)}))}},e.prototype._scrollDown=function(e,t,n){var r=(n-e)/t,o=r>1?r:1;this.element.scrollTop=e+o},e.prototype._scrollUp=function(e,t,n){var r=(e-n)/t,o=r>1?r:1;this.element.scrollTop=e-o},e.prototype._animateScroll=function(e,t){var n=this,o=r.SCROLLING_SPEED,i=this.element.scrollTop,a=!1;t>0?(this._scrollDown(i,o,e),ie&&(a=!0)),a&&requestAnimationFrame((function(){n._animateScroll(e,t)}))},e}();t.default=o},730:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(799),o=function(){function e(e){var t=e.element,n=e.classNames;if(this.element=t,this.classNames=n,!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement))throw new TypeError("Invalid element passed");this.isDisabled=!1}return Object.defineProperty(e.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),e.prototype.conceal=function(){this.element.classList.add(this.classNames.input),this.element.hidden=!0,this.element.tabIndex=-1;var e=this.element.getAttribute("style");e&&this.element.setAttribute("data-choice-orig-style",e),this.element.setAttribute("data-choice","active")},e.prototype.reveal=function(){this.element.classList.remove(this.classNames.input),this.element.hidden=!1,this.element.removeAttribute("tabindex");var e=this.element.getAttribute("data-choice-orig-style");e?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",e)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},e.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.prototype.triggerEvent=function(e,t){(0,r.dispatchEvent)(this.element,e,t)},e}();t.default=o},541:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t){var n=t.element,r=t.classNames,o=t.delimiter,i=e.call(this,{element:n,classNames:r})||this;return i.delimiter=o,i}return o(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),t}(i(n(730)).default);t.default=a},982:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t){var n=t.element,r=t.classNames,o=t.template,i=e.call(this,{element:n,classNames:r})||this;return i.template=o,i}return o(t,e),Object.defineProperty(t.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optionGroups",{get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return Array.from(this.element.options)},set:function(e){var t=this,n=document.createDocumentFragment();e.forEach((function(e){return r=e,o=t.template(r),void n.appendChild(o);var r,o})),this.appendDocFragment(n)},enumerable:!1,configurable:!0}),t.prototype.appendDocFragment=function(e){this.element.innerHTML="",this.element.appendChild(e)},t}(i(n(730)).default);t.default=a},883:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SCROLLING_SPEED=t.SELECT_MULTIPLE_TYPE=t.SELECT_ONE_TYPE=t.TEXT_TYPE=t.KEY_CODES=t.ACTION_TYPES=t.EVENTS=void 0,t.EVENTS={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice",unhighlightItem:"unhighlightItem"},t.ACTION_TYPES={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL",RESET_TO:"RESET_TO",SET_IS_LOADING:"SET_IS_LOADING"},t.KEY_CODES={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},t.TEXT_TYPE="text",t.SELECT_ONE_TYPE="select-one",t.SELECT_MULTIPLE_TYPE="select-multiple",t.SCROLLING_SPEED=4},789:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CONFIG=t.DEFAULT_CLASSNAMES=void 0;var r=n(799);t.DEFAULT_CLASSNAMES={containerOuter:"choices",containerInner:"choices__inner",input:"choices__input",inputCloned:"choices__input--cloned",list:"choices__list",listItems:"choices__list--multiple",listSingle:"choices__list--single",listDropdown:"choices__list--dropdown",item:"choices__item",itemSelectable:"choices__item--selectable",itemDisabled:"choices__item--disabled",itemChoice:"choices__item--choice",placeholder:"choices__placeholder",group:"choices__group",groupHeading:"choices__heading",button:"choices__button",activeState:"is-active",focusState:"is-focused",openState:"is-open",disabledState:"is-disabled",highlightedState:"is-highlighted",selectedState:"is-selected",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"},t.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,allowHTML:!0,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:r.sortByAlpha,shadowRoot:null,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(e){return'Press Enter to add "'.concat((0,r.sanitise)(e),'"')},maxItemText:function(e){return"Only ".concat(e," values can be added")},valueComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:t.DEFAULT_CLASSNAMES}},18:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},978:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},948:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},359:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},285:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},533:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},187:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(18),t),o(n(978),t),o(n(948),t),o(n(359),t),o(n(285),t),o(n(533),t),o(n(287),t),o(n(132),t),o(n(837),t),o(n(598),t),o(n(369),t),o(n(37),t),o(n(47),t),o(n(923),t),o(n(876),t)},287:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},132:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},837:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},598:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},37:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},369:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},47:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},923:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},876:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},799:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.parseCustomProperties=t.diff=t.cloneObject=t.existsInArray=t.dispatchEvent=t.sortByScore=t.sortByAlpha=t.strToEl=t.sanitise=t.isScrolledIntoView=t.getAdjacentEl=t.wrap=t.isType=t.getType=t.generateId=t.generateChars=t.getRandomNumber=void 0,t.getRandomNumber=function(e,t){return Math.floor(Math.random()*(t-e)+e)},t.generateChars=function(e){return Array.from({length:e},(function(){return(0,t.getRandomNumber)(0,36).toString(36)})).join("")},t.generateId=function(e,n){var r=e.id||e.name&&"".concat(e.name,"-").concat((0,t.generateChars)(2))||(0,t.generateChars)(4);return r=r.replace(/(:|\.|\[|\]|,)/g,""),"".concat(n,"-").concat(r)},t.getType=function(e){return Object.prototype.toString.call(e).slice(8,-1)},t.isType=function(e,n){return null!=n&&(0,t.getType)(n)===e},t.wrap=function(e,t){return void 0===t&&(t=document.createElement("div")),e.parentNode&&(e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t)),t.appendChild(e)},t.getAdjacentEl=function(e,t,n){void 0===n&&(n=1);for(var r="".concat(n>0?"next":"previous","ElementSibling"),o=e[r];o;){if(o.matches(t))return o;o=o[r]}return o},t.isScrolledIntoView=function(e,t,n){return void 0===n&&(n=1),!!e&&(n>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop)},t.sanitise=function(e){return"string"!=typeof e?e:e.replace(/&/g,"&").replace(/>/g,">").replace(/-1?e.map((function(e){var t=e;return t.id===parseInt("".concat(a.choiceId),10)&&(t.selected=!0),t})):e;case"REMOVE_ITEM":var u=r;return u.choiceId&&u.choiceId>-1?e.map((function(e){var t=e;return t.id===parseInt("".concat(u.choiceId),10)&&(t.selected=!1),t})):e;case"FILTER_CHOICES":var l=r;return e.map((function(e){var t=e;return t.active=l.results.some((function(e){var n=e.item,r=e.score;return n.id===t.id&&(t.score=r,!0)})),t}));case"ACTIVATE_CHOICES":var s=r;return e.map((function(e){var t=e;return t.active=s.active,t}));case"CLEAR_CHOICES":return t.defaultState;default:return e}}},871:function(e,t){var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0,t.defaultState=!1,t.default=function(e,n){return void 0===e&&(e=t.defaultState),void 0===n&&(n={}),"SET_IS_LOADING"===n.type?n.isLoading:e}},744:function(e,t,n){var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o{Object.defineProperty(t,"__esModule",{value:!0});var n={containerOuter:function(e,t,n,r,o,i,a){var u=e.classNames.containerOuter,l=Object.assign(document.createElement("div"),{className:u});return l.dataset.type=i,t&&(l.dir=t),r&&(l.tabIndex=0),n&&(l.setAttribute("role",o?"combobox":"listbox"),o&&l.setAttribute("aria-autocomplete","list")),l.setAttribute("aria-haspopup","true"),l.setAttribute("aria-expanded","false"),a&&l.setAttribute("aria-labelledby",a),l},containerInner:function(e){var t=e.classNames.containerInner;return Object.assign(document.createElement("div"),{className:t})},itemList:function(e,t){var n=e.classNames,r=n.list,o=n.listSingle,i=n.listItems;return Object.assign(document.createElement("div"),{className:"".concat(r," ").concat(t?o:i)})},placeholder:function(e,t){var n,r=e.allowHTML,o=e.classNames.placeholder;return Object.assign(document.createElement("div"),((n={className:o})[r?"innerHTML":"innerText"]=t,n))},item:function(e,t,n){var r,o,i=e.allowHTML,a=e.classNames,u=a.item,l=a.button,s=a.highlightedState,c=a.itemSelectable,f=a.placeholder,d=t.id,p=t.value,h=t.label,y=t.customProperties,m=t.active,v=t.disabled,b=t.highlighted,g=t.placeholder,w=Object.assign(document.createElement("div"),((r={className:u})[i?"innerHTML":"innerText"]=h,r));if(Object.assign(w.dataset,{item:"",id:d,value:p,customProperties:y}),m&&w.setAttribute("aria-selected","true"),v&&w.setAttribute("aria-disabled","true"),g&&w.classList.add(f),w.classList.add(b?s:c),n){v&&w.classList.remove(c),w.dataset.deletable="";var k="Remove item",O=Object.assign(document.createElement("button"),((o={type:"button",className:l})[i?"innerHTML":"innerText"]=k,o));O.setAttribute("aria-label","".concat(k,": '").concat(p,"'")),O.dataset.button="",w.appendChild(O)}return w},choiceList:function(e,t){var n=e.classNames.list,r=Object.assign(document.createElement("div"),{className:n});return t||r.setAttribute("aria-multiselectable","true"),r.setAttribute("role","listbox"),r},choiceGroup:function(e,t){var n,r=e.allowHTML,o=e.classNames,i=o.group,a=o.groupHeading,u=o.itemDisabled,l=t.id,s=t.value,c=t.disabled,f=Object.assign(document.createElement("div"),{className:"".concat(i," ").concat(c?u:"")});return f.setAttribute("role","group"),Object.assign(f.dataset,{group:"",id:l,value:s}),c&&f.setAttribute("aria-disabled","true"),f.appendChild(Object.assign(document.createElement("div"),((n={className:a})[r?"innerHTML":"innerText"]=s,n))),f},choice:function(e,t,n){var r,o=e.allowHTML,i=e.classNames,a=i.item,u=i.itemChoice,l=i.itemSelectable,s=i.selectedState,c=i.itemDisabled,f=i.placeholder,d=t.id,p=t.value,h=t.label,y=t.groupId,m=t.elementId,v=t.disabled,b=t.selected,g=t.placeholder,w=Object.assign(document.createElement("div"),((r={id:m})[o?"innerHTML":"innerText"]=h,r.className="".concat(a," ").concat(u),r));return b&&w.classList.add(s),g&&w.classList.add(f),w.setAttribute("role",y&&y>0?"treeitem":"option"),Object.assign(w.dataset,{choice:"",id:d,value:p,selectText:n}),v?(w.classList.add(c),w.dataset.choiceDisabled="",w.setAttribute("aria-disabled","true")):(w.classList.add(l),w.dataset.choiceSelectable=""),w},input:function(e,t){var n=e.classNames,r=n.input,o=n.inputCloned,i=Object.assign(document.createElement("input"),{type:"text",name:"search_terms",className:"".concat(r," ").concat(o),autocomplete:"off",autocapitalize:"off",spellcheck:!1});return i.setAttribute("role","textbox"),i.setAttribute("aria-autocomplete","list"),i.setAttribute("aria-label",t),i},dropdown:function(e){var t=e.classNames,n=t.list,r=t.listDropdown,o=document.createElement("div");return o.classList.add(n,r),o.setAttribute("aria-expanded","false"),o},notice:function(e,t,n){var r,o=e.allowHTML,i=e.classNames,a=i.item,u=i.itemChoice,l=i.noResults,s=i.noChoices;void 0===n&&(n="");var c=[a,u];return"no-choices"===n?c.push(s):"no-results"===n&&c.push(l),Object.assign(document.createElement("div"),((r={})[o?"innerHTML":"innerText"]=t,r.className=c.join(" "),r))},option:function(e){var t=e.label,n=e.value,r=e.customProperties,o=e.active,i=e.disabled,a=new Option(t,n,!1,o);return r&&(a.dataset.customProperties="".concat(r)),a.disabled=!!i,a}};t.default=n},996:e=>{var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?u((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function u(e,n,l){(l=l||{}).arrayMerge=l.arrayMerge||o,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=r;var s=Array.isArray(n);return s===Array.isArray(e)?s?l.arrayMerge(e,n,l):function(e,t,n){var o={};return n.isMergeableObject(e)&&i(e).forEach((function(t){o[t]=r(e[t],n)})),i(t).forEach((function(i){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(a(e,i)&&n.isMergeableObject(t[i])?o[i]=function(e,t){if(!t.customMerge)return u;var n=t.customMerge(e);return"function"==typeof n?n:u}(i,n)(e[i],t[i],n):o[i]=r(t[i],n))})),o}(e,n,l):r(n,l)}u.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return u(e,n,t)}),{})};var l=u;e.exports=l},221:(e,t,n)=>{function r(e){return Array.isArray?Array.isArray(e):"[object Array]"===s(e)}function o(e){return"string"==typeof e}function i(e){return"number"==typeof e}function a(e){return"object"==typeof e}function u(e){return null!=e}function l(e){return!e.trim().length}function s(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}n.r(t),n.d(t,{default:()=>F});const c=Object.prototype.hasOwnProperty;class f{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let n=d(e);t+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function d(e){let t=null,n=null,i=null,a=1,u=null;if(o(e)||r(e))i=e,t=p(e),n=h(e);else{if(!c.call(e,"name"))throw new Error("Missing name property in key");const r=e.name;if(i=r,c.call(e,"weight")&&(a=e.weight,a<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(r));t=p(r),n=h(r),u=e.getFn}return{path:t,id:n,weight:a,src:i,getFn:u}}function p(e){return r(e)?e:e.split(".")}function h(e){return r(e)?e.join("."):e}var y={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx{if(u(e))if(t[f]){const d=e[t[f]];if(!u(d))return;if(f===t.length-1&&(o(d)||i(d)||function(e){return!0===e||!1===e||function(e){return a(e)&&null!==e}(e)&&"[object Boolean]"==s(e)}(d)))n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(d));else if(r(d)){l=!0;for(let e=0,n=d.length;e{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,o(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();o(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t{let a=t.getFn?t.getFn(e):this.getFn(e,t.path);if(u(a))if(r(a)){let e=[];const t=[{nestedArrIndex:-1,value:a}];for(;t.length;){const{nestedArrIndex:n,value:i}=t.pop();if(u(i))if(o(i)&&!l(i)){let t={v:i,i:n,n:this.norm.get(i)};e.push(t)}else r(i)&&i.forEach(((e,n)=>{t.push({nestedArrIndex:n,value:e})}))}n.$[i]=e}else if(o(a)&&!l(a)){let e={v:a,n:this.norm.get(a)};n.$[i]=e}})),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function b(e,t,{getFn:n=y.getFn,fieldNormWeight:r=y.fieldNormWeight}={}){const o=new v({getFn:n,fieldNormWeight:r});return o.setKeys(e.map(d)),o.setSources(t),o.create(),o}function g(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:o=y.distance,ignoreLocation:i=y.ignoreLocation}={}){const a=t/e.length;if(i)return a;const u=Math.abs(r-n);return o?a+u/o:u?1:a}const w=32;function k(e){let t={};for(let n=0,r=e.length;n{this.chunks.push({pattern:e,alphabet:k(e),startIndex:t})},c=this.pattern.length;if(c>w){let e=0;const t=c%w,n=c-t;for(;e{const{isMatch:h,score:m,indices:v}=function(e,t,n,{location:r=y.location,distance:o=y.distance,threshold:i=y.threshold,findAllMatches:a=y.findAllMatches,minMatchCharLength:u=y.minMatchCharLength,includeMatches:l=y.includeMatches,ignoreLocation:s=y.ignoreLocation}={}){if(t.length>w)throw new Error("Pattern length exceeds max of 32.");const c=t.length,f=e.length,d=Math.max(0,Math.min(r,f));let p=i,h=d;const m=u>1||l,v=m?Array(f):[];let b;for(;(b=e.indexOf(t,h))>-1;){let e=g(t,{currentLocation:b,expectedLocation:d,distance:o,ignoreLocation:s});if(p=Math.min(e,p),h=b+c,m){let e=0;for(;e=l;i-=1){let a=i-1,u=n[e.charAt(a)];if(m&&(v[a]=+!!u),b[i]=(b[i+1]<<1|1)&u,r&&(b[i]|=(k[i+1]|k[i])<<1|1|k[i+1]),b[i]&S&&(O=g(t,{errors:r,currentLocation:a,expectedLocation:d,distance:o,ignoreLocation:s}),O<=p)){if(p=O,h=a,h<=d)break;l=Math.max(1,2*d-h)}}if(g(t,{errors:r+1,currentLocation:d,expectedLocation:d,distance:o,ignoreLocation:s})>p)break;k=b}const j={isMatch:h>=0,score:Math.max(.001,O)};if(m){const e=function(e=[],t=y.minMatchCharLength){let n=[],r=-1,o=-1,i=0;for(let a=e.length;i=t&&n.push([r,o]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}(v,u);e.length?l&&(j.indices=e):j.isMatch=!1}return j}(e,t,d,{location:r+p,distance:o,threshold:i,findAllMatches:a,minMatchCharLength:u,includeMatches:n,ignoreLocation:l});h&&(f=!0),c+=m,h&&v&&(s=[...s,...v])}));let d={isMatch:f,score:f?c/this.chunks.length:1};return f&&n&&(d.indices=s),d}}class _{constructor(e){this.pattern=e}static isMultiMatch(e){return S(e,this.multiRegex)}static isSingleMatch(e){return S(e,this.singleRegex)}search(){}}function S(e,t){const n=e.match(t);return n?n[1]:null}class j extends _{constructor(e,{location:t=y.location,threshold:n=y.threshold,distance:r=y.distance,includeMatches:o=y.includeMatches,findAllMatches:i=y.findAllMatches,minMatchCharLength:a=y.minMatchCharLength,isCaseSensitive:u=y.isCaseSensitive,ignoreLocation:l=y.ignoreLocation}={}){super(e),this._bitapSearch=new O(e,{location:t,threshold:n,distance:r,includeMatches:o,findAllMatches:i,minMatchCharLength:a,isCaseSensitive:u,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class P extends _{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,n=0;const r=[],o=this.pattern.length;for(;(t=e.indexOf(this.pattern,n))>-1;)n=t+o,r.push([t,n-1]);const i=!!r.length;return{isMatch:i,score:i?0:1,indices:r}}}const x=[class extends _{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},P,class extends _{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends _{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends _{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends _{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends _{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},j],E=x.length,C=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,A=new Set([j.type,P.type]);const T=[];function R(e,t){for(let n=0,r=T.length;n!(!e.$and&&!e.$or),I=e=>({[M]:Object.keys(e).map((t=>({[t]:e[t]})))});function L(e,t,{auto:n=!0}={}){const i=e=>{let u=Object.keys(e);const l=(e=>!!e.$path)(e);if(!l&&u.length>1&&!D(e))return i(I(e));if((e=>!r(e)&&a(e)&&!D(e))(e)){const r=l?e.$path:u[0],i=l?e.$val:e[r];if(!o(i))throw new Error((e=>`Invalid value for key ${e}`)(r));const a={keyId:h(r),pattern:i};return n&&(a.searcher=R(i,t)),a}let s={children:[],operator:u[0]};return u.forEach((t=>{const n=e[t];r(n)&&n.forEach((e=>{s.children.push(i(e))}))})),s};return D(e)||(e=I(e)),i(e)}function V(e,t){const n=e.matches;t.matches=[],u(n)&&n.forEach((e=>{if(!u(e.indices)||!e.indices.length)return;const{indices:n,value:r}=e;let o={indices:n,value:r};e.key&&(o.key=e.key.src),e.idx>-1&&(o.refIndex=e.idx),t.matches.push(o)}))}function N(e,t){t.score=e.score}class F{constructor(e,t={},n){this.options={...y,...t},this.options.useExtendedSearch,this._keyStore=new f(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof v))throw new Error("Incorrect 'index' type");this._myIndex=t||b(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){u(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let n=0,r=this._docs.length;n{let n=1;e.matches.forEach((({key:e,norm:r,score:o})=>{const i=e?e.weight:null;n*=Math.pow(0===o&&i?Number.EPSILON:o,(i||1)*(t?1:r))})),e.score=n}))}(s,{ignoreFieldNorm:l}),a&&s.sort(u),i(t)&&t>-1&&(s=s.slice(0,t)),function(e,t,{includeMatches:n=y.includeMatches,includeScore:r=y.includeScore}={}){const o=[];return n&&o.push(V),r&&o.push(N),e.map((e=>{const{idx:n}=e,r={item:t[n],refIndex:n};return o.length&&o.forEach((t=>{t(e,r)})),r}))}(s,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){const t=R(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach((({v:e,i:n,n:o})=>{if(!u(e))return;const{isMatch:i,score:a,indices:l}=t.searchIn(e);i&&r.push({item:e,idx:n,matches:[{score:a,value:e,norm:o,indices:l}]})})),r}_searchLogical(e){const t=L(e,this.options),n=(e,t,r)=>{if(!e.children){const{keyId:n,searcher:o}=e,i=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:o});return i&&i.length?[{idx:r,item:t,matches:i}]:[]}const o=[];for(let i=0,a=e.children.length;i{if(u(e)){let a=n(t,e,r);a.length&&(o[r]||(o[r]={idx:r,item:e,matches:[]},i.push(o[r])),a.forEach((({matches:e})=>{o[r].matches.push(...e)})))}})),i}_searchObjectList(e){const t=R(e,this.options),{keys:n,records:r}=this._myIndex,o=[];return r.forEach((({$:e,i:r})=>{if(!u(e))return;let i=[];n.forEach(((n,r)=>{i.push(...this._findMatches({key:n,value:e[r],searcher:t}))})),i.length&&o.push({idx:r,item:e,matches:i})})),o}_findMatches({key:e,value:t,searcher:n}){if(!u(t))return[];let o=[];if(r(t))t.forEach((({v:t,i:r,n:i})=>{if(!u(t))return;const{isMatch:a,score:l,indices:s}=n.searchIn(t);a&&o.push({score:l,key:e,value:t,idx:r,norm:i,indices:s})}));else{const{v:r,n:i}=t,{isMatch:a,score:u,indices:l}=n.searchIn(r);a&&o.push({score:u,key:e,value:r,norm:i,indices:l})}return o}}F.version="6.6.2",F.createIndex=b,F.parseIndex=function(e,{getFn:t=y.getFn,fieldNormWeight:n=y.fieldNormWeight}={}){const{keys:r,records:o}=e,i=new v({getFn:t,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(o),i},F.config=y,F.parseQuery=L,function(...e){T.push(...e)}(class{constructor(e,{isCaseSensitive:t=y.isCaseSensitive,includeMatches:n=y.includeMatches,minMatchCharLength:r=y.minMatchCharLength,ignoreLocation:o=y.ignoreLocation,findAllMatches:i=y.findAllMatches,location:a=y.location,threshold:u=y.threshold,distance:l=y.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:n,minMatchCharLength:r,findAllMatches:i,ignoreLocation:o,location:a,threshold:u,distance:l},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let n=e.trim().split(C).filter((e=>e&&!!e.trim())),r=[];for(let e=0,o=n.length;e{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===r(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;tc,applyMiddleware:()=>b,bindActionCreators:()=>m,combineReducers:()=>h,compose:()=>v,createStore:()=>d,legacy_createStore:()=>p});var l="function"==typeof Symbol&&Symbol.observable||"@@observable",s=function(){return Math.random().toString(36).substring(7).split("").join(".")},c={INIT:"@@redux/INIT"+s(),REPLACE:"@@redux/REPLACE"+s(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+s()}};function f(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function d(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(u(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(u(1));return n(d)(e,t)}if("function"!=typeof e)throw new Error(u(2));var o=e,i=t,a=[],s=a,p=!1;function h(){s===a&&(s=a.slice())}function y(){if(p)throw new Error(u(3));return i}function m(e){if("function"!=typeof e)throw new Error(u(4));if(p)throw new Error(u(5));var t=!0;return h(),s.push(e),function(){if(t){if(p)throw new Error(u(6));t=!1,h();var n=s.indexOf(e);s.splice(n,1),a=null}}}function v(e){if(!f(e))throw new Error(u(7));if(void 0===e.type)throw new Error(u(8));if(p)throw new Error(u(9));try{p=!0,i=o(i,e)}finally{p=!1}for(var t=a=s,n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{n.d(r,{default:()=>o});var e=n(373),t=n.n(e);n(187),n(883),n(789),n(686);const o=t()})(),r.default})(),e.exports=t()},95295:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(38571);t.default={framework:"semantic",templates:r.default}},38571:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5487);t.default={semantic:r.default}},89345:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+=""+(null==(t=e.message)?"":t)+"\n"}},35692:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(89345);t.default={form:r.default}},23138:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n '+(null==(t=e.form)?"":t)+"\n
    \n
    \n"}},84594:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(23138);t.default={form:r.default}},16751:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n '+(null==(t=e.html)?"":t)+"\n
    \n"}},61967:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16751);t.default={form:r.default}},84558:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n '+(null==(t=e.html)?"":t)+"\n
    \n"}},13332:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(84558);t.default={form:r.default}},26680:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n

    '+(null==(t=e.t(e.componentInfo.title))?"":t)+" "+(null==(t=e.t("Component"))?"":t)+'

    \n
    \n \n
    \n
    \n
    \n ",e.preview||(n+='\n
    \n \n \n \n
    \n "),n+="\n
    \n ",e.preview&&(n+='\n
    \n
    \n '+(null==(t=e.t("Preview"))?"":t)+'\n
    \n
    \n '+(null==(t=e.preview)?"":t)+"\n
    \n ",e.componentInfo.help&&(n+='\n
    \n '+(null==(t=e.componentInfo.help)?"":t)+"\n
    \n "),n+='\n
    \n \n \n \n
    \n
    \n "),n+"\n
    \n"}},85097:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(26680);t.default={form:r.default}},36634:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'\n Drag and Drop a form component\n\n'}},59144:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(36634);t.default={form:r.default}},21102:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.groups.forEach((function(e){n+="\n "+(null==(t=e)?"":t)+"\n "})),n+="\n
    \n"}},67767:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21102);t.default={form:r.default}},3414:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n
    \n \n '+(null==(t=e.t(e.group.title))?"":t)+'\n \n
    \n
    \n
    \n
    \n \n
    \n ',e.group.componentOrder.forEach((function(r){n+='\n \n ',e.group.components[r].icon&&(n+='\n \n '),n+="\n "+(null==(t=e.t(e.group.components[r].title))?"":t)+"\n \n "})),n+="\n "+(null==(t=e.subgroups.join(""))?"":t)+"\n
    \n
    \n\n"}},18840:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3414);t.default={form:r.default}},17517:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n '+(null==(t=e.sidebar)?"":t)+'\n
    \n
    \n \n
    \n"}},29733:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17517);t.default={form:r.default}},50052:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+="<"+(null==(t=e.input.type)?"":t)+'\n ref="button"\n class="ui button '+(null==(t=e.transform("theme",e.component.theme))?"":t)+" "+(null==(t=e.component.customClass)?"":t)+'"\n ',e.input.attr)n+="\n "+(null==(t=r)?"":t)+'="'+(null==(t=e.input.attr[r])?"":t)+'"\n ';return n+="\n>\n",e.component.leftIcon&&(n+=' '),n+="\n"+(null==(t=e.input.content)?"":t)+"\n",e.component.tooltip&&(n+='\n \n'),n+="\n",e.component.rightIcon&&(n+=' '),n+"\n\n
    \n \n
    \n'}},12749:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"\n"}},21614:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(50052),o=n(12749);t.default={form:r.default,html:o.default}},1237:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+='
    \n <'+(null==(t=e.input.type)?"":t)+'\n ref="input"\n id="'+(null==(t=e.id)?"":t)+'"\n ',e.input.attr)n+="\n "+(null==(t=r)?"":t)+'="'+(null==(t=e.input.attr[r])?"":t)+'"\n ';return n+="\n ",e.checked&&(n+="checked=true"),n+="\n >\n \n \n ",e.component.tooltip&&(n+='\n \n '),n+"\n
    \n"}},51266:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n
    ',e.checked?n+="True":n+="False",n+"
    \n"}},48424:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1237),o=n(51266);t.default={form:r.default,html:o.default}},46530:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.component.columns.forEach((function(r,o){n+='\n
    \n '+(null==(t=e.columnComponents[o])?"":t)+"\n
    \n "})),n+="\n
    \n"}},43960:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(46530);t.default={form:r.default}},23475:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.visible&&(n+="\n "+(null==(t=e.children)?"":t)+'\n
    \n '),n+"\n
    \n"}},71427:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(23475);t.default={form:r.default}},51284:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={"has-error":"error","is-invalid":"error","formio-tab-panel-active":"active","formio-tab-link-active":"active","formio-tab-link-container-active":"active"}},15894:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n '+(null==(t=r.hideLabel?"":e.t(r.label||r.title))?"":t)+"\n ",r.tooltip&&(n+=' '),n+="\n \n "})),n+="\n ",e.hasExtraColumn&&(n+="\n \n "),n+="\n \n \n "),n+='\n \n ',e.rows.forEach((function(r,o){n+="\n ",e.hasGroups&&e.groups[o]&&(n+='\n \n '+(null==(t=e.groups[o].label)?"":t)+"\n \n "),n+='\n \n ',e.component.reorder&&(n+='\n \n '),n+="\n ",e.columns.forEach((function(o){n+='\n \n "})),n+="\n ",e.hasExtraColumn&&(n+="\n ",e.hasRemoveButtons&&(n+='\n \n '),n+="\n ",e.canAddColumn&&(n+='\n \n "),n+="\n "),n+="\n \n "})),n+="\n \n ",e.hasAddButton&&e.hasBottomSubmit&&(n+='\n \n \n \n \n \n "),n+="\n
    \n ",e.hasAddButton&&e.hasTopSubmit&&(n+='\n \n "),n+="\n
    \n \n \n '+(null==(t=r[o.key])?"":t)+"\n \n \n \n '+(null==(t=e.placeholder)?"":t)+"\n
    \n \n
    \n"}},46719:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n ',e.hasHeader&&(n+="\n \n \n ",e.columns.forEach((function(r){n+='\n \n "})),n+="\n \n \n "),n+="\n \n ",e.rows.forEach((function(r){n+="\n \n ",e.columns.forEach((function(o){n+='\n \n "})),n+="\n \n "})),n+="\n \n
    \n '+(null==(t=r.hideLabel?"":e.t(r.label||r.title))?"":t)+"\n ",r.tooltip&&(n+=' '),n+="\n
    \n '+(null==(t=r[o.key])?"":t)+"\n
    \n"}},99126:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15894),o=n(46719);t.default={form:r.default,html:o.default}},20173:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.dayFirst&&e.showDay&&(n+='\n
    \n \n "+(null==(t=e.day)?"":t)+"\n
    \n "),n+="\n ",e.showMonth&&(n+='\n
    \n \n "+(null==(t=e.month)?"":t)+"\n
    \n "),n+="\n ",!e.dayFirst&&e.showDay&&(n+='\n
    \n \n "+(null==(t=e.day)?"":t)+"\n
    \n "),n+="\n ",e.showYear&&(n+='\n
    \n \n "+(null==(t=e.year)?"":t)+"\n
    \n "),n+'\n
    \n\n'}},20446:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20173);t.default={form:r.default}},97483:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.header&&(n+='\n
    \n '+(null==(t=e.header)?"":t)+"\n
    \n "),n+="\n ",e.rows.forEach((function(r,o){n+='\n
    \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n
    \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
    \n "),n+='\n
    \n
    \n '+(null==(t=e.errors[o])?"":t)+"\n
    \n
    \n
    \n "})),n+="\n ",e.footer&&(n+='\n \n "),n+="\n
    \n",!e.readOnly&&e.hasAddButton&&(n+='\n\n"),n+="\n"}},5264:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.header&&(n+='\n
    \n '+(null==(t=e.header)?"":t)+"\n
    \n "),n+="\n ",e.rows.forEach((function(r,o){n+='\n
    \n '+(null==(t=r)?"":t)+"\n ",e.openRows[o]&&!e.readOnly&&(n+='\n
    \n \n ",e.component.removeRow&&(n+='\n \n "),n+="\n
    \n "),n+='\n
    \n
    \n '+(null==(t=e.errors[o])?"":t)+"\n
    \n
    \n
    \n "})),n+="\n ",e.footer&&(n+='\n \n "),n+="\n
    \n"}},96943:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(97483),o=n(5264);t.default={form:r.default,html:o.default}},95463:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+="

    "+(null==(t=e.t("error"))?"":t)+"

    \n
      \n ",e.errors.forEach((function(r){n+='\n '+(null==(t=r.message)?"":t)+"\n "})),n+="\n
    \n\n"}},69240:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(95463);t.default={form:r.default}},64129:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.label.hidden||(n+='\n
    \n '+(null==(t=e.labelMarkup)?"":t)+"\n
    \n "),n+="\n\n ",e.label.hidden&&e.label.className&&e.component.validate.required&&(n+='\n
    \n \n
    \n '),n+='\n\n
    \n '+(null==(t=e.element)?"":t)+"\n
    \n
    \n\n",e.component.description&&(n+='\n
    '+(null==(t=e.t(e.component.description))?"":t)+"
    \n"),n+"\n"}},99809:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.label.hidden||"bottom"===e.label.labelPosition||(n+="\n "+(null==(t=e.labelMarkup)?"":t)+"\n"),n+="\n\n",e.label.hidden&&e.label.className&&e.component.validate.required&&(n+='\n \n'),n+="\n\n"+(null==(t=e.element)?"":t)+"\n",e.label.hidden||"bottom"!==e.label.labelPosition||(n+="\n "+(null==(t=e.labelMarkup)?"":t)+"\n"),n+="\n",e.component.description&&(n+='\n
    '+(null==(t=e.t(e.component.description))?"":t)+"
    \n"),n+"\n"}},4061:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(99809),o=n(64129);t.default={form:r.default,align:o.default}},54427:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n \n '+(null==(t=e.t(e.component.legend))?"":t)+"\n ",e.component.tooltip&&(n+='\n \n '),n+="\n ",e.collapsed||(n+='\n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n "),n+"\n
    \n"}},72297:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(54427);t.default={form:r.default}},75762:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.self.imageUpload?(n+="\n
    \n ",e.files.forEach((function(r){n+='\n
    \n \n '+(null==(t=r.originalName||r.name)?\n ',e.disabled||(n+='\n \n '),n+="\n \n
    \n "})),n+="\n
    \n"):(n+='\n
    \n
    \n
    \n ',e.disabled||(n+='\n
    \n '),n+='\n
    \n
    '+(null==(t=e.t("Size"))?"":t)+"
    \n ",e.self.hasTypes&&(n+='\n
    '+(null==(t=e.t("Type"))?"":t)+"
    \n "),n+="\n
    \n
    \n ",e.files.forEach((function(r){n+='\n
  • \n
    \n ',e.disabled||(n+='\n
    \n '),n+='\n
    '+(null==(t=r.originalName||r.name)?"":t)+"\n ",n+='\n
    \n
    '+(null==(t=e.fileSize(r.size))?"":t)+"
    \n ",e.self.hasTypes&&!e.disabled&&(n+='\n
    \n \n
    \n "),n+="\n ",e.self.hasTypes&&e.disabled&&(n+='\n
    '+(null==(t=r.fileType)?"":t)+"
    \n "),n+="\n
    \n
  • \n "})),n+="\n
    \n"),n+="\n",e.disabled||!e.component.multiple&&e.files.length||(n+="\n ",e.self.useWebViewCamera?n+='\n
    \n \n \n
    \n ":e.self.cameraMode?n+='\n
    \n \n
    \n \n \n ":(n+='\n
    \n '+(null==(t=e.t("Drop files to attach,"))?"":t)+"\n ",e.self.imageUpload&&e.component.webcam&&(n+='\n '+(null==(t=e.t("Use Camera,"))?"":t)+"\n "),n+="\n "+(null==(t=e.t("or"))?"":t)+' '+(null==(t=e.t("browse"))?"":t)+"\n
    \n "),n+="\n"),n+="\n",e.statuses.forEach((function(r){n+='\n
    \n
    \n
    '+(null==(t=r.originalName)?"":t)+'
    \n
    '+(null==(t=e.fileSize(r.size))?"":t)+'
    \n
    \n
    \n
    \n ',"progress"===r.status?n+='\n
    \n
    \n '+(null==(t=r.progress)?"":t)+"% "+(null==(t=e.t("Complete"))?"":t)+"\n
    \n
    \n ":n+='\n
    '+(null==(t=e.t(r.message))?"":t)+"
    \n ",n+="\n
    \n
    \n
    \n"})),n+="\n",e.component.storage&&!e.support.hasWarning||(n+='\n
    \n ',e.component.storage||(n+="\n

    "+(null==(t=e.t("No storage has been set for this field. File uploads are disabled until storage is set up."))?"":t)+"

    \n "),n+="\n ",e.support.filereader||(n+="\n

    "+(null==(t=e.t("File API & FileReader API not supported."))?"":t)+"

    \n "),n+="\n ",e.support.formdata||(n+="\n

    "+(null==(t=e.t("XHR2's FormData is not supported."))?"":t)+"

    \n "),n+="\n ",e.support.progress||(n+="\n

    "+(null==(t=e.t("XHR2's upload progress isn't supported."))?"":t)+"

    \n "),n+="\n
    \n"),n+="\n"}},7007:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(75762);t.default={form:r.default}},84481:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+''+(null==(t=e.content)?"":t)+"\n"}},63751:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(84481);t.default={form:r.default}},83836:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r={"plus-squre-o":"plus square outline","minus-squre-o":"minus square outline","question-sign":"question circle","remove-circle":"trash alternate outline","new-window":"external alternate","files-o":"file outline",move:"arrows alternate",link:"linkify"};return r.hasOwnProperty(t)&&(t=r[t]),t=(t=(t=t||"").replace(/-/g," ")).replace(/ o$/," outline"),n?"icon ".concat(t," loading"):"icon ".concat(t)}},5487:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n\n',e.prefix&&(n+='\n\n"),n+="\n",!e.component.editor&&!e.component.wysiwyg){for(var r in n+="\n<"+(null==(t=e.input.type)?"":t)+'\n ref="'+(null==(t=e.input.ref?e.input.ref:"input")?"":t)+'"\n ',e.input.attr)n+="\n "+(null==(t=r)?"":t)+'="'+(null==(t=e.input.attr[r])?"":t)+'"\n ';n+='\n id="'+(null==(t=e.instance.id)?"":t)+"-"+(null==(t=e.component.key)?"":t)+'"\n>'+(null==(t=e.input.content)?"":t)+"\n"}return n+="\n",(e.component.editor||e.component.wysiwyg)&&(n+='\n
    \n'),n+="\n",e.component.showCharCount&&(n+='\n\n'),n+="\n",e.component.showWordCount&&(n+='\n\n'),n+="\n",e.suffix&&(n+='\n
    \n',e.suffix instanceof HTMLElement?n+="\n "+(null==(t=e.t(e.suffix.outerHTML))?"":t)+"\n":n+="\n "+(null==(t=e.t(e.suffix))?"":t)+"\n",n+="\n
    \n"),n+"\n
    \n"}},2305:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.value?n+=null==(t=e.value)?"":t:n+="-",n+"
    \n"}},89504:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10090),o=n(2305);t.default={form:r.default,html:o.default}},31520:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n ',e.label.hidden||(n+="\n "+(null==(t=e.t(e.component.label))?"":t)+"\n ",e.component.tooltip&&(n+='\n \n '),n+="\n "),n+"\n\n"}},61206:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(31520);t.default={form:r.default}},83345:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'
    \n
    \n
    \n
    \n
    \n'}},11042:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(83345);t.default={form:r.default}},23432:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"Loading...\n"}},72763:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(23432);t.default={form:r.default}},18182:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n '+(null==(t=e.message)?"":t)+"\n
    \n"}},30490:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18182);t.default={form:r.default}},9637:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n '+(null==(t=e.element)?"":t)+"\n \n ",e.disabled||(n+='\n \n \n \n '),n+"\n\n"}},71580:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9637);t.default={form:r.default}},42412:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n '+(null==(t=e.rows)?"":t)+"\n ",e.disabled||(n+='\n \n \n \n "),n+"\n \n
    \n \n
    \n"}},29367:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(42412);t.default={form:r.default}},4860:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,(!e.component.hideLabel||e.builder||e.component.collapsible||e.component.tooltip)&&(n+='\n

    \n ',e.component.collapsible&&(n+='\n \n '),n+="\n ",e.component.hideLabel&&!e.builder||(n+="\n "+(null==(t=e.t(e.component.title))?"":t)+"\n "),n+="\n ",e.component.tooltip&&(n+='\n \n '),n+="\n

    \n"),n+="\n",e.collapsed&&!e.builder||(n+='\n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n"),n+"\n"}},88576:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4860);t.default={form:r.default}},84275:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.values.forEach((function(r){for(var o in n+='\n
    \n
    \n <'+(null==(t=e.input.type)?"":t)+'\n ref="input"\n ',e.input.attr)n+="\n "+(null==(t=o)?"":t)+'="'+(null==(t=e.input.attr[o])?"":t)+'"\n ';n+='\n value="'+(null==(t=r.value)?"":t)+'"\n ',(e.value===r.value||"object"==typeof e.value&&e.value.hasOwnProperty(r.value)&&e.value[r.value])&&(n+="\n checked=true\n "),n+="\n ",r.disabled&&(n+="\n disabled=true\n "),n+='\n id="'+(null==(t=e.instance.root&&e.instance.root.id)?"":t)+"-"+(null==(t=e.id)?"":t)+"-"+(null==(t=e.row)?"":t)+"-"+(null==(t=r.value)?"":t)+'"\n >\n \n
    \n
    \n "})),n+="\n
    \n"}},2227:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,(n+='
    \n ')+"\n "+(null==(t=e.values.filter((function(t){return e.value===t.value||"object"==typeof e.value&&e.value.hasOwnProperty(t.value)&&e.value[t.value]})).map((function(t){return e.t(t.label)})).join(", "))?"":t)+"\n
    \n"}},1746:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(84275),o=n(2227);t.default={form:r.default,html:o.default}},25396:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'\n \n \n \n \n \n \n \n \n
    \n '+(null==(t=e.element)?"":t)+'\n
    \n \n
    \n"}},56533:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(25396);t.default={form:r.default}},5721:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+='\n\n'}},80260:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    ',e.value?n+=null==(t=e.self.itemValueForHTMLMode(e.value))?"":t:n+="-",n+"
    \n"}},60587:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5721),o=n(80260);t.default={form:r.default,html:o.default}},93593:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";for(var r in Array.prototype.join,n+="\n"}},60345:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.selected&&(n+=null==(t=e.t(e.option.label))?"":t),n+"\n"}},14668:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(93593),o=n(60345);t.default={form:r.default,html:o.default}},90538:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+=(null==(t=e.element)?"":t)+'\n\n\n \n \n \n \n ',e.required&&(n+='\n \n '),n+='\n \n\n',e.component.footer&&(n+='\n \n"),n+"\n"}},96515:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return'\n'}},95339:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(90538),o=n(96515);t.default={form:r.default,html:o.default}},87090:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n \n \n ',e.component.values.forEach((function(r){n+='\n \n "})),n+="\n \n \n \n ",e.component.questions.forEach((function(r){n+="\n \n \n ",e.component.values.forEach((function(o){n+='\n \n '})),n+="\n \n "})),n+="\n \n
    '+(null==(t=e.t(r.label))?"":t)+"
    "+(null==(t=e.t(r.label))?"":t)+"\n \n
    \n"}},13556:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n \n ',e.component.questions.forEach((function(r){n+="\n \n \n \n \n "})),n+="\n \n
    "+(null==(t=e.t(r.label))?"":t)+"\n ",e.component.values.forEach((function(o){n+="\n ",e.value&&e.value.hasOwnProperty(r.value)&&e.value[r.value]===o.value&&(n+="\n "+(null==(t=e.t(o.label))?"":t)+"\n "),n+="\n "})),n+="\n
    \n"}},88020:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(87090),o=n(13556);t.default={form:r.default,html:o.default}},74216:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.component.components.forEach((function(r,o){n+='\n

    '+(null==(t=e.t(r.label))?"":t)+'

    \n
    \n '+(null==(t=e.tabComponents[o])?"":t)+"\n
    \n"})),n+="\n"}},25238:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n \n ",e.component.components.forEach((function(r,o){n+='\n
    '+(null==(t=e.tabComponents[o])?"":t)+"
    \n "})),n+="\n
    \n"}},31533:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(74216),o=n(25238);t.default={flat:r.default,form:o.default}},949:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n ',e.component.header&&e.component.header.length>0&&(n+="\n \n \n ",e.component.header.forEach((function(r){n+="\n \n "})),n+="\n \n \n "),n+="\n \n ",e.tableComponents.forEach((function(r,o){n+='\n \n ',r.forEach((function(r,o){n+='\n \n "})),n+="\n \n
    "+(null==(t=e.t(r))?"":t)+"
    \n "})),n+="\n
    \n"}},83725:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(949);t.default={form:r.default}},37552:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,e.node.isRoot?n+='\n
    \n
    \n ':n+='\n
    \n ',n+="\n ",e.content&&(n+='\n
    \n '+(null==(t=e.content)?"":t)+"\n
    \n "),n+="\n ",e.childNodes&&e.childNodes.length&&(n+='\n
    \n '+(null==(t=e.childNodes.join(""))?"":t)+"\n
    \n "),n+="\n ",e.node.isRoot?n+="\n
    \n
    \n ":n+="\n
    \n",n+"\n"}},62441:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(37552);t.default={form:r.default}},16016:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    '+(null==(t=e.children)?"":t)+"
    \n ",e.readOnly||(n+='\n
    \n \n
    \n "),n+"\n
    \n"}},12923:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16016),o=n(47379);t.default={treeView:{form:o.default},treeEdit:{form:r.default}}},47379:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n ',e.values.forEach((function(e){n+='\n
    \n '+(null==(t=e)?"":t)+"\n
    \n "})),n+='\n
    \n
    \n ',e.node.hasChildren&&(n+='\n \n
    \n '),n+="\n ",e.readOnly||(n+='\n \n
    \n \n
    \n \n ",e.node.revertAvailable&&(n+='\n
    \n \n "),n+="\n "),n+="\n
    \n
    \n
    \n
    \n"}},21710:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'

    '+(null==(t=e.t(e.component.title))?"":t)+"

    \n"}},32178:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.children)?"":t)+"
    \n"}},4599:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21710),o=n(32178);t.default={form:o.default,builder:r.default}},2230:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    \n
    \n '+(null==(t=e.children)?"":t)+"\n
    \n
    \n"}},76709:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2230);t.default={form:r.default}},70084:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;return""+'
    '+(null==(t=e.t(e.component.title))?"":t)+"
    \n"}},16466:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n
    \n ',"wizardHeaderVertical"===e.wizardHeaderType?n+='\n
    \n
    \n '+(null==(t=e.wizardHeader)?"":t)+'\n
    \n
    \n
    \n '+(null==(t=e.components)?"":t)+'\n
    \n
    \n
    \n
    \n
    \n '+(null==(t=e.wizardNav)?"":t)+"\n
    \n
    \n ":n+=" \n "+(null==(t=e.wizardHeader)?"":t)+'\n
    \n '+(null==(t=e.components)?"":t)+"\n
    \n "+(null==(t=e.wizardNav)?"":t)+"\n ",n+" \n
    \n
    "}},42317:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(70084),o=n(16466);t.default={form:o.default,builder:r.default}},93363:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},86739:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(93363);t.default={form:r.default}},28267:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},7130:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(28267);t.default={form:r.default}},81256:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='\n"}},54815:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(81256);t.default={form:r.default}},41993:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n="";return Array.prototype.join,n+='
    \n ',e.buttons.cancel&&(n+='\n
    \n \n
    \n "),n+="\n ",e.buttons.previous&&(n+='\n
    \n \n
    \n "),n+="\n ",e.buttons.next&&(n+='\n
    \n \n
    \n "),n+="\n ",e.buttons.submit&&(n+='\n
    \n \n
    \n "),n+"\n
    \n"}},86858:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(41993);t.default={form:r.default}},43281:function(e){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1);Object.defineProperty(t,"createAutoCorrectedDatePipe",{enumerable:!0,get:function(){return r(o).default}});var i=n(2);Object.defineProperty(t,"createNumberMask",{enumerable:!0,get:function(){return r(i).default}});var a=n(3);Object.defineProperty(t,"emailMask",{enumerable:!0,get:function(){return r(a).default}})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mm dd yyyy",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.minYear,i=void 0===o?1:o,a=t.maxYear,u=void 0===a?9999:a,l=e.split(/[^dmyHMS]+/).sort((function(e,t){return r.indexOf(e)-r.indexOf(t)}));return function(t){var r=[],o={dd:31,mm:12,yy:99,yyyy:u,HH:23,MM:59,SS:59},a={dd:1,mm:1,yy:0,yyyy:i,HH:0,MM:0,SS:0},s=t.split("");l.forEach((function(t){var n=e.indexOf(t),i=parseInt(o[t].toString().substr(0,1),10);parseInt(s[n],10)>i&&(s[n+1]=s[n],s[n]=0,r.push(n))}));var c=0,f=l.some((function(r){var l=e.indexOf(r),s=r.length,f=t.substr(l,s).replace(/\D/g,""),d=parseInt(f,10);"mm"===r&&(c=d||0);var p="dd"===r?n[c]:o[r];if("yyyy"===r&&(1!==i||9999!==u)){var h=parseInt(o[r].toString().substring(0,f.length),10);return dh}return d>p||f.length===s&&d0&&void 0!==arguments[0]?arguments[0]:a,t=e.length;if(e===a||e[0]===m[0]&&1===t)return m.split(a).concat([p]).concat(b.split(a));if(e===P&&S)return m.split(a).concat(["0",P,p]).concat(b.split(a));var i=e[0]===s&&R;i&&(e=e.toString().substr(1));var u=e.lastIndexOf(P),l=-1!==u,y=void 0,v=void 0,g=void 0;if(e.slice(-1*N)===b&&(e=e.slice(0,-1*N)),l&&(S||A)?(y=e.slice(e.slice(0,V)===m?V:0,u),v=n((v=e.slice(u+1,t)).replace(f,a))):y=e.slice(0,V)===m?e.slice(V):e,L&&(void 0===L?"undefined":o(L))===d){var k="."===O?"[.]":""+O,_=(y.match(new RegExp(k,"g"))||[]).length;y=y.slice(0,L+_*F)}return y=y.replace(f,a),D||(y=y.replace(/^0+(0$|[^0])/,"$1")),g=n(y=w?r(y,O):y),(l&&S||!0===A)&&(e[u-1]!==P&&g.push(h),g.push(P,h),v&&((void 0===E?"undefined":o(E))===d&&(v=v.slice(0,E)),g=g.concat(v)),!0===A&&e[u-1]===P&&g.push(p)),V>0&&(g=m.split(a).concat(g)),i&&(g.length===V&&g.push(p),g=[c].concat(g)),b.length>0&&(g=g.concat(b.split(a))),g}var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},y=t.prefix,m=void 0===y?i:y,v=t.suffix,b=void 0===v?a:v,g=t.includeThousandsSeparator,w=void 0===g||g,k=t.thousandsSeparatorSymbol,O=void 0===k?u:k,_=t.allowDecimal,S=void 0!==_&&_,j=t.decimalSymbol,P=void 0===j?l:j,x=t.decimalLimit,E=void 0===x?2:x,C=t.requireDecimal,A=void 0!==C&&C,T=t.allowNegative,R=void 0!==T&&T,M=t.allowLeadingZeroes,D=void 0!==M&&M,I=t.integerLimit,L=void 0===I?null:I,V=m&&m.length||0,N=b&&b.length||0,F=O&&O.length||0;return e.instanceOf="createNumberMask",e};var i="$",a="",u=",",l=".",s="-",c=/-/,f=/\D+/g,d="number",p=/\d/,h="[]"},function(e,t,n){"use strict";function r(e,t,n){var r=[];return e[t]===n?r.push(n):r.push(d,n),r.push(d),r}function o(e,t,n,r){var o=c;return-1!==t&&(o=-1===n?e.slice(t+1,e.length):e.slice(t+1,n)),(o=o.replace(new RegExp("[\\s"+r+"]",h),c))===f?l:o.length<1?p:o[o.length-1]===s?o.slice(0,o.length-1):o}function i(e,t,n,r){var o=c;return-1!==t&&(o=e.slice(t+1,e.length)),0===(o=o.replace(new RegExp("[\\s"+n+".]",h),c)).length?e[t-1]===s&&r!==e.length?l:c:o}function a(e,t){return e.split(c).map((function(e){return e===p?e:t?m:y}))}Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){return e&&e.__esModule?e:{default:e}}(n(4)),l="*",s=".",c="",f="@",d="[]",p=" ",h="g",y=/[^\s]/,m=/[^.\s]/,v=/\s/g;t.default={mask:function(e,t){e=e.replace(v,c);var n=t.placeholderChar,u=t.currentCaretPosition,l=e.indexOf(f),d=e.lastIndexOf(s),p=d1&&h.substr(-1)===u&&o!==f.length&&(h=h.slice(0,h.length-1)),h};var r="@",o=/@/g,i="",a="@.",u=".",l="..",s=[],c=/\./g}])},47853:function(e){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.inputElement,n=e.afterUpdate,r=(0,a.default)(e),o=function(e){var t=e.target.value;r.update(t),"function"==typeof n&&n(t)};return t.addEventListener("input",o),r.update(t.value),{textMaskInputElement:r,destroy:function(){t.removeEventListener("input",o)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.conformToMask=void 0,t.maskInput=o;var i=n(2);Object.defineProperty(t,"conformToMask",{enumerable:!0,get:function(){return r(i).default}});var a=r(n(5));t.default=o},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.placeholderChar="_",t.strFunction="function"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(0,o.isArray)(t)){if((void 0===t?"undefined":r(t))!==i.strFunction)throw new Error("Text-mask:conformToMask; The mask property must be an array.");t=t(e,n),t=(0,o.processCaretTraps)(t).maskWithoutCaretTraps}var l=n.guide,s=void 0===l||l,c=n.previousConformedValue,f=void 0===c?u:c,d=n.placeholderChar,p=void 0===d?i.placeholderChar:d,h=n.placeholder,y=void 0===h?(0,o.convertMaskToPlaceholder)(t,p):h,m=n.currentCaretPosition,v=n.keepCharPositions,b=!1===s&&void 0!==f,g=e.length,w=f.length,k=y.length,O=t.length,_=g-w,S=_>0,j=m+(S?-_:0),P=j+Math.abs(_);if(!0===v&&!S){for(var x=u,E=j;E=j&&t=0;A--){var T=C[A].char;T!==p&&T===y[A>=j&&w===O?A-_:A]&&C.splice(A,1)}var R=u,M=!1;e:for(var D=0;D0)for(;C.length>0;){var L=C.shift(),V=L.char,N=L.isNew;if(V===p&&!0!==b){R+=p;continue e}if(t[D].test(V)){if(!0===v&&!1!==N&&f!==u&&!1!==s&&S){for(var F=C.length,B=null,U=0;U0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.placeholderChar;if(!r(e))throw new Error("Text-mask:convertMaskToPlaceholder; The mask property must be an array.");if(-1!==e.indexOf(t))throw new Error("Placeholder character must not be used as part of the mask. Please specify a character that is not present in your mask as your placeholder character.\n\nThe placeholder character that was received is: "+JSON.stringify(t)+"\n\nThe mask that was received is: "+JSON.stringify(e));return e.map((function(e){return e instanceof RegExp?t:e})).join("")},t.isArray=r,t.isString=function(e){return"string"==typeof e||e instanceof String},t.isNumber=function(e){return"number"==typeof e&&void 0===e.length&&!isNaN(e)},t.isNil=function(e){return null==e},t.processCaretTraps=function(e){for(var t=[],n=void 0;-1!==(n=e.indexOf(a));)t.push(n),e.splice(n,1);return{maskWithoutCaretTraps:e,indexes:t}};var o=n(1),i=[],a="[]"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.previousConformedValue,o=void 0===t?r:t,i=e.previousPlaceholder,a=void 0===i?r:i,u=e.currentCaretPosition,l=void 0===u?0:u,s=e.conformedValue,c=e.rawValue,f=e.placeholderChar,d=e.placeholder,p=e.indexesOfPipedChars,h=void 0===p?n:p,y=e.caretTrapIndexes,m=void 0===y?n:y;if(0===l||!c.length)return 0;var v=c.length,b=o.length,g=d.length,w=s.length,k=v-b,O=k>0;if(k>1&&!O&&0!==b)return l;var _=0,S=void 0,j=void 0;if(!O||o!==s&&s!==d){var P=s.toLowerCase(),x=c.toLowerCase().substr(0,l).split(r).filter((function(e){return-1!==P.indexOf(e)}));j=x[x.length-1];var E=a.substr(0,x.length).split(r).filter((function(e){return e!==f})).length,C=d.substr(0,x.length).split(r).filter((function(e){return e!==f})).length,A=C!==E,T=void 0!==a[x.length-1]&&void 0!==d[x.length-2]&&a[x.length-1]!==f&&a[x.length-1]!==d[x.length-1]&&a[x.length-1]===d[x.length-2];!O&&(A||T)&&E>0&&d.indexOf(j)>-1&&void 0!==c[l]&&(S=!0,j=c[l]);for(var R=h.map((function(e){return P[e]})),M=R.filter((function(e){return e===j})).length,D=x.filter((function(e){return e===j})).length,I=d.substr(0,d.indexOf(f)).split(r).filter((function(e,t){return e===j&&c[t]!==e})).length,L=I+D+M+(S?1:0),V=0,N=0;N=L));N++);}else _=l-k;if(O){for(var F=_,B=_;B<=g;B++)if(d[B]===f&&(F=B),d[B]===f||-1!==m.indexOf(B)||B===g)return F}else if(S){for(var U=_-1;U>=0;U--)if(s[U]===j||-1!==m.indexOf(U)||0===U)return U}else for(var z=_;z>=0;z--)if(d[z-1]===f||-1!==m.indexOf(z)||0===z)return z};var n=[],r=""},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){(n?n.activeElement:document.activeElement)===e&&(y?m((function(){return e.setSelectionRange(t,t,p)}),0):e.setSelectionRange(t,t,p))}function i(e){if((0,c.isString)(e))return e;if((0,c.isNumber)(e))return String(e);if(null==e)return d;throw new Error("The 'value' provided to Text Mask needs to be a string or a number. The value received was:\n\n "+JSON.stringify(e))}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:e,p=r.inputElement,y=r.mask,m=r.guide,v=r.pipe,b=r.placeholderChar,g=void 0===b?f.placeholderChar:b,w=r.keepCharPositions,k=void 0!==w&&w,O=r.showMask,_=void 0!==O&&O;if(void 0===n&&(n=p.value),n!==t.previousConformedValue){(void 0===y?"undefined":u(y))===h&&void 0!==y.pipe&&void 0!==y.mask&&(v=y.pipe,y=y.mask);var S=void 0,j=void 0;if(y instanceof Array&&(S=(0,c.convertMaskToPlaceholder)(y,g)),!1!==y){var P=i(n),x=p.selectionEnd,E=t.previousConformedValue,C=t.previousPlaceholder,A=void 0;if((void 0===y?"undefined":u(y))===f.strFunction){if(!1===(j=y(P,{currentCaretPosition:x,previousConformedValue:E,placeholderChar:g})))return;var T=(0,c.processCaretTraps)(j);j=T.maskWithoutCaretTraps,A=T.indexes,S=(0,c.convertMaskToPlaceholder)(j,g)}else j=y;var R={previousConformedValue:E,guide:m,placeholderChar:g,pipe:v,placeholder:S,currentCaretPosition:x,keepCharPositions:k},M=(0,s.default)(P,j,R).conformedValue,D=(void 0===v?"undefined":u(v))===f.strFunction,I={};D&&(!1===(I=v(M,a({rawValue:P},R)))?I={value:E,rejected:!0}:(0,c.isString)(I)&&(I={value:I}));var L=D?I.value:M,V=(0,l.default)({previousConformedValue:E,previousPlaceholder:C,conformedValue:L,placeholder:S,rawValue:P,currentCaretPosition:x,placeholderChar:g,indexesOfPipedChars:I.indexesOfPipedChars,caretTrapIndexes:A}),N=L===S&&0===V?_?S:d:L;t.previousConformedValue=N,t.previousPlaceholder=S,p.value!==N&&(P.includes("e-")?p.value=P:p.value=N,o(p,V,e.shadowRoot))}}}}};var l=r(n(4)),s=r(n(2)),c=n(3),f=n(1),d="",p="none",h="object",y="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),m="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:setTimeout}])},65988:function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n0?1:-1)*Math.floor(Math.abs(t)):t}(e);return Math.min(Math.max(t,0),n)},o=function(e){if(null!=e){if(["string","number","boolean","symbol"].indexOf(typeof e)>-1)return Symbol.iterator;if("undefined"!=typeof Symbol&&"iterator"in Symbol&&Symbol.iterator in e)return Symbol.iterator;if("@@iterator"in e)return"@@iterator"}},i=function(e,n){if(null!=e&&null!=n){var r=e[n];if(null==r)return;if(!t(r))throw new TypeError(r+" is not a function");return r}},a=function(e){var t=e.next();return!Boolean(t.done)&&t},function(e){"use strict";var n,u,l,s=this,c=arguments.length>1?arguments[1]:void 0;if(void 0!==c){if(!t(c))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(n=arguments[2])}var f=i(e,o(e));if(void 0!==f){u=t(s)?Object(new s):[];var d,p,h=f.call(e);if(null==h)throw new TypeError("Array.from requires an array-like or iterable object");for(l=0;;){if(!(d=a(h)))return u.length=l,u;p=d.value,u[l]=c?c.call(n,p,l):p,l++}}else{var y=Object(e);if(null==e)throw new TypeError("Array.from requires an array-like object - not null or undefined");var m,v=r(y.length);for(u=t(s)?Object(new s(v)):new Array(v),l=0;l0){var t=e[0],r=t.previousElementSibling;if(r&&-1!==r.className.indexOf("group")&&!r.previousElementSibling&&(t=r),t.offsetTopi&&(n.scrollTop+=o-i)}}}()}function _(){w()&&O()}function S(){_()}function j(e){e.target!==n?_():e.preventDefault()}function P(t){for(var n=t.which||t.keyCode||0,r=0,o=e.keysToIgnore||[38,13,27,39,37,16,17,18,20,91,9];r=112&&n<=123&&!e.keysToIgnore||40===n&&w()||C(0)}function x(t){var n=t.which||t.keyCode||0;if(38===n||40===n||27===n){var o=w();if(27===n)k();else{if(!o||d.length<1)return;38===n?function(){if(d.length<1)r=void 0;else if(r===d[0])r=d[d.length-1];else for(var e=d.length-1;e>0;e--)if(r===d[e]||1===e){r=d[e-1];break}}():function(){if(d.length<1&&(r=void 0),r&&r!==d[d.length-1]){for(var e=0;e=h||1===t?(g(),o=window.setTimeout((function(){e.fetch(i,(function(e){m===n&&e&&(p=i,r=(d=e).length<1||c?void 0:d[0],O())}),t,a)}),0===t?l:0)):k()}function A(){setTimeout((function(){t.activeElement!==v&&k()}),200)}return n.className="autocomplete "+(e.className||""),n.setAttribute("role","listbox"),v.setAttribute("role","combobox"),v.setAttribute("aria-expanded","false"),v.setAttribute("aria-autocomplete","list"),v.setAttribute("aria-controls",n.id),v.setAttribute("aria-owns",n.id),v.setAttribute("aria-activedescendant",""),v.setAttribute("aria-haspopup","listbox"),i.position="absolute",n.addEventListener("mousedown",(function(e){e.stopPropagation(),e.preventDefault()})),n.addEventListener("focus",(function(){return v.focus()})),v.addEventListener("keydown",x),v.addEventListener(f,P),v.addEventListener("blur",A),v.addEventListener("focus",E),window.addEventListener("resize",S),t.addEventListener("scroll",j,!0),{destroy:function(){v.removeEventListener("focus",E),v.removeEventListener("keydown",x),v.removeEventListener(f,P),v.removeEventListener("blur",A),window.removeEventListener("resize",S),t.removeEventListener("scroll",j,!0),v.removeAttribute("role"),v.removeAttribute("aria-expanded"),v.removeAttribute("aria-autocomplete"),v.removeAttribute("aria-controls"),v.removeAttribute("aria-activedescendant"),v.removeAttribute("aria-owns"),v.removeAttribute("aria-haspopup"),g(),k()}}}}()},4389:function(e,t){t.defaults={},t.set=function(e,n,r){var o=r||{},i=t.defaults,a=o.expires||i.expires,u=o.domain||i.domain,l=void 0!==o.path?o.path:void 0!==i.path?i.path:"/",s=void 0!==o.secure?o.secure:i.secure,c=void 0!==o.httponly?o.httponly:i.httponly,f=void 0!==o.samesite?o.samesite:i.samesite,d=a?new Date("number"==typeof a?(new Date).getTime()+864e5*a:a):0;document.cookie=e.replace(/[^+#$&^`|]/g,encodeURIComponent).replace("(","%28").replace(")","%29")+"="+n.replace(/[^+#$&/:<-\[\]-}]/g,encodeURIComponent)+(d&&d.getTime()>=0?";expires="+d.toUTCString():"")+(u?";domain="+u:"")+(l?";path="+l:"")+(s?";secure":"")+(c?";httponly":"")+(f?";samesite="+f:"")},t.get=function(e){for(var t=document.cookie.split(";");t.length;){var n=t.pop(),r=n.indexOf("=");if(r=r<0?n.length:r,decodeURIComponent(n.slice(0,r).replace(/^\s+/,""))===e)return decodeURIComponent(n.slice(r+1))}return null},t.erase=function(e,n){t.set(e,"",{expires:-1,domain:n&&n.domain,path:n&&n.path,secure:0,httponly:0})},t.all=function(){for(var e={},t=document.cookie.split(";");t.length;){var n=t.pop(),r=n.indexOf("=");r=r<0?n.length:r,e[decodeURIComponent(n.slice(0,r).replace(/^\s+/,""))]=decodeURIComponent(n.slice(r+1))}return e}},354:function(e){e.exports=function(){"use strict";var e=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){e.exports=function(e){var t=function(e,t){return e+t&4294967295},n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(e,n,r,o,i,a){return n=t(t(n,e),t(o,a)),t(n<>>32-i,r)}function o(e,t,n,o,i,a,u){return r(t&n|~t&o,e,t,i,a,u)}function i(e,t,n,o,i,a,u){return r(t&o|n&~o,e,t,i,a,u)}function a(e,t,n,o,i,a,u){return r(t^n^o,e,t,i,a,u)}function u(e,t,n,o,i,a,u){return r(n^(t|~o),e,t,i,a,u)}function l(e,n){var r=e[0],l=e[1],s=e[2],c=e[3];r=o(r,l,s,c,n[0],7,-680876936),c=o(c,r,l,s,n[1],12,-389564586),s=o(s,c,r,l,n[2],17,606105819),l=o(l,s,c,r,n[3],22,-1044525330),r=o(r,l,s,c,n[4],7,-176418897),c=o(c,r,l,s,n[5],12,1200080426),s=o(s,c,r,l,n[6],17,-1473231341),l=o(l,s,c,r,n[7],22,-45705983),r=o(r,l,s,c,n[8],7,1770035416),c=o(c,r,l,s,n[9],12,-1958414417),s=o(s,c,r,l,n[10],17,-42063),l=o(l,s,c,r,n[11],22,-1990404162),r=o(r,l,s,c,n[12],7,1804603682),c=o(c,r,l,s,n[13],12,-40341101),s=o(s,c,r,l,n[14],17,-1502002290),r=i(r,l=o(l,s,c,r,n[15],22,1236535329),s,c,n[1],5,-165796510),c=i(c,r,l,s,n[6],9,-1069501632),s=i(s,c,r,l,n[11],14,643717713),l=i(l,s,c,r,n[0],20,-373897302),r=i(r,l,s,c,n[5],5,-701558691),c=i(c,r,l,s,n[10],9,38016083),s=i(s,c,r,l,n[15],14,-660478335),l=i(l,s,c,r,n[4],20,-405537848),r=i(r,l,s,c,n[9],5,568446438),c=i(c,r,l,s,n[14],9,-1019803690),s=i(s,c,r,l,n[3],14,-187363961),l=i(l,s,c,r,n[8],20,1163531501),r=i(r,l,s,c,n[13],5,-1444681467),c=i(c,r,l,s,n[2],9,-51403784),s=i(s,c,r,l,n[7],14,1735328473),r=a(r,l=i(l,s,c,r,n[12],20,-1926607734),s,c,n[5],4,-378558),c=a(c,r,l,s,n[8],11,-2022574463),s=a(s,c,r,l,n[11],16,1839030562),l=a(l,s,c,r,n[14],23,-35309556),r=a(r,l,s,c,n[1],4,-1530992060),c=a(c,r,l,s,n[4],11,1272893353),s=a(s,c,r,l,n[7],16,-155497632),l=a(l,s,c,r,n[10],23,-1094730640),r=a(r,l,s,c,n[13],4,681279174),c=a(c,r,l,s,n[0],11,-358537222),s=a(s,c,r,l,n[3],16,-722521979),l=a(l,s,c,r,n[6],23,76029189),r=a(r,l,s,c,n[9],4,-640364487),c=a(c,r,l,s,n[12],11,-421815835),s=a(s,c,r,l,n[15],16,530742520),r=u(r,l=a(l,s,c,r,n[2],23,-995338651),s,c,n[0],6,-198630844),c=u(c,r,l,s,n[7],10,1126891415),s=u(s,c,r,l,n[14],15,-1416354905),l=u(l,s,c,r,n[5],21,-57434055),r=u(r,l,s,c,n[12],6,1700485571),c=u(c,r,l,s,n[3],10,-1894986606),s=u(s,c,r,l,n[10],15,-1051523),l=u(l,s,c,r,n[1],21,-2054922799),r=u(r,l,s,c,n[8],6,1873313359),c=u(c,r,l,s,n[15],10,-30611744),s=u(s,c,r,l,n[6],15,-1560198380),l=u(l,s,c,r,n[13],21,1309151649),r=u(r,l,s,c,n[4],6,-145523070),c=u(c,r,l,s,n[11],10,-1120210379),s=u(s,c,r,l,n[2],15,718787259),l=u(l,s,c,r,n[9],21,-343485551),e[0]=t(r,e[0]),e[1]=t(l,e[1]),e[2]=t(s,e[2]),e[3]=t(c,e[3])}function s(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function c(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function f(e){var t,n,r,o,i,a,u=e.length,c=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=u;t+=64)l(c,s(e.substring(t-64,t)));for(n=(e=e.substring(t-64)).length,r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(r[t>>2]|=128<<(t%4<<3),t>55)for(l(c,r),t=0;t<16;t+=1)r[t]=0;return o=(o=8*u).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(o[2],16),a=parseInt(o[1],16)||0,r[14]=i,r[15]=a,l(c,r),c}function d(e){var t,n,r,o,i,a,u=e.length,s=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=u;t+=64)l(s,c(e.subarray(t-64,t)));for(n=(e=t-64>2]|=e[t]<<(t%4<<3);if(r[t>>2]|=128<<(t%4<<3),t>55)for(l(s,r),t=0;t<16;t+=1)r[t]=0;return o=(o=8*u).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(o[2],16),a=parseInt(o[1],16)||0,r[14]=i,r[15]=a,l(s,r),s}function p(e){var t,r="";for(t=0;t<4;t+=1)r+=n[e>>8*t+4&15]+n[e>>8*t&15];return r}function h(e){var t;for(t=0;t>16)+(t>>16)+(n>>16)<<16|65535&n}),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function t(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(n,r){var o,i,a,u,l=this.byteLength,s=t(n,l),c=l;return r!==e&&(c=t(r,l)),s>c?new ArrayBuffer(0):(o=c-s,i=new ArrayBuffer(o),a=new Uint8Array(i),u=new Uint8Array(this,s,o),a.set(u),i)}}(),w.prototype.append=function(e){return this.appendBinary(y(e)),this},w.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,n=this._buff.length;for(t=64;t<=n;t+=64)l(this._hash,s(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},w.prototype.end=function(e){var t,n,r=this._buff,o=r.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=r.charCodeAt(t)<<(t%4<<3);return this._finish(i,o),n=h(this._hash),e&&(n=g(n)),this.reset(),n},w.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},w.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},w.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},w.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},w.prototype._finish=function(e,t){var n,r,o,i=t;if(e[i>>2]|=128<<(i%4<<3),i>55)for(l(this._hash,e),i=0;i<16;i+=1)e[i]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(n[2],16),o=parseInt(n[1],16)||0,e[14]=r,e[15]=o,l(this._hash,e)},w.hash=function(e,t){return w.hashBinary(y(e),t)},w.hashBinary=function(e,t){var n=h(f(e));return t?g(n):n},w.ArrayBuffer=function(){this.reset()},w.ArrayBuffer.prototype.append=function(e){var t,n=b(this._buff.buffer,e,!0),r=n.length;for(this._length+=e.byteLength,t=64;t<=r;t+=64)l(this._hash,c(n.subarray(t-64,t)));return this._buff=t-64>2]|=r[t]<<(t%4<<3);return this._finish(i,o),n=h(this._hash),e&&(n=g(n)),this.reset(),n},w.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},w.ArrayBuffer.prototype.getState=function(){var e=w.prototype.getState.call(this);return e.buff=v(e.buff),e},w.ArrayBuffer.prototype.setState=function(e){return e.buff=m(e.buff,!0),w.prototype.setState.call(this,e)},w.ArrayBuffer.prototype.destroy=w.prototype.destroy,w.ArrayBuffer.prototype._finish=w.prototype._finish,w.ArrayBuffer.hash=function(e,t){var n=h(d(new Uint8Array(e)));return t?g(n):n},w}()}));return class{md5(t,n,r){this.aborted=!1,this.progress=0;let o=0;const i=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,a=2097152,u=Math.ceil(t.size/a),l=new e.ArrayBuffer,s=new FileReader;function c(){const e=o*a,n=e+a>=t.size?t.size:e+a;s.readAsArrayBuffer(i.call(t,e,n))}c(),s.onloadend=e=>{l.append(e.target.result),o++,this.progress=o/u,r&&"function"==typeof r&&r(this.progress),this.aborted?n("aborted"):o{const n=l(e),r=l(t),o=n.pop(),i=r.pop(),a=d(n,r);return 0!==a?a:o&&i?d(o.split("."),i.split(".")):o||i?o?-1:1:0},o=e=>"string"==typeof e&&/^[v\d]/.test(e)&&u.test(e),i=(e,t,n)=>{y(n);const o=r(e,t);return p[n].includes(o)},a=(e,t)=>{const n=t.match(/^([<>=~^]+)/),r=n?n[1]:"=";if("^"!==r&&"~"!==r)return i(e,t,r);const[o,a,u]=l(e),[s,c,p]=l(t);return 0===f(o,s)&&("^"===r?d([a,u],[c,p])>=0:0===f(a,c)&&f(u,p)>=0)},u=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,l=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(u);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},s=e=>"*"===e||"x"===e||"X"===e,c=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},f=(e,t)=>{if(s(e)||s(t))return 0;const[n,r]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(c(e),c(t));return n>r?1:n{for(let n=0;n":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},h=Object.keys(p),y=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===h.indexOf(e))throw new Error(`Invalid operator, expected one of ${h.join("|")}`)}},19662:function(e,t,n){var r=n(60614),o=n(66330),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not a function")}},39483:function(e,t,n){var r=n(4411),o=n(66330),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not a constructor")}},96077:function(e,t,n){var r=n(60614),o=String,i=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw i("Can't set "+o(e)+" as a prototype")}},51223:function(e,t,n){var r=n(5112),o=n(70030),i=n(3070).f,a=r("unscopables"),u=Array.prototype;null==u[a]&&i(u,a,{configurable:!0,value:o(null)}),e.exports=function(e){u[a][e]=!0}},31530:function(e,t,n){"use strict";var r=n(28710).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},25787:function(e,t,n){var r=n(47976),o=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw o("Incorrect invocation")}},19670:function(e,t,n){var r=n(70111),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not an object")}},23013:function(e){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7556:function(e,t,n){var r=n(47293);e.exports=r((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},90260:function(e,t,n){"use strict";var r,o,i,a=n(23013),u=n(19781),l=n(17854),s=n(60614),c=n(70111),f=n(92597),d=n(70648),p=n(66330),h=n(68880),y=n(98052),m=n(3070).f,v=n(47976),b=n(79518),g=n(27674),w=n(5112),k=n(69711),O=n(29909),_=O.enforce,S=O.get,j=l.Int8Array,P=j&&j.prototype,x=l.Uint8ClampedArray,E=x&&x.prototype,C=j&&b(j),A=P&&b(P),T=Object.prototype,R=l.TypeError,M=w("toStringTag"),D=k("TYPED_ARRAY_TAG"),I=a&&!!g&&"Opera"!==d(l.opera),L=!1,V={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},N={BigInt64Array:8,BigUint64Array:8},F=function(e){var t=b(e);if(c(t)){var n=S(t);return n&&f(n,"TypedArrayConstructor")?n.TypedArrayConstructor:F(t)}},B=function(e){if(!c(e))return!1;var t=d(e);return f(V,t)||f(N,t)};for(r in V)(i=(o=l[r])&&o.prototype)?_(i).TypedArrayConstructor=o:I=!1;for(r in N)(i=(o=l[r])&&o.prototype)&&(_(i).TypedArrayConstructor=o);if((!I||!s(C)||C===Function.prototype)&&(C=function(){throw R("Incorrect invocation")},I))for(r in V)l[r]&&g(l[r],C);if((!I||!A||A===T)&&(A=C.prototype,I))for(r in V)l[r]&&g(l[r].prototype,A);if(I&&b(E)!==A&&g(E,A),u&&!f(A,M))for(r in L=!0,m(A,M,{get:function(){return c(this)?this[D]:void 0}}),V)l[r]&&h(l[r],D,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:I,TYPED_ARRAY_TAG:L&&D,aTypedArray:function(e){if(B(e))return e;throw R("Target is not a typed array")},aTypedArrayConstructor:function(e){if(s(e)&&(!g||v(C,e)))return e;throw R(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(u){if(n)for(var o in V){var i=l[o];if(i&&f(i.prototype,e))try{delete i.prototype[e]}catch(n){try{i.prototype[e]=t}catch(e){}}}A[e]&&!n||y(A,e,n?t:I&&P[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,o;if(u){if(g){if(n)for(r in V)if((o=l[r])&&f(o,e))try{delete o[e]}catch(e){}if(C[e]&&!n)return;try{return y(C,e,n?t:I&&C[e]||t)}catch(e){}}for(r in V)!(o=l[r])||o[e]&&!n||y(o,e,t)}},getTypedArrayConstructor:F,isView:function(e){if(!c(e))return!1;var t=d(e);return"DataView"===t||f(V,t)||f(N,t)},isTypedArray:B,TypedArray:C,TypedArrayPrototype:A}},13331:function(e,t,n){"use strict";var r=n(17854),o=n(1702),i=n(19781),a=n(23013),u=n(76530),l=n(68880),s=n(89190),c=n(47293),f=n(25787),d=n(19303),p=n(17466),h=n(57067),y=n(11179),m=n(79518),v=n(27674),b=n(8006).f,g=n(3070).f,w=n(21285),k=n(41589),O=n(58003),_=n(29909),S=u.PROPER,j=u.CONFIGURABLE,P=_.get,x=_.set,E="ArrayBuffer",C="Wrong index",A=r.ArrayBuffer,T=A,R=T&&T.prototype,M=r.DataView,D=M&&M.prototype,I=Object.prototype,L=r.Array,V=r.RangeError,N=o(w),F=o([].reverse),B=y.pack,U=y.unpack,z=function(e){return[255&e]},q=function(e){return[255&e,e>>8&255]},H=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},W=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},K=function(e){return B(e,23,4)},Y=function(e){return B(e,52,8)},G=function(e,t){g(e.prototype,t,{get:function(){return P(this)[t]}})},$=function(e,t,n,r){var o=h(n),i=P(e);if(o+t>i.byteLength)throw V(C);var a=P(i.buffer).bytes,u=o+i.byteOffset,l=k(a,u,u+t);return r?l:F(l)},J=function(e,t,n,r,o,i){var a=h(n),u=P(e);if(a+t>u.byteLength)throw V(C);for(var l=P(u.buffer).bytes,s=a+u.byteOffset,c=r(+o),f=0;fee;)(Z=Q[ee++])in T||l(T,Z,A[Z]);R.constructor=T}v&&m(D)!==I&&v(D,I);var te=new M(new T(2)),ne=o(D.setInt8);te.setInt8(0,2147483648),te.setInt8(1,2147483649),!te.getInt8(0)&&te.getInt8(1)||s(D,{setInt8:function(e,t){ne(this,e,t<<24>>24)},setUint8:function(e,t){ne(this,e,t<<24>>24)}},{unsafe:!0})}else R=(T=function(e){f(this,R);var t=h(e);x(this,{bytes:N(L(t),0),byteLength:t}),i||(this.byteLength=t)}).prototype,D=(M=function(e,t,n){f(this,D),f(e,R);var r=P(e).byteLength,o=d(t);if(o<0||o>r)throw V("Wrong offset");if(o+(n=void 0===n?r-o:p(n))>r)throw V("Wrong length");x(this,{buffer:e,byteLength:n,byteOffset:o}),i||(this.buffer=e,this.byteLength=n,this.byteOffset=o)}).prototype,i&&(G(T,"byteLength"),G(M,"buffer"),G(M,"byteLength"),G(M,"byteOffset")),s(D,{getInt8:function(e){return $(this,1,e)[0]<<24>>24},getUint8:function(e){return $(this,1,e)[0]},getInt16:function(e){var t=$(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=$(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return W($(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return W($(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return U($(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return U($(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){J(this,1,e,z,t)},setUint8:function(e,t){J(this,1,e,z,t)},setInt16:function(e,t){J(this,2,e,q,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){J(this,2,e,q,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){J(this,4,e,H,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){J(this,4,e,H,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){J(this,4,e,K,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){J(this,8,e,Y,t,arguments.length>2?arguments[2]:void 0)}});O(T,E),O(M,"DataView"),e.exports={ArrayBuffer:T,DataView:M}},1048:function(e,t,n){"use strict";var r=n(47908),o=n(51400),i=n(26244),a=n(85117),u=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),l=i(n),s=o(e,l),c=o(t,l),f=arguments.length>2?arguments[2]:void 0,d=u((void 0===f?l:o(f,l))-c,l-s),p=1;for(c0;)c in n?n[s]=n[c]:a(n,s),s+=p,c+=p;return n}},21285:function(e,t,n){"use strict";var r=n(47908),o=n(51400),i=n(26244);e.exports=function(e){for(var t=r(this),n=i(t),a=arguments.length,u=o(a>1?arguments[1]:void 0,n),l=a>2?arguments[2]:void 0,s=void 0===l?n:o(l,n);s>u;)t[u++]=e;return t}},18533:function(e,t,n){"use strict";var r=n(42092).forEach,o=n(9341)("forEach");e.exports=o?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},97745:function(e,t,n){var r=n(26244);e.exports=function(e,t){for(var n=0,o=r(t),i=new e(o);o>n;)i[n]=t[n++];return i}},48457:function(e,t,n){"use strict";var r=n(49974),o=n(46916),i=n(47908),a=n(53411),u=n(97659),l=n(4411),s=n(26244),c=n(86135),f=n(18554),d=n(71246),p=Array;e.exports=function(e){var t=i(e),n=l(this),h=arguments.length,y=h>1?arguments[1]:void 0,m=void 0!==y;m&&(y=r(y,h>2?arguments[2]:void 0));var v,b,g,w,k,O,_=d(t),S=0;if(!_||this===p&&u(_))for(v=s(t),b=n?new this(v):p(v);v>S;S++)O=m?y(t[S],S):t[S],c(b,S,O);else for(k=(w=f(t,_)).next,b=n?new this:[];!(g=o(k,w)).done;S++)O=m?a(w,y,[g.value,S],!0):g.value,c(b,S,O);return b.length=S,b}},41318:function(e,t,n){var r=n(45656),o=n(51400),i=n(26244),a=function(e){return function(t,n,a){var u,l=r(t),s=i(l),c=o(a,s);if(e&&n!=n){for(;s>c;)if((u=l[c++])!=u)return!0}else for(;s>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},42092:function(e,t,n){var r=n(49974),o=n(1702),i=n(68361),a=n(47908),u=n(26244),l=n(65417),s=o([].push),c=function(e){var t=1==e,n=2==e,o=3==e,c=4==e,f=6==e,d=7==e,p=5==e||f;return function(h,y,m,v){for(var b,g,w=a(h),k=i(w),O=r(y,m),_=u(k),S=0,j=v||l,P=t?j(h,_):n||d?j(h,0):void 0;_>S;S++)if((p||S in k)&&(g=O(b=k[S],S,w),e))if(t)P[S]=g;else if(g)switch(e){case 3:return!0;case 5:return b;case 6:return S;case 2:s(P,b)}else switch(e){case 4:return!1;case 7:s(P,b)}return f?-1:o||c?c:P}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},86583:function(e,t,n){"use strict";var r=n(22104),o=n(45656),i=n(19303),a=n(26244),u=n(9341),l=Math.min,s=[].lastIndexOf,c=!!s&&1/[1].lastIndexOf(1,-0)<0,f=u("lastIndexOf"),d=c||!f;e.exports=d?function(e){if(c)return r(s,this,arguments)||0;var t=o(this),n=a(t),u=n-1;for(arguments.length>1&&(u=l(u,i(arguments[1]))),u<0&&(u=n+u);u>=0;u--)if(u in t&&t[u]===e)return u||0;return-1}:s},81194:function(e,t,n){var r=n(47293),o=n(5112),i=n(7392),a=o("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},9341:function(e,t,n){"use strict";var r=n(47293);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},53671:function(e,t,n){var r=n(19662),o=n(47908),i=n(68361),a=n(26244),u=TypeError,l=function(e){return function(t,n,l,s){r(n);var c=o(t),f=i(c),d=a(c),p=e?d-1:0,h=e?-1:1;if(l<2)for(;;){if(p in f){s=f[p],p+=h;break}if(p+=h,e?p<0:d<=p)throw u("Reduce of empty array with no initial value")}for(;e?p>=0:d>p;p+=h)p in f&&(s=n(s,f[p],p,c));return s}};e.exports={left:l(!1),right:l(!0)}},83658:function(e,t,n){"use strict";var r=n(19781),o=n(43157),i=TypeError,a=Object.getOwnPropertyDescriptor,u=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=u?function(e,t){if(o(e)&&!a(e,"length").writable)throw i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},41589:function(e,t,n){var r=n(51400),o=n(26244),i=n(86135),a=Array,u=Math.max;e.exports=function(e,t,n){for(var l=o(e),s=r(t,l),c=r(void 0===n?l:n,l),f=a(u(c-s,0)),d=0;s0;)e[r]=e[--r];r!==i++&&(e[r]=n)}return e},u=function(e,t,n,r){for(var o=t.length,i=n.length,a=0,u=0;a1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!g(this,e)}}),i(d,n?{get:function(e){var t=g(this,e);return t&&t.value},set:function(e,t){return b(this,0===e?0:e,t)}}:{add:function(e){return b(this,e=0===e?0:e,e)}}),p&&r(d,"size",{get:function(){return y(this).size}}),f},setStrong:function(e,t,n){var r=t+" Iterator",o=v(t),i=v(r);c(e,t,(function(e,t){m(this,{type:r,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?f("keys"==t?n.key:"values"==t?n.value:[n.key,n.value],!1):(e.target=void 0,f(void 0,!0))}),n?"entries":"values",!n,!0),d(t)}}},29320:function(e,t,n){"use strict";var r=n(1702),o=n(89190),i=n(62423).getWeakData,a=n(25787),u=n(19670),l=n(68554),s=n(70111),c=n(20408),f=n(42092),d=n(92597),p=n(29909),h=p.set,y=p.getterFor,m=f.find,v=f.findIndex,b=r([].splice),g=0,w=function(e){return e.frozen||(e.frozen=new k)},k=function(){this.entries=[]},O=function(e,t){return m(e.entries,(function(e){return e[0]===t}))};k.prototype={get:function(e){var t=O(this,e);if(t)return t[1]},has:function(e){return!!O(this,e)},set:function(e,t){var n=O(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=v(this.entries,(function(t){return t[0]===e}));return~t&&b(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,n,r){var f=e((function(e,o){a(e,p),h(e,{type:t,id:g++,frozen:void 0}),l(o)||c(o,e[r],{that:e,AS_ENTRIES:n})})),p=f.prototype,m=y(t),v=function(e,t,n){var r=m(e),o=i(u(t),!0);return!0===o?w(r).set(t,n):o[r.id]=n,e};return o(p,{delete:function(e){var t=m(this);if(!s(e))return!1;var n=i(e);return!0===n?w(t).delete(e):n&&d(n,t.id)&&delete n[t.id]},has:function(e){var t=m(this);if(!s(e))return!1;var n=i(e);return!0===n?w(t).has(e):n&&d(n,t.id)}}),o(p,n?{get:function(e){var t=m(this);if(s(e)){var n=i(e);return!0===n?w(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return v(this,e,t)}}:{add:function(e){return v(this,e,!0)}}),f}}},77710:function(e,t,n){"use strict";var r=n(82109),o=n(17854),i=n(1702),a=n(54705),u=n(98052),l=n(62423),s=n(20408),c=n(25787),f=n(60614),d=n(68554),p=n(70111),h=n(47293),y=n(17072),m=n(58003),v=n(79587);e.exports=function(e,t,n){var b=-1!==e.indexOf("Map"),g=-1!==e.indexOf("Weak"),w=b?"set":"add",k=o[e],O=k&&k.prototype,_=k,S={},j=function(e){var t=i(O[e]);u(O,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(g&&!p(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return g&&!p(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(g&&!p(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(a(e,!f(k)||!(g||O.forEach&&!h((function(){(new k).entries().next()})))))_=n.getConstructor(t,e,b,w),l.enable();else if(a(e,!0)){var P=new _,x=P[w](g?{}:-0,1)!=P,E=h((function(){P.has(1)})),C=y((function(e){new k(e)})),A=!g&&h((function(){for(var e=new k,t=5;t--;)e[w](t,t);return!e.has(-0)}));C||((_=t((function(e,t){c(e,O);var n=v(new k,e,_);return d(t)||s(t,n[w],{that:n,AS_ENTRIES:b}),n}))).prototype=O,O.constructor=_),(E||A)&&(j("delete"),j("has"),b&&j("get")),(A||x)&&j(w),g&&O.clear&&delete O.clear}return S[e]=_,r({global:!0,constructor:!0,forced:_!=k},S),m(_,e),g||n.setStrong(_,e,b),_}},99920:function(e,t,n){var r=n(92597),o=n(53887),i=n(31236),a=n(3070);e.exports=function(e,t,n){for(var u=o(t),l=a.f,s=i.f,c=0;c9999?"+":"";return r+i(l(t),r?6:4,0)+"-"+i(v(e)+1,2,0)+"-"+i(d(e),2,0)+"T"+i(h(e),2,0)+":"+i(m(e),2,0)+":"+i(b(e),2,0)+"."+i(n,3,0)+"Z"}:c},38709:function(e,t,n){"use strict";var r=n(19670),o=n(92140),i=TypeError;e.exports=function(e){if(r(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw i("Incorrect hint");return o(this,e)}},47045:function(e,t,n){var r=n(56339),o=n(3070);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),o.f(e,t,n)}},98052:function(e,t,n){var r=n(60614),o=n(3070),i=n(56339),a=n(13072);e.exports=function(e,t,n,u){u||(u={});var l=u.enumerable,s=void 0!==u.name?u.name:t;if(r(n)&&i(n,s,u),u.global)l?e[t]=n:a(t,n);else{try{u.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=n:o.f(e,t,{value:n,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return e}},89190:function(e,t,n){var r=n(98052);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},13072:function(e,t,n){var r=n(17854),o=Object.defineProperty;e.exports=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},85117:function(e,t,n){"use strict";var r=n(66330),o=TypeError;e.exports=function(e,t){if(!delete e[t])throw o("Cannot delete property "+r(t)+" of "+r(e))}},19781:function(e,t,n){var r=n(47293);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4154:function(e){var t="object"==typeof document&&document.all,n=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:n}},80317:function(e,t,n){var r=n(17854),o=n(70111),i=r.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},7207:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},48324:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},98509:function(e,t,n){var r=n(80317)("span").classList,o=r&&r.constructor&&r.constructor.prototype;e.exports=o===Object.prototype?void 0:o},68886:function(e,t,n){var r=n(88113).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},7871:function(e,t,n){var r=n(83823),o=n(35268);e.exports=!r&&!o&&"object"==typeof window&&"object"==typeof document},83823:function(e){e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},30256:function(e,t,n){var r=n(88113);e.exports=/MSIE|Trident/.test(r)},71528:function(e,t,n){var r=n(88113),o=n(17854);e.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==o.Pebble},6833:function(e,t,n){var r=n(88113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},35268:function(e,t,n){var r=n(84326),o=n(17854);e.exports="process"==r(o.process)},71036:function(e,t,n){var r=n(88113);e.exports=/web0s(?!.*chrome)/i.test(r)},88113:function(e,t,n){var r=n(35005);e.exports=r("navigator","userAgent")||""},7392:function(e,t,n){var r,o,i=n(17854),a=n(88113),u=i.process,l=i.Deno,s=u&&u.versions||l&&l.version,c=s&&s.v8;c&&(o=(r=c.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},98008:function(e,t,n){var r=n(88113).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},80748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},82109:function(e,t,n){var r=n(17854),o=n(31236).f,i=n(68880),a=n(98052),u=n(13072),l=n(99920),s=n(54705);e.exports=function(e,t){var n,c,f,d,p,h=e.target,y=e.global,m=e.stat;if(n=y?r:m?r[h]||u(h,{}):(r[h]||{}).prototype)for(c in t){if(d=t[c],f=e.dontCallGetSet?(p=o(n,c))&&p.value:n[c],!s(y?c:h+(m?".":"#")+c,e.forced)&&void 0!==f){if(typeof d==typeof f)continue;l(d,f)}(e.sham||f&&f.sham)&&i(d,"sham",!0),a(n,c,d,e)}}},47293:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},27007:function(e,t,n){"use strict";n(74916);var r=n(21470),o=n(98052),i=n(22261),a=n(47293),u=n(5112),l=n(68880),s=u("species"),c=RegExp.prototype;e.exports=function(e,t,n,f){var d=u(e),p=!a((function(){var t={};return t[d]=function(){return 7},7!=""[e](t)})),h=p&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[s]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return t=!0,null},n[d](""),!t}));if(!p||!h||n){var y=r(/./[d]),m=t(d,""[e],(function(e,t,n,o,a){var u=r(e),l=t.exec;return l===i||l===c.exec?p&&!a?{done:!0,value:y(t,n,o)}:{done:!0,value:u(n,t,o)}:{done:!1}}));o(String.prototype,e,m[0]),o(c,d,m[1])}f&&l(c[d],"sham",!0)}},76677:function(e,t,n){var r=n(47293);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},22104:function(e,t,n){var r=n(34374),o=Function.prototype,i=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(i):function(){return a.apply(i,arguments)})},49974:function(e,t,n){var r=n(21470),o=n(19662),i=n(34374),a=r(r.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?a(e,t):function(){return e.apply(t,arguments)}}},34374:function(e,t,n){var r=n(47293);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},27065:function(e,t,n){"use strict";var r=n(1702),o=n(19662),i=n(70111),a=n(92597),u=n(50206),l=n(34374),s=Function,c=r([].concat),f=r([].join),d={},p=function(e,t,n){if(!a(d,t)){for(var r=[],o=0;o]*>)/g,c=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,f,d){var p=n+e.length,h=r.length,y=c;return void 0!==f&&(f=o(f),y=s),u(d,y,(function(o,u){var s;switch(a(u,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,n);case"'":return l(t,p);case"<":s=f[l(u,1,-1)];break;default:var c=+u;if(0===c)return o;if(c>h){var d=i(c/10);return 0===d?o:d<=h?void 0===r[d-1]?a(u,1):r[d-1]+a(u,1):o}s=r[c-1]}return void 0===s?"":s}))}},17854:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},92597:function(e,t,n){var r=n(1702),o=n(47908),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},3501:function(e){e.exports={}},842:function(e,t,n){var r=n(17854);e.exports=function(e,t){var n=r.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}},60490:function(e,t,n){var r=n(35005);e.exports=r("document","documentElement")},64664:function(e,t,n){var r=n(19781),o=n(47293),i=n(80317);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},11179:function(e){var t=Array,n=Math.abs,r=Math.pow,o=Math.floor,i=Math.log,a=Math.LN2;e.exports={pack:function(e,u,l){var s,c,f,d=t(l),p=8*l-u-1,h=(1<>1,m=23===u?r(2,-24)-r(2,-77):0,v=e<0||0===e&&1/e<0?1:0,b=0;for((e=n(e))!=e||e===1/0?(c=e!=e?1:0,s=h):(s=o(i(e)/a),e*(f=r(2,-s))<1&&(s--,f*=2),(e+=s+y>=1?m/f:m*r(2,1-y))*f>=2&&(s++,f/=2),s+y>=h?(c=0,s=h):s+y>=1?(c=(e*f-1)*r(2,u),s+=y):(c=e*r(2,y-1)*r(2,u),s=0));u>=8;)d[b++]=255&c,c/=256,u-=8;for(s=s<0;)d[b++]=255&s,s/=256,p-=8;return d[--b]|=128*v,d},unpack:function(e,t){var n,o=e.length,i=8*o-t-1,a=(1<>1,l=i-7,s=o-1,c=e[s--],f=127&c;for(c>>=7;l>0;)f=256*f+e[s--],l-=8;for(n=f&(1<<-l)-1,f>>=-l,l+=t;l>0;)n=256*n+e[s--],l-=8;if(0===f)f=1-u;else{if(f===a)return n?NaN:c?-1/0:1/0;n+=r(2,t),f-=u}return(c?-1:1)*n*r(2,f-t)}}},68361:function(e,t,n){var r=n(1702),o=n(47293),i=n(84326),a=Object,u=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?u(e,""):a(e)}:a},79587:function(e,t,n){var r=n(60614),o=n(70111),i=n(27674);e.exports=function(e,t,n){var a,u;return i&&r(a=t.constructor)&&a!==n&&o(u=a.prototype)&&u!==n.prototype&&i(e,u),e}},42788:function(e,t,n){var r=n(1702),o=n(60614),i=n(5465),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},62423:function(e,t,n){var r=n(82109),o=n(1702),i=n(3501),a=n(70111),u=n(92597),l=n(3070).f,s=n(8006),c=n(1156),f=n(52050),d=n(69711),p=n(76677),h=!1,y=d("meta"),m=0,v=function(e){l(e,y,{value:{objectID:"O"+m++,weakData:{}}})},b=e.exports={enable:function(){b.enable=function(){},h=!0;var e=s.f,t=o([].splice),n={};n[y]=1,e(n).length&&(s.f=function(n){for(var r=e(n),o=0,i=r.length;ob;b++)if((w=A(e[b]))&&s(y,w))return w;return new h(!1)}m=c(e,v)}for(k=j?e.next:m.next;!(O=o(k,m)).done;){try{w=A(O.value)}catch(e){d(m,"throw",e)}if("object"==typeof w&&w&&s(y,w))return w}return new h(!1)}},99212:function(e,t,n){var r=n(46916),o=n(19670),i=n(58173);e.exports=function(e,t,n){var a,u;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){u=!0,a=e}if("throw"===t)throw n;if(u)throw a;return o(a),n}},63061:function(e,t,n){"use strict";var r=n(13383).IteratorPrototype,o=n(70030),i=n(79114),a=n(58003),u=n(97497),l=function(){return this};e.exports=function(e,t,n,s){var c=t+" Iterator";return e.prototype=o(r,{next:i(+!s,n)}),a(e,c,!1,!0),u[c]=l,e}},51656:function(e,t,n){"use strict";var r=n(82109),o=n(46916),i=n(31913),a=n(76530),u=n(60614),l=n(63061),s=n(79518),c=n(27674),f=n(58003),d=n(68880),p=n(98052),h=n(5112),y=n(97497),m=n(13383),v=a.PROPER,b=a.CONFIGURABLE,g=m.IteratorPrototype,w=m.BUGGY_SAFARI_ITERATORS,k=h("iterator"),O="keys",_="values",S="entries",j=function(){return this};e.exports=function(e,t,n,a,h,m,P){l(n,t,a);var x,E,C,A=function(e){if(e===h&&I)return I;if(!w&&e in M)return M[e];switch(e){case O:case _:case S:return function(){return new n(this,e)}}return function(){return new n(this)}},T=t+" Iterator",R=!1,M=e.prototype,D=M[k]||M["@@iterator"]||h&&M[h],I=!w&&D||A(h),L="Array"==t&&M.entries||D;if(L&&(x=s(L.call(new e)))!==Object.prototype&&x.next&&(i||s(x)===g||(c?c(x,g):u(x[k])||p(x,k,j)),f(x,T,!0,!0),i&&(y[T]=j)),v&&h==_&&D&&D.name!==_&&(!i&&b?d(M,"name",_):(R=!0,I=function(){return o(D,this)})),h)if(E={values:A(_),keys:m?I:A(O),entries:A(S)},P)for(C in E)(w||R||!(C in M))&&p(M,C,E[C]);else r({target:t,proto:!0,forced:w||R},E);return i&&!P||M[k]===I||p(M,k,I,{name:h}),y[t]=I,E}},13383:function(e,t,n){"use strict";var r,o,i,a=n(47293),u=n(60614),l=n(70111),s=n(70030),c=n(79518),f=n(98052),d=n(5112),p=n(31913),h=d("iterator"),y=!1;[].keys&&("next"in(i=[].keys())?(o=c(c(i)))!==Object.prototype&&(r=o):y=!0),!l(r)||a((function(){var e={};return r[h].call(e)!==e}))?r={}:p&&(r=s(r)),u(r[h])||f(r,h,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:y}},97497:function(e){e.exports={}},26244:function(e,t,n){var r=n(17466);e.exports=function(e){return r(e.length)}},56339:function(e,t,n){var r=n(47293),o=n(60614),i=n(92597),a=n(19781),u=n(76530).CONFIGURABLE,l=n(42788),s=n(29909),c=s.enforce,f=s.get,d=Object.defineProperty,p=a&&!r((function(){return 8!==d((function(){}),"length",{value:8}).length})),h=String(String).split("String"),y=e.exports=function(e,t,n){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!i(e,"name")||u&&e.name!==t)&&(a?d(e,"name",{value:t,configurable:!0}):e.name=t),p&&n&&i(n,"arity")&&e.length!==n.arity&&d(e,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?a&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=c(e);return i(r,"source")||(r.source=h.join("string"==typeof t?t:"")),e};Function.prototype.toString=y((function(){return o(this)&&f(this).source||l(this)}),"toString")},74758:function(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},95948:function(e,t,n){var r,o,i,a,u,l,s,c,f=n(17854),d=n(49974),p=n(31236).f,h=n(20261).set,y=n(6833),m=n(71528),v=n(71036),b=n(35268),g=f.MutationObserver||f.WebKitMutationObserver,w=f.document,k=f.process,O=f.Promise,_=p(f,"queueMicrotask"),S=_&&_.value;S||(r=function(){var e,t;for(b&&(e=k.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(e){throw o?a():i=void 0,e}}i=void 0,e&&e.enter()},y||b||v||!g||!w?!m&&O&&O.resolve?((s=O.resolve(void 0)).constructor=O,c=d(s.then,s),a=function(){c(r)}):b?a=function(){k.nextTick(r)}:(h=d(h,f),a=function(){h(r)}):(u=!0,l=w.createTextNode(""),new g(r).observe(l,{characterData:!0}),a=function(){l.data=u=!u})),e.exports=S||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,a()),i=t}},78523:function(e,t,n){"use strict";var r=n(19662),o=TypeError,i=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw o("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new i(e)}},3929:function(e,t,n){var r=n(47850),o=TypeError;e.exports=function(e){if(r(e))throw o("The method doesn't accept regular expressions");return e}},77023:function(e,t,n){var r=n(17854).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&r(e)}},2814:function(e,t,n){var r=n(17854),o=n(47293),i=n(1702),a=n(41340),u=n(53111).trim,l=n(81361),s=i("".charAt),c=r.parseFloat,f=r.Symbol,d=f&&f.iterator,p=1/c(l+"-0")!=-1/0||d&&!o((function(){c(Object(d))}));e.exports=p?function(e){var t=u(a(e)),n=c(t);return 0===n&&"-"==s(t,0)?-0:n}:c},83009:function(e,t,n){var r=n(17854),o=n(47293),i=n(1702),a=n(41340),u=n(53111).trim,l=n(81361),s=r.parseInt,c=r.Symbol,f=c&&c.iterator,d=/^[+-]?0x/i,p=i(d.exec),h=8!==s(l+"08")||22!==s(l+"0x16")||f&&!o((function(){s(Object(f))}));e.exports=h?function(e,t){var n=u(a(e));return s(n,t>>>0||(p(d,n)?16:10))}:s},21574:function(e,t,n){"use strict";var r=n(19781),o=n(1702),i=n(46916),a=n(47293),u=n(81956),l=n(25181),s=n(55296),c=n(47908),f=n(68361),d=Object.assign,p=Object.defineProperty,h=o([].concat);e.exports=!d||a((function(){if(r&&1!==d({b:1},d(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),o="abcdefghijklmnopqrst";return e[n]=7,o.split("").forEach((function(e){t[e]=e})),7!=d({},e)[n]||u(d({},t)).join("")!=o}))?function(e,t){for(var n=c(e),o=arguments.length,a=1,d=l.f,p=s.f;o>a;)for(var y,m=f(arguments[a++]),v=d?h(u(m),d(m)):u(m),b=v.length,g=0;b>g;)y=v[g++],r&&!i(p,m,y)||(n[y]=m[y]);return n}:d},70030:function(e,t,n){var r,o=n(19670),i=n(36048),a=n(80748),u=n(3501),l=n(60490),s=n(80317),c=n(6200)("IE_PROTO"),f=function(){},d=function(e){return"