From affc565209decc3f40d43f88308012001f768a09 Mon Sep 17 00:00:00 2001 From: william dutton Date: Wed, 25 Oct 2023 11:26:07 +1000 Subject: [PATCH] QOLDEV-636 update to latest 8.3.3 versions --- .github/workflows/formioLibUpdate.js.yml | 2 +- .github/workspace/formiojs/package-lock.json | 24 +- .github/workspace/formiojs/package.json | 2 +- .github/workspace/grid/package-lock.json | 2228 +++++++++++------ .github/workspace/grid/package.json | 2 +- .github/workspace/prem/package-lock.json | 8 +- .github/workspace/prem/package.json | 2 +- lib/formio.changelog.md | 121 +- lib/formio.full.css | 15 +- lib/formio.full.js | 105 +- lib/formio.full.min.css | 2 +- lib/formio.full.min.js | 2 +- lib/formio.full.min.js.LICENSE.txt | 4 +- lib/{ => grid}/formio.grid.changelog.md | 0 lib/{ => grid}/formio.grid.css | 0 lib/{ => grid}/formio.grid.js | 0 lib/grid/formio.grid.min.css | 1 + lib/grid/formio.grid.min.js | 1 + lib/{ => grid}/formio.grid.min.js.LICENSE.txt | 0 lib/premium.js | 14 +- lib/premium.min.js | 2 +- 21 files changed, 1748 insertions(+), 787 deletions(-) rename lib/{ => grid}/formio.grid.changelog.md (100%) rename lib/{ => grid}/formio.grid.css (100%) rename lib/{ => grid}/formio.grid.js (100%) create mode 100644 lib/grid/formio.grid.min.css create mode 100644 lib/grid/formio.grid.min.js rename lib/{ => grid}/formio.grid.min.js.LICENSE.txt (100%) diff --git a/.github/workflows/formioLibUpdate.js.yml b/.github/workflows/formioLibUpdate.js.yml index a1ec0e4f..fe91a52b 100644 --- a/.github/workflows/formioLibUpdate.js.yml +++ b/.github/workflows/formioLibUpdate.js.yml @@ -1,4 +1,4 @@ -name: Update Libs +name: Update Premium Libs on: # schedule: # * is a special character in YAMLso you have to quote this string diff --git a/.github/workspace/formiojs/package-lock.json b/.github/workspace/formiojs/package-lock.json index 7b3bc112..0f593263 100644 --- a/.github/workspace/formiojs/package-lock.json +++ b/.github/workspace/formiojs/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "formiojs": "4.15.1", + "formiojs": "4.17.2", "moment": "^2.29.4" }, "devDependencies": {} @@ -27,9 +27,9 @@ } }, "node_modules/@formio/bootstrap3": { - "version": "2.12.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/bootstrap3/-/bootstrap3-2.12.3.tgz", - "integrity": "sha512-/jod5STUSz9wLnniCCZwKvqigLrzHt4jDZ07VUxmnqg1IcPcJKNX1UrY7tBAYWa2lWJ/p1j4bSerC6UWjbdYDQ==", + "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", + "integrity": "sha512-4B5rs+w9tAk5i+wbdw2/NrTxPqnDX7/W19tiTd9lfXnIGQmaj0ecMEVqDmOJg8pIlyU02g3c4ih6JnA/JVmUbA==", "license": "MIT", "dependencies": { "resize-observer-polyfill": "^1.5.1" @@ -308,9 +308,9 @@ } }, "node_modules/dompurify": { - "version": "2.4.7", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/dompurify/-/dompurify-2.4.7.tgz", - "integrity": "sha512-kxxKlPEDa6Nc5WJi+qRgPbOAbgTpSULL+vI3NUXsZMlkJxTqYI9wg5ZTay2sFrdZRWHPWNi+EdAhcJf81WtoMQ==", + "version": "3.0.6", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/dompurify/-/dompurify-3.0.6.tgz", + "integrity": "sha512-ilkD8YEnnGh1zJ240uJsW7AzE+2qpbOUYjacomn3AvJ6J4JhKGSZ2nh4wUIXPZrEPppaCLx5jFe8T89Rk8tQ7w==", "license": "(MPL-2.0 OR Apache-2.0)" }, "node_modules/downloadjs": { @@ -445,12 +445,12 @@ "license": "MIT" }, "node_modules/formiojs": { - "version": "4.15.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/formiojs/-/formiojs-4.15.1.tgz", - "integrity": "sha512-h1Oxcib1dbk63PzBxv7Zzix//7hBdHskZVfX1y0evqRhjA75ZIAQv4UOoebe0OZ0DngGt8qzTp7jsXX5TfDXWw==", + "version": "4.17.2", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/formiojs/-/formiojs-4.17.2.tgz", + "integrity": "sha512-2Nc8BAoYHD7slPdm59A1U7RldBGwkUJobbBmOX5cn8pBT0N/LFc1xsJBWpwv34mECPCJ1373FHE4nX6vqFpBkw==", "license": "MIT", "dependencies": { - "@formio/bootstrap3": "2.12.3", + "@formio/bootstrap3": "2.12.4-rc.1", "@formio/choices.js": "10.2.0", "@formio/semantic": "2.6.1", "@formio/text-mask-addons": "^3.8.0-formio.2", @@ -463,7 +463,7 @@ "custom-event-polyfill": "^1.0.7", "dialog-polyfill": "^0.5.6", "dom-autoscroller": "^2.3.4", - "dompurify": "^2.4.1", + "dompurify": "^3.0.5", "downloadjs": "^1.4.7", "dragula": "^3.7.3", "eventemitter3": "^4.0.7", diff --git a/.github/workspace/formiojs/package.json b/.github/workspace/formiojs/package.json index 70aed52b..5c369f02 100644 --- a/.github/workspace/formiojs/package.json +++ b/.github/workspace/formiojs/package.json @@ -30,7 +30,7 @@ }, "devDependencies": {}, "dependencies": { - "formiojs": "4.15.1", + "formiojs": "4.17.2", "moment": "^2.29.4" } } diff --git a/.github/workspace/grid/package-lock.json b/.github/workspace/grid/package-lock.json index 9ca1ba01..672a24b1 100644 --- a/.github/workspace/grid/package-lock.json +++ b/.github/workspace/grid/package-lock.json @@ -1,130 +1,184 @@ { "name": "formio-qld-prem-downloader", "version": "0.0.1", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "@babel/code-frame": { + "packages": { + "": { + "name": "formio-qld-prem-downloader", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "@formio/grid": "1.1.1" + }, + "devDependencies": {} + }, + "node_modules/@babel/code-frame": { "version": "7.22.13", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@babel/code-frame/-/code-frame-7.22.13.tgz", "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", - "requires": { + "license": "MIT", + "dependencies": { "@babel/highlight": "^7.22.13", "chalk": "^2.4.2" }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - } + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "@babel/helper-validator-identifier": { + "node_modules/@babel/helper-validator-identifier": { "version": "7.22.20", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==" + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } }, - "@babel/highlight": { + "node_modules/@babel/highlight": { "version": "7.22.20", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@babel/highlight/-/highlight-7.22.20.tgz", "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", - "requires": { + "license": "MIT", + "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - } + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "@formio/core": { + "node_modules/@formio/core": { "version": "1.2.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/core/-/core-1.2.0.tgz", "integrity": "sha512-Emt64RzWnCg+HCcC8LNzLaTf96fOYjz4xVE6CPkhCcIcpMOVsZrUlIsTaxnaQn3lNPvt7bCp1uCcyy5dRJUK9Q==", - "requires": { + "license": "MIT", + "dependencies": { "@formio/lodash": "0.0.9", "core-js": "^3.21.1", "dayjs": "^1.10.8", @@ -134,193 +188,264 @@ "json-logic-js": "^2.0.2" } }, - "@formio/grid": { + "node_modules/@formio/grid": { "version": "1.1.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/grid/-/grid-1.1.1.tgz", "integrity": "sha512-URA1M60VyQJ3wLFYEnB5hf2tD6I7WkWWydy4+PgVph30z37jTzKRPeiviBo2/p4I6a11mJNNROEqq4sZ3HiJ3A==", - "requires": { + "license": "MIT", + "dependencies": { "@formio/core": "^1.1.0", "@formio/lodash": "0.0.9", "core-js": "^3.25.1", "node-sass": "^7.0.3" } }, - "@formio/lodash": { + "node_modules/@formio/lodash": { "version": "0.0.9", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/lodash/-/lodash-0.0.9.tgz", - "integrity": "sha512-g/mcs0WOjcivqXFtc148jrfuSdZiwbX/CWHSTzPDwMCJzJIy7iftO9G6jyewELsKG2DGzqLRHxbDW/jnr4WjPw==" + "integrity": "sha512-g/mcs0WOjcivqXFtc148jrfuSdZiwbX/CWHSTzPDwMCJzJIy7iftO9G6jyewELsKG2DGzqLRHxbDW/jnr4WjPw==", + "license": "MIT" }, - "@gar/promisify": { + "node_modules/@gar/promisify": { "version": "1.1.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@gar/promisify/-/promisify-1.1.3.tgz", - "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==" + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "license": "MIT" }, - "@npmcli/fs": { + "node_modules/@npmcli/fs": { "version": "1.1.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@npmcli/fs/-/fs-1.1.1.tgz", "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", - "requires": { + "license": "ISC", + "dependencies": { "@gar/promisify": "^1.0.1", "semver": "^7.3.5" } }, - "@npmcli/move-file": { + "node_modules/@npmcli/move-file": { "version": "1.1.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@npmcli/move-file/-/move-file-1.1.2.tgz", "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", - "requires": { + "deprecated": "This functionality has been moved to @npmcli/fs", + "license": "MIT", + "dependencies": { "mkdirp": "^1.0.4", "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=10" } }, - "@tootallnate/once": { + "node_modules/@tootallnate/once": { "version": "1.1.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "license": "MIT", + "engines": { + "node": ">= 6" + } }, - "@types/minimist": { + "node_modules/@types/minimist": { "version": "1.2.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "license": "MIT" }, - "@types/normalize-package-data": { + "node_modules/@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==" + "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", + "license": "MIT" }, - "abbrev": { + "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC" }, - "agent-base": { + "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "requires": { + "license": "MIT", + "dependencies": { "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" } }, - "agentkeepalive": { + "node_modules/agentkeepalive": { "version": "4.5.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/agentkeepalive/-/agentkeepalive-4.5.0.tgz", "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", - "requires": { + "license": "MIT", + "dependencies": { "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" } }, - "aggregate-error": { + "node_modules/aggregate-error": { "version": "3.1.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "requires": { + "license": "MIT", + "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "ajv": { + "node_modules/ajv": { "version": "6.12.6", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "requires": { + "license": "MIT", + "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "ansi-regex": { + "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "ansi-styles": { + "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { + "license": "MIT", + "dependencies": { "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "aproba": { + "node_modules/aproba": { "version": "2.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "license": "ISC" }, - "are-we-there-yet": { + "node_modules/are-we-there-yet": { "version": "3.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", - "requires": { + "license": "ISC", + "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "arrify": { + "node_modules/arrify": { "version": "1.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==" + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "asn1": { + "node_modules/asn1": { "version": "0.2.6", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/asn1/-/asn1-0.2.6.tgz", "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "requires": { + "license": "MIT", + "dependencies": { "safer-buffer": "~2.1.0" } }, - "assert-plus": { + "node_modules/assert-plus": { "version": "1.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==" + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "license": "MIT", + "engines": { + "node": ">=0.8" + } }, - "async-foreach": { + "node_modules/async-foreach": { "version": "0.1.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/async-foreach/-/async-foreach-0.1.3.tgz", - "integrity": "sha512-VUeSMD8nEGBWaZK4lizI1sf3yEC7pnAQ/mrI7pC2fBz2s/tq5jWWEngTwaf0Gruu/OoXRGLGg1XFqpYBiGTYJA==" + "integrity": "sha512-VUeSMD8nEGBWaZK4lizI1sf3yEC7pnAQ/mrI7pC2fBz2s/tq5jWWEngTwaf0Gruu/OoXRGLGg1XFqpYBiGTYJA==", + "engines": { + "node": "*" + } }, - "asynckit": { + "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" }, - "aws-sign2": { + "node_modules/aws-sign2": { "version": "0.7.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==" + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "license": "Apache-2.0", + "engines": { + "node": "*" + } }, - "aws4": { + "node_modules/aws4": { "version": "1.12.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" + "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", + "license": "MIT" }, - "balanced-match": { + "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" }, - "bcrypt-pbkdf": { + "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "requires": { + "license": "BSD-3-Clause", + "dependencies": { "tweetnacl": "^0.14.3" } }, - "brace-expansion": { + "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { + "license": "MIT", + "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "cacache": { + "node_modules/cacache": { "version": "15.3.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/cacache/-/cacache-15.3.0.tgz", "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", - "requires": { + "license": "ISC", + "dependencies": { "@npmcli/fs": "^1.0.0", "@npmcli/move-file": "^1.0.1", "chownr": "^2.0.0", @@ -339,308 +464,445 @@ "ssri": "^8.0.1", "tar": "^6.0.2", "unique-filename": "^1.1.1" + }, + "engines": { + "node": ">= 10" } }, - "camelcase": { + "node_modules/camelcase": { "version": "5.3.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "camelcase-keys": { + "node_modules/camelcase-keys": { "version": "6.2.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/camelcase-keys/-/camelcase-keys-6.2.2.tgz", "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", - "requires": { + "license": "MIT", + "dependencies": { "camelcase": "^5.3.1", "map-obj": "^4.0.0", "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "caseless": { + "node_modules/caseless": { "version": "0.12.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "license": "Apache-2.0" }, - "chalk": { + "node_modules/chalk": { "version": "4.1.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { + "license": "MIT", + "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "chownr": { + "node_modules/chownr": { "version": "2.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", + "engines": { + "node": ">=10" + } }, - "clean-stack": { + "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "cliui": { + "node_modules/cliui": { "version": "8.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "requires": { + "license": "ISC", + "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, - "color-convert": { + "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { + "license": "MIT", + "dependencies": { "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "color-name": { + "node_modules/color-name": { "version": "1.1.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" }, - "color-support": { + "node_modules/color-support": { "version": "1.1.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", + "bin": { + "color-support": "bin.js" + } }, - "combined-stream": { + "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { + "license": "MIT", + "dependencies": { "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" } }, - "concat-map": { + "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" }, - "console-control-strings": { + "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC" }, - "core-js": { + "node_modules/core-js": { "version": "3.32.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/core-js/-/core-js-3.32.2.tgz", - "integrity": "sha512-pxXSw1mYZPDGvTQqEc5vgIb83jGQKFGYWY76z4a7weZXUolw3G+OvpZqSRcfYOoOVUQJYEPsWeQK8pKEnUtWxQ==" + "integrity": "sha512-pxXSw1mYZPDGvTQqEc5vgIb83jGQKFGYWY76z4a7weZXUolw3G+OvpZqSRcfYOoOVUQJYEPsWeQK8pKEnUtWxQ==", + "hasInstallScript": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } }, - "core-util-is": { + "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "license": "MIT" }, - "cross-spawn": { + "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "requires": { + "license": "MIT", + "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" } }, - "dashdash": { + "node_modules/dashdash": { "version": "1.14.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "requires": { + "license": "MIT", + "dependencies": { "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" } }, - "dayjs": { + "node_modules/dayjs": { "version": "1.11.10", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/dayjs/-/dayjs-1.11.10.tgz", - "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==", + "license": "MIT" }, - "debug": { + "node_modules/debug": { "version": "4.3.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { + "license": "MIT", + "dependencies": { "ms": "2.1.2" }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true } } }, - "decamelize": { + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/decamelize": { "version": "1.2.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "decamelize-keys": { + "node_modules/decamelize-keys": { "version": "1.1.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/decamelize-keys/-/decamelize-keys-1.1.1.tgz", "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", - "requires": { + "license": "MIT", + "dependencies": { "decamelize": "^1.1.0", "map-obj": "^1.0.0" }, - "dependencies": { - "map-obj": { - "version": "1.0.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==" - } + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, - "delayed-stream": { + "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } }, - "delegates": { + "node_modules/delegates": { "version": "1.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT" }, - "dompurify": { + "node_modules/dompurify": { "version": "2.4.7", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/dompurify/-/dompurify-2.4.7.tgz", - "integrity": "sha512-kxxKlPEDa6Nc5WJi+qRgPbOAbgTpSULL+vI3NUXsZMlkJxTqYI9wg5ZTay2sFrdZRWHPWNi+EdAhcJf81WtoMQ==" + "integrity": "sha512-kxxKlPEDa6Nc5WJi+qRgPbOAbgTpSULL+vI3NUXsZMlkJxTqYI9wg5ZTay2sFrdZRWHPWNi+EdAhcJf81WtoMQ==", + "license": "(MPL-2.0 OR Apache-2.0)" }, - "ecc-jsbn": { + "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "requires": { + "license": "MIT", + "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" } }, - "emoji-regex": { + "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" }, - "encoding": { + "node_modules/encoding": { "version": "0.1.13", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/encoding/-/encoding-0.1.13.tgz", "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "license": "MIT", "optional": true, - "requires": { + "dependencies": { "iconv-lite": "^0.6.2" } }, - "env-paths": { + "node_modules/env-paths": { "version": "2.2.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "err-code": { + "node_modules/err-code": { "version": "2.0.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "license": "MIT" }, - "error-ex": { + "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { + "license": "MIT", + "dependencies": { "is-arrayish": "^0.2.1" } }, - "escalade": { + "node_modules/escalade": { "version": "3.1.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "escape-string-regexp": { + "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } }, - "eventemitter3": { + "node_modules/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==" + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "license": "MIT" }, - "extend": { + "node_modules/extend": { "version": "3.0.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" }, - "extsprintf": { + "node_modules/extsprintf": { "version": "1.3.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==" + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" }, - "fast-deep-equal": { + "node_modules/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==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" }, - "fast-json-stable-stringify": { + "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "license": "MIT" }, - "fetch-ponyfill": { + "node_modules/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", "integrity": "sha512-FhbbL55dj/qdVO3YNK7ZEkshvj3eQ7EuIGV2I6ic/2YiocvyWv+7jg2s4AyS0wdRU75s3tA8ZxI/xPigb0v5Aw==", - "requires": { + "license": "MIT", + "dependencies": { "node-fetch": "~2.6.1" } }, - "find-up": { + "node_modules/find-up": { "version": "4.1.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { + "license": "MIT", + "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "forever-agent": { + "node_modules/forever-agent": { "version": "0.6.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==" + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "license": "Apache-2.0", + "engines": { + "node": "*" + } }, - "form-data": { + "node_modules/form-data": { "version": "2.3.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { + "license": "MIT", + "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" } }, - "fs-minipass": { + "node_modules/fs-minipass": { "version": "2.1.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/fs-minipass/-/fs-minipass-2.1.0.tgz", "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "requires": { + "license": "ISC", + "dependencies": { "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" } }, - "fs.realpath": { + "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" }, - "function-bind": { + "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "license": "MIT" }, - "gauge": { + "node_modules/gauge": { "version": "4.0.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/gauge/-/gauge-4.0.4.tgz", "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", - "requires": { + "license": "ISC", + "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.3", "console-control-strings": "^1.1.0", @@ -649,39 +911,56 @@ "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "gaze": { + "node_modules/gaze": { "version": "1.1.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/gaze/-/gaze-1.1.3.tgz", "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", - "requires": { + "license": "MIT", + "dependencies": { "globule": "^1.0.0" + }, + "engines": { + "node": ">= 4.0.0" } }, - "get-caller-file": { + "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } }, - "get-stdin": { + "node_modules/get-stdin": { "version": "4.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha512-F5aQMywwJ2n85s4hJPTT9RPxGmubonuB10MNYo17/xph174n2MIR33HRguhzVag10O/npM7SPk73LMZNP+FaWw==" + "integrity": "sha512-F5aQMywwJ2n85s4hJPTT9RPxGmubonuB10MNYo17/xph174n2MIR33HRguhzVag10O/npM7SPk73LMZNP+FaWw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "getpass": { + "node_modules/getpass": { "version": "0.1.7", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/getpass/-/getpass-0.1.7.tgz", "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "requires": { + "license": "MIT", + "dependencies": { "assert-plus": "^1.0.0" } }, - "glob": { + "node_modules/glob": { "version": "7.2.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "requires": { + "license": "ISC", + "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", @@ -689,312 +968,432 @@ "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", "dependencies": { - "minimatch": { - "version": "3.1.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - } + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "globule": { + "node_modules/globule": { "version": "1.3.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/globule/-/globule-1.3.4.tgz", "integrity": "sha512-OPTIfhMBh7JbBYDpa5b+Q5ptmMWKwcNcFSR/0c6t8V4f3ZAVBEsKNY37QdVqmLRYSMhOUGYrY0QhSoEpzGr/Eg==", - "requires": { + "license": "MIT", + "dependencies": { "glob": "~7.1.1", "lodash": "^4.17.21", "minimatch": "~3.0.2" }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/globule/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "license": "ISC", "dependencies": { - "glob": { - "version": "7.1.7", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "graceful-fs": { + "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" }, - "har-schema": { + "node_modules/har-schema": { "version": "2.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==" + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", + "license": "ISC", + "engines": { + "node": ">=4" + } }, - "har-validator": { + "node_modules/har-validator": { "version": "5.1.5", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/har-validator/-/har-validator-5.1.5.tgz", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "requires": { + "deprecated": "this library is no longer supported", + "license": "MIT", + "dependencies": { "ajv": "^6.12.3", "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" } }, - "hard-rejection": { + "node_modules/hard-rejection": { "version": "2.1.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/hard-rejection/-/hard-rejection-2.1.0.tgz", - "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==" + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "has": { + "node_modules/has": { "version": "1.0.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { + "license": "MIT", + "dependencies": { "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" } }, - "has-flag": { + "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "has-unicode": { + "node_modules/has-unicode": { "version": "2.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC" }, - "hosted-git-info": { + "node_modules/hosted-git-info": { "version": "4.1.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/hosted-git-info/-/hosted-git-info-4.1.0.tgz", "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", - "requires": { + "license": "ISC", + "dependencies": { "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" } }, - "http-cache-semantics": { + "node_modules/http-cache-semantics": { "version": "4.1.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "license": "BSD-2-Clause" }, - "http-proxy-agent": { + "node_modules/http-proxy-agent": { "version": "4.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "requires": { + "license": "MIT", + "dependencies": { "@tootallnate/once": "1", "agent-base": "6", "debug": "4" + }, + "engines": { + "node": ">= 6" } }, - "http-signature": { + "node_modules/http-signature": { "version": "1.2.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "requires": { + "license": "MIT", + "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" } }, - "https-proxy-agent": { + "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "requires": { + "license": "MIT", + "dependencies": { "agent-base": "6", "debug": "4" + }, + "engines": { + "node": ">= 6" } }, - "humanize-ms": { + "node_modules/humanize-ms": { "version": "1.2.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/humanize-ms/-/humanize-ms-1.2.1.tgz", "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", - "requires": { + "license": "MIT", + "dependencies": { "ms": "^2.0.0" } }, - "iconv-lite": { + "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", "optional": true, - "requires": { + "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "imurmurhash": { + "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } }, - "indent-string": { + "node_modules/indent-string": { "version": "4.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "infer-owner": { + "node_modules/infer-owner": { "version": "1.0.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==" + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "license": "ISC" }, - "inflight": { + "node_modules/inflight": { "version": "1.0.6", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "requires": { + "license": "ISC", + "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" }, - "ip": { + "node_modules/ip": { "version": "2.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "license": "MIT" }, - "is-arrayish": { + "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "license": "MIT" }, - "is-core-module": { + "node_modules/is-core-module": { "version": "2.13.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/is-core-module/-/is-core-module-2.13.0.tgz", "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", - "requires": { + "license": "MIT", + "dependencies": { "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "is-fullwidth-code-point": { + "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "is-lambda": { + "node_modules/is-lambda": { "version": "1.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==" + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "license": "MIT" }, - "is-plain-obj": { + "node_modules/is-plain-obj": { "version": "1.1.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==" + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "is-typedarray": { + "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "license": "MIT" }, - "isarray": { + "node_modules/isarray": { "version": "1.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" }, - "isexe": { + "node_modules/isexe": { "version": "2.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" }, - "isstream": { + "node_modules/isstream": { "version": "0.1.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "license": "MIT" }, - "js-base64": { + "node_modules/js-base64": { "version": "2.6.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/js-base64/-/js-base64-2.6.4.tgz", - "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==" + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", + "license": "BSD-3-Clause" }, - "js-tokens": { + "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" }, - "jsbn": { + "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "license": "MIT" }, - "json-logic-js": { + "node_modules/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==" + "integrity": "sha512-ZBtBdMJieqQcH7IX/LaBsr5pX+Y5JIW+EhejtM3Ffg2jdN9Iwf+Ht6TbHnvAZ/YtwyuhPaCBlnvzrwVeWdvGDQ==", + "license": "MIT" }, - "json-parse-even-better-errors": { + "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "license": "MIT" }, - "json-schema": { + "node_modules/json-schema": { "version": "0.4.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "license": "(AFL-2.1 OR BSD-3-Clause)" }, - "json-schema-traverse": { + "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "license": "MIT" }, - "json-stringify-safe": { + "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "license": "ISC" }, - "jsprim": { + "node_modules/jsprim": { "version": "1.4.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/jsprim/-/jsprim-1.4.2.tgz", "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "requires": { + "license": "MIT", + "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", "json-schema": "0.4.0", "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" } }, - "kind-of": { + "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "lines-and-columns": { + "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "license": "MIT" }, - "locate-path": { + "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { + "license": "MIT", + "dependencies": { "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" } }, - "lodash": { + "node_modules/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==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" }, - "lru-cache": { + "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { + "license": "ISC", + "dependencies": { "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" } }, - "make-fetch-happen": { + "node_modules/make-fetch-happen": { "version": "9.1.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", - "requires": { + "license": "ISC", + "dependencies": { "agentkeepalive": "^4.1.3", "cacache": "^15.2.0", "http-cache-semantics": "^4.1.0", @@ -1011,18 +1410,29 @@ "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.0.0", "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" } }, - "map-obj": { + "node_modules/map-obj": { "version": "4.3.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/map-obj/-/map-obj-4.3.0.tgz", - "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==" + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "meow": { + "node_modules/meow": { "version": "9.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/meow/-/meow-9.0.0.tgz", "integrity": "sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==", - "requires": { + "license": "MIT", + "dependencies": { "@types/minimist": "^1.2.0", "camelcase-keys": "^6.2.2", "decamelize": "^1.2.0", @@ -1035,137 +1445,219 @@ "trim-newlines": "^3.0.0", "type-fest": "^0.18.0", "yargs-parser": "^20.2.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "mime-db": { + "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } }, - "mime-types": { + "node_modules/mime-types": { "version": "2.1.35", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "requires": { + "license": "MIT", + "dependencies": { "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" } }, - "min-indent": { + "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "license": "MIT", + "engines": { + "node": ">=4" + } }, - "minimatch": { + "node_modules/minimatch": { "version": "3.0.8", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minimatch/-/minimatch-3.0.8.tgz", "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", - "requires": { + "license": "ISC", + "dependencies": { "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "minimist-options": { + "node_modules/minimist-options": { "version": "4.1.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minimist-options/-/minimist-options-4.1.0.tgz", "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "requires": { + "license": "MIT", + "dependencies": { "arrify": "^1.0.1", "is-plain-obj": "^1.1.0", "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" } }, - "minipass": { + "node_modules/minipass": { "version": "3.3.6", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "requires": { + "license": "ISC", + "dependencies": { "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "minipass-collect": { + "node_modules/minipass-collect": { "version": "1.0.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minipass-collect/-/minipass-collect-1.0.2.tgz", "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", - "requires": { + "license": "ISC", + "dependencies": { "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" } }, - "minipass-fetch": { + "node_modules/minipass-fetch": { "version": "1.4.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minipass-fetch/-/minipass-fetch-1.4.1.tgz", "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", - "requires": { - "encoding": "^0.1.12", + "license": "MIT", + "dependencies": { "minipass": "^3.1.0", "minipass-sized": "^1.0.3", "minizlib": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "optionalDependencies": { + "encoding": "^0.1.12" } }, - "minipass-flush": { + "node_modules/minipass-flush": { "version": "1.0.5", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minipass-flush/-/minipass-flush-1.0.5.tgz", "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", - "requires": { + "license": "ISC", + "dependencies": { "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" } }, - "minipass-pipeline": { + "node_modules/minipass-pipeline": { "version": "1.2.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", - "requires": { + "license": "ISC", + "dependencies": { "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "minipass-sized": { + "node_modules/minipass-sized": { "version": "1.0.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minipass-sized/-/minipass-sized-1.0.3.tgz", "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", - "requires": { + "license": "ISC", + "dependencies": { "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "minizlib": { + "node_modules/minizlib": { "version": "2.1.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minizlib/-/minizlib-2.1.2.tgz", "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "requires": { + "license": "MIT", + "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" } }, - "mkdirp": { + "node_modules/mkdirp": { "version": "1.0.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } }, - "ms": { + "node_modules/ms": { "version": "2.1.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" }, - "nan": { + "node_modules/nan": { "version": "2.18.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/nan/-/nan-2.18.0.tgz", - "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==" + "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==", + "license": "MIT" }, - "negotiator": { + "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } }, - "node-fetch": { + "node_modules/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", "integrity": "sha512-StxNAxh15zr77QvvkmveSQ8uCQ4+v5FkvNTj0OESmiHu+VRi/gXArXtkWMElOsOUNLtUEvI4yS+rdtOHZTwlQA==", - "requires": { + "license": "MIT", + "dependencies": { "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, - "node-gyp": { + "node_modules/node-gyp": { "version": "8.4.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/node-gyp/-/node-gyp-8.4.1.tgz", "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", - "requires": { + "license": "MIT", + "dependencies": { "env-paths": "^2.2.0", "glob": "^7.1.4", "graceful-fs": "^4.2.6", @@ -1177,25 +1669,35 @@ "tar": "^6.1.2", "which": "^2.0.2" }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": ">= 10.12.0" + } + }, + "node_modules/node-gyp/node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "license": "ISC", "dependencies": { - "npmlog": { - "version": "6.0.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", - "requires": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - } - } + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node-sass": { + "node_modules/node-sass": { "version": "7.0.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/node-sass/-/node-sass-7.0.3.tgz", "integrity": "sha512-8MIlsY/4dXUkJDYht9pIWBhMil3uHmE8b/AdJPjmFn1nBx9X9BASzfzmsCy0uCCb8eqI3SYYzVPDswWqSx7gjw==", - "requires": { + "hasInstallScript": true, + "license": "MIT", + "dependencies": { "async-foreach": "^0.1.3", "chalk": "^4.1.2", "cross-spawn": "^7.0.3", @@ -1211,267 +1713,393 @@ "sass-graph": "^4.0.1", "stdout-stream": "^1.4.0", "true-case-path": "^1.0.2" + }, + "bin": { + "node-sass": "bin/node-sass" + }, + "engines": { + "node": ">=12" } }, - "nopt": { + "node_modules/nopt": { "version": "5.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/nopt/-/nopt-5.0.0.tgz", "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "requires": { + "license": "ISC", + "dependencies": { "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" } }, - "normalize-package-data": { + "node_modules/normalize-package-data": { "version": "3.0.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/normalize-package-data/-/normalize-package-data-3.0.3.tgz", "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", - "requires": { + "license": "BSD-2-Clause", + "dependencies": { "hosted-git-info": "^4.0.1", "is-core-module": "^2.5.0", "semver": "^7.3.4", "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" } }, - "npmlog": { + "node_modules/npmlog": { "version": "5.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/npmlog/-/npmlog-5.0.1.tgz", "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", - "requires": { + "license": "ISC", + "dependencies": { "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", "gauge": "^3.0.0", "set-blocking": "^2.0.0" + } + }, + "node_modules/npmlog/node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "license": "ISC", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npmlog/node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "license": "ISC", "dependencies": { - "are-we-there-yet": { - "version": "2.0.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", - "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - } - }, - "gauge": { - "version": "3.0.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", - "requires": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - } - } + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" } }, - "oauth-sign": { + "node_modules/oauth-sign": { "version": "0.9.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "license": "Apache-2.0", + "engines": { + "node": "*" + } }, - "object-assign": { + "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "once": { + "node_modules/once": { "version": "1.4.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "requires": { + "license": "ISC", + "dependencies": { "wrappy": "1" } }, - "p-limit": { + "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { + "license": "MIT", + "dependencies": { "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "p-locate": { + "node_modules/p-locate": { "version": "4.1.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { + "license": "MIT", + "dependencies": { "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" } }, - "p-map": { + "node_modules/p-map": { "version": "4.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/p-map/-/p-map-4.0.0.tgz", "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "requires": { + "license": "MIT", + "dependencies": { "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "p-try": { + "node_modules/p-try": { "version": "2.2.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "parse-json": { + "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "requires": { + "license": "MIT", + "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "path-exists": { + "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "path-is-absolute": { + "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "path-key": { + "node_modules/path-key": { "version": "3.1.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "path-parse": { + "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" }, - "performance-now": { + "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "license": "MIT" }, - "process-nextick-args": { + "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" }, - "promise-inflight": { + "node_modules/promise-inflight": { "version": "1.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==" + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "license": "ISC" }, - "promise-retry": { + "node_modules/promise-retry": { "version": "2.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/promise-retry/-/promise-retry-2.0.1.tgz", "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", - "requires": { + "license": "MIT", + "dependencies": { "err-code": "^2.0.2", "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" } }, - "psl": { + "node_modules/psl": { "version": "1.9.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "license": "MIT" }, - "punycode": { + "node_modules/punycode": { "version": "2.3.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==" + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "qs": { + "node_modules/qs": { "version": "6.5.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==" + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.6" + } }, - "quick-lru": { + "node_modules/quick-lru": { "version": "4.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==" + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "read-pkg": { + "node_modules/read-pkg": { "version": "5.2.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/read-pkg/-/read-pkg-5.2.0.tgz", "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "requires": { + "license": "MIT", + "dependencies": { "@types/normalize-package-data": "^2.4.0", "normalize-package-data": "^2.5.0", "parse-json": "^5.0.0", "type-fest": "^0.6.0" }, - "dependencies": { - "hosted-git-info": { - "version": "2.8.9", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "semver": { - "version": "5.7.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" - }, - "type-fest": { - "version": "0.6.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==" - } + "engines": { + "node": ">=8" } }, - "read-pkg-up": { + "node_modules/read-pkg-up": { "version": "7.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/read-pkg-up/-/read-pkg-up-7.0.1.tgz", "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "requires": { + "license": "MIT", + "dependencies": { "find-up": "^4.1.0", "read-pkg": "^5.2.0", "type-fest": "^0.8.1" }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "license": "ISC" + }, + "node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "license": "BSD-2-Clause", "dependencies": { - "type-fest": { - "version": "0.8.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" - } + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, - "readable-stream": { + "node_modules/read-pkg/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "requires": { + "license": "MIT", + "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" } }, - "redent": { + "node_modules/redent": { "version": "3.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/redent/-/redent-3.0.0.tgz", "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "requires": { + "license": "MIT", + "dependencies": { "indent-string": "^4.0.0", "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "request": { + "node_modules/request": { "version": "2.88.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/request/-/request-2.88.2.tgz", "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "requires": { + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "license": "Apache-2.0", + "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", "caseless": "~0.12.0", @@ -1492,159 +2120,248 @@ "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" } }, - "require-directory": { + "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "resolve": { + "node_modules/resolve": { "version": "1.22.6", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/resolve/-/resolve-1.22.6.tgz", "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==", - "requires": { + "license": "MIT", + "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "retry": { + "node_modules/retry": { "version": "0.12.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "license": "MIT", + "engines": { + "node": ">= 4" + } }, - "rimraf": { + "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { + "license": "ISC", + "dependencies": { "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "safe-buffer": { + "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" }, - "safer-buffer": { + "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" }, - "sass-graph": { + "node_modules/sass-graph": { "version": "4.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/sass-graph/-/sass-graph-4.0.1.tgz", "integrity": "sha512-5YCfmGBmxoIRYHnKK2AKzrAkCoQ8ozO+iumT8K4tXJXRVCPf+7s1/9KxTSW3Rbvf+7Y7b4FR3mWyLnQr3PHocA==", - "requires": { + "license": "MIT", + "dependencies": { "glob": "^7.0.0", "lodash": "^4.17.11", "scss-tokenizer": "^0.4.3", "yargs": "^17.2.1" + }, + "bin": { + "sassgraph": "bin/sassgraph" + }, + "engines": { + "node": ">=12" } }, - "scss-tokenizer": { + "node_modules/scss-tokenizer": { "version": "0.4.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/scss-tokenizer/-/scss-tokenizer-0.4.3.tgz", "integrity": "sha512-raKLgf1LI5QMQnG+RxHz6oK0sL3x3I4FN2UDLqgLOGO8hodECNnNh5BXn7fAyBxrA8zVzdQizQ6XjNJQ+uBwMw==", - "requires": { + "license": "MIT", + "dependencies": { "js-base64": "^2.4.9", "source-map": "^0.7.3" } }, - "semver": { + "node_modules/semver": { "version": "7.5.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "requires": { + "license": "ISC", + "dependencies": { "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, - "set-blocking": { + "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" }, - "shebang-command": { + "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "requires": { + "license": "MIT", + "dependencies": { "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "shebang-regex": { + "node_modules/shebang-regex": { "version": "3.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "signal-exit": { + "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" }, - "smart-buffer": { + "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==" + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } }, - "socks": { + "node_modules/socks": { "version": "2.7.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/socks/-/socks-2.7.1.tgz", "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", - "requires": { + "license": "MIT", + "dependencies": { "ip": "^2.0.0", "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" } }, - "socks-proxy-agent": { + "node_modules/socks-proxy-agent": { "version": "6.2.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", - "requires": { + "license": "MIT", + "dependencies": { "agent-base": "^6.0.2", "debug": "^4.3.3", "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" } }, - "source-map": { + "node_modules/source-map": { "version": "0.7.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/source-map/-/source-map-0.7.4.tgz", - "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==" + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">= 8" + } }, - "spdx-correct": { + "node_modules/spdx-correct": { "version": "3.2.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/spdx-correct/-/spdx-correct-3.2.0.tgz", "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", - "requires": { + "license": "Apache-2.0", + "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" } }, - "spdx-exceptions": { + "node_modules/spdx-exceptions": { "version": "2.3.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "license": "CC-BY-3.0" }, - "spdx-expression-parse": { + "node_modules/spdx-expression-parse": { "version": "3.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "requires": { + "license": "MIT", + "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, - "spdx-license-ids": { + "node_modules/spdx-license-ids": { "version": "3.0.15", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/spdx-license-ids/-/spdx-license-ids-3.0.15.tgz", - "integrity": "sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==" + "integrity": "sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==", + "license": "CC0-1.0" }, - "sshpk": { + "node_modules/sshpk": { "version": "1.17.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/sshpk/-/sshpk-1.17.0.tgz", "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "requires": { + "license": "MIT", + "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", "bcrypt-pbkdf": "^1.0.0", @@ -1654,105 +2371,144 @@ "jsbn": "~0.1.0", "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" } }, - "ssri": { + "node_modules/ssri": { "version": "8.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/ssri/-/ssri-8.0.1.tgz", "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", - "requires": { + "license": "ISC", + "dependencies": { "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" } }, - "stdout-stream": { + "node_modules/stdout-stream": { "version": "1.4.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/stdout-stream/-/stdout-stream-1.4.1.tgz", "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", - "requires": { + "license": "MIT", + "dependencies": { "readable-stream": "^2.0.1" - }, + } + }, + "node_modules/stdout-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", "dependencies": { - "readable-stream": { - "version": "2.3.8", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/stdout-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/stdout-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" } }, - "string-width": { + "node_modules/string-width": { "version": "4.2.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { + "license": "MIT", + "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" } }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "strip-ansi": { + "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { + "license": "MIT", + "dependencies": { "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "strip-indent": { + "node_modules/strip-indent": { "version": "3.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/strip-indent/-/strip-indent-3.0.0.tgz", "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "requires": { + "license": "MIT", + "dependencies": { "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" } }, - "supports-color": { + "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { + "license": "MIT", + "dependencies": { "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "supports-preserve-symlinks-flag": { + "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "tar": { + "node_modules/tar": { "version": "6.2.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/tar/-/tar-6.2.0.tgz", "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", - "requires": { + "license": "ISC", + "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "minipass": "^5.0.0", @@ -1760,172 +2516,237 @@ "mkdirp": "^1.0.3", "yallist": "^4.0.0" }, - "dependencies": { - "minipass": { - "version": "5.0.0", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==" - } + "engines": { + "node": ">=10" } }, - "tough-cookie": { + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/tough-cookie": { "version": "2.5.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/tough-cookie/-/tough-cookie-2.5.0.tgz", "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "requires": { + "license": "BSD-3-Clause", + "dependencies": { "psl": "^1.1.28", "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" } }, - "tr46": { + "node_modules/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==" + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" }, - "trim-newlines": { + "node_modules/trim-newlines": { "version": "3.0.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/trim-newlines/-/trim-newlines-3.0.1.tgz", - "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==" + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "true-case-path": { + "node_modules/true-case-path": { "version": "1.0.3", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/true-case-path/-/true-case-path-1.0.3.tgz", "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", - "requires": { + "license": "Apache-2.0", + "dependencies": { "glob": "^7.1.2" } }, - "tunnel-agent": { + "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "requires": { + "license": "Apache-2.0", + "dependencies": { "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" } }, - "tweetnacl": { + "node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "license": "Unlicense" }, - "type-fest": { + "node_modules/type-fest": { "version": "0.18.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/type-fest/-/type-fest-0.18.1.tgz", - "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==" + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "unique-filename": { + "node_modules/unique-filename": { "version": "1.1.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/unique-filename/-/unique-filename-1.1.1.tgz", "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "requires": { + "license": "ISC", + "dependencies": { "unique-slug": "^2.0.0" } }, - "unique-slug": { + "node_modules/unique-slug": { "version": "2.0.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/unique-slug/-/unique-slug-2.0.2.tgz", "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "requires": { + "license": "ISC", + "dependencies": { "imurmurhash": "^0.1.4" } }, - "uri-js": { + "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "requires": { + "license": "BSD-2-Clause", + "dependencies": { "punycode": "^2.1.0" } }, - "util-deprecate": { + "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" }, - "uuid": { + "node_modules/uuid": { "version": "3.4.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "license": "MIT", + "bin": { + "uuid": "bin/uuid" + } }, - "validate-npm-package-license": { + "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "requires": { + "license": "Apache-2.0", + "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" } }, - "verror": { + "node_modules/verror": { "version": "1.10.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/verror/-/verror-1.10.0.tgz", "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "requires": { + "engines": [ + "node >=0.6.0" + ], + "license": "MIT", + "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", "extsprintf": "^1.2.0" } }, - "webidl-conversions": { + "node_modules/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==" + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" }, - "whatwg-url": { + "node_modules/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", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { + "license": "MIT", + "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, - "which": { + "node_modules/which": { "version": "2.0.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "requires": { + "license": "ISC", + "dependencies": { "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, - "wide-align": { + "node_modules/wide-align": { "version": "1.1.5", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/wide-align/-/wide-align-1.1.5.tgz", "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "requires": { + "license": "ISC", + "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" } }, - "wrap-ansi": { + "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "requires": { + "license": "MIT", + "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "wrappy": { + "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" }, - "y18n": { + "node_modules/y18n": { "version": "5.0.8", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } }, - "yallist": { + "node_modules/yallist": { "version": "4.0.0", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" }, - "yargs": { + "node_modules/yargs": { "version": "17.7.2", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "requires": { + "license": "MIT", + "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", @@ -1934,18 +2755,27 @@ "y18n": "^5.0.5", "yargs-parser": "^21.1.1" }, - "dependencies": { - "yargs-parser": { - "version": "21.1.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" - } + "engines": { + "node": ">=12" } }, - "yargs-parser": { + "node_modules/yargs-parser": { "version": "20.2.9", "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } } } } diff --git a/.github/workspace/grid/package.json b/.github/workspace/grid/package.json index 10a845fe..687eb7c7 100644 --- a/.github/workspace/grid/package.json +++ b/.github/workspace/grid/package.json @@ -25,7 +25,7 @@ "scripts": { "update": "npm update `npm outdated | awk '{print $1}' | tr '\n' ' '` ", "copy-formio-grid-changelog": "cp node_modules/@formio/grid/Changelog.md ../../../lib/grid.changlog.md", - "copy-formios-grid": "cp -rf node_modules/@formio/grid/dist/* ../../../lib", + "copy-formios-grid": "mkdir ../../../lib/grid && cp -rf node_modules/@formio/grid/dist/* ../../../lib/grid", "cleanup": "rm -rf ../../../lib/*server*", "copy-all": "npm run copy-formios-grid && npm run cleanup" }, diff --git a/.github/workspace/prem/package-lock.json b/.github/workspace/prem/package-lock.json index 49f8610d..633587a0 100644 --- a/.github/workspace/prem/package-lock.json +++ b/.github/workspace/prem/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "@formio/premium": "1.19.1", + "@formio/premium": "1.21.1", "moment": "^2.29.4" }, "devDependencies": {} @@ -50,9 +50,9 @@ } }, "node_modules/@formio/premium": { - "version": "1.19.1", - "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/premium/-/premium-1.19.1.tgz", - "integrity": "sha512-5xxcoJIKA/zlpx9q8UQF1fgsM29wPcgCatIB0OvgKl5e9QylrxGNNngh+eCnmxYCHcBJBiYBPiXwyNpyBnEhIw==", + "version": "1.21.1", + "resolved": "https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/@formio/premium/-/premium-1.21.1.tgz", + "integrity": "sha512-UuDmJt+ywBsS04RLeAJ09eOiygw7fsupZJ73D1fB8Dih6FUhv8p3/JxLO6Bd6mItb64yZ2Fh9yfABLyH9Zh4eg==", "license": "UNLICENSED", "dependencies": { "@juggle/resize-observer": "^3.4.0", diff --git a/.github/workspace/prem/package.json b/.github/workspace/prem/package.json index 1a8f488e..c0b15f02 100644 --- a/.github/workspace/prem/package.json +++ b/.github/workspace/prem/package.json @@ -31,7 +31,7 @@ }, "devDependencies": {}, "dependencies": { - "@formio/premium": "1.19.1", + "@formio/premium": "1.21.1", "moment": "^2.29.4" } } diff --git a/lib/formio.changelog.md b/lib/formio.changelog.md index 251f72e8..4fe0f4e9 100644 --- a/lib/formio.changelog.md +++ b/lib/formio.changelog.md @@ -4,23 +4,130 @@ 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.15.1 +## 4.17.2 ### Changed - Official Release -## 4.15.1-rc.4 +## 4.17.2-rc.1 ### Changed - - Revert "FIO-4876 fixed the display of current submission for pdf download" + - FIO-4816: fixed email submission: data display issues + - FIO-6578: Fixes an issue with losing focus on Year field when Day component has advanced logic + - FIO 7246: DOMPurify when PDF option is set + +## 4.17.1 +### Changed + - Official Release + +## 4.17.1-rc.3 +### Changed + - Avoid passing 'undefined' to function getFocusableElements in DataGrid#focusOnNewRowElement(row) (#5345) + +## 4.17.1-rc.2 +### Changed + - Revert "FIO-7074: Fixes an issue where setting submission to the Wizard from the form controller will not set values for all the pages" + - FIO-7197 Increased builder dropzone in DataGrid + +## 4.17.1-rc.1 +### Changed + - Updated @formio/bootstrap3@2.12.4-rc.1 + - FIO-7074: Fixes an issue where setting submission to the Wizard from the form controller will not set values for all the pages + - FIO-7173 Fixed issue when initial focus gets triggered in Formbuilder… + +## 4.17.0 +### Changed + - Official Release + +## 4.17.0-rc.7 +### Changed + - FIO-7310: Revert formio.js/pull/5187 + +## 4.17.0-rc.5 +### Changed + - FIO-3820: Ability to delete files inside the Storage Services -## 4.15.1-rc.3 +## 4.17.0-rc.4 +### Changed + - FIO-5967: fixed issue with incorrect string representation for object type + - Revert "FI0-5429: added a condition to remove the decimal separator when the decimal digits are set to 0" + - FIO-7110: when 'use original revision' is enabled for nested form, submission still displays in current form revision pdfs + +## 4.17.0-rc.3 ### Fixed - - FIO-7054: Fixes an issue where after saving Wizard Panel settings, some of them disappear + - FIO-7209: Radio works without ValueProperty set + +## 4.17.0-rc.2 + +## 4.17.0-rc.1 +### Changed + - FIO-3448: Fixed an issue where Keep overlay aspect ratio feature of the Signature component in PDF form does not work + - FI0-5429: added a condition to remove the decimal separator when the decimal digits are set to 0 + - FIO-6785: Content Field formatting not showing indentation + - FIO-6807: fixed an issue with date time format after using enableDate or enableTime checkboxes + - FIO-4782: added encodeURIComponent for filter query + - FIO-6849: fixed issue where form components cannot be edited because of legacy format of multi select default value multiple values + - FIO-5967: fixed issue with empty data for html 5 select component + - FIO-6906: fixed value for Checkbox submission in Data Tab + - FIO-6919: fixed value for Signature submission in Data Tab + - FIO-6630: Expanded Actions Logic UI + - FIO-6933: Fixes for the formbuilder with keyboard actions + - FIO-7043: Fixes an issue where {{}} values in DataSource headers are resolved in the form builder + - FIO-7007: fixed display of submitted values on DataTab + - FIO-7128: Fixed issues with multiple select + - FIO-7110 fixed display of nested form with Use Original Revision on PDF download + +## 4.16.0-rc.9 +### Changed + - FIO-7040 Enabled selectData for all List Based Components + +## 4.16.0-rc.8 +### Changed + - FIO-6688: Fixes producing additional components when minLength is set up + - FIO-7096: fixed adding components for PDF in the Microsoft Edge browser with Mac + - FIO-7035, FIO-7036: fixed issue with dragging layout resource component + - FIO-6735: added additional check to calculateComponentValue method + - FIO-6234: added submit button to the webform builder after switching from the wizard builder + + +## 4.16.0-rc.7 +### Changed + - FIO-5748 Collapsible preview for Form Builder + - FIO-6950 fixed test + - FIO-6669 Fixed tooltips cutting off in the component settings modal + +## 4.16.0-rc.6 +### Changed + - FIO-6156 Fixed help link for Time component -## 4.15.1-rc.2 +## 4.16.0-rc.5 ### Changed + - Revert "FIO-4876 fixed the display of current submission for pdf download" + +## 4.16.0-rc.4 +### Changed + - FIO-5303 fixed Edit and Delete buttons + - FIO-5730 fixed template for Select on PDF download + - FIO-6659 added warnings for Tree and Resource - FIO-7030: Fixes an issue where Wizard pages are displayed in one line in the for builder - - FIO-7049 fixed data populating in the Data Table + - FIO-5857 Update flatpickr to a version with the latest changes - FIO-6840: change unique validation for email comps and certain textfield comps + - FIO-7054: Fixes an issue where after saving Wizard Panel settings, some of them disappear + +## 4.16.0-rc.3 +### Changed + - FIO-7002: Fixing hide and show options to change visibility of components. + +## 4.16.0-rc.2 +### Changed + - 4.16.0-rc.1 previously published to NPM + +## 4.16.0-rc.1 +### Changed + - FIO-5566: Fixes an issue where deprication warning appears in the console when using Day component with dateFirst setting + - FIO-6164 Fixed an issue with date/time component localization + - FIO-3345: Added tests for the eachComponent function that were not including Tagpad key to the components paths + - FIO-6604 fixed padding for Numbers inside Content + - FIO-4809: Fixes an issue where value of Wizard suffix/prefix components will be deleted during validation on server + - Fix build 4.15.x ## 4.15.1-rc.1 ### Changed diff --git a/lib/formio.full.css b/lib/formio.full.css index 4bdf83fa..d142a5cf 100644 --- a/lib/formio.full.css +++ b/lib/formio.full.css @@ -3296,6 +3296,9 @@ body.formio-dialog-open { .formio-component-htmlelement { word-wrap: break-word; } +.formio-component-htmlelement ol, .formio-component-htmlelement ul { + margin-left: 10px; +} .editgrid-table-container { margin-bottom: 10px; @@ -3521,6 +3524,9 @@ td .formio-component-modaledit .formio-modaledit-view-container { .formio-component-textarea .ck.ck-editor__editable .image .ck-progress-bar { height: 4px; } +.formio-component-textarea .ck.ck-editor ul, .formio-component-textarea .ck.ck-editor ol { + margin-left: 10px; +} div[data-oembed-url] { width: 100%; @@ -3701,6 +3707,9 @@ div[data-oembed-url] { .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; @@ -4164,6 +4173,9 @@ span[role=link] { .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; @@ -4241,7 +4253,6 @@ span[role=link] { .component-edit-tabs.col-sm-6 { min-height: 87vh; height: 100%; - overflow-y: auto; } .component-edit-tabs.col-sm-12 { @@ -4270,6 +4281,6 @@ span[role=link] { } .builder-component-selected { - border: 2px dashed #e8e8e8; + border: 2px dashed #919191; outline: none !important; } \ No newline at end of file diff --git a/lib/formio.full.js b/lib/formio.full.js index 2046fd6d..cfc94f34 100644 --- a/lib/formio.full.js +++ b/lib/formio.full.js @@ -26,7 +26,7 @@ return /******/ (function() { // webpackBootstrap /***/ (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.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.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.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\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 _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); }\n// All external libs URLs should be injected through this class.\n// CDN libs URLs are accessible throuh CDN object properties\n// like Formio.cdn.ace === 'http://cdn.form.io/ace/1.4.12'.\n// For latest version use empty string\nvar CDN = /*#__PURE__*/function () {\n function CDN(baseUrl) {\n _classCallCheck(this, CDN);\n this.baseUrl = baseUrl || 'https://cdn.form.io';\n this.overrides = {};\n this.libs = {\n 'ace': '1.4.12',\n 'bootstrap': '4.6.2',\n 'ckeditor': '19.0.0',\n 'flatpickr': '4.6.8',\n 'flatpickr-formio': '4.6.13-formio.2',\n 'font-awesome': '4.7.0',\n 'grid': 'latest',\n 'moment-timezone': 'latest',\n 'quill': '2.0.0-dev.3',\n 'shortcut-buttons-flatpickr': '0.4.0',\n 'uswds': '2.4.8',\n 'core': ''\n };\n this.updateUrls();\n }\n _createClass(CDN, [{\n key: \"getVersion\",\n value: function getVersion(lib) {\n return this.libs[lib];\n }\n\n // Sets a specific library version\n }, {\n key: \"setVersion\",\n value: function setVersion(lib, version) {\n this.libs[lib] = version;\n this.updateUrls();\n }\n\n // Sets base CDN url for all libraries\n }, {\n key: \"setBaseUrl\",\n value: function setBaseUrl(url) {\n this.baseUrl = url;\n this.updateUrls();\n }\n\n // Allows to override CDN url for a specific library\n }, {\n key: \"setOverrideUrl\",\n value: function setOverrideUrl(lib, url) {\n this.overrides[lib] = url;\n this.updateUrls();\n }\n\n // Removes override for a specific library\n }, {\n key: \"removeOverride\",\n value: function removeOverride(lib) {\n delete this.overrides[lib];\n this.updateUrls();\n }\n\n // Removes all overrides\n }, {\n key: \"removeOverrides\",\n value: function removeOverrides() {\n this.overrides = {};\n this.updateUrls();\n }\n }, {\n key: \"buildUrl\",\n value: function buildUrl(cdnUrl, lib, version) {\n var url;\n if (version === 'latest' || version === '') {\n url = \"\".concat(cdnUrl, \"/\").concat(lib);\n } else {\n url = \"\".concat(cdnUrl, \"/\").concat(lib, \"/\").concat(version);\n }\n return url;\n }\n }, {\n key: \"updateUrls\",\n value: function updateUrls() {\n for (var lib in this.libs) {\n if (lib in this.overrides) {\n this[lib] = this.buildUrl(this.overrides[lib], lib, this.libs[lib]);\n } else {\n this[lib] = this.buildUrl(this.baseUrl, lib, this.libs[lib]);\n }\n }\n }\n }]);\n return CDN;\n}();\nvar _default = CDN;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/CDN.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.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.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.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"./node_modules/core-js/modules/es.number.constructor.js\");\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 _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); }\n// All external libs URLs should be injected through this class.\n// CDN libs URLs are accessible throuh CDN object properties\n// like Formio.cdn.ace === 'http://cdn.form.io/ace/1.4.12'.\n// For latest version use empty string\nvar CDN = /*#__PURE__*/function () {\n function CDN(baseUrl) {\n _classCallCheck(this, CDN);\n this.baseUrl = baseUrl || 'https://cdn.form.io';\n this.overrides = {};\n this.libs = {\n 'ace': '1.4.12',\n 'bootstrap': '4.6.2',\n 'ckeditor': '19.0.0',\n 'flatpickr': '4.6.8',\n 'flatpickr-formio': '4.6.13-formio.3',\n 'font-awesome': '4.7.0',\n 'grid': 'latest',\n 'moment-timezone': 'latest',\n 'quill': '2.0.0-dev.3',\n 'shortcut-buttons-flatpickr': '0.4.0',\n 'uswds': '2.4.8',\n 'core': ''\n };\n this.updateUrls();\n }\n _createClass(CDN, [{\n key: \"getVersion\",\n value: function getVersion(lib) {\n return this.libs[lib];\n }\n\n // Sets a specific library version\n }, {\n key: \"setVersion\",\n value: function setVersion(lib, version) {\n this.libs[lib] = version;\n this.updateUrls();\n }\n\n // Sets base CDN url for all libraries\n }, {\n key: \"setBaseUrl\",\n value: function setBaseUrl(url) {\n this.baseUrl = url;\n this.updateUrls();\n }\n\n // Allows to override CDN url for a specific library\n }, {\n key: \"setOverrideUrl\",\n value: function setOverrideUrl(lib, url) {\n this.overrides[lib] = url;\n this.updateUrls();\n }\n\n // Removes override for a specific library\n }, {\n key: \"removeOverride\",\n value: function removeOverride(lib) {\n delete this.overrides[lib];\n this.updateUrls();\n }\n\n // Removes all overrides\n }, {\n key: \"removeOverrides\",\n value: function removeOverrides() {\n this.overrides = {};\n this.updateUrls();\n }\n }, {\n key: \"buildUrl\",\n value: function buildUrl(cdnUrl, lib, version) {\n var url;\n if (version === 'latest' || version === '') {\n url = \"\".concat(cdnUrl, \"/\").concat(lib);\n } else {\n url = \"\".concat(cdnUrl, \"/\").concat(lib, \"/\").concat(version);\n }\n return url;\n }\n }, {\n key: \"updateUrls\",\n value: function updateUrls() {\n for (var lib in this.libs) {\n if (lib in this.overrides) {\n this[lib] = this.buildUrl(this.overrides[lib], lib, this.libs[lib]);\n } else {\n this[lib] = this.buildUrl(this.baseUrl, lib, this.libs[lib]);\n }\n }\n }\n }]);\n return CDN;\n}();\nvar _default = CDN;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/CDN.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) {\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);\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.15.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) {\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);\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.17.2';\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?"); /***/ }), @@ -103,7 +103,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (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.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.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.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.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.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/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/web.url.js */ \"./node_modules/core-js/modules/web.url.js\");\n__webpack_require__(/*! core-js/modules/web.url-search-params.js */ \"./node_modules/core-js/modules/web.url-search-params.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.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/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/esnext.global-this.js */ \"./node_modules/core-js/modules/esnext.global-this.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 _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 _WebformBuilder2 = _interopRequireDefault(__webpack_require__(/*! ./WebformBuilder */ \"./lib/WebformBuilder.js\"));\nvar _utils = __webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\");\nvar _formUtils = __webpack_require__(/*! ./utils/formUtils */ \"./lib/utils/formUtils.js\");\nvar _builder = _interopRequireDefault(__webpack_require__(/*! ./utils/builder */ \"./lib/utils/builder.js\"));\nvar _PDF = _interopRequireDefault(__webpack_require__(/*! ./PDF */ \"./lib/PDF.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": 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 _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 PDFBuilder = /*#__PURE__*/function (_WebformBuilder) {\n _inherits(PDFBuilder, _WebformBuilder);\n var _super = _createSuper(PDFBuilder);\n function PDFBuilder() {\n var _this;\n _classCallCheck(this, PDFBuilder);\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\n // Force superclass to skip the automatic init; we'll trigger it manually\n options.skipInit = true;\n options.display = 'pdf';\n if (element) {\n _this = _super.call(this, element, options);\n } else {\n _this = _super.call(this, options);\n }\n _this.dragDropEnabled = false;\n return _possibleConstructorReturn(_this);\n }\n _createClass(PDFBuilder, [{\n key: \"defaultGroups\",\n get: function get() {\n return {\n pdf: {\n title: 'PDF Fields',\n weight: 0,\n \"default\": true,\n components: {\n textfield: true,\n number: true,\n password: true,\n email: true,\n phoneNumber: true,\n currency: true,\n checkbox: true,\n signature: true,\n select: true,\n textarea: true,\n datetime: true,\n file: true,\n htmlelement: true,\n signrequestsignature: true\n }\n },\n basic: false,\n advanced: false,\n layout: false,\n data: false,\n premium: false,\n resource: false\n };\n }\n }, {\n key: \"hasPDF\",\n get: function get() {\n return _lodash[\"default\"].has(this.webform.form, 'settings.pdf');\n }\n }, {\n key: \"projectUrl\",\n get: function get() {\n return this.options.projectUrl || _Formio.GlobalFormio.getProjectUrl();\n }\n }, {\n key: \"init\",\n value: function init() {\n this.options.attachMode = 'builder';\n this.webform = this.webform || this.createForm(this.options);\n this.webform.init();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n var result = this.renderTemplate('pdfBuilder', {\n sidebar: this.renderTemplate('builderSidebar', {\n scrollEnabled: this.sideBarScroll,\n groupOrder: this.groupOrder,\n groupId: \"builder-sidebar-\".concat(this.id),\n groups: this.groupOrder.map(function (groupKey) {\n return _this2.renderTemplate('builderSidebarGroup', {\n group: _this2.groups[groupKey],\n groupKey: groupKey,\n groupId: \"builder-sidebar-\".concat(_this2.id),\n subgroups: _this2.groups[groupKey].subgroups.map(function (group) {\n return _this2.renderTemplate('builderSidebarGroup', {\n group: group,\n groupKey: group.key,\n groupId: \"group-container-\".concat(groupKey),\n subgroups: []\n });\n })\n });\n })\n }),\n form: this.hasPDF ? this.webform.render() : this.renderTemplate('pdfBuilderUpload', {})\n });\n return result;\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this3 = this;\n // PDF Upload\n if (!this.hasPDF) {\n this.loadRefs(element, {\n 'fileDrop': 'single',\n 'fileBrowse': 'single',\n 'hiddenFileInputElement': 'single',\n 'uploadError': 'single',\n 'uploadProgress': 'single',\n 'uploadProgressWrapper': 'single',\n 'dragDropText': 'single'\n });\n this.addEventListener(this.refs['pdf-upload-button'], 'click', function (event) {\n event.preventDefault();\n });\n\n // Init the upload error.\n if (!this.projectUrl) {\n this.setUploadError('Form options.projectUrl not set. Please set the \"projectUrl\" property of the options for this form or use Formio.setProjectUrl(). This setting is necessary to upload a pdf background.');\n } else {\n this.setUploadError();\n }\n if (this.refs.fileDrop) {\n var _element = this;\n this.addEventListener(this.refs.fileDrop, 'dragover', function (event) {\n this.className = 'fileSelector fileDragOver';\n event.preventDefault();\n });\n this.addEventListener(this.refs.fileDrop, 'dragleave', function (event) {\n this.className = 'fileSelector';\n event.preventDefault();\n });\n this.addEventListener(this.refs.fileDrop, 'drop', function (event) {\n this.className = 'fileSelector';\n event.preventDefault();\n _element.upload(event.dataTransfer.files[0]);\n return false;\n });\n }\n if (this.refs.fileBrowse && this.refs.hiddenFileInputElement) {\n this.addEventListener(this.refs.fileBrowse, 'click', function (event) {\n event.preventDefault();\n // There is no direct way to trigger a file dialog. To work around this, create an input of type file and trigger\n // a click event on it.\n if (typeof _this3.refs.hiddenFileInputElement.trigger === 'function') {\n _this3.refs.hiddenFileInputElement.trigger('click');\n } else {\n _this3.refs.hiddenFileInputElement.click();\n }\n });\n this.addEventListener(this.refs.hiddenFileInputElement, 'change', function () {\n if (!_this3.refs.hiddenFileInputElement.value) {\n return;\n }\n _this3.upload(_this3.refs.hiddenFileInputElement.files[0]);\n _this3.refs.hiddenFileInputElement.value = '';\n });\n }\n return _nativePromiseOnly[\"default\"].resolve();\n }\n\n // Normal PDF Builder\n return _get(_getPrototypeOf(PDFBuilder.prototype), \"attach\", this).call(this, element).then(function () {\n _this3.loadRefs(_this3.element, {\n iframeDropzone: 'single',\n 'sidebar-container': 'multiple',\n 'sidebar': 'single'\n });\n _this3.afterAttach();\n return _this3.element;\n });\n }\n }, {\n key: \"afterAttach\",\n value: function afterAttach() {\n var _this4 = this;\n this.on('saveComponent', function (component) {\n _this4.webform.postMessage({\n name: 'updateElement',\n data: component\n });\n });\n this.on('removeComponent', function (component) {\n _this4.webform.postMessage({\n name: 'removeElement',\n data: component\n });\n });\n this.initIframeEvents();\n this.updateDropzoneDimensions();\n var sidebar = this.refs.sidebar;\n if (sidebar) {\n this.addClass(sidebar, 'disabled');\n this.webform.on('iframe-ready', function () {\n _this4.pdfLoaded = true;\n _this4.updateDragAndDrop();\n _this4.removeClass(sidebar, 'disabled');\n }, true);\n }\n }\n }, {\n key: \"upload\",\n value: function upload(file) {\n var _this5 = this;\n var formio = new _Formio.GlobalFormio(this.projectUrl);\n if (this.refs.dragDropText) {\n this.refs.dragDropText.style.display = 'none';\n }\n if (this.refs.uploadProgressWrapper) {\n this.refs.uploadProgressWrapper.style.display = 'inherit';\n }\n formio.uploadFile('url', file, file, '', function (event) {\n if (_this5.refs.uploadProgress) {\n var progress = Math.floor(event.loaded / event.total * 100);\n _this5.refs.uploadProgress.style.width = \"\".concat(progress, \"%\");\n if (progress > 98) {\n _this5.refs.uploadProgress.innerHTML = _this5.t('Converting PDF. Please wait.');\n } else {\n _this5.refs.uploadProgress.innerHTML = \"\".concat(_this5.t('Uploading'), \" \").concat(progress, \"%\");\n }\n }\n }, \"\".concat(this.projectUrl, \"/upload\"), {}, 'file').then(function (result) {\n var _result$data$formfiel;\n var autoConversionComponentsAssigned = false;\n if ((_result$data$formfiel = result.data.formfields) !== null && _result$data$formfiel !== void 0 && _result$data$formfiel.components && result.data.formfields.components.length) {\n var _this5$webform$form$c, _this5$webform$form$c2, _this5$webform$form$c3;\n var formInitState = ((_this5$webform$form$c = _this5.webform.form.components[0]) === null || _this5$webform$form$c === void 0 ? void 0 : _this5$webform$form$c.key) === 'submit';\n var wizardInitState = ((_this5$webform$form$c2 = _this5.webform.form.components[0]) === null || _this5$webform$form$c2 === void 0 ? void 0 : _this5$webform$form$c2.key) === 'page1' && ((_this5$webform$form$c3 = _this5.webform.form.components[0]) === null || _this5$webform$form$c3 === void 0 ? void 0 : _this5$webform$form$c3.components.length) === 0;\n var emptyFormState = _this5.webform.form.components.length === 0;\n if (formInitState || wizardInitState || emptyFormState) {\n autoConversionComponentsAssigned = true;\n _this5.webform.form.components = result.data.formfields.components;\n }\n }\n if (_this5.refs.dragDropText) {\n _this5.refs.dragDropText.style.display = 'inherit';\n }\n if (_this5.refs.uploadProgressWrapper) {\n _this5.refs.uploadProgressWrapper.style.display = 'none';\n }\n _lodash[\"default\"].set(_this5.webform.form, 'settings.pdf', {\n id: result.data.file,\n src: result.data.filesServer ? \"\".concat(result.data.filesServer).concat(result.data.path) : \"\".concat(new URL(_this5.projectUrl).origin, \"/pdf-proxy\").concat(result.data.path),\n nonFillableConversionUsed: autoConversionComponentsAssigned && result.data.formfields.nonFillableConversionUsed\n });\n _this5.emit('pdfUploaded', result.data);\n _this5.redraw();\n })[\"catch\"](function (err) {\n return _this5.setUploadError(err);\n });\n }\n }, {\n key: \"setUploadError\",\n value: function setUploadError(message) {\n if (!this.refs.uploadError) {\n return;\n }\n this.refs.uploadError.style.display = message ? '' : 'none';\n this.refs.uploadError.innerHTML = message;\n }\n }, {\n key: \"createForm\",\n value: function createForm(options) {\n var _this6 = this;\n // Instantiate the webform from the PDF class instead of Webform\n options.skipInit = false;\n options.hideLoader = true;\n this.webform = new _PDF[\"default\"](this.element, options);\n this.webform.on('attach', function () {\n // If the dropzone exists but has been removed in a PDF rebuild, reinstate it\n if (_this6.refs.iframeDropzone && !_toConsumableArray(_this6.refs.form.children).includes(_this6.refs.iframeDropzone)) {\n _this6.prependTo(_this6.refs.iframeDropzone, _this6.refs.form);\n }\n });\n return this.webform;\n }\n }, {\n key: \"destroy\",\n value: function destroy(deleteFromGlobal) {\n _get(_getPrototypeOf(PDFBuilder.prototype), \"destroy\", this).call(this, deleteFromGlobal);\n this.webform.destroy(deleteFromGlobal);\n }\n\n // d8b 8888888888 888\n // Y8P 888 888\n // 888 888\n // 888 8888888 888d888 8888b. 88888b.d88b. .d88b. .d88b. 888 888 .d88b. 88888b. 888888 .d8888b\n // 888 888 888P\" \"88b 888 \"888 \"88b d8P Y8b d8P Y8b 888 888 d8P Y8b 888 \"88b 888 88K\n // 888 888 888 .d888888 888 888 888 88888888 88888888 Y88 88P 88888888 888 888 888 \"Y8888b.\n // 888 888 888 888 888 888 888 888 Y8b. Y8b. Y8bd8P Y8b. 888 888 Y88b. X88\n // 888 888 888 \"Y888888 888 888 888 \"Y8888 \"Y8888 Y88P \"Y8888 888 888 \"Y888 88888P'\n }, {\n key: \"getParentContainer\",\n value: function getParentContainer(component) {\n var container = [];\n var originalComponent = null;\n (0, _formUtils.eachComponent)(this.webform._form.components, function (comp, path, components) {\n if (comp.id === component.component.id) {\n container = components;\n originalComponent = comp;\n return true;\n }\n }, true);\n return {\n formioComponent: component.parent,\n formioContainer: container,\n originalComponent: originalComponent\n };\n }\n }, {\n key: \"initIframeEvents\",\n value: function initIframeEvents() {\n var _this7 = this;\n this.webform.off('iframe-elementUpdate');\n this.webform.off('iframe-componentUpdate');\n this.webform.off('iframe-componentClick');\n this.webform.on('iframe-elementUpdate', function (schema) {\n var component = _this7.webform.getComponentById(schema.id);\n if (component && component.component) {\n var isNew = true;\n component.component.overlay = {\n page: schema.page,\n left: schema.left,\n top: schema.top,\n height: schema.height,\n width: schema.width\n };\n if (!_this7.options.noNewEdit && !component.component.noNewEdit) {\n _this7.editComponent(component.component, _this7.getParentContainer(component), isNew);\n }\n _this7.emit('updateComponent', component.component);\n }\n return component;\n });\n this.webform.on('iframe-componentUpdate', function (schema) {\n var component = _this7.webform.getComponentById(schema.id);\n if (component && component.component) {\n component.component.overlay = {\n page: schema.overlay.page,\n left: schema.overlay.left,\n top: schema.overlay.top,\n height: schema.overlay.height,\n width: schema.overlay.width\n };\n _this7.emit('updateComponent', component.component);\n _this7.emit('change', _this7.form);\n }\n return component;\n });\n this.webform.on('iframe-componentClick', function (schema) {\n var component = _this7.webform.getComponentById(schema.id);\n if (component) {\n _this7.editComponent(component.component, _this7.getParentContainer(component));\n }\n }, true);\n }\n\n // 8888888b. 888 d8b\n // 888 \"Y88b 888 Y8P\n // 888 888 888\n // 888 888 888d888 .d88b. 88888b. 88888888 .d88b. 88888b. .d88b. 888 .d88b. .d88b. 888 .d8888b\n // 888 888 888P\" d88\"\"88b 888 \"88b d88P d88\"\"88b 888 \"88b d8P Y8b 888 d88\"\"88b d88P\"88b 888 d88P\"\n // 888 888 888 888 888 888 888 d88P 888 888 888 888 88888888 888 888 888 888 888 888 888\n // 888 .d88P 888 Y88..88P 888 d88P d88P Y88..88P 888 888 Y8b. 888 Y88..88P Y88b 888 888 Y88b.\n // 8888888P\" 888 \"Y88P\" 88888P\" 88888888 \"Y88P\" 888 888 \"Y8888 888 \"Y88P\" \"Y88888 888 \"Y8888P\n // 888 888\n // 888 Y8b d88P\n // 888 \"Y88P\"\n }, {\n key: \"initDropzoneEvents\",\n value: function initDropzoneEvents() {\n if (!this.refs.iframeDropzone) {\n return;\n }\n // This is required per HTML spec in order for the drop event to fire\n this.removeEventListener(this.refs.iframeDropzone, 'dragover');\n this.removeEventListener(this.refs.iframeDropzone, 'drop');\n this.addEventListener(this.refs.iframeDropzone, 'dragover', function (e) {\n e.preventDefault();\n return false;\n });\n this.addEventListener(this.refs.iframeDropzone, 'drop', this.onDropzoneDrop.bind(this));\n }\n }, {\n key: \"updateDragAndDrop\",\n value: function updateDragAndDrop() {\n if (!this.pdfLoaded) {\n return;\n }\n this.initDropzoneEvents();\n this.prepSidebarComponentsForDrag();\n }\n }, {\n key: \"prepSidebarComponentsForDrag\",\n value: function prepSidebarComponentsForDrag() {\n var _this8 = this;\n if (!this.refs['sidebar-container']) {\n return;\n }\n this.refs['sidebar-container'].forEach(function (container) {\n _toConsumableArray(container.children).forEach(function (el) {\n el.draggable = true;\n el.setAttribute('draggable', true);\n _this8.removeEventListener(el, 'dragstart');\n _this8.removeEventListener(el, 'dragend');\n _this8.addEventListener(el, 'dragstart', _this8.onDragStart.bind(_this8), true);\n _this8.addEventListener(el, 'dragend', _this8.onDragEnd.bind(_this8), true);\n _this8.addEventListener(el, 'drag', function (e) {\n e.target.style.cursor = 'none';\n });\n });\n });\n }\n }, {\n key: \"updateDropzoneDimensions\",\n value: function updateDropzoneDimensions() {\n if (!this.refs.iframeDropzone) {\n return;\n }\n var iframeRect = (0, _utils.getElementRect)(this.webform.refs.iframeContainer);\n this.refs.iframeDropzone.style.height = iframeRect && iframeRect.height ? \"\".concat(iframeRect.height, \"px\") : '1000px';\n this.refs.iframeDropzone.style.width = iframeRect && iframeRect.width ? \"\".concat(iframeRect.width, \"px\") : '100%';\n }\n }, {\n key: \"onDragStart\",\n value: function onDragStart(e) {\n // Taking the current offset of a dragged item relative to the cursor\n var _e$offsetX = e.offsetX,\n offsetX = _e$offsetX === void 0 ? 0 : _e$offsetX,\n _e$offsetY = e.offsetY,\n offsetY = _e$offsetY === void 0 ? 0 : _e$offsetY;\n this.itemOffsetX = offsetX;\n this.itemOffsetY = offsetY;\n e.dataTransfer.setData('text', '');\n this.updateDropzoneDimensions();\n this.addClass(this.refs.iframeDropzone, 'enabled');\n this.dropEmitted = false;\n }\n }, {\n key: \"onDropzoneDrop\",\n value: function onDropzoneDrop(e) {\n this.dropEmitted = true;\n this.dropEvent = e;\n e.preventDefault();\n return false;\n }\n }, {\n key: \"onDragEnd\",\n value: function onDragEnd(e) {\n // IMPORTANT - must retrieve offsets BEFORE disabling the dropzone - offsets will\n // reflect absolute positioning if accessed after the target element is hidden\n var iframeRect = this.webform.refs.iframeContainer.getBoundingClientRect();\n var layerX = this.dropEvent ? this.dropEvent.layerX : null;\n var layerY = this.dropEvent ? this.dropEvent.layerY : null;\n var WIDTH = 100;\n var HEIGHT = 20;\n // Always disable the dropzone on drag end\n this.removeClass(this.refs.iframeDropzone, 'enabled');\n\n // If there hasn't been a drop event on the dropzone, we're done\n if (!this.dropEvent) {\n // a 'drop' event may not be emited in the chrome browser when using a Mac, therefore an additional check has been added\n // eslint-disable-next-line no-undef\n if (!this.dropEmitted && (0, _utils.getBrowserInfo)().chrome && globalThis.navigator.userAgentData.platform === 'macOS' && iframeRect.left < e.clientX && iframeRect.top < e.clientY) {\n this.dropEvent = e;\n this.dropEvent.dataTransfer.effectAllowed = 'all';\n this.dropEmitted = true;\n } else {\n return;\n }\n }\n var element = e.target;\n var type = element.getAttribute('data-type');\n var key = element.getAttribute('data-key');\n var group = element.getAttribute('data-group');\n var schema = (0, _utils.fastCloneDeep)(this.schemas[type]);\n if (key && group) {\n var info = this.getComponentInfo(key, group);\n _lodash[\"default\"].merge(schema, info);\n }\n\n // Set a unique key for this component.\n _builder[\"default\"].uniquify([this.webform._form], schema);\n this.webform._form.components.push(schema);\n schema.overlay = {\n top: layerY ? layerY - this.itemOffsetY + HEIGHT : e.clientY - iframeRect.top - (this.itemOffsetY - HEIGHT) * 2,\n left: layerX ? layerX - this.itemOffsetX : e.clientX - iframeRect.left - this.itemOffsetX * 2,\n width: WIDTH,\n height: HEIGHT\n };\n this.webform.addComponent(schema, {}, null, true);\n this.webform.postMessage({\n name: 'addElement',\n data: schema\n });\n this.emit('addComponent', schema, this.webform, schema.key, this.webform.component.components.length, !this.options.noNewEdit && !schema.noNewEdit);\n\n // Delete the stored drop event now that it's been handled\n this.dropEvent = null;\n e.target.style.cursor = 'default';\n }\n }, {\n key: \"highlightInvalidComponents\",\n value: function highlightInvalidComponents() {\n var _this9 = this;\n var repeatablePaths = this.findRepeatablePaths();\n\n // update elements which path was duplicated if any pathes have been changed\n if (!_lodash[\"default\"].isEqual(this.repeatablePaths, repeatablePaths)) {\n (0, _formUtils.eachComponent)(this.webform.getComponents(), function (comp, path) {\n if (_this9.repeatablePaths.includes(path)) {\n _this9.webform.postMessage({\n name: 'updateElement',\n data: comp.component\n });\n }\n });\n this.repeatablePaths = repeatablePaths;\n }\n if (!repeatablePaths.length) {\n return;\n }\n (0, _formUtils.eachComponent)(this.webform.getComponents(), function (comp, path) {\n if (_this9.repeatablePaths.includes(path)) {\n _this9.webform.postMessage({\n name: 'showBuilderErrors',\n data: {\n compId: comp.component.id,\n errorMessage: \"API Key is not unique: \".concat(comp.key)\n }\n });\n }\n });\n }\n }]);\n return PDFBuilder;\n}(_WebformBuilder2[\"default\"]);\nexports[\"default\"] = PDFBuilder;\n\n//# sourceURL=webpack://Formio/./lib/PDFBuilder.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.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.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.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.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.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/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/web.url.js */ \"./node_modules/core-js/modules/web.url.js\");\n__webpack_require__(/*! core-js/modules/web.url-search-params.js */ \"./node_modules/core-js/modules/web.url-search-params.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.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/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/esnext.global-this.js */ \"./node_modules/core-js/modules/esnext.global-this.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 _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 _WebformBuilder2 = _interopRequireDefault(__webpack_require__(/*! ./WebformBuilder */ \"./lib/WebformBuilder.js\"));\nvar _utils = __webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\");\nvar _formUtils = __webpack_require__(/*! ./utils/formUtils */ \"./lib/utils/formUtils.js\");\nvar _builder = _interopRequireDefault(__webpack_require__(/*! ./utils/builder */ \"./lib/utils/builder.js\"));\nvar _PDF = _interopRequireDefault(__webpack_require__(/*! ./PDF */ \"./lib/PDF.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": 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 _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 PDFBuilder = /*#__PURE__*/function (_WebformBuilder) {\n _inherits(PDFBuilder, _WebformBuilder);\n var _super = _createSuper(PDFBuilder);\n function PDFBuilder() {\n var _this;\n _classCallCheck(this, PDFBuilder);\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\n // Force superclass to skip the automatic init; we'll trigger it manually\n options.skipInit = true;\n options.display = 'pdf';\n if (element) {\n _this = _super.call(this, element, options);\n } else {\n _this = _super.call(this, options);\n }\n _this.dragDropEnabled = false;\n return _possibleConstructorReturn(_this);\n }\n _createClass(PDFBuilder, [{\n key: \"defaultGroups\",\n get: function get() {\n return {\n pdf: {\n title: 'PDF Fields',\n weight: 0,\n \"default\": true,\n components: {\n textfield: true,\n number: true,\n password: true,\n email: true,\n phoneNumber: true,\n currency: true,\n checkbox: true,\n signature: true,\n select: true,\n textarea: true,\n datetime: true,\n file: true,\n htmlelement: true,\n signrequestsignature: true\n }\n },\n basic: false,\n advanced: false,\n layout: false,\n data: false,\n premium: false,\n resource: false\n };\n }\n }, {\n key: \"hasPDF\",\n get: function get() {\n return _lodash[\"default\"].has(this.webform.form, 'settings.pdf');\n }\n }, {\n key: \"projectUrl\",\n get: function get() {\n return this.options.projectUrl || _Formio.GlobalFormio.getProjectUrl();\n }\n }, {\n key: \"init\",\n value: function init() {\n this.options.attachMode = 'builder';\n this.webform = this.webform || this.createForm(this.options);\n this.webform.init();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n var result = this.renderTemplate('pdfBuilder', {\n sidebar: this.renderTemplate('builderSidebar', {\n scrollEnabled: this.sideBarScroll,\n groupOrder: this.groupOrder,\n groupId: \"builder-sidebar-\".concat(this.id),\n groups: this.groupOrder.map(function (groupKey) {\n return _this2.renderTemplate('builderSidebarGroup', {\n group: _this2.groups[groupKey],\n groupKey: groupKey,\n groupId: \"builder-sidebar-\".concat(_this2.id),\n subgroups: _this2.groups[groupKey].subgroups.map(function (group) {\n return _this2.renderTemplate('builderSidebarGroup', {\n group: group,\n groupKey: group.key,\n groupId: \"group-container-\".concat(groupKey),\n subgroups: []\n });\n })\n });\n })\n }),\n form: this.hasPDF ? this.webform.render() : this.renderTemplate('pdfBuilderUpload', {})\n });\n return result;\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this3 = this;\n // PDF Upload\n if (!this.hasPDF) {\n this.loadRefs(element, {\n 'fileDrop': 'single',\n 'fileBrowse': 'single',\n 'hiddenFileInputElement': 'single',\n 'uploadError': 'single',\n 'uploadProgress': 'single',\n 'uploadProgressWrapper': 'single',\n 'dragDropText': 'single'\n });\n this.addEventListener(this.refs['pdf-upload-button'], 'click', function (event) {\n event.preventDefault();\n });\n\n // Init the upload error.\n if (!this.projectUrl) {\n this.setUploadError('Form options.projectUrl not set. Please set the \"projectUrl\" property of the options for this form or use Formio.setProjectUrl(). This setting is necessary to upload a pdf background.');\n } else {\n this.setUploadError();\n }\n if (this.refs.fileDrop) {\n var _element = this;\n this.addEventListener(this.refs.fileDrop, 'dragover', function (event) {\n this.className = 'fileSelector fileDragOver';\n event.preventDefault();\n });\n this.addEventListener(this.refs.fileDrop, 'dragleave', function (event) {\n this.className = 'fileSelector';\n event.preventDefault();\n });\n this.addEventListener(this.refs.fileDrop, 'drop', function (event) {\n this.className = 'fileSelector';\n event.preventDefault();\n _element.upload(event.dataTransfer.files[0]);\n return false;\n });\n }\n if (this.refs.fileBrowse && this.refs.hiddenFileInputElement) {\n this.addEventListener(this.refs.fileBrowse, 'click', function (event) {\n event.preventDefault();\n // There is no direct way to trigger a file dialog. To work around this, create an input of type file and trigger\n // a click event on it.\n if (typeof _this3.refs.hiddenFileInputElement.trigger === 'function') {\n _this3.refs.hiddenFileInputElement.trigger('click');\n } else {\n _this3.refs.hiddenFileInputElement.click();\n }\n });\n this.addEventListener(this.refs.hiddenFileInputElement, 'change', function () {\n if (!_this3.refs.hiddenFileInputElement.value) {\n return;\n }\n _this3.upload(_this3.refs.hiddenFileInputElement.files[0]);\n _this3.refs.hiddenFileInputElement.value = '';\n });\n }\n return _nativePromiseOnly[\"default\"].resolve();\n }\n\n // Normal PDF Builder\n return _get(_getPrototypeOf(PDFBuilder.prototype), \"attach\", this).call(this, element).then(function () {\n _this3.loadRefs(_this3.element, {\n iframeDropzone: 'single',\n 'sidebar-container': 'multiple',\n 'sidebar': 'single'\n });\n _this3.afterAttach();\n return _this3.element;\n });\n }\n }, {\n key: \"afterAttach\",\n value: function afterAttach() {\n var _this4 = this;\n this.on('saveComponent', function (component) {\n _this4.webform.postMessage({\n name: 'updateElement',\n data: component\n });\n });\n this.on('removeComponent', function (component) {\n _this4.webform.postMessage({\n name: 'removeElement',\n data: component\n });\n });\n this.initIframeEvents();\n this.updateDropzoneDimensions();\n var sidebar = this.refs.sidebar;\n if (sidebar) {\n this.addClass(sidebar, 'disabled');\n this.webform.on('iframe-ready', function () {\n _this4.pdfLoaded = true;\n _this4.updateDragAndDrop();\n _this4.removeClass(sidebar, 'disabled');\n }, true);\n }\n }\n }, {\n key: \"upload\",\n value: function upload(file) {\n var _this5 = this;\n var formio = new _Formio.GlobalFormio(this.projectUrl);\n if (this.refs.dragDropText) {\n this.refs.dragDropText.style.display = 'none';\n }\n if (this.refs.uploadProgressWrapper) {\n this.refs.uploadProgressWrapper.style.display = 'inherit';\n }\n formio.uploadFile('url', file, file, '', function (event) {\n if (_this5.refs.uploadProgress) {\n var progress = Math.floor(event.loaded / event.total * 100);\n _this5.refs.uploadProgress.style.width = \"\".concat(progress, \"%\");\n if (progress > 98) {\n _this5.refs.uploadProgress.innerHTML = _this5.t('Converting PDF. Please wait.');\n } else {\n _this5.refs.uploadProgress.innerHTML = \"\".concat(_this5.t('Uploading'), \" \").concat(progress, \"%\");\n }\n }\n }, \"\".concat(this.projectUrl, \"/upload\"), {}, 'file').then(function (result) {\n var _result$data$formfiel;\n var autoConversionComponentsAssigned = false;\n if ((_result$data$formfiel = result.data.formfields) !== null && _result$data$formfiel !== void 0 && _result$data$formfiel.components && result.data.formfields.components.length) {\n var _this5$webform$form$c, _this5$webform$form$c2, _this5$webform$form$c3;\n var formInitState = ((_this5$webform$form$c = _this5.webform.form.components[0]) === null || _this5$webform$form$c === void 0 ? void 0 : _this5$webform$form$c.key) === 'submit';\n var wizardInitState = ((_this5$webform$form$c2 = _this5.webform.form.components[0]) === null || _this5$webform$form$c2 === void 0 ? void 0 : _this5$webform$form$c2.key) === 'page1' && ((_this5$webform$form$c3 = _this5.webform.form.components[0]) === null || _this5$webform$form$c3 === void 0 ? void 0 : _this5$webform$form$c3.components.length) === 0;\n var emptyFormState = _this5.webform.form.components.length === 0;\n if (formInitState || wizardInitState || emptyFormState) {\n autoConversionComponentsAssigned = true;\n _this5.webform.form.components = result.data.formfields.components;\n }\n }\n if (_this5.refs.dragDropText) {\n _this5.refs.dragDropText.style.display = 'inherit';\n }\n if (_this5.refs.uploadProgressWrapper) {\n _this5.refs.uploadProgressWrapper.style.display = 'none';\n }\n _lodash[\"default\"].set(_this5.webform.form, 'settings.pdf', {\n id: result.data.file,\n src: result.data.filesServer ? \"\".concat(result.data.filesServer).concat(result.data.path) : \"\".concat(new URL(_this5.projectUrl).origin, \"/pdf-proxy\").concat(result.data.path),\n nonFillableConversionUsed: autoConversionComponentsAssigned && result.data.formfields.nonFillableConversionUsed\n });\n _this5.emit('pdfUploaded', result.data);\n _this5.redraw();\n })[\"catch\"](function (err) {\n return _this5.setUploadError(err);\n });\n }\n }, {\n key: \"setUploadError\",\n value: function setUploadError(message) {\n if (!this.refs.uploadError) {\n return;\n }\n this.refs.uploadError.style.display = message ? '' : 'none';\n this.refs.uploadError.innerHTML = message;\n }\n }, {\n key: \"createForm\",\n value: function createForm(options) {\n var _this6 = this;\n // Instantiate the webform from the PDF class instead of Webform\n options.skipInit = false;\n options.hideLoader = true;\n this.webform = new _PDF[\"default\"](this.element, options);\n this.webform.on('attach', function () {\n // If the dropzone exists but has been removed in a PDF rebuild, reinstate it\n if (_this6.refs.iframeDropzone && !_toConsumableArray(_this6.refs.form.children).includes(_this6.refs.iframeDropzone)) {\n _this6.prependTo(_this6.refs.iframeDropzone, _this6.refs.form);\n }\n });\n return this.webform;\n }\n }, {\n key: \"destroy\",\n value: function destroy(deleteFromGlobal) {\n _get(_getPrototypeOf(PDFBuilder.prototype), \"destroy\", this).call(this, deleteFromGlobal);\n this.webform.destroy(deleteFromGlobal);\n }\n\n // d8b 8888888888 888\n // Y8P 888 888\n // 888 888\n // 888 8888888 888d888 8888b. 88888b.d88b. .d88b. .d88b. 888 888 .d88b. 88888b. 888888 .d8888b\n // 888 888 888P\" \"88b 888 \"888 \"88b d8P Y8b d8P Y8b 888 888 d8P Y8b 888 \"88b 888 88K\n // 888 888 888 .d888888 888 888 888 88888888 88888888 Y88 88P 88888888 888 888 888 \"Y8888b.\n // 888 888 888 888 888 888 888 888 Y8b. Y8b. Y8bd8P Y8b. 888 888 Y88b. X88\n // 888 888 888 \"Y888888 888 888 888 \"Y8888 \"Y8888 Y88P \"Y8888 888 888 \"Y888 88888P'\n }, {\n key: \"getParentContainer\",\n value: function getParentContainer(component) {\n var container = [];\n var originalComponent = null;\n (0, _formUtils.eachComponent)(this.webform._form.components, function (comp, path, components) {\n if (comp.id === component.component.id) {\n container = components;\n originalComponent = comp;\n return true;\n }\n }, true);\n return {\n formioComponent: component.parent,\n formioContainer: container,\n originalComponent: originalComponent\n };\n }\n }, {\n key: \"initIframeEvents\",\n value: function initIframeEvents() {\n var _this7 = this;\n this.webform.off('iframe-elementUpdate');\n this.webform.off('iframe-componentUpdate');\n this.webform.off('iframe-componentClick');\n this.webform.on('iframe-elementUpdate', function (schema) {\n var component = _this7.webform.getComponentById(schema.id);\n if (component && component.component) {\n var isNew = true;\n component.component.overlay = {\n page: schema.page,\n left: schema.left,\n top: schema.top,\n height: schema.height,\n width: schema.width\n };\n if (!_this7.options.noNewEdit && !component.component.noNewEdit) {\n _this7.editComponent(component.component, _this7.getParentContainer(component), isNew);\n }\n _this7.emit('updateComponent', component.component);\n }\n return component;\n });\n this.webform.on('iframe-componentUpdate', function (schema) {\n var component = _this7.webform.getComponentById(schema.id);\n if (component && component.component) {\n component.component.overlay = {\n page: schema.overlay.page,\n left: schema.overlay.left,\n top: schema.overlay.top,\n height: schema.overlay.height,\n width: schema.overlay.width\n };\n _this7.emit('updateComponent', component.component);\n _this7.emit('change', _this7.form);\n }\n return component;\n });\n this.webform.on('iframe-componentClick', function (schema) {\n var component = _this7.webform.getComponentById(schema.id);\n if (component) {\n _this7.editComponent(component.component, _this7.getParentContainer(component));\n }\n }, true);\n }\n\n // 8888888b. 888 d8b\n // 888 \"Y88b 888 Y8P\n // 888 888 888\n // 888 888 888d888 .d88b. 88888b. 88888888 .d88b. 88888b. .d88b. 888 .d88b. .d88b. 888 .d8888b\n // 888 888 888P\" d88\"\"88b 888 \"88b d88P d88\"\"88b 888 \"88b d8P Y8b 888 d88\"\"88b d88P\"88b 888 d88P\"\n // 888 888 888 888 888 888 888 d88P 888 888 888 888 88888888 888 888 888 888 888 888 888\n // 888 .d88P 888 Y88..88P 888 d88P d88P Y88..88P 888 888 Y8b. 888 Y88..88P Y88b 888 888 Y88b.\n // 8888888P\" 888 \"Y88P\" 88888P\" 88888888 \"Y88P\" 888 888 \"Y8888 888 \"Y88P\" \"Y88888 888 \"Y8888P\n // 888 888\n // 888 Y8b d88P\n // 888 \"Y88P\"\n }, {\n key: \"initDropzoneEvents\",\n value: function initDropzoneEvents() {\n if (!this.refs.iframeDropzone) {\n return;\n }\n // This is required per HTML spec in order for the drop event to fire\n this.removeEventListener(this.refs.iframeDropzone, 'dragover');\n this.removeEventListener(this.refs.iframeDropzone, 'drop');\n this.addEventListener(this.refs.iframeDropzone, 'dragover', function (e) {\n e.preventDefault();\n return false;\n });\n this.addEventListener(this.refs.iframeDropzone, 'drop', this.onDropzoneDrop.bind(this));\n }\n }, {\n key: \"updateDragAndDrop\",\n value: function updateDragAndDrop() {\n if (!this.pdfLoaded) {\n return;\n }\n this.initDropzoneEvents();\n this.prepSidebarComponentsForDrag();\n }\n }, {\n key: \"prepSidebarComponentsForDrag\",\n value: function prepSidebarComponentsForDrag() {\n var _this8 = this;\n if (!this.refs['sidebar-container']) {\n return;\n }\n this.refs['sidebar-container'].forEach(function (container) {\n _toConsumableArray(container.children).forEach(function (el) {\n el.draggable = true;\n el.setAttribute('draggable', true);\n _this8.removeEventListener(el, 'dragstart');\n _this8.removeEventListener(el, 'dragend');\n _this8.addEventListener(el, 'dragstart', _this8.onDragStart.bind(_this8), true);\n _this8.addEventListener(el, 'dragend', _this8.onDragEnd.bind(_this8), true);\n _this8.addEventListener(el, 'drag', function (e) {\n e.target.style.cursor = 'none';\n });\n });\n });\n }\n }, {\n key: \"updateDropzoneDimensions\",\n value: function updateDropzoneDimensions() {\n if (!this.refs.iframeDropzone) {\n return;\n }\n var iframeRect = (0, _utils.getElementRect)(this.webform.refs.iframeContainer);\n this.refs.iframeDropzone.style.height = iframeRect && iframeRect.height ? \"\".concat(iframeRect.height, \"px\") : '1000px';\n this.refs.iframeDropzone.style.width = iframeRect && iframeRect.width ? \"\".concat(iframeRect.width, \"px\") : '100%';\n }\n }, {\n key: \"onDragStart\",\n value: function onDragStart(e) {\n // Taking the current offset of a dragged item relative to the cursor\n var _e$offsetX = e.offsetX,\n offsetX = _e$offsetX === void 0 ? 0 : _e$offsetX,\n _e$offsetY = e.offsetY,\n offsetY = _e$offsetY === void 0 ? 0 : _e$offsetY;\n this.itemOffsetX = offsetX;\n this.itemOffsetY = offsetY;\n e.dataTransfer.setData('text', '');\n this.updateDropzoneDimensions();\n this.addClass(this.refs.iframeDropzone, 'enabled');\n this.dropEmitted = false;\n }\n }, {\n key: \"onDropzoneDrop\",\n value: function onDropzoneDrop(e) {\n this.dropEmitted = true;\n this.dropEvent = e;\n e.preventDefault();\n return false;\n }\n }, {\n key: \"onDragEnd\",\n value: function onDragEnd(e) {\n // IMPORTANT - must retrieve offsets BEFORE disabling the dropzone - offsets will\n // reflect absolute positioning if accessed after the target element is hidden\n var iframeRect = this.webform.refs.iframeContainer.getBoundingClientRect();\n var layerX = this.dropEvent ? this.dropEvent.layerX : null;\n var layerY = this.dropEvent ? this.dropEvent.layerY : null;\n var WIDTH = 100;\n var HEIGHT = 20;\n // Always disable the dropzone on drag end\n this.removeClass(this.refs.iframeDropzone, 'enabled');\n\n // If there hasn't been a drop event on the dropzone, we're done\n if (!this.dropEvent) {\n // a 'drop' event may not be emited in the chrome browser when using a Mac, therefore an additional check has been added\n // eslint-disable-next-line no-undef\n if (!this.dropEmitted && ((0, _utils.getBrowserInfo)().chrome || (0, _utils.getBrowserInfo)().edge) && globalThis.navigator.userAgentData.platform === 'macOS' && iframeRect.left < e.clientX && iframeRect.top < e.clientY) {\n this.dropEvent = e;\n this.dropEvent.dataTransfer.effectAllowed = 'all';\n this.dropEmitted = true;\n } else {\n return;\n }\n }\n var element = e.target;\n var type = element.getAttribute('data-type');\n var key = element.getAttribute('data-key');\n var group = element.getAttribute('data-group');\n var schema = (0, _utils.fastCloneDeep)(this.schemas[type]);\n if (key && group) {\n var info = this.getComponentInfo(key, group);\n _lodash[\"default\"].merge(schema, info);\n }\n\n // Set a unique key for this component.\n _builder[\"default\"].uniquify([this.webform._form], schema);\n this.webform._form.components.push(schema);\n schema.overlay = {\n top: layerY ? layerY - this.itemOffsetY + HEIGHT : e.clientY - iframeRect.top - (this.itemOffsetY - HEIGHT) * 2,\n left: layerX ? layerX - this.itemOffsetX : e.clientX - iframeRect.left - this.itemOffsetX * 2,\n width: WIDTH,\n height: HEIGHT\n };\n this.webform.addComponent(schema, {}, null, true);\n this.webform.postMessage({\n name: 'addElement',\n data: schema\n });\n this.emit('addComponent', schema, this.webform, schema.key, this.webform.component.components.length, !this.options.noNewEdit && !schema.noNewEdit);\n\n // Delete the stored drop event now that it's been handled\n this.dropEvent = null;\n e.target.style.cursor = 'default';\n }\n }, {\n key: \"highlightInvalidComponents\",\n value: function highlightInvalidComponents() {\n var _this9 = this;\n var repeatablePaths = this.findRepeatablePaths();\n\n // update elements which path was duplicated if any pathes have been changed\n if (!_lodash[\"default\"].isEqual(this.repeatablePaths, repeatablePaths)) {\n (0, _formUtils.eachComponent)(this.webform.getComponents(), function (comp, path) {\n if (_this9.repeatablePaths.includes(path)) {\n _this9.webform.postMessage({\n name: 'updateElement',\n data: comp.component\n });\n }\n });\n this.repeatablePaths = repeatablePaths;\n }\n if (!repeatablePaths.length) {\n return;\n }\n (0, _formUtils.eachComponent)(this.webform.getComponents(), function (comp, path) {\n if (_this9.repeatablePaths.includes(path)) {\n _this9.webform.postMessage({\n name: 'showBuilderErrors',\n data: {\n compId: comp.component.id,\n errorMessage: \"API Key is not unique: \".concat(comp.key)\n }\n });\n }\n });\n }\n }]);\n return PDFBuilder;\n}(_WebformBuilder2[\"default\"]);\nexports[\"default\"] = PDFBuilder;\n\n//# sourceURL=webpack://Formio/./lib/PDFBuilder.js?"); /***/ }), @@ -125,7 +125,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.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.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\");\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.sort.js */ \"./node_modules/core-js/modules/es.array.sort.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.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.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.function.name.js */ \"./node_modules/core-js/modules/es.function.name.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.keys.js */ \"./node_modules/core-js/modules/es.object.keys.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.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.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.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.slice.js */ \"./node_modules/core-js/modules/es.array.slice.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.array.join.js */ \"./node_modules/core-js/modules/es.array.join.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.find.js */ \"./node_modules/core-js/modules/es.array.find.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.some.js */ \"./node_modules/core-js/modules/es.array.some.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.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.map.js */ \"./node_modules/core-js/modules/es.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.string.starts-with.js */ \"./node_modules/core-js/modules/es.string.starts-with.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.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 _Webform = _interopRequireDefault(__webpack_require__(/*! ./Webform */ \"./lib/Webform.js\"));\nvar _Component2 = _interopRequireDefault(__webpack_require__(/*! ./components/_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _tippy = _interopRequireDefault(__webpack_require__(/*! tippy.js */ \"./node_modules/tippy.js/dist/tippy.esm.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 _Formio = __webpack_require__(/*! ./Formio */ \"./lib/Formio.js\");\nvar _utils = __webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\");\nvar _formUtils = __webpack_require__(/*! ./utils/formUtils */ \"./lib/utils/formUtils.js\");\nvar _builder = _interopRequireDefault(__webpack_require__(/*! ./utils/builder */ \"./lib/utils/builder.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _domAutoscroller = _interopRequireDefault(__webpack_require__(/*! dom-autoscroller */ \"./node_modules/dom-autoscroller/dist/bundle.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 _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 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__webpack_require__(/*! ./components/builder */ \"./lib/components/builder.js\");\nvar Templates = _Formio.GlobalFormio.Templates;\nif (!Templates) {\n Templates = (__webpack_require__(/*! ./templates/Templates */ \"./lib/templates/Templates.js\")[\"default\"]);\n}\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 WebformBuilder = /*#__PURE__*/function (_Component) {\n _inherits(WebformBuilder, _Component);\n var _super = _createSuper(WebformBuilder);\n // eslint-disable-next-line max-statements\n function WebformBuilder() {\n var _this;\n _classCallCheck(this, WebformBuilder);\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 // Reset skipInit in case PDFBuilder has set it.\n options.skipInit = false;\n options.display = options.display || 'form';\n _this = _super.call(this, null, options);\n _defineProperty(_assertThisInitialized(_this), \"moveHandler\", function (e) {\n e.stopPropagation();\n e.preventDefault();\n if (e.keyCode === 38) {\n _this.updateComponentPlacement(true);\n }\n if (e.keyCode === 40) {\n _this.updateComponentPlacement(false);\n }\n if (e.keyCode === 13) {\n _this.stopMoving(_this.selectedElement);\n }\n });\n _this.element = element;\n _this.builderHeight = 0;\n _this.schemas = {};\n _this.repeatablePaths = [];\n _this.sideBarScroll = _lodash[\"default\"].get(_this.options, 'sideBarScroll', true);\n _this.sideBarScrollOffset = _lodash[\"default\"].get(_this.options, 'sideBarScrollOffset', 0);\n _this.dragDropEnabled = true;\n\n // Setup the builder options.\n _this.builder = _lodash[\"default\"].defaultsDeep({}, _this.options.builder, _this.defaultGroups);\n\n // Turn off if explicitely said to do so...\n _lodash[\"default\"].each(_this.defaultGroups, function (config, key) {\n if (config === false) {\n _this.builder[key] = false;\n }\n });\n\n // Add the groups.////\n _this.groups = {};\n _this.groupOrder = [];\n var _loop = function _loop(group) {\n if (_this.builder[group]) {\n _this.builder[group].key = group;\n _this.groups[group] = _this.builder[group];\n _this.groups[group].components = _this.groups[group].components || {};\n _this.groups[group].componentOrder = _this.groups[group].componentOrder || [];\n _this.groups[group].subgroups = Object.keys(_this.groups[group].groups || {}).map(function (groupKey) {\n _this.groups[group].groups[groupKey].componentOrder = Object.keys(_this.groups[group].groups[groupKey].components).map(function (key) {\n return key;\n });\n return _this.groups[group].groups[groupKey];\n });\n _this.groupOrder.push(_this.groups[group]);\n }\n };\n for (var group in _this.builder) {\n _loop(group);\n }\n _this.groupOrder = _this.groupOrder.filter(function (group) {\n return group && !group.ignore;\n }).sort(function (a, b) {\n return a.weight - b.weight;\n }).map(function (group) {\n return group.key;\n });\n for (var type in _Components[\"default\"].components) {\n var component = _Components[\"default\"].components[type];\n if (component.builderInfo && component.builderInfo.schema) {\n _this.schemas[type] = component.builderInfo.schema;\n component.type = type;\n var builderInfo = component.builderInfo;\n builderInfo.key = component.type;\n _this.addBuilderComponentInfo(builderInfo);\n }\n }\n\n // Filter out any extra components.\n // Add the components in each group.\n for (var _group in _this.groups) {\n var info = _this.groups[_group];\n for (var key in info.components) {\n var compKey = _group === 'resource' ? \"component-\".concat(key) : key;\n var comp = info.components[compKey];\n if (comp === true && _Components[\"default\"].components[key] && _Components[\"default\"].components[key].builderInfo) {\n comp = _Components[\"default\"].components[key].builderInfo;\n }\n if (comp && comp.schema) {\n _this.schemas[key] = comp.schema;\n info.components[compKey] = comp;\n info.components[compKey].key = key;\n } else {\n // Do not include this component in the components array.\n delete info.components[compKey];\n }\n }\n\n // Order the components.\n _this.orderComponents(info);\n }\n _this.options.hooks = _this.options.hooks || {};\n _this.options.hooks.renderComponent = function (html, _ref) {\n var _self$component;\n var component = _ref.component,\n self = _ref.self;\n if (self.type === 'form' && !self.key) {\n var template = _this.hook('renderComponentFormTemplate', html.replace('formio-component-form', ''));\n // The main webform shouldn't have this class as it adds extra styles.\n return template;\n }\n if (_this.options.disabled && _this.options.disabled.includes(self.key) || self.parent.noDragDrop) {\n return html;\n }\n return _this.renderTemplate('builderComponent', {\n html: html,\n disableBuilderActions: self === null || self === void 0 ? void 0 : (_self$component = self.component) === null || _self$component === void 0 ? void 0 : _self$component.disableBuilderActions,\n childComponent: component\n });\n };\n _this.options.hooks.renderComponents = function (html, _ref2) {\n var components = _ref2.components,\n self = _ref2.self;\n // if Datagrid and already has a component, don't make it droppable.\n if (self.type === 'datagrid' && components.length > 0 || self.noDragDrop) {\n return html;\n }\n if (!components || !components.length && !components.nodrop || self.type === 'form' && components.length <= 1 && (components.length === 0 || components[0].type === 'button')) {\n html = _this.renderTemplate('builderPlaceholder', {\n position: 0\n }) + html;\n }\n return _this.renderTemplate('builderComponents', {\n key: self.key,\n type: self.type,\n html: html\n });\n };\n _this.options.hooks.renderInput = function (html, _ref3) {\n var self = _ref3.self;\n if (self.type === 'hidden') {\n return html + self.name;\n }\n return html;\n };\n _this.options.hooks.renderLoading = function (html, _ref4) {\n var self = _ref4.self;\n if (self.type === 'form' && self.key) {\n return self.name;\n }\n return html;\n };\n _this.options.hooks.attachComponents = function (element, components, container, component) {\n // Don't attach if no element was found or component doesn't participate in drag'n'drop.\n if (!element) {\n return;\n }\n if (component.noDragDrop) {\n return element;\n }\n // Attach container and component to element for later reference.\n var containerElement = element.querySelector(\"[ref=\\\"\".concat(component.component.key, \"-container\\\"]\")) || element;\n containerElement.formioContainer = container;\n containerElement.formioComponent = component;\n\n // Add container to draggable list.\n if (_this.dragula && _this.allowDrop(element)) {\n _this.dragula.containers.push(containerElement);\n }\n\n // If this is an existing datagrid element, don't make it draggable.\n if ((component.type === 'datagrid' || component.type === 'datamap') && components.length > 0) {\n return element;\n }\n\n // Since we added a wrapper, need to return the original element so that we can find the components inside it.\n return element.children[0];\n };\n _this.options.hooks.attachDatagrid = function (element, component) {\n component.loadRefs(element, _defineProperty({}, \"\".concat(component.key, \"-container\"), 'single'));\n var dataGridContainer = component.refs[\"\".concat(component.key, \"-container\")];\n if (dataGridContainer) {\n component.attachComponents(dataGridContainer.parentNode, [], component.component.components);\n }\n // Need to set up horizontal rearrangement of fields.\n };\n\n _this.options.hooks.attachComponent = _this.attachComponent.bind(_assertThisInitialized(_this));\n\n // Load resources tagged as 'builder'\n var query = {\n params: {\n type: 'resource',\n limit: 1000000,\n select: '_id,title,name,components'\n }\n };\n if (_this.options && _this.options.resourceTag) {\n query.params.tags = [_this.options.resourceTag];\n } else if (!_this.options || !_this.options.hasOwnProperty('resourceTag')) {\n query.params.tags = ['builder'];\n }\n var formio = new _Formio.GlobalFormio(_Formio.GlobalFormio.projectUrl);\n var isResourcesDisabled = _this.options.builder && _this.options.builder.resource === false;\n formio.loadProject().then(function (project) {\n if (project && (_lodash[\"default\"].get(project, 'settings.addConfigToForms', false) || _lodash[\"default\"].get(project, 'addConfigToForms', false))) {\n var config = project.config || {};\n _this.options.formConfig = config;\n var pathToFormConfig = 'webform._form.config';\n var webformConfig = _lodash[\"default\"].get(_assertThisInitialized(_this), pathToFormConfig);\n if (_this.webform && !webformConfig) {\n _lodash[\"default\"].set(_assertThisInitialized(_this), pathToFormConfig, config);\n }\n }\n })[\"catch\"](function (err) {\n console.warn(\"Could not load project settings: \".concat(err.message || err));\n });\n if (!formio.noProject && !isResourcesDisabled) {\n var resourceOptions = _this.options.builder && _this.options.builder.resource;\n formio.loadForms(query).then(function (resources) {\n if (resources.length) {\n _this.builder.resource = {\n title: resourceOptions ? resourceOptions.title : 'Existing Resource Fields',\n key: 'resource',\n weight: resourceOptions ? resourceOptions.weight : 50,\n subgroups: [],\n components: [],\n componentOrder: []\n };\n _this.groups.resource = {\n title: resourceOptions ? resourceOptions.title : 'Existing Resource Fields',\n key: 'resource',\n weight: resourceOptions ? resourceOptions.weight : 50,\n subgroups: [],\n components: [],\n componentOrder: []\n };\n if (!_this.groupOrder.includes('resource')) {\n _this.groupOrder.push('resource');\n }\n _this.addExistingResourceFields(resources);\n }\n });\n }\n\n // Notify components if they need to modify their render.\n _this.options.attachMode = 'builder';\n _this.webform = _this.webform || _this.createForm(_this.options);\n _this.pathComponentsMapping = {};\n _this.arrayDataComponentPaths = [];\n _this.nestedDataComponents = [];\n _this.arrayDataComponents = [];\n return _this;\n }\n _createClass(WebformBuilder, [{\n key: \"allowDrop\",\n value: function allowDrop() {\n return true;\n }\n }, {\n key: \"addExistingResourceFields\",\n value: function addExistingResourceFields(resources) {\n var _this2 = this;\n _lodash[\"default\"].each(resources, function (resource, index) {\n var resourceKey = \"resource-\".concat(resource.name);\n var subgroup = {\n key: resourceKey,\n title: resource.title,\n components: [],\n componentOrder: [],\n \"default\": index === 0\n };\n (0, _formUtils.eachComponent)(resource.components, function (component) {\n if (component.type === 'button') return;\n if (_this2.options && _this2.options.resourceFilter && (!component.tags || component.tags.indexOf(_this2.options.resourceFilter) === -1)) return;\n var componentName = component.label;\n if (!componentName && component.key) {\n componentName = _lodash[\"default\"].upperFirst(component.key);\n }\n subgroup.componentOrder.push(\"component-\".concat(component.key));\n subgroup.components[\"component-\".concat(component.key)] = _lodash[\"default\"].merge((0, _utils.fastCloneDeep)(_Components[\"default\"].components[component.type] ? _Components[\"default\"].components[component.type].builderInfo : _Components[\"default\"].components['unknown'].builderInfo), {\n key: component.key,\n title: componentName,\n group: 'resource',\n subgroup: resourceKey\n }, {\n schema: _objectSpread(_objectSpread({}, component), {}, {\n label: component.label,\n key: component.key,\n lockKey: true,\n source: !_this2.options.noSource ? resource._id : undefined,\n isNew: true\n })\n });\n }, true);\n _this2.groups.resource.subgroups.push(subgroup);\n });\n this.triggerRedraw();\n }\n }, {\n key: \"attachTooltip\",\n value: function attachTooltip(component, title) {\n return (0, _tippy[\"default\"])(component, {\n allowHTML: true,\n trigger: 'mouseenter focus',\n placement: 'top',\n delay: [200, 0],\n zIndex: 10000,\n content: title\n });\n }\n }, {\n key: \"attachComponent\",\n value: function attachComponent(element, component) {\n var _this3 = this;\n // Add component to element for later reference.\n element.formioComponent = component;\n component.loadRefs(element, {\n removeComponent: 'single',\n editComponent: 'single',\n moveComponent: 'single',\n copyComponent: 'single',\n pasteComponent: 'single',\n editJson: 'single'\n });\n if (component.refs.copyComponent) {\n this.attachTooltip(component.refs.copyComponent, this.t('Copy'));\n component.addEventListener(component.refs.copyComponent, 'click', function () {\n return _this3.copyComponent(component);\n });\n }\n if (component.refs.pasteComponent) {\n var pasteToolTip = this.attachTooltip(component.refs.pasteComponent, this.t('Paste below'));\n component.addEventListener(component.refs.pasteComponent, 'click', function () {\n pasteToolTip.hide();\n _this3.pasteComponent(component);\n });\n }\n if (component.refs.moveComponent) {\n this.attachTooltip(component.refs.moveComponent, this.t('Move'));\n if (this.keyboardActionsEnabled) {\n component.addEventListener(component.refs.moveComponent, 'click', function () {\n _this3.moveComponent(component);\n });\n }\n }\n var parent = this.getParentElement(element);\n if (component.refs.editComponent) {\n this.attachTooltip(component.refs.editComponent, this.t('Edit'));\n component.addEventListener(component.refs.editComponent, 'click', function () {\n return _this3.editComponent(component.schema, parent, false, false, component.component, {\n inDataGrid: component.isInDataGrid\n });\n });\n }\n if (component.refs.editJson) {\n this.attachTooltip(component.refs.editJson, this.t('Edit JSON'));\n component.addEventListener(component.refs.editJson, 'click', function () {\n return _this3.editComponent(component.schema, parent, false, true, component.component);\n });\n }\n if (component.refs.removeComponent) {\n this.attachTooltip(component.refs.removeComponent, this.t('Remove'));\n component.addEventListener(component.refs.removeComponent, 'click', function () {\n return _this3.removeComponent(component.schema, parent, component.component);\n });\n }\n return element;\n }\n }, {\n key: \"createForm\",\n value: function createForm(options) {\n this.webform = new _Webform[\"default\"](this.element, options);\n if (this.element) {\n this.loadRefs(this.element, {\n form: 'single'\n });\n if (this.refs.form) {\n this.webform.element = this.refs.form;\n }\n }\n return this.webform;\n }\n\n /**\n * Called when everything is ready.\n *\n * @returns {Promise} - Wait for webform to be ready.\n */\n }, {\n key: \"ready\",\n get: function get() {\n return this.webform.ready;\n }\n }, {\n key: \"defaultGroups\",\n get: function get() {\n return {\n basic: {\n title: 'Basic',\n weight: 0,\n \"default\": true\n },\n advanced: {\n title: 'Advanced',\n weight: 10\n },\n layout: {\n title: 'Layout',\n weight: 20\n },\n data: {\n title: 'Data',\n weight: 30\n },\n premium: {\n title: 'Premium',\n weight: 40\n }\n };\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n return _Webform[\"default\"].prototype.redraw.call(this);\n }\n }, {\n key: \"form\",\n get: function get() {\n return this.webform.form;\n },\n set: function set(value) {\n this.setForm(value);\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.webform.schema;\n }\n }, {\n key: \"container\",\n get: function get() {\n return this.webform.form.components;\n }\n\n /**\n * When a component sets its api key, we need to check if it is unique within its namespace. Find the namespace root\n * so we can calculate this correctly.\n * @param component\n */\n }, {\n key: \"findNamespaceRoot\",\n value: function findNamespaceRoot(component) {\n var path = (0, _utils.getArrayFromComponentPath)(component.path);\n // First get the component with nested parents.\n var comp = this.webform.getComponent(path);\n comp = Array.isArray(comp) ? comp[0] : comp;\n var namespaceKey = this.recurseNamespace(comp);\n\n // If there is no key, it is the root form.\n if (!namespaceKey || this.form.key === namespaceKey) {\n return this.form.components;\n }\n var componentSchema = component.component;\n // If the current component is the namespace, we don't need to find it again.\n if (namespaceKey === component.key) {\n return [].concat(_toConsumableArray(componentSchema.components), [componentSchema]);\n }\n\n // Get the namespace component so we have the original object.\n var namespaceComponent = (0, _formUtils.getComponent)(this.form.components, namespaceKey, true);\n return namespaceComponent ? namespaceComponent.components : comp.components;\n }\n }, {\n key: \"recurseNamespace\",\n value: function recurseNamespace(component) {\n // If there is no parent, we are at the root level.\n if (!component) {\n return null;\n }\n\n // Some components are their own namespace.\n if (['address', 'container', 'datagrid', 'editgrid', 'dynamicWizard', 'tree'].includes(component.type) || component.tree || component.arrayTree) {\n return component.key;\n }\n\n // Anything else, keep going up.\n return this.recurseNamespace(component.parent);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n return this.renderTemplate('builder', {\n sidebar: this.renderTemplate('builderSidebar', {\n scrollEnabled: this.sideBarScroll,\n groupOrder: this.groupOrder,\n groupId: \"builder-sidebar-\".concat(this.id),\n groups: this.groupOrder.map(function (groupKey) {\n return _this4.renderTemplate('builderSidebarGroup', {\n group: _this4.groups[groupKey],\n groupKey: groupKey,\n groupId: \"builder-sidebar-\".concat(_this4.id),\n subgroups: _this4.groups[groupKey].subgroups.map(function (group) {\n return _this4.renderTemplate('builderSidebarGroup', {\n group: group,\n groupKey: group.key,\n groupId: \"group-container-\".concat(groupKey),\n subgroups: []\n });\n }),\n keyboardActionsEnabled: _this4.keyboardActionsEnabled\n });\n })\n }),\n form: this.webform.render()\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this5 = this;\n this.on('change', function (form) {\n _this5.populateRecaptchaSettings(form);\n });\n return _get(_getPrototypeOf(WebformBuilder.prototype), \"attach\", this).call(this, element).then(function () {\n _this5.loadRefs(element, {\n form: 'single',\n sidebar: 'single',\n 'sidebar-search': 'single',\n 'sidebar-groups': 'single',\n 'container': 'multiple',\n 'sidebar-anchor': 'multiple',\n 'sidebar-group': 'multiple',\n 'sidebar-container': 'multiple',\n 'sidebar-component': 'multiple'\n });\n if (_this5.sideBarScroll && Templates.current.handleBuilderSidebarScroll) {\n Templates.current.handleBuilderSidebarScroll.call(_this5, _this5);\n }\n\n // Add the paste status in form\n if (typeof window !== 'undefined' && window.sessionStorage) {\n var data = window.sessionStorage.getItem('formio.clipboard');\n if (data) {\n _this5.addClass(_this5.refs.form, 'builder-paste-mode');\n }\n }\n if (!(0, _utils.bootstrapVersion)(_this5.options)) {\n // Initialize\n _this5.refs['sidebar-group'].forEach(function (group) {\n group.style.display = group.getAttribute('data-default') === 'true' ? 'inherit' : 'none';\n });\n\n // Click event\n _this5.refs['sidebar-anchor'].forEach(function (anchor, index) {\n _this5.addEventListener(anchor, 'click', function () {\n var clickedParentId = anchor.getAttribute('data-parent').slice('#builder-sidebar-'.length);\n var clickedId = anchor.getAttribute('data-target').slice('#group-'.length);\n _this5.refs['sidebar-group'].forEach(function (group, groupIndex) {\n var openByDefault = group.getAttribute('data-default') === 'true';\n var groupId = group.getAttribute('id').slice('group-'.length);\n var groupParent = group.getAttribute('data-parent').slice('#builder-sidebar-'.length);\n group.style.display = openByDefault && groupParent === clickedId || groupId === clickedParentId || groupIndex === index ? 'inherit' : 'none';\n });\n }, true);\n });\n }\n if (_this5.keyboardActionsEnabled) {\n _this5.refs['sidebar-component'].forEach(function (component) {\n _this5.addEventListener(component, 'keydown', function (event) {\n if (event.keyCode === 13) {\n _this5.addNewComponent(component);\n }\n });\n });\n }\n _this5.addEventListener(_this5.refs['sidebar-search'], 'input', _lodash[\"default\"].debounce(function (e) {\n var searchString = e.target.value;\n _this5.searchFields(searchString);\n }, 300));\n if (_this5.dragDropEnabled) {\n _this5.initDragula();\n }\n var drake = _this5.dragula;\n if (_this5.refs.form) {\n (0, _domAutoscroller[\"default\"])([window], {\n margin: 20,\n maxSpeed: 6,\n scrollWhenOutside: true,\n autoScroll: function autoScroll() {\n return this.down && (drake === null || drake === void 0 ? void 0 : drake.dragging);\n }\n });\n return _this5.webform.attach(_this5.refs.form);\n }\n });\n }\n }, {\n key: \"searchFields\",\n value: function searchFields() {\n var _this6 = this;\n var searchString = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var searchValue = searchString.toLowerCase();\n var sidebar = this.refs['sidebar'];\n var sidebarGroups = this.refs['sidebar-groups'];\n if (!sidebar || !sidebarGroups) {\n return;\n }\n var filterGroupBy = function filterGroupBy(group) {\n var searchValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var result = _lodash[\"default\"].toPlainObject(group);\n var _result$subgroups = result.subgroups,\n subgroups = _result$subgroups === void 0 ? [] : _result$subgroups,\n components = result.components;\n var filteredComponents = [];\n for (var key in components) {\n var isMatchedToTitle = components[key].title.toLowerCase().match(searchValue);\n var isMatchedToKey = components[key].key.toLowerCase().match(searchValue);\n if (isMatchedToTitle || isMatchedToKey) {\n filteredComponents.push(components[key]);\n }\n }\n _this6.orderComponents(result, filteredComponents);\n if (searchValue) {\n result[\"default\"] = true;\n }\n if (result.componentOrder.length || subgroups.length) {\n return result;\n }\n return null;\n };\n var filterGroupOrder = function filterGroupOrder(groupOrder, searchValue) {\n var result = _lodash[\"default\"].cloneDeep(groupOrder);\n return result.filter(function (key) {\n return filterGroupBy(_this6.groups[key], searchValue);\n });\n };\n var filterSubgroups = function filterSubgroups(groups, searchValue) {\n var result = _lodash[\"default\"].clone(groups);\n return result.map(function (subgroup) {\n return filterGroupBy(subgroup, searchValue);\n }).filter(function (subgroup) {\n return !_lodash[\"default\"].isNull(subgroup);\n });\n };\n var toTemplate = function toTemplate(groupKey) {\n return {\n group: filterGroupBy(_this6.groups[groupKey], searchValue),\n groupKey: groupKey,\n groupId: sidebar.id || sidebarGroups.id,\n subgroups: filterSubgroups(_this6.groups[groupKey].subgroups, searchValue).map(function (group) {\n return _this6.renderTemplate('builderSidebarGroup', {\n group: group,\n groupKey: group.key,\n groupId: \"group-container-\".concat(groupKey),\n subgroups: []\n });\n })\n };\n };\n sidebarGroups.innerHTML = filterGroupOrder(this.groupOrder, searchValue).map(function (groupKey) {\n return _this6.renderTemplate('builderSidebarGroup', toTemplate(groupKey));\n }).join('');\n this.loadRefs(this.element, {\n 'sidebar-groups': 'single',\n 'sidebar-anchor': 'multiple',\n 'sidebar-group': 'multiple',\n 'sidebar-container': 'multiple'\n });\n this.updateDragAndDrop();\n if (searchValue === '') {\n this.triggerRedraw();\n }\n }\n }, {\n key: \"orderComponents\",\n value: function orderComponents(groupInfo, foundComponents) {\n var components = foundComponents || groupInfo.components;\n var isResource = groupInfo.key.indexOf('resource-') === 0;\n if (components) {\n groupInfo.componentOrder = Object.keys(components).map(function (key) {\n return components[key];\n }).filter(function (component) {\n return component && !component.ignore && !component.ignoreForForm;\n }).sort(function (a, b) {\n return a.weight - b.weight;\n }).map(function (component) {\n return isResource ? \"component-\".concat(component.key) : component.key;\n });\n }\n }\n }, {\n key: \"updateDragAndDrop\",\n value: function updateDragAndDrop() {\n if (this.dragDropEnabled) {\n this.initDragula();\n }\n if (this.refs.form) {\n return this.webform.attach(this.refs.form);\n }\n }\n }, {\n key: \"initDragula\",\n value: function initDragula() {\n var _this7 = this;\n var options = this.options;\n if (this.dragula) {\n this.dragula.destroy();\n }\n var containersArray = Array.prototype.slice.call(this.refs['sidebar-container']).filter(function (item) {\n return item.id !== 'group-container-resource';\n });\n if (!dragula) {\n return;\n }\n this.dragula = dragula(containersArray, {\n moves: function moves(el) {\n var moves = true;\n var list = Array.from(el.classList).filter(function (item) {\n return item.indexOf('formio-component-') === 0;\n });\n list.forEach(function (item) {\n var key = item.slice('formio-component-'.length);\n if (options.disabled && options.disabled.includes(key)) {\n moves = false;\n }\n });\n if (el.classList.contains('no-drag')) {\n moves = false;\n }\n return moves;\n },\n copy: function copy(el) {\n return el.classList.contains('drag-copy');\n },\n accepts: function accepts(el, target) {\n return !el.contains(target) && !target.classList.contains('no-drop');\n }\n }).on('drop', function (element, target, source, sibling) {\n return _this7.onDrop(element, target, source, sibling);\n });\n }\n }, {\n key: \"detach\",\n value: function detach() {\n if (this.dragula) {\n this.dragula.destroy();\n }\n this.dragula = null;\n if (this.sideBarScroll && Templates.current.clearBuilderSidebarScroll) {\n Templates.current.clearBuilderSidebarScroll.call(this, this);\n }\n _get(_getPrototypeOf(WebformBuilder.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"getComponentInfo\",\n value: function getComponentInfo(key, group) {\n var info;\n // This is a new component\n if (this.schemas.hasOwnProperty(key)) {\n info = (0, _utils.fastCloneDeep)(this.schemas[key]);\n } else if (this.groups.hasOwnProperty(group)) {\n var groupComponents = this.groups[group].components;\n if (groupComponents.hasOwnProperty(key)) {\n info = (0, _utils.fastCloneDeep)(groupComponents[key].schema);\n }\n } else if (group.slice(0, group.indexOf('-')) === 'resource') {\n // This is an existing resource field.\n var resourceGroups = this.groups.resource.subgroups;\n var resourceGroup = _lodash[\"default\"].find(resourceGroups, {\n key: group\n });\n if (resourceGroup && resourceGroup.components.hasOwnProperty(\"component-\".concat(key))) {\n info = (0, _utils.fastCloneDeep)(resourceGroup.components[\"component-\".concat(key)].schema);\n }\n } else if (group === 'searchFields') {\n //Search components go into this group\n var _resourceGroups = this.groups.resource.subgroups;\n for (var ix = 0; ix < _resourceGroups.length; ix++) {\n var _resourceGroup = _resourceGroups[ix];\n if (_resourceGroup.components.hasOwnProperty(\"component-\".concat(key))) {\n info = (0, _utils.fastCloneDeep)(_resourceGroup.components[\"component-\".concat(key)].schema);\n break;\n }\n }\n }\n if (info) {\n info.key = this.generateKey(info);\n }\n return info;\n }\n }, {\n key: \"getComponentsPath\",\n value: function getComponentsPath(component, parent) {\n // Get path to the component in the parent component.\n var path = 'components';\n var columnIndex = 0;\n var tableRowIndex = 0;\n var tableColumnIndex = 0;\n var tabIndex = 0;\n switch (parent.type) {\n case 'table':\n tableRowIndex = _lodash[\"default\"].findIndex(parent.rows, function (row) {\n return row.some(function (column) {\n return column.components.some(function (comp) {\n return comp.key === component.key;\n });\n });\n });\n tableColumnIndex = _lodash[\"default\"].findIndex(parent.rows[tableRowIndex], function (column) {\n return column.components.some(function (comp) {\n return comp.key === component.key;\n });\n });\n path = \"rows[\".concat(tableRowIndex, \"][\").concat(tableColumnIndex, \"].components\");\n break;\n case 'columns':\n columnIndex = _lodash[\"default\"].findIndex(parent.columns, function (column) {\n return column.components.some(function (comp) {\n return comp.key === component.key;\n });\n });\n path = \"columns[\".concat(columnIndex, \"].components\");\n break;\n case 'tabs':\n tabIndex = _lodash[\"default\"].findIndex(parent.components, function (tab) {\n return tab.components.some(function (comp) {\n return comp.key === component.key;\n });\n });\n path = \"components[\".concat(tabIndex, \"].components\");\n break;\n }\n return path;\n }\n\n /* eslint-disable max-statements */\n }, {\n key: \"onDrop\",\n value: function onDrop(element, target, source, sibling) {\n var _this$groups$group,\n _this8 = this;\n if (!target) {\n return;\n }\n\n // If you try to drop within itself.\n if (element.contains(target)) {\n return;\n }\n var key = element.getAttribute('data-key');\n var type = element.getAttribute('data-type');\n var group = element.getAttribute('data-group');\n var info, isNew, path, index;\n if (key && group) {\n // This is a new component.\n info = this.getComponentInfo(key, group);\n if (!info && type) {\n info = this.getComponentInfo(type, group);\n }\n isNew = true;\n } else if (source.formioContainer) {\n index = _lodash[\"default\"].findIndex(source.formioContainer, {\n key: element.formioComponent.component.key\n });\n if (index !== -1) {\n // Grab and remove the component from the source container.\n info = source.formioContainer.splice(_lodash[\"default\"].findIndex(source.formioContainer, {\n key: element.formioComponent.component.key\n }), 1);\n\n // Since splice returns an array of one object, we need to destructure it.\n info = info[0];\n }\n }\n\n // If we haven't found the component, stop.\n if (!info) {\n return;\n }\n\n // Show an error if siblings are disabled for a component and such a component already exists.\n var compKey = group === 'resource' ? \"component-\".concat(key) : key;\n var draggableComponent = ((_this$groups$group = this.groups[group]) === null || _this$groups$group === void 0 ? void 0 : _this$groups$group.components[compKey]) || {};\n if (draggableComponent.disableSiblings) {\n var isCompAlreadyExists = false;\n (0, _formUtils.eachComponent)(this.webform.components, function (component) {\n if (component.type === draggableComponent.schema.type) {\n isCompAlreadyExists = true;\n return;\n }\n }, true);\n if (isCompAlreadyExists) {\n this.webform.redraw();\n this.webform.setAlert('danger', \"You cannot add more than one \".concat(draggableComponent.key, \" component to one page.\"));\n return;\n }\n }\n if (target !== source) {\n // Ensure the key remains unique in its new container.\n _builder[\"default\"].uniquify(this.findNamespaceRoot(target.formioComponent), info);\n }\n var parent = target.formioComponent;\n\n // Insert in the new container.\n if (target.formioContainer) {\n if (sibling) {\n if (!sibling.getAttribute('data-noattach')) {\n index = _lodash[\"default\"].findIndex(target.formioContainer, {\n key: _lodash[\"default\"].get(sibling, 'formioComponent.component.key')\n });\n index = index === -1 ? 0 : index;\n } else {\n index = sibling.getAttribute('data-position');\n }\n if (index !== -1) {\n target.formioContainer.splice(index, 0, info);\n }\n } else {\n target.formioContainer.push(info);\n }\n path = this.getComponentsPath(info, parent.component);\n index = _lodash[\"default\"].findIndex(_lodash[\"default\"].get(parent.schema, path), {\n key: info.key\n });\n if (index === -1) {\n index = 0;\n }\n }\n if (parent && parent.addChildComponent) {\n parent.addChildComponent(info, element, target, source, sibling);\n }\n var componentInDataGrid = parent.type === 'datagrid';\n if (isNew && !this.options.noNewEdit && !info.noNewEdit) {\n this.editComponent(info, target, isNew, null, null, {\n inDataGrid: componentInDataGrid\n });\n }\n\n // Only rebuild the parts needing to be rebuilt.\n var rebuild;\n if (target !== source) {\n if (source.formioContainer && source.contains(target)) {\n rebuild = source.formioComponent.rebuild();\n } else if (target.contains(source)) {\n rebuild = target.formioComponent.rebuild();\n } else {\n if (source.formioContainer) {\n rebuild = source.formioComponent.rebuild();\n }\n rebuild = target.formioComponent.rebuild();\n }\n } else {\n // If they are the same, only rebuild one.\n rebuild = target.formioComponent.rebuild();\n }\n if (!rebuild) {\n rebuild = _nativePromiseOnly[\"default\"].resolve();\n }\n return rebuild.then(function () {\n _this8.emit('addComponent', info, parent, path, index, isNew && !_this8.options.noNewEdit && !info.noNewEdit);\n if (!isNew || _this8.options.noNewEdit || info.noNewEdit) {\n _this8.emit('change', _this8.form);\n }\n });\n }\n }, {\n key: \"setForm\",\n value: function setForm(form) {\n var _this$options$propert,\n _this9 = this;\n if (!form.components) {\n form.components = [];\n }\n if (form && form.properties) {\n this.options.properties = form.properties;\n }\n this.keyboardActionsEnabled = _lodash[\"default\"].get(this.options, 'keyboardBuilder', false) || ((_this$options$propert = this.options.properties) === null || _this$options$propert === void 0 ? void 0 : _this$options$propert.keyboardBuilder);\n var isShowSubmitButton = !this.options.noDefaultSubmitButton && !form.components.length;\n\n // Ensure there is at least a submit button.\n if (isShowSubmitButton) {\n form.components.push({\n type: 'button',\n label: 'Submit',\n key: 'submit',\n size: 'md',\n block: false,\n action: 'submit',\n disableOnInvalid: true,\n theme: 'primary'\n });\n }\n if (this.webform) {\n var shouldRebuild = !this.webform.form.components || form.components.length !== this.webform.form.components.length;\n return this.webform.setForm(form, {\n keepAsReference: true\n }).then(function () {\n if (_this9.refs.form) {\n _this9.builderHeight = _this9.refs.form.offsetHeight;\n }\n if (!shouldRebuild) {\n return _this9.form;\n }\n return _this9.rebuild().then(function () {\n return _this9.form;\n });\n });\n }\n return _nativePromiseOnly[\"default\"].resolve(form);\n }\n }, {\n key: \"populateRecaptchaSettings\",\n value: function populateRecaptchaSettings(form) {\n //populate isEnabled for recaptcha form settings\n var isRecaptchaEnabled = false;\n if (this.form.components) {\n (0, _formUtils.eachComponent)(form.components, function (component) {\n if (isRecaptchaEnabled) {\n return;\n }\n if (component.type === 'recaptcha') {\n isRecaptchaEnabled = true;\n return false;\n }\n });\n if (isRecaptchaEnabled) {\n _lodash[\"default\"].set(form, 'settings.recaptcha.isEnabled', true);\n } else if (_lodash[\"default\"].get(form, 'settings.recaptcha.isEnabled')) {\n _lodash[\"default\"].set(form, 'settings.recaptcha.isEnabled', false);\n }\n }\n }\n }, {\n key: \"removeComponent\",\n value: function removeComponent(component, parent, original) {\n var _this10 = this;\n if (!parent) {\n return;\n }\n var remove = true;\n var removingComponentsGroup = !component.skipRemoveConfirm && (Array.isArray(component.components) && component.components.length || Array.isArray(component.rows) && component.rows.length || Array.isArray(component.columns) && component.columns.length);\n if (this.options.alwaysConfirmComponentRemoval || removingComponentsGroup) {\n var message = removingComponentsGroup ? 'Removing this component will also remove all of its children. Are you sure you want to do this?' : 'Are you sure you want to remove this component?';\n remove = window.confirm(this.t(message));\n }\n if (!original) {\n original = parent.formioContainer.find(function (comp) {\n return comp.id === component.id;\n });\n }\n var index = parent.formioContainer ? parent.formioContainer.indexOf(original) : 0;\n if (remove && index !== -1) {\n var path = this.getComponentsPath(component, parent.formioComponent.component);\n if (parent.formioContainer) {\n parent.formioContainer.splice(index, 1);\n } else if (parent.formioComponent && parent.formioComponent.removeChildComponent) {\n parent.formioComponent.removeChildComponent(component);\n }\n var rebuild = parent.formioComponent.rebuild() || _nativePromiseOnly[\"default\"].resolve();\n rebuild.then(function () {\n _this10.emit('removeComponent', component, parent.formioComponent.schema, path, index);\n _this10.emit('change', _this10.form);\n });\n }\n return remove;\n }\n }, {\n key: \"replaceDoubleQuotes\",\n value: function replaceDoubleQuotes(data) {\n var fieldsToRemoveDoubleQuotes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n if (data) {\n fieldsToRemoveDoubleQuotes.forEach(function (key) {\n if (data[key]) {\n data[key] = data[key].replace(/\"/g, \"'\");\n }\n });\n return data;\n }\n }\n }, {\n key: \"updateComponent\",\n value: function updateComponent(component, changed) {\n var _this11 = this;\n // Update the preview.\n if (this.preview) {\n this.preview.form = {\n components: [_lodash[\"default\"].omit(_objectSpread({}, component), ['hidden', 'conditional', 'calculateValue', 'logic', 'autofocus', 'customConditional'])],\n config: this.options.formConfig || {}\n };\n var fieldsToRemoveDoubleQuotes = ['label', 'tooltip'];\n this.preview.form.components.forEach(function (component) {\n return _this11.replaceDoubleQuotes(component, fieldsToRemoveDoubleQuotes);\n });\n var previewElement = this.componentEdit.querySelector('[ref=\"preview\"]');\n if (previewElement) {\n this.setContent(previewElement, this.preview.render());\n this.preview.attach(previewElement);\n }\n }\n\n // Change the \"default value\" field to be reflective of this component.\n var defaultValueComponent = (0, _formUtils.getComponent)(this.editForm.components, 'defaultValue', true);\n if (defaultValueComponent && component.type !== 'hidden') {\n var defaultChanged = changed && (changed.component && changed.component.key === 'defaultValue' || changed.instance && defaultValueComponent.hasComponent && defaultValueComponent.hasComponent(changed.instance));\n if (!defaultChanged) {\n _lodash[\"default\"].assign(defaultValueComponent.component, _lodash[\"default\"].omit(_objectSpread({}, component), ['key', 'label', 'placeholder', 'tooltip', 'hidden', 'autofocus', 'validate', 'disabled', 'defaultValue', 'customDefaultValue', 'calculateValue', 'conditional', 'customConditional', 'id']));\n var parentComponent = defaultValueComponent.parent;\n var tabIndex = -1;\n var index = -1;\n parentComponent.tabs.some(function (tab, tIndex) {\n tab.some(function (comp, compIndex) {\n if (comp.id === defaultValueComponent.id) {\n tabIndex = tIndex;\n index = compIndex;\n return true;\n }\n return false;\n });\n });\n if (tabIndex !== -1 && index !== -1 && changed && changed.value) {\n var sibling = parentComponent.tabs[tabIndex][index + 1];\n parentComponent.removeComponent(defaultValueComponent);\n var newComp = parentComponent.addComponent(defaultValueComponent.component, defaultValueComponent.data, sibling);\n _lodash[\"default\"].pull(newComp.validators, 'required');\n parentComponent.tabs[tabIndex].splice(index, 1, newComp);\n newComp.checkValidity = function () {\n return true;\n };\n newComp.build(defaultValueComponent.element);\n }\n } else {\n var dataPath = changed.instance._data.key;\n var path = (0, _utils.getArrayFromComponentPath)(changed.instance.path);\n path.shift();\n if (path.length) {\n path.unshift(component.key);\n dataPath = (0, _utils.getStringFromComponentPath)(path);\n }\n _lodash[\"default\"].set(this.preview._data, dataPath, changed.value);\n _lodash[\"default\"].set(this.webform._data, dataPath, changed.value);\n }\n }\n\n // Called when we update a component.\n this.emit('updateComponent', component);\n }\n }, {\n key: \"findRepeatablePaths\",\n value: function findRepeatablePaths() {\n var repeatablePaths = [];\n var keys = new Map();\n (0, _formUtils.eachComponent)(this.form.components, function (comp, path) {\n if (!comp.key) {\n return;\n }\n if (keys.has(comp.key)) {\n if (keys.get(comp.key).includes(path)) {\n repeatablePaths.push(path);\n } else {\n keys.set(comp.key, [].concat(_toConsumableArray(keys.get(comp.key)), [path]));\n }\n } else {\n keys.set(comp.key, [path]);\n }\n }, true);\n return repeatablePaths;\n }\n }, {\n key: \"highlightInvalidComponents\",\n value: function highlightInvalidComponents() {\n var repeatablePaths = this.findRepeatablePaths();\n var hasInvalidComponents = false;\n this.webform.everyComponent(function (comp) {\n var _comp$error, _comp$error$message;\n var path = comp.path;\n if (repeatablePaths.includes(path)) {\n comp.setCustomValidity(\"API Key is not unique: \".concat(comp.key));\n hasInvalidComponents = true;\n } else if ((_comp$error = comp.error) !== null && _comp$error !== void 0 && (_comp$error$message = _comp$error.message) !== null && _comp$error$message !== void 0 && _comp$error$message.startsWith('API Key is not unique')) {\n comp.setCustomValidity('');\n }\n });\n this.emit('builderFormValidityChange', hasInvalidComponents);\n }\n\n /**\n * Called when a new component is saved.\n *\n * @param parent\n * @param component\n * @return {boolean}\n */\n }, {\n key: \"saveComponent\",\n value: function saveComponent(component, parent, isNew, original) {\n var _this12 = this;\n this.editForm.detach();\n var parentContainer = parent ? parent.formioContainer : this.container;\n var parentComponent = parent ? parent.formioComponent : this;\n this.dialog.close();\n var path = parentContainer ? this.getComponentsPath(component, parentComponent.component) : '';\n if (!original) {\n original = parent.formioContainer.find(function (comp) {\n return comp.id === component.id;\n });\n }\n var index = parentContainer ? parentContainer.indexOf(original) : 0;\n if (index !== -1) {\n var submissionData = this.editForm.submission.data;\n submissionData = submissionData.componentJson || submissionData;\n var fieldsToRemoveDoubleQuotes = ['label', 'tooltip'];\n this.replaceDoubleQuotes(submissionData, fieldsToRemoveDoubleQuotes);\n this.hook('beforeSaveComponentSettings', submissionData);\n var comp = null;\n parentComponent.getComponents().forEach(function (component) {\n if (component.component.key === original.key) {\n comp = component;\n }\n });\n var originalComp = comp.component;\n var originalComponentSchema = comp.schema;\n var isParentSaveChildMethod = this.isParentSaveChildMethod(parent.formioComponent);\n if (parentContainer && !isParentSaveChildMethod) {\n parentContainer[index] = submissionData;\n if (comp) {\n comp.component = submissionData;\n }\n } else if (isParentSaveChildMethod) {\n parent.formioComponent.saveChildComponent(submissionData);\n }\n var rebuild = parentComponent.rebuild() || _nativePromiseOnly[\"default\"].resolve();\n return rebuild.then(function () {\n var schema = parentContainer ? parentContainer[index] : comp ? comp.schema : [];\n _this12.emitSaveComponentEvent(schema, originalComp, parentComponent.schema, path, index, isNew, originalComponentSchema);\n _this12.emit('change', _this12.form);\n _this12.highlightInvalidComponents();\n if (_this12.isComponentCreated) {\n var _component = parent.formioComponent.components[0];\n _this12.moveComponent(_component);\n _this12.isComponentCreated = false;\n }\n });\n }\n this.highlightInvalidComponents();\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"emitSaveComponentEvent\",\n value: function emitSaveComponentEvent(schema, originalComp, parentComponentSchema, path, index, isNew, originalComponentSchema) {\n this.emit('saveComponent', schema, originalComp, parentComponentSchema, path, index, isNew, originalComponentSchema);\n }\n }, {\n key: \"editComponent\",\n value: function editComponent(component, parent, isNew, isJsonEdit, original) {\n var _this13 = this;\n var flags = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};\n if (!component.key) {\n return;\n }\n var saved = false;\n var componentCopy = (0, _utils.fastCloneDeep)(component);\n var ComponentClass = _Components[\"default\"].components[componentCopy.type];\n var isCustom = ComponentClass === undefined;\n isJsonEdit = isJsonEdit || isCustom;\n ComponentClass = isCustom ? _Components[\"default\"].components.unknown : ComponentClass;\n // Make sure we only have one dialog open at a time.\n if (this.dialog) {\n this.dialog.close();\n this.highlightInvalidComponents();\n }\n\n // This is the render step.\n var editFormOptions = _lodash[\"default\"].clone(_lodash[\"default\"].get(this, 'options.editForm', {}));\n if (this.editForm) {\n this.editForm.destroy();\n }\n\n // Allow editForm overrides per component.\n var overrides = _lodash[\"default\"].get(this.options, \"editForm.\".concat(componentCopy.type), {});\n\n // Pass along the form being edited.\n editFormOptions.editForm = this.form;\n editFormOptions.editComponent = component;\n editFormOptions.flags = flags;\n this.hook('editComponentParentInstance', editFormOptions, parent);\n this.editForm = new _Webform[\"default\"](_objectSpread(_objectSpread({}, _lodash[\"default\"].omit(this.options, ['hooks', 'builder', 'events', 'attachMode', 'skipInit'])), {}, {\n language: this.options.language\n }, editFormOptions));\n this.hook('editFormProperties', parent);\n this.editForm.form = isJsonEdit && !isCustom ? {\n components: [{\n type: 'textarea',\n as: 'json',\n editor: 'ace',\n weight: 10,\n input: true,\n key: 'componentJson',\n label: 'Component JSON',\n tooltip: 'Edit the JSON for this component.'\n }, {\n type: 'checkbox',\n key: 'showFullSchema',\n label: 'Full Schema'\n }]\n } : ComponentClass.editForm(_lodash[\"default\"].cloneDeep(overrides));\n var instanceOptions = {};\n this.hook('instanceOptionsPreview', instanceOptions);\n var instance = new ComponentClass(componentCopy, instanceOptions);\n var schema = this.hook('builderComponentSchema', component, instance);\n this.editForm.submission = isJsonEdit ? {\n data: {\n componentJson: schema,\n showFullSchema: this.options.showFullJsonSchema\n }\n } : {\n data: instance.component\n };\n if (this.preview) {\n this.preview.destroy();\n }\n if (!ComponentClass.builderInfo.hasOwnProperty('preview') || ComponentClass.builderInfo.preview) {\n this.preview = new _Webform[\"default\"](_lodash[\"default\"].omit(_objectSpread(_objectSpread({}, this.options), {}, {\n preview: true\n }), ['hooks', 'builder', 'events', 'attachMode', 'calculateValue']));\n this.hook('previewFormSettitngs', schema, isJsonEdit);\n }\n this.componentEdit = this.ce('div', {\n 'class': 'component-edit-container'\n });\n this.setContent(this.componentEdit, this.renderTemplate('builderEditForm', {\n componentInfo: ComponentClass.builderInfo,\n editForm: this.editForm.render(),\n preview: this.preview ? this.preview.render() : false,\n helplinks: this.helplinks\n }));\n this.dialog = this.createModal(this.componentEdit, _lodash[\"default\"].get(this.options, 'dialogAttr', {}));\n\n // This is the attach step.\n this.editForm.attach(this.componentEdit.querySelector('[ref=\"editForm\"]'));\n this.hook('editFormWrapper');\n this.updateComponent(componentCopy);\n this.editForm.on('change', function (event) {\n if (event.changed) {\n if (event.changed.component && event.changed.component.key === 'showFullSchema') {\n var value = event.changed.value;\n _this13.editForm.submission = {\n data: {\n componentJson: value ? instance.component : component,\n showFullSchema: value\n }\n };\n return;\n }\n // See if this is a manually modified key. Treat custom component keys as manually modified\n if (event.changed.component && event.changed.component.key === 'key' || isJsonEdit) {\n componentCopy.keyModified = true;\n }\n var isComponentLabelChanged = false;\n if (event.changed.instance) {\n isComponentLabelChanged = ['label', 'title'].includes(event.changed.instance.path);\n } else if (event.changed.component) {\n isComponentLabelChanged = ['label', 'title'].includes(event.changed.component.key);\n }\n if (isComponentLabelChanged) {\n // Ensure this component has a key.\n if (isNew) {\n if (!event.data.keyModified) {\n _this13.editForm.everyComponent(function (component) {\n if (component.key === 'key' && component.parent.component.key === 'tabs') {\n component.setValue(_this13.updateComponentKey(event.data));\n return false;\n }\n });\n }\n if (_this13.form) {\n var formComponents = _this13.findNamespaceRoot(parent.formioComponent);\n // excluding component which key uniqueness is to be checked to prevent the comparing of the same keys\n formComponents = formComponents.filter(function (comp) {\n return editFormOptions.editComponent.id !== comp.id;\n });\n\n // Set a unique key for this component.\n _builder[\"default\"].uniquify(formComponents, event.data);\n }\n }\n }\n\n // Update the component.\n _this13.updateComponent(event.data.componentJson || event.data, event.changed);\n }\n });\n var cancelButtons = this.componentEdit.querySelectorAll('[ref=\"cancelButton\"]');\n cancelButtons.forEach(function (cancelButton) {\n _this13.addEventListener(cancelButton, 'click', function (event) {\n event.preventDefault();\n _this13.editForm.detach();\n _this13.emit('cancelComponent', component);\n _this13.dialog.close();\n _this13.highlightInvalidComponents();\n });\n });\n var removeButtons = this.componentEdit.querySelectorAll('[ref=\"removeButton\"]');\n removeButtons.forEach(function (removeButton) {\n _this13.addEventListener(removeButton, 'click', function (event) {\n event.preventDefault();\n // Since we are already removing the component, don't trigger another remove.\n saved = true;\n _this13.editForm.detach();\n _this13.removeComponent(component, parent, original);\n _this13.dialog.close();\n _this13.highlightInvalidComponents();\n });\n });\n var saveButtons = this.componentEdit.querySelectorAll('[ref=\"saveButton\"]');\n saveButtons.forEach(function (saveButton) {\n _this13.addEventListener(saveButton, 'click', function (event) {\n event.preventDefault();\n if (!_this13.editForm.checkValidity(_this13.editForm.data, true, _this13.editForm.data)) {\n _this13.editForm.setPristine(false);\n _this13.editForm.showErrors();\n return false;\n }\n saved = true;\n _this13.saveComponent(component, parent, isNew, original);\n });\n });\n var dialogClose = function dialogClose() {\n _this13.editForm.destroy(true);\n if (_this13.preview) {\n _this13.preview.destroy(true);\n _this13.preview = null;\n }\n if (isNew && !saved) {\n _this13.removeComponent(component, parent, original);\n _this13.highlightInvalidComponents();\n }\n // Clean up.\n _this13.removeEventListener(_this13.dialog, 'close', dialogClose);\n _this13.dialog = null;\n };\n this.addEventListener(this.dialog, 'close', dialogClose);\n\n // Called when we edit a component.\n this.emit('editComponent', component);\n }\n }, {\n key: \"updateComponentKey\",\n value: function updateComponentKey(data) {\n return _lodash[\"default\"].camelCase(data.title || data.label || data.placeholder || data.type).replace(/^[0-9]*/, '');\n }\n }, {\n key: \"moveComponent\",\n value: function moveComponent(component) {\n component.element.focus();\n component.element.classList.add('builder-selected');\n this.selectedElement = component;\n this.removeEventListener(component.element, 'keydown');\n this.addEventListener(component.element, 'keydown', this.moveHandler.bind(this));\n }\n }, {\n key: \"updateComponentPlacement\",\n value: function updateComponentPlacement(direction) {\n var component = this.selectedElement;\n var index, info;\n var step = direction ? -1 : 1;\n if (component) {\n var element = component.element;\n var sibling = direction ? element.previousElementSibling : element.nextElementSibling;\n var source = element.parentNode;\n var containerLength = source.formioContainer.length;\n if (containerLength && containerLength <= 1) {\n return;\n }\n if (source.formioContainer) {\n index = _lodash[\"default\"].findIndex(source.formioContainer, {\n key: element.formioComponent.component.key\n });\n if (index !== -1) {\n info = source.formioContainer.splice(_lodash[\"default\"].findIndex(source.formioContainer, {\n key: element.formioComponent.component.key\n }), 1);\n info = info[0];\n source.removeChild(element);\n }\n }\n var len = source.formioComponent.components.length;\n index = index === -1 ? 0 : index + step;\n if (index === -1) {\n source.formioContainer.push(info);\n source.appendChild(element);\n } else if (index === len) {\n var key = source.formioContainer[0].key;\n index = _lodash[\"default\"].findIndex(source.formioComponent.components, {\n key: key\n });\n var firstElement = source.formioComponent.components[index].element;\n source.formioContainer.splice(0, 0, info);\n source.insertBefore(element, firstElement);\n } else if (index !== -1) {\n source.formioContainer.splice(index, 0, info);\n direction ? source.insertBefore(element, sibling) : source.insertBefore(element, sibling.nextElementSibling);\n }\n element.focus();\n }\n }\n }, {\n key: \"stopMoving\",\n value: function stopMoving(comp) {\n var parent = comp.element.parentNode;\n parent.formioComponent.rebuild();\n }\n }, {\n key: \"addNewComponent\",\n value: function addNewComponent(element) {\n var _source$formioCompone,\n _this14 = this;\n var source = document.querySelector('.formio-builder-form');\n var key = element.getAttribute('data-key');\n var group = element.getAttribute('data-group');\n var isNew = true;\n var info;\n if (key && group) {\n info = this.getComponentInfo(key, group);\n }\n if (isNew && !this.options.noNewEdit && !info.noNewEdit) {\n _builder[\"default\"].uniquify(this.findNamespaceRoot(source.formioComponent), info);\n this.editComponent(info, source, isNew, null, null);\n }\n var firstComponent = (_source$formioCompone = source.formioComponent.components[0]) === null || _source$formioCompone === void 0 ? void 0 : _source$formioCompone.element;\n if (firstComponent) {\n source.formioContainer.splice(0, 0, info);\n } else {\n source.formioContainer.push(info);\n }\n source.formioComponent.rebuild().then(function () {\n _this14.isComponentCreated = true;\n });\n }\n\n /**\n * Creates copy of component schema and stores it under sessionStorage.\n * @param {Component} component\n * @return {*}\n */\n }, {\n key: \"copyComponent\",\n value: function copyComponent(component) {\n if (!window.sessionStorage) {\n return console.warn('Session storage is not supported in this browser.');\n }\n this.addClass(this.refs.form, 'builder-paste-mode');\n window.sessionStorage.setItem('formio.clipboard', JSON.stringify(component.schema));\n }\n\n /**\n * Paste copied component after the current component.\n * @param {Component} component\n * @return {*}\n */\n }, {\n key: \"pasteComponent\",\n value: function pasteComponent(component) {\n if (!window.sessionStorage) {\n return console.warn('Session storage is not supported in this browser.');\n }\n this.removeClass(this.refs.form, 'builder-paste-mode');\n if (window.sessionStorage) {\n var data = window.sessionStorage.getItem('formio.clipboard');\n if (data) {\n var schema = JSON.parse(data);\n var parent = this.getParentElement(component.element);\n if (parent) {\n _builder[\"default\"].uniquify(this.findNamespaceRoot(parent.formioComponent), schema);\n var path = '';\n var index = 0;\n var isParentSaveChildMethod = this.isParentSaveChildMethod(parent.formioComponent);\n if (parent.formioContainer && !isParentSaveChildMethod) {\n index = parent.formioContainer.indexOf(component.component);\n path = this.getComponentsPath(schema, parent.formioComponent.component);\n parent.formioContainer.splice(index + 1, 0, schema);\n } else if (isParentSaveChildMethod) {\n parent.formioComponent.saveChildComponent(schema, false);\n }\n parent.formioComponent.rebuild();\n this.emitSaveComponentEvent(schema, schema, parent.formioComponent.component, path, index + 1, true, schema);\n }\n this.emit('change', this.form);\n }\n }\n }\n }, {\n key: \"isParentSaveChildMethod\",\n value: function isParentSaveChildMethod(parentComp) {\n return !!(parentComp && parentComp.saveChildComponent);\n }\n }, {\n key: \"getParentElement\",\n value: function getParentElement(element) {\n var container = element;\n do {\n container = container.parentNode;\n } while (container && !container.formioComponent);\n return container;\n }\n }, {\n key: \"addBuilderComponentInfo\",\n value: function addBuilderComponentInfo(component) {\n if (!component || !component.group || !this.groups[component.group]) {\n return;\n }\n component = _lodash[\"default\"].clone(component);\n var groupInfo = this.groups[component.group];\n if (!groupInfo.components.hasOwnProperty(component.key)) {\n groupInfo.components[component.key] = component;\n }\n return component;\n }\n }, {\n key: \"init\",\n value: function init() {\n if (this.webform) {\n this.webform.init();\n }\n return _get(_getPrototypeOf(WebformBuilder.prototype), \"init\", this).call(this);\n }\n }, {\n key: \"clear\",\n value: function clear() {\n if (this.webform.initialized) {\n this.webform.clear();\n }\n }\n }, {\n key: \"destroy\",\n value: function destroy(deleteFromGlobal) {\n if (this.webform.initialized) {\n this.webform.destroy(deleteFromGlobal);\n }\n _get(_getPrototypeOf(WebformBuilder.prototype), \"destroy\", this).call(this, deleteFromGlobal);\n }\n }, {\n key: \"addBuilderGroup\",\n value: function addBuilderGroup(name, group) {\n if (!this.groups[name]) {\n this.groups[name] = group;\n this.groupOrder.push(name);\n this.triggerRedraw();\n } else {\n this.updateBuilderGroup(name, group);\n }\n }\n }, {\n key: \"updateBuilderGroup\",\n value: function updateBuilderGroup(name, group) {\n if (this.groups[name]) {\n this.groups[name] = group;\n this.triggerRedraw();\n }\n }\n }, {\n key: \"generateKey\",\n value: function generateKey(info) {\n return info.key || _lodash[\"default\"].camelCase(info.title || info.label || info.placeholder || info.type);\n }\n }]);\n return WebformBuilder;\n}(_Component2[\"default\"]);\nexports[\"default\"] = WebformBuilder;\n\n//# sourceURL=webpack://Formio/./lib/WebformBuilder.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.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\");\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.sort.js */ \"./node_modules/core-js/modules/es.array.sort.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.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.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.function.name.js */ \"./node_modules/core-js/modules/es.function.name.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.keys.js */ \"./node_modules/core-js/modules/es.object.keys.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.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.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.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.slice.js */ \"./node_modules/core-js/modules/es.array.slice.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.array.join.js */ \"./node_modules/core-js/modules/es.array.join.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.find.js */ \"./node_modules/core-js/modules/es.array.find.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.some.js */ \"./node_modules/core-js/modules/es.array.some.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.iterator.js */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.map.js */ \"./node_modules/core-js/modules/es.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.string.starts-with.js */ \"./node_modules/core-js/modules/es.string.starts-with.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.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 _Webform = _interopRequireDefault(__webpack_require__(/*! ./Webform */ \"./lib/Webform.js\"));\nvar _Component2 = _interopRequireDefault(__webpack_require__(/*! ./components/_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _tippy = _interopRequireDefault(__webpack_require__(/*! tippy.js */ \"./node_modules/tippy.js/dist/tippy.esm.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 _Formio = __webpack_require__(/*! ./Formio */ \"./lib/Formio.js\");\nvar _utils = __webpack_require__(/*! ./utils/utils */ \"./lib/utils/utils.js\");\nvar _formUtils = __webpack_require__(/*! ./utils/formUtils */ \"./lib/utils/formUtils.js\");\nvar _builder = _interopRequireDefault(__webpack_require__(/*! ./utils/builder */ \"./lib/utils/builder.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _domAutoscroller = _interopRequireDefault(__webpack_require__(/*! dom-autoscroller */ \"./node_modules/dom-autoscroller/dist/bundle.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 _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 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__webpack_require__(/*! ./components/builder */ \"./lib/components/builder.js\");\nvar Templates = _Formio.GlobalFormio.Templates;\nif (!Templates) {\n Templates = (__webpack_require__(/*! ./templates/Templates */ \"./lib/templates/Templates.js\")[\"default\"]);\n}\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 WebformBuilder = /*#__PURE__*/function (_Component) {\n _inherits(WebformBuilder, _Component);\n var _super = _createSuper(WebformBuilder);\n // eslint-disable-next-line max-statements\n function WebformBuilder() {\n var _this;\n _classCallCheck(this, WebformBuilder);\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 // Reset skipInit in case PDFBuilder has set it.\n options.skipInit = false;\n options.display = options.display || 'form';\n _this = _super.call(this, null, options);\n _defineProperty(_assertThisInitialized(_this), \"moveHandler\", function (e) {\n if (e.keyCode === 38 || e.keyCode === 40 || e.keyCode === 13) {\n e.stopPropagation();\n e.preventDefault();\n }\n if (e.keyCode === 38) {\n _this.updateComponentPlacement(true);\n }\n if (e.keyCode === 40) {\n _this.updateComponentPlacement(false);\n }\n if (e.keyCode === 13) {\n _this.stopMoving(_this.selectedComponent);\n }\n });\n _this.element = element;\n _this.builderHeight = 0;\n _this.schemas = {};\n _this.repeatablePaths = [];\n _this.sideBarScroll = _lodash[\"default\"].get(_this.options, 'sideBarScroll', true);\n _this.sideBarScrollOffset = _lodash[\"default\"].get(_this.options, 'sideBarScrollOffset', 0);\n _this.dragDropEnabled = true;\n\n // Setup the builder options.\n _this.builder = _lodash[\"default\"].defaultsDeep({}, _this.options.builder, _this.defaultGroups);\n\n // Turn off if explicitely said to do so...\n _lodash[\"default\"].each(_this.defaultGroups, function (config, key) {\n if (config === false) {\n _this.builder[key] = false;\n }\n });\n\n // Add the groups.////\n _this.groups = {};\n _this.groupOrder = [];\n var _loop = function _loop(group) {\n if (_this.builder[group]) {\n _this.builder[group].key = group;\n _this.groups[group] = _this.builder[group];\n _this.groups[group].components = _this.groups[group].components || {};\n _this.groups[group].componentOrder = _this.groups[group].componentOrder || [];\n _this.groups[group].subgroups = Object.keys(_this.groups[group].groups || {}).map(function (groupKey) {\n _this.groups[group].groups[groupKey].componentOrder = Object.keys(_this.groups[group].groups[groupKey].components).map(function (key) {\n return key;\n });\n return _this.groups[group].groups[groupKey];\n });\n _this.groupOrder.push(_this.groups[group]);\n }\n };\n for (var group in _this.builder) {\n _loop(group);\n }\n _this.groupOrder = _this.groupOrder.filter(function (group) {\n return group && !group.ignore;\n }).sort(function (a, b) {\n return a.weight - b.weight;\n }).map(function (group) {\n return group.key;\n });\n for (var type in _Components[\"default\"].components) {\n var component = _Components[\"default\"].components[type];\n if (component.builderInfo && component.builderInfo.schema) {\n _this.schemas[type] = component.builderInfo.schema;\n component.type = type;\n var builderInfo = component.builderInfo;\n builderInfo.key = component.type;\n _this.addBuilderComponentInfo(builderInfo);\n }\n }\n\n // Filter out any extra components.\n // Add the components in each group.\n for (var _group in _this.groups) {\n var info = _this.groups[_group];\n for (var key in info.components) {\n var compKey = _group === 'resource' ? \"component-\".concat(key) : key;\n var comp = info.components[compKey];\n if (comp === true && _Components[\"default\"].components[key] && _Components[\"default\"].components[key].builderInfo) {\n comp = _Components[\"default\"].components[key].builderInfo;\n }\n if (comp && comp.schema) {\n _this.schemas[key] = comp.schema;\n info.components[compKey] = comp;\n info.components[compKey].key = key;\n } else {\n // Do not include this component in the components array.\n delete info.components[compKey];\n }\n }\n\n // Order the components.\n _this.orderComponents(info);\n }\n _this.options.hooks = _this.options.hooks || {};\n _this.options.hooks.renderComponent = function (html, _ref) {\n var _self$component;\n var component = _ref.component,\n self = _ref.self;\n if (self.type === 'form' && !self.key) {\n var template = _this.hook('renderComponentFormTemplate', html.replace('formio-component-form', ''));\n // The main webform shouldn't have this class as it adds extra styles.\n return template;\n }\n if (_this.options.disabled && _this.options.disabled.includes(self.key) || self.parent.noDragDrop) {\n return html;\n }\n return _this.renderTemplate('builderComponent', {\n html: html,\n disableBuilderActions: self === null || self === void 0 ? void 0 : (_self$component = self.component) === null || _self$component === void 0 ? void 0 : _self$component.disableBuilderActions,\n childComponent: component\n });\n };\n _this.options.hooks.renderComponents = function (html, _ref2) {\n var components = _ref2.components,\n self = _ref2.self;\n // if Datagrid and already has a component, don't make it droppable.\n if (self.type === 'datagrid' && components.length > 0 || self.noDragDrop) {\n return html;\n }\n if (!components || !components.length && !components.nodrop || self.type === 'form' && components.length <= 1 && (components.length === 0 || components[0].type === 'button')) {\n html = _this.renderTemplate('builderPlaceholder', {\n position: 0\n }) + html;\n }\n return _this.renderTemplate('builderComponents', {\n key: self.key,\n type: self.type,\n html: html\n });\n };\n _this.options.hooks.renderInput = function (html, _ref3) {\n var self = _ref3.self;\n if (self.type === 'hidden') {\n return html + self.name;\n }\n return html;\n };\n _this.options.hooks.renderLoading = function (html, _ref4) {\n var self = _ref4.self;\n if (self.type === 'form' && self.key) {\n return self.name;\n }\n return html;\n };\n _this.options.hooks.attachComponents = function (element, components, container, component) {\n // Don't attach if no element was found or component doesn't participate in drag'n'drop.\n if (!element) {\n return;\n }\n if (component.noDragDrop) {\n return element;\n }\n // Attach container and component to element for later reference.\n var containerElement = element.querySelector(\"[ref=\\\"\".concat(component.component.key, \"-container\\\"]\")) || element;\n containerElement.formioContainer = container;\n containerElement.formioComponent = component;\n\n // Add container to draggable list.\n if (_this.dragula && _this.allowDrop(element)) {\n _this.dragula.containers.push(containerElement);\n }\n\n // If this is an existing datagrid element, don't make it draggable.\n if ((component.type === 'datagrid' || component.type === 'datamap') && components.length > 0) {\n return element;\n }\n\n // Since we added a wrapper, need to return the original element so that we can find the components inside it.\n return element.children[0];\n };\n _this.options.hooks.attachDatagrid = function (element, component) {\n component.loadRefs(element, _defineProperty({}, \"\".concat(component.key, \"-container\"), 'single'));\n var dataGridContainer = component.refs[\"\".concat(component.key, \"-container\")];\n if (dataGridContainer) {\n component.attachComponents(dataGridContainer.parentNode, [], component.component.components);\n }\n // Need to set up horizontal rearrangement of fields.\n };\n\n _this.options.hooks.attachComponent = _this.attachComponent.bind(_assertThisInitialized(_this));\n\n // Load resources tagged as 'builder'\n var query = {\n params: {\n type: 'resource',\n limit: 1000000,\n select: '_id,title,name,components'\n }\n };\n if (_this.options && _this.options.resourceTag) {\n query.params.tags = [_this.options.resourceTag];\n } else if (!_this.options || !_this.options.hasOwnProperty('resourceTag')) {\n query.params.tags = ['builder'];\n }\n var formio = new _Formio.GlobalFormio(_Formio.GlobalFormio.projectUrl);\n var isResourcesDisabled = _this.options.builder && _this.options.builder.resource === false;\n formio.loadProject().then(function (project) {\n if (project && (_lodash[\"default\"].get(project, 'settings.addConfigToForms', false) || _lodash[\"default\"].get(project, 'addConfigToForms', false))) {\n var config = project.config || {};\n _this.options.formConfig = config;\n var pathToFormConfig = 'webform._form.config';\n var webformConfig = _lodash[\"default\"].get(_assertThisInitialized(_this), pathToFormConfig);\n if (_this.webform && !webformConfig) {\n _lodash[\"default\"].set(_assertThisInitialized(_this), pathToFormConfig, config);\n }\n }\n })[\"catch\"](function (err) {\n console.warn(\"Could not load project settings: \".concat(err.message || err));\n });\n if (!formio.noProject && !isResourcesDisabled) {\n var resourceOptions = _this.options.builder && _this.options.builder.resource;\n formio.loadForms(query).then(function (resources) {\n if (resources.length) {\n _this.builder.resource = {\n title: resourceOptions ? resourceOptions.title : 'Existing Resource Fields',\n key: 'resource',\n weight: resourceOptions ? resourceOptions.weight : 50,\n subgroups: [],\n components: [],\n componentOrder: []\n };\n _this.groups.resource = {\n title: resourceOptions ? resourceOptions.title : 'Existing Resource Fields',\n key: 'resource',\n weight: resourceOptions ? resourceOptions.weight : 50,\n subgroups: [],\n components: [],\n componentOrder: []\n };\n if (!_this.groupOrder.includes('resource')) {\n _this.groupOrder.push('resource');\n }\n _this.addExistingResourceFields(resources);\n }\n });\n }\n\n // Notify components if they need to modify their render.\n _this.options.attachMode = 'builder';\n _this.webform = _this.webform || _this.createForm(_this.options);\n _this.pathComponentsMapping = {};\n _this.arrayDataComponentPaths = [];\n _this.nestedDataComponents = [];\n _this.arrayDataComponents = [];\n return _this;\n }\n _createClass(WebformBuilder, [{\n key: \"allowDrop\",\n value: function allowDrop() {\n return true;\n }\n }, {\n key: \"addExistingResourceFields\",\n value: function addExistingResourceFields(resources) {\n var _this2 = this;\n _lodash[\"default\"].each(resources, function (resource, index) {\n var resourceKey = \"resource-\".concat(resource.name);\n var subgroup = {\n key: resourceKey,\n title: resource.title,\n components: [],\n componentOrder: [],\n \"default\": index === 0\n };\n (0, _formUtils.eachComponent)(resource.components, function (component) {\n if (component.type === 'button') return;\n if (_this2.options && _this2.options.resourceFilter && (!component.tags || component.tags.indexOf(_this2.options.resourceFilter) === -1)) return;\n var componentName = component.label;\n if (!componentName && component.key) {\n componentName = _lodash[\"default\"].upperFirst(component.key);\n }\n subgroup.componentOrder.push(\"component-\".concat(component.key));\n subgroup.components[\"component-\".concat(component.key)] = _lodash[\"default\"].merge((0, _utils.fastCloneDeep)(_Components[\"default\"].components[component.type] ? _Components[\"default\"].components[component.type].builderInfo : _Components[\"default\"].components['unknown'].builderInfo), {\n key: component.key,\n title: componentName,\n group: 'resource',\n subgroup: resourceKey\n }, {\n schema: _objectSpread(_objectSpread({}, component), {}, {\n label: component.label,\n key: component.key,\n lockKey: true,\n source: !_this2.options.noSource ? resource._id : undefined,\n isNew: true\n })\n });\n }, true);\n _this2.groups.resource.subgroups.push(subgroup);\n });\n this.triggerRedraw();\n }\n }, {\n key: \"attachTooltip\",\n value: function attachTooltip(component, title) {\n return (0, _tippy[\"default\"])(component, {\n allowHTML: true,\n trigger: 'mouseenter focus',\n placement: 'top',\n delay: [200, 0],\n zIndex: 10000,\n content: title\n });\n }\n }, {\n key: \"attachComponent\",\n value: function attachComponent(element, component) {\n var _this3 = this;\n if (component instanceof WebformBuilder) {\n return;\n }\n\n // Add component to element for later reference.\n element.formioComponent = component;\n component.loadRefs(element, {\n removeComponent: 'single',\n editComponent: 'single',\n moveComponent: 'single',\n copyComponent: 'single',\n pasteComponent: 'single',\n editJson: 'single'\n });\n if (component.refs.copyComponent) {\n this.attachTooltip(component.refs.copyComponent, this.t('Copy'));\n component.addEventListener(component.refs.copyComponent, 'click', function () {\n return _this3.copyComponent(component);\n });\n }\n if (component.refs.pasteComponent) {\n var pasteToolTip = this.attachTooltip(component.refs.pasteComponent, this.t('Paste below'));\n component.addEventListener(component.refs.pasteComponent, 'click', function () {\n pasteToolTip.hide();\n _this3.pasteComponent(component);\n });\n }\n if (component.refs.moveComponent) {\n this.attachTooltip(component.refs.moveComponent, this.t('Move'));\n if (this.keyboardActionsEnabled) {\n component.addEventListener(component.refs.moveComponent, 'click', function () {\n _this3.moveComponent(component);\n });\n }\n }\n var parent = this.getParentElement(element);\n if (component.refs.editComponent) {\n this.attachTooltip(component.refs.editComponent, this.t('Edit'));\n component.addEventListener(component.refs.editComponent, 'click', function () {\n return _this3.editComponent(component.schema, parent, false, false, component.component, {\n inDataGrid: component.isInDataGrid\n });\n });\n }\n if (component.refs.editJson) {\n this.attachTooltip(component.refs.editJson, this.t('Edit JSON'));\n component.addEventListener(component.refs.editJson, 'click', function () {\n return _this3.editComponent(component.schema, parent, false, true, component.component);\n });\n }\n if (component.refs.removeComponent) {\n this.attachTooltip(component.refs.removeComponent, this.t('Remove'));\n component.addEventListener(component.refs.removeComponent, 'click', function () {\n return _this3.removeComponent(component.schema, parent, component.component);\n });\n }\n return element;\n }\n }, {\n key: \"createForm\",\n value: function createForm(options) {\n this.webform = new _Webform[\"default\"](this.element, options);\n if (this.element) {\n this.loadRefs(this.element, {\n form: 'single'\n });\n if (this.refs.form) {\n this.webform.element = this.refs.form;\n }\n }\n return this.webform;\n }\n\n /**\n * Called when everything is ready.\n *\n * @returns {Promise} - Wait for webform to be ready.\n */\n }, {\n key: \"ready\",\n get: function get() {\n return this.webform.ready;\n }\n }, {\n key: \"defaultGroups\",\n get: function get() {\n return {\n basic: {\n title: 'Basic',\n weight: 0,\n \"default\": true\n },\n advanced: {\n title: 'Advanced',\n weight: 10\n },\n layout: {\n title: 'Layout',\n weight: 20\n },\n data: {\n title: 'Data',\n weight: 30\n },\n premium: {\n title: 'Premium',\n weight: 40\n }\n };\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n return _Webform[\"default\"].prototype.redraw.call(this);\n }\n }, {\n key: \"form\",\n get: function get() {\n return this.webform.form;\n },\n set: function set(value) {\n this.setForm(value);\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.webform.schema;\n }\n }, {\n key: \"container\",\n get: function get() {\n return this.webform.form.components;\n }\n\n /**\n * When a component sets its api key, we need to check if it is unique within its namespace. Find the namespace root\n * so we can calculate this correctly.\n * @param component\n */\n }, {\n key: \"findNamespaceRoot\",\n value: function findNamespaceRoot(component) {\n var path = (0, _utils.getArrayFromComponentPath)(component.path);\n // First get the component with nested parents.\n var comp = this.webform.getComponent(path);\n comp = Array.isArray(comp) ? comp[0] : comp;\n var namespaceKey = this.recurseNamespace(comp);\n\n // If there is no key, it is the root form.\n if (!namespaceKey || this.form.key === namespaceKey) {\n return this.form.components;\n }\n var componentSchema = component.component;\n // If the current component is the namespace, we don't need to find it again.\n if (namespaceKey === component.key) {\n return [].concat(_toConsumableArray(componentSchema.components), [componentSchema]);\n }\n\n // Get the namespace component so we have the original object.\n var namespaceComponent = (0, _formUtils.getComponent)(this.form.components, namespaceKey, true);\n return namespaceComponent ? namespaceComponent.components : comp.components;\n }\n }, {\n key: \"recurseNamespace\",\n value: function recurseNamespace(component) {\n // If there is no parent, we are at the root level.\n if (!component) {\n return null;\n }\n\n // Some components are their own namespace.\n if (['address', 'container', 'datagrid', 'editgrid', 'dynamicWizard', 'tree'].includes(component.type) || component.tree || component.arrayTree) {\n return component.key;\n }\n\n // Anything else, keep going up.\n return this.recurseNamespace(component.parent);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n return this.renderTemplate('builder', {\n sidebar: this.renderTemplate('builderSidebar', {\n scrollEnabled: this.sideBarScroll,\n groupOrder: this.groupOrder,\n groupId: \"builder-sidebar-\".concat(this.id),\n groups: this.groupOrder.map(function (groupKey) {\n return _this4.renderTemplate('builderSidebarGroup', {\n group: _this4.groups[groupKey],\n groupKey: groupKey,\n groupId: \"builder-sidebar-\".concat(_this4.id),\n subgroups: _this4.groups[groupKey].subgroups.map(function (group) {\n return _this4.renderTemplate('builderSidebarGroup', {\n group: group,\n groupKey: group.key,\n groupId: \"group-container-\".concat(groupKey),\n subgroups: []\n });\n }),\n keyboardActionsEnabled: _this4.keyboardActionsEnabled\n });\n })\n }),\n form: this.webform.render()\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this5 = this;\n this.on('change', function (form) {\n _this5.populateRecaptchaSettings(form);\n });\n return _get(_getPrototypeOf(WebformBuilder.prototype), \"attach\", this).call(this, element).then(function () {\n _this5.loadRefs(element, {\n form: 'single',\n sidebar: 'single',\n 'sidebar-search': 'single',\n 'sidebar-groups': 'single',\n 'container': 'multiple',\n 'sidebar-anchor': 'multiple',\n 'sidebar-group': 'multiple',\n 'sidebar-container': 'multiple',\n 'sidebar-component': 'multiple'\n });\n if (_this5.sideBarScroll && Templates.current.handleBuilderSidebarScroll) {\n Templates.current.handleBuilderSidebarScroll.call(_this5, _this5);\n }\n\n // Add the paste status in form\n if (typeof window !== 'undefined' && window.sessionStorage) {\n var data = window.sessionStorage.getItem('formio.clipboard');\n if (data) {\n _this5.addClass(_this5.refs.form, 'builder-paste-mode');\n }\n }\n if (!(0, _utils.bootstrapVersion)(_this5.options)) {\n // Initialize\n _this5.refs['sidebar-group'].forEach(function (group) {\n group.style.display = group.getAttribute('data-default') === 'true' ? 'inherit' : 'none';\n });\n\n // Click event\n _this5.refs['sidebar-anchor'].forEach(function (anchor, index) {\n _this5.addEventListener(anchor, 'click', function () {\n var clickedParentId = anchor.getAttribute('data-parent').slice('#builder-sidebar-'.length);\n var clickedId = anchor.getAttribute('data-target').slice('#group-'.length);\n _this5.refs['sidebar-group'].forEach(function (group, groupIndex) {\n var openByDefault = group.getAttribute('data-default') === 'true';\n var groupId = group.getAttribute('id').slice('group-'.length);\n var groupParent = group.getAttribute('data-parent').slice('#builder-sidebar-'.length);\n group.style.display = openByDefault && groupParent === clickedId || groupId === clickedParentId || groupIndex === index ? 'inherit' : 'none';\n });\n }, true);\n });\n }\n if (_this5.keyboardActionsEnabled) {\n _this5.refs['sidebar-component'].forEach(function (component) {\n _this5.addEventListener(component, 'keydown', function (event) {\n if (event.keyCode === 13) {\n _this5.addNewComponent(component);\n }\n });\n });\n }\n _this5.addEventListener(_this5.refs['sidebar-search'], 'input', _lodash[\"default\"].debounce(function (e) {\n var searchString = e.target.value;\n _this5.searchFields(searchString);\n }, 300));\n if (_this5.dragDropEnabled) {\n _this5.initDragula();\n }\n var drake = _this5.dragula;\n if (_this5.refs.form) {\n (0, _domAutoscroller[\"default\"])([window], {\n margin: 20,\n maxSpeed: 6,\n scrollWhenOutside: true,\n autoScroll: function autoScroll() {\n return this.down && (drake === null || drake === void 0 ? void 0 : drake.dragging);\n }\n });\n return _this5.webform.attach(_this5.refs.form);\n }\n });\n }\n }, {\n key: \"searchFields\",\n value: function searchFields() {\n var _this6 = this;\n var searchString = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var searchValue = searchString.toLowerCase();\n var sidebar = this.refs['sidebar'];\n var sidebarGroups = this.refs['sidebar-groups'];\n if (!sidebar || !sidebarGroups) {\n return;\n }\n var filterGroupBy = function filterGroupBy(group) {\n var searchValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var result = _lodash[\"default\"].toPlainObject(group);\n var _result$subgroups = result.subgroups,\n subgroups = _result$subgroups === void 0 ? [] : _result$subgroups,\n components = result.components;\n var filteredComponents = [];\n for (var key in components) {\n var isMatchedToTitle = components[key].title.toLowerCase().match(searchValue);\n var isMatchedToKey = components[key].key.toLowerCase().match(searchValue);\n if (isMatchedToTitle || isMatchedToKey) {\n filteredComponents.push(components[key]);\n }\n }\n _this6.orderComponents(result, filteredComponents);\n if (searchValue) {\n result[\"default\"] = true;\n }\n if (result.componentOrder.length || subgroups.length) {\n return result;\n }\n return null;\n };\n var filterGroupOrder = function filterGroupOrder(groupOrder, searchValue) {\n var result = _lodash[\"default\"].cloneDeep(groupOrder);\n return result.filter(function (key) {\n return filterGroupBy(_this6.groups[key], searchValue);\n });\n };\n var filterSubgroups = function filterSubgroups(groups, searchValue) {\n var result = _lodash[\"default\"].clone(groups);\n return result.map(function (subgroup) {\n return filterGroupBy(subgroup, searchValue);\n }).filter(function (subgroup) {\n return !_lodash[\"default\"].isNull(subgroup);\n });\n };\n var toTemplate = function toTemplate(groupKey) {\n return {\n group: filterGroupBy(_this6.groups[groupKey], searchValue),\n groupKey: groupKey,\n groupId: sidebar.id || sidebarGroups.id,\n subgroups: filterSubgroups(_this6.groups[groupKey].subgroups, searchValue).map(function (group) {\n return _this6.renderTemplate('builderSidebarGroup', {\n group: group,\n groupKey: group.key,\n groupId: \"group-container-\".concat(groupKey),\n subgroups: []\n });\n })\n };\n };\n sidebarGroups.innerHTML = filterGroupOrder(this.groupOrder, searchValue).map(function (groupKey) {\n return _this6.renderTemplate('builderSidebarGroup', toTemplate(groupKey));\n }).join('');\n this.loadRefs(this.element, {\n 'sidebar-groups': 'single',\n 'sidebar-anchor': 'multiple',\n 'sidebar-group': 'multiple',\n 'sidebar-container': 'multiple'\n });\n this.updateDragAndDrop();\n if (searchValue === '') {\n this.triggerRedraw();\n }\n }\n }, {\n key: \"orderComponents\",\n value: function orderComponents(groupInfo, foundComponents) {\n var components = foundComponents || groupInfo.components;\n var isResource = groupInfo.key.indexOf('resource-') === 0;\n if (components) {\n groupInfo.componentOrder = Object.keys(components).map(function (key) {\n return components[key];\n }).filter(function (component) {\n return component && !component.ignore && !component.ignoreForForm;\n }).sort(function (a, b) {\n return a.weight - b.weight;\n }).map(function (component) {\n return isResource ? \"component-\".concat(component.key) : component.key;\n });\n }\n }\n }, {\n key: \"updateDragAndDrop\",\n value: function updateDragAndDrop() {\n if (this.dragDropEnabled) {\n this.initDragula();\n }\n if (this.refs.form) {\n return this.webform.attach(this.refs.form);\n }\n }\n }, {\n key: \"initDragula\",\n value: function initDragula() {\n var _this7 = this;\n var options = this.options;\n if (this.dragula) {\n this.dragula.destroy();\n }\n var containersArray = Array.prototype.slice.call(this.refs['sidebar-container']).filter(function (item) {\n return item.id !== 'group-container-resource';\n });\n if (!dragula) {\n return;\n }\n this.dragula = dragula(containersArray, {\n moves: function moves(el) {\n var moves = true;\n var list = Array.from(el.classList).filter(function (item) {\n return item.indexOf('formio-component-') === 0;\n });\n list.forEach(function (item) {\n var key = item.slice('formio-component-'.length);\n if (options.disabled && options.disabled.includes(key)) {\n moves = false;\n }\n });\n if (el.classList.contains('no-drag')) {\n moves = false;\n }\n return moves;\n },\n copy: function copy(el) {\n return el.classList.contains('drag-copy');\n },\n accepts: function accepts(el, target) {\n return !el.contains(target) && !target.classList.contains('no-drop');\n }\n }).on('drop', function (element, target, source, sibling) {\n return _this7.onDrop(element, target, source, sibling);\n });\n }\n }, {\n key: \"detach\",\n value: function detach() {\n if (this.dragula) {\n this.dragula.destroy();\n }\n this.dragula = null;\n if (this.sideBarScroll && Templates.current.clearBuilderSidebarScroll) {\n Templates.current.clearBuilderSidebarScroll.call(this, this);\n }\n _get(_getPrototypeOf(WebformBuilder.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"getComponentInfo\",\n value: function getComponentInfo(key, group) {\n var info;\n // Need to check in first order as resource component key can be the same as from webform default components\n if (group && group.slice(0, group.indexOf('-')) === 'resource') {\n // This is an existing resource field.\n var resourceGroups = this.groups.resource.subgroups;\n var resourceGroup = _lodash[\"default\"].find(resourceGroups, {\n key: group\n });\n if (resourceGroup && resourceGroup.components.hasOwnProperty(\"component-\".concat(key))) {\n info = (0, _utils.fastCloneDeep)(resourceGroup.components[\"component-\".concat(key)].schema);\n }\n }\n // This is a new component\n else if (this.schemas.hasOwnProperty(key)) {\n info = (0, _utils.fastCloneDeep)(this.schemas[key]);\n } else if (this.groups.hasOwnProperty(group)) {\n var groupComponents = this.groups[group].components;\n if (groupComponents.hasOwnProperty(key)) {\n info = (0, _utils.fastCloneDeep)(groupComponents[key].schema);\n }\n } else if (group === 'searchFields') {\n //Search components go into this group\n var _resourceGroups = this.groups.resource.subgroups;\n for (var ix = 0; ix < _resourceGroups.length; ix++) {\n var _resourceGroup = _resourceGroups[ix];\n if (_resourceGroup.components.hasOwnProperty(\"component-\".concat(key))) {\n info = (0, _utils.fastCloneDeep)(_resourceGroup.components[\"component-\".concat(key)].schema);\n break;\n }\n }\n }\n if (info) {\n info.key = this.generateKey(info);\n }\n return info;\n }\n }, {\n key: \"getComponentsPath\",\n value: function getComponentsPath(component, parent) {\n // Get path to the component in the parent component.\n var path = 'components';\n var columnIndex = 0;\n var tableRowIndex = 0;\n var tableColumnIndex = 0;\n var tabIndex = 0;\n switch (parent.type) {\n case 'table':\n tableRowIndex = _lodash[\"default\"].findIndex(parent.rows, function (row) {\n return row.some(function (column) {\n return column.components.some(function (comp) {\n return comp.key === component.key;\n });\n });\n });\n tableColumnIndex = _lodash[\"default\"].findIndex(parent.rows[tableRowIndex], function (column) {\n return column.components.some(function (comp) {\n return comp.key === component.key;\n });\n });\n path = \"rows[\".concat(tableRowIndex, \"][\").concat(tableColumnIndex, \"].components\");\n break;\n case 'columns':\n columnIndex = _lodash[\"default\"].findIndex(parent.columns, function (column) {\n return column.components.some(function (comp) {\n return comp.key === component.key;\n });\n });\n path = \"columns[\".concat(columnIndex, \"].components\");\n break;\n case 'tabs':\n tabIndex = _lodash[\"default\"].findIndex(parent.components, function (tab) {\n return tab.components.some(function (comp) {\n return comp.key === component.key;\n });\n });\n path = \"components[\".concat(tabIndex, \"].components\");\n break;\n }\n return path;\n }\n\n /* eslint-disable max-statements */\n }, {\n key: \"onDrop\",\n value: function onDrop(element, target, source, sibling) {\n var _this$groups$group,\n _this8 = this;\n if (!target) {\n return;\n }\n\n // If you try to drop within itself.\n if (element.contains(target)) {\n return;\n }\n var key = element.getAttribute('data-key');\n var type = element.getAttribute('data-type');\n var group = element.getAttribute('data-group');\n var info, isNew, path, index;\n if (key && group) {\n // This is a new component.\n info = this.getComponentInfo(key, group);\n if (!info && type) {\n info = this.getComponentInfo(type, group);\n }\n isNew = true;\n } else if (source.formioContainer) {\n index = _lodash[\"default\"].findIndex(source.formioContainer, {\n key: element.formioComponent.component.key\n });\n if (index !== -1) {\n // Grab and remove the component from the source container.\n info = source.formioContainer.splice(_lodash[\"default\"].findIndex(source.formioContainer, {\n key: element.formioComponent.component.key\n }), 1);\n\n // Since splice returns an array of one object, we need to destructure it.\n info = info[0];\n }\n }\n\n // If we haven't found the component, stop.\n if (!info) {\n return;\n }\n\n // Show an error if siblings are disabled for a component and such a component already exists.\n var compKey = group === 'resource' ? \"component-\".concat(key) : key;\n var draggableComponent = ((_this$groups$group = this.groups[group]) === null || _this$groups$group === void 0 ? void 0 : _this$groups$group.components[compKey]) || {};\n if (draggableComponent.disableSiblings) {\n var isCompAlreadyExists = false;\n (0, _formUtils.eachComponent)(this.webform.components, function (component) {\n if (component.type === draggableComponent.schema.type) {\n isCompAlreadyExists = true;\n return;\n }\n }, true);\n if (isCompAlreadyExists) {\n this.webform.redraw();\n this.webform.setAlert('danger', \"You cannot add more than one \".concat(draggableComponent.key, \" component to one page.\"));\n return;\n }\n }\n if (target !== source) {\n // Ensure the key remains unique in its new container.\n _builder[\"default\"].uniquify(this.findNamespaceRoot(target.formioComponent), info);\n }\n var parent = target.formioComponent;\n\n // Insert in the new container.\n if (target.formioContainer) {\n if (sibling) {\n if (!sibling.getAttribute('data-noattach')) {\n index = _lodash[\"default\"].findIndex(target.formioContainer, {\n key: _lodash[\"default\"].get(sibling, 'formioComponent.component.key')\n });\n index = index === -1 ? 0 : index;\n } else {\n index = sibling.getAttribute('data-position');\n }\n if (index !== -1) {\n target.formioContainer.splice(index, 0, info);\n }\n } else {\n target.formioContainer.push(info);\n }\n path = this.getComponentsPath(info, parent.component);\n index = _lodash[\"default\"].findIndex(_lodash[\"default\"].get(parent.schema, path), {\n key: info.key\n });\n if (index === -1) {\n index = 0;\n }\n }\n if (parent && parent.addChildComponent) {\n parent.addChildComponent(info, element, target, source, sibling);\n }\n var componentInDataGrid = parent.type === 'datagrid';\n if (isNew && !this.options.noNewEdit && !info.noNewEdit) {\n this.editComponent(info, target, isNew, null, null, {\n inDataGrid: componentInDataGrid\n });\n }\n\n // Only rebuild the parts needing to be rebuilt.\n var rebuild;\n if (target !== source) {\n if (source.formioContainer && source.contains(target)) {\n rebuild = source.formioComponent.rebuild();\n } else if (target.contains(source)) {\n rebuild = target.formioComponent.rebuild();\n } else {\n if (source.formioContainer) {\n rebuild = source.formioComponent.rebuild();\n }\n rebuild = target.formioComponent.rebuild();\n }\n } else {\n // If they are the same, only rebuild one.\n rebuild = target.formioComponent.rebuild();\n }\n if (!rebuild) {\n rebuild = _nativePromiseOnly[\"default\"].resolve();\n }\n return rebuild.then(function () {\n _this8.emit('addComponent', info, parent, path, index, isNew && !_this8.options.noNewEdit && !info.noNewEdit);\n if (!isNew || _this8.options.noNewEdit || info.noNewEdit) {\n _this8.emit('change', _this8.form);\n }\n });\n }\n }, {\n key: \"setForm\",\n value: function setForm(form) {\n var _this$options$propert,\n _this9 = this;\n if (!form.components) {\n form.components = [];\n }\n if (form && form.properties) {\n this.options.properties = form.properties;\n }\n this.keyboardActionsEnabled = _lodash[\"default\"].get(this.options, 'keyboardBuilder', false) || ((_this$options$propert = this.options.properties) === null || _this$options$propert === void 0 ? void 0 : _this$options$propert.keyboardBuilder);\n var isShowSubmitButton = !this.options.noDefaultSubmitButton && !form.components.length;\n\n // Ensure there is at least a submit button.\n if (isShowSubmitButton) {\n form.components.push({\n type: 'button',\n label: 'Submit',\n key: 'submit',\n size: 'md',\n block: false,\n action: 'submit',\n disableOnInvalid: true,\n theme: 'primary'\n });\n }\n if (this.webform) {\n var shouldRebuild = !this.webform.form.components || form.components.length !== this.webform.form.components.length;\n return this.webform.setForm(form, {\n keepAsReference: true\n }).then(function () {\n if (_this9.refs.form) {\n _this9.builderHeight = _this9.refs.form.offsetHeight;\n }\n if (!shouldRebuild) {\n return _this9.form;\n }\n return _this9.rebuild().then(function () {\n return _this9.form;\n });\n });\n }\n return _nativePromiseOnly[\"default\"].resolve(form);\n }\n }, {\n key: \"populateRecaptchaSettings\",\n value: function populateRecaptchaSettings(form) {\n //populate isEnabled for recaptcha form settings\n var isRecaptchaEnabled = false;\n if (this.form.components) {\n (0, _formUtils.eachComponent)(form.components, function (component) {\n if (isRecaptchaEnabled) {\n return;\n }\n if (component.type === 'recaptcha') {\n isRecaptchaEnabled = true;\n return false;\n }\n });\n if (isRecaptchaEnabled) {\n _lodash[\"default\"].set(form, 'settings.recaptcha.isEnabled', true);\n } else if (_lodash[\"default\"].get(form, 'settings.recaptcha.isEnabled')) {\n _lodash[\"default\"].set(form, 'settings.recaptcha.isEnabled', false);\n }\n }\n }\n }, {\n key: \"removeComponent\",\n value: function removeComponent(component, parent, original) {\n var _this10 = this;\n if (!parent) {\n return;\n }\n var remove = true;\n var removingComponentsGroup = !component.skipRemoveConfirm && (Array.isArray(component.components) && component.components.length || Array.isArray(component.rows) && component.rows.length || Array.isArray(component.columns) && component.columns.length);\n if (this.options.alwaysConfirmComponentRemoval || removingComponentsGroup) {\n var message = removingComponentsGroup ? 'Removing this component will also remove all of its children. Are you sure you want to do this?' : 'Are you sure you want to remove this component?';\n remove = window.confirm(this.t(message));\n }\n if (!original) {\n original = parent.formioContainer.find(function (comp) {\n return comp.id === component.id;\n });\n }\n var index = parent.formioContainer ? parent.formioContainer.indexOf(original) : 0;\n if (remove && index !== -1) {\n var path = this.getComponentsPath(component, parent.formioComponent.component);\n if (parent.formioContainer) {\n parent.formioContainer.splice(index, 1);\n } else if (parent.formioComponent && parent.formioComponent.removeChildComponent) {\n parent.formioComponent.removeChildComponent(component);\n }\n var rebuild = parent.formioComponent.rebuild() || _nativePromiseOnly[\"default\"].resolve();\n rebuild.then(function () {\n _this10.emit('removeComponent', component, parent.formioComponent.schema, path, index);\n _this10.emit('change', _this10.form);\n });\n }\n return remove;\n }\n }, {\n key: \"replaceDoubleQuotes\",\n value: function replaceDoubleQuotes(data) {\n var fieldsToRemoveDoubleQuotes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n if (data) {\n fieldsToRemoveDoubleQuotes.forEach(function (key) {\n if (data[key]) {\n data[key] = data[key].replace(/\"/g, \"'\");\n }\n });\n return data;\n }\n }\n }, {\n key: \"updateComponent\",\n value: function updateComponent(component, changed) {\n var _this11 = this;\n // Update the preview.\n if (this.preview) {\n this.preview.form = {\n components: [_lodash[\"default\"].omit(_objectSpread({}, component), ['hidden', 'conditional', 'calculateValue', 'logic', 'autofocus', 'customConditional'])],\n config: this.options.formConfig || {}\n };\n var fieldsToRemoveDoubleQuotes = ['label', 'tooltip'];\n this.preview.form.components.forEach(function (component) {\n return _this11.replaceDoubleQuotes(component, fieldsToRemoveDoubleQuotes);\n });\n var previewElement = this.componentEdit.querySelector('[ref=\"preview\"]');\n if (previewElement) {\n this.setContent(previewElement, this.preview.render());\n this.preview.attach(previewElement);\n }\n }\n\n // Change the \"default value\" field to be reflective of this component.\n var defaultValueComponent = (0, _formUtils.getComponent)(this.editForm.components, 'defaultValue', true);\n if (defaultValueComponent && component.type !== 'hidden') {\n var defaultChanged = changed && (changed.component && changed.component.key === 'defaultValue' || changed.instance && defaultValueComponent.hasComponent && defaultValueComponent.hasComponent(changed.instance));\n if (!defaultChanged) {\n _lodash[\"default\"].assign(defaultValueComponent.component, _lodash[\"default\"].omit(_objectSpread({}, component), ['key', 'label', 'placeholder', 'tooltip', 'hidden', 'autofocus', 'validate', 'disabled', 'defaultValue', 'customDefaultValue', 'calculateValue', 'conditional', 'customConditional', 'id']));\n var parentComponent = defaultValueComponent.parent;\n var tabIndex = -1;\n var index = -1;\n parentComponent.tabs.some(function (tab, tIndex) {\n tab.some(function (comp, compIndex) {\n if (comp.id === defaultValueComponent.id) {\n tabIndex = tIndex;\n index = compIndex;\n return true;\n }\n return false;\n });\n });\n if (tabIndex !== -1 && index !== -1 && changed && !_lodash[\"default\"].isNil(changed.value)) {\n var sibling = parentComponent.tabs[tabIndex][index + 1];\n parentComponent.removeComponent(defaultValueComponent);\n var newComp = parentComponent.addComponent(defaultValueComponent.component, defaultValueComponent.data, sibling);\n _lodash[\"default\"].pull(newComp.validators, 'required');\n parentComponent.tabs[tabIndex].splice(index, 1, newComp);\n newComp.checkValidity = function () {\n return true;\n };\n newComp.build(defaultValueComponent.element);\n }\n } else {\n var dataPath = changed.instance._data.key;\n var path = (0, _utils.getArrayFromComponentPath)(changed.instance.path);\n path.shift();\n if (path.length) {\n path.unshift(component.key);\n dataPath = (0, _utils.getStringFromComponentPath)(path);\n }\n _lodash[\"default\"].set(this.preview._data, dataPath, changed.value);\n _lodash[\"default\"].set(this.webform._data, dataPath, changed.value);\n }\n }\n\n // Called when we update a component.\n this.emit('updateComponent', component);\n }\n }, {\n key: \"findRepeatablePaths\",\n value: function findRepeatablePaths() {\n var repeatablePaths = [];\n var keys = new Map();\n (0, _formUtils.eachComponent)(this.form.components, function (comp, path) {\n if (!comp.key) {\n return;\n }\n if (keys.has(comp.key)) {\n if (keys.get(comp.key).includes(path)) {\n repeatablePaths.push(path);\n } else {\n keys.set(comp.key, [].concat(_toConsumableArray(keys.get(comp.key)), [path]));\n }\n } else {\n keys.set(comp.key, [path]);\n }\n }, true);\n return repeatablePaths;\n }\n }, {\n key: \"highlightInvalidComponents\",\n value: function highlightInvalidComponents() {\n var repeatablePaths = this.findRepeatablePaths();\n var hasInvalidComponents = false;\n this.webform.everyComponent(function (comp) {\n var _comp$error, _comp$error$message;\n var path = comp.path;\n if (repeatablePaths.includes(path)) {\n comp.setCustomValidity(\"API Key is not unique: \".concat(comp.key));\n hasInvalidComponents = true;\n } else if ((_comp$error = comp.error) !== null && _comp$error !== void 0 && (_comp$error$message = _comp$error.message) !== null && _comp$error$message !== void 0 && _comp$error$message.startsWith('API Key is not unique')) {\n comp.setCustomValidity('');\n }\n });\n this.emit('builderFormValidityChange', hasInvalidComponents);\n }\n\n /**\n * Called when a new component is saved.\n *\n * @param parent\n * @param component\n * @return {boolean}\n */\n }, {\n key: \"saveComponent\",\n value: function saveComponent(component, parent, isNew, original) {\n var _this12 = this;\n this.editForm.detach();\n var parentContainer = parent ? parent.formioContainer : this.container;\n var parentComponent = parent ? parent.formioComponent : this;\n this.dialog.close();\n var path = parentContainer ? this.getComponentsPath(component, parentComponent.component) : '';\n if (!original) {\n original = parent.formioContainer.find(function (comp) {\n return comp.id === component.id;\n });\n }\n var index = parentContainer ? parentContainer.indexOf(original) : 0;\n if (index !== -1) {\n var submissionData = this.editForm.submission.data;\n submissionData = submissionData.componentJson || submissionData;\n var fieldsToRemoveDoubleQuotes = ['label', 'tooltip'];\n this.replaceDoubleQuotes(submissionData, fieldsToRemoveDoubleQuotes);\n this.hook('beforeSaveComponentSettings', submissionData);\n var comp = null;\n parentComponent.getComponents().forEach(function (component) {\n if (component.component.key === original.key) {\n comp = component;\n }\n });\n var originalComp = comp.component;\n var originalComponentSchema = comp.schema;\n var isParentSaveChildMethod = this.isParentSaveChildMethod(parent.formioComponent);\n if (parentContainer && !isParentSaveChildMethod) {\n parentContainer[index] = submissionData;\n if (comp) {\n comp.component = submissionData;\n }\n } else if (isParentSaveChildMethod) {\n parent.formioComponent.saveChildComponent(submissionData);\n }\n var rebuild = parentComponent.rebuild() || _nativePromiseOnly[\"default\"].resolve();\n return rebuild.then(function () {\n var schema = parentContainer ? parentContainer[index] : comp ? comp.schema : [];\n _this12.emitSaveComponentEvent(schema, originalComp, parentComponent.schema, path, index, isNew, originalComponentSchema);\n _this12.emit('change', _this12.form);\n _this12.highlightInvalidComponents();\n if (_this12.isComponentCreated) {\n var _component = parent.formioComponent.components[0];\n _this12.moveComponent(_component);\n _this12.isComponentCreated = false;\n }\n });\n }\n this.highlightInvalidComponents();\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"emitSaveComponentEvent\",\n value: function emitSaveComponentEvent(schema, originalComp, parentComponentSchema, path, index, isNew, originalComponentSchema) {\n this.emit('saveComponent', schema, originalComp, parentComponentSchema, path, index, isNew, originalComponentSchema);\n }\n }, {\n key: \"attachEditComponentControls\",\n value: function attachEditComponentControls(component, parent, isNew, original, ComponentClass) {\n var _this13 = this;\n var cancelButtons = this.componentEdit.querySelectorAll('[ref=\"cancelButton\"]');\n cancelButtons.forEach(function (cancelButton) {\n _this13.editForm.addEventListener(cancelButton, 'click', function (event) {\n event.preventDefault();\n _this13.editForm.detach();\n _this13.emit('cancelComponent', component);\n _this13.dialog.close();\n _this13.highlightInvalidComponents();\n });\n });\n var removeButtons = this.componentEdit.querySelectorAll('[ref=\"removeButton\"]');\n removeButtons.forEach(function (removeButton) {\n _this13.editForm.addEventListener(removeButton, 'click', function (event) {\n event.preventDefault();\n // Since we are already removing the component, don't trigger another remove.\n _this13.saved = true;\n _this13.editForm.detach();\n _this13.removeComponent(component, parent, original);\n _this13.dialog.close();\n _this13.highlightInvalidComponents();\n });\n });\n var saveButtons = this.componentEdit.querySelectorAll('[ref=\"saveButton\"]');\n saveButtons.forEach(function (saveButton) {\n _this13.editForm.addEventListener(saveButton, 'click', function (event) {\n event.preventDefault();\n if (!_this13.editForm.checkValidity(_this13.editForm.data, true, _this13.editForm.data)) {\n _this13.editForm.setPristine(false);\n _this13.editForm.showErrors();\n return false;\n }\n _this13.saved = true;\n _this13.saveComponent(component, parent, isNew, original);\n });\n });\n var previewButtons = this.componentEdit.querySelectorAll('[ref=\"previewButton\"]');\n previewButtons.forEach(function (previewButton) {\n _this13.editForm.addEventListener(previewButton, 'click', function (event) {\n event.preventDefault();\n _this13.showPreview = !_this13.showPreview;\n _this13.editForm.detach();\n _this13.setContent(_this13.componentEdit, _this13.renderTemplate('builderEditForm', {\n componentInfo: ComponentClass.builderInfo,\n editForm: _this13.editForm.render(),\n preview: _this13.preview ? _this13.preview.render() : false,\n showPreview: _this13.showPreview,\n helplinks: _this13.helplinks\n }));\n _this13.editForm.attach(_this13.componentEdit.querySelector('[ref=\"editForm\"]'));\n _this13.attachEditComponentControls(component, parent, isNew, original, ComponentClass);\n });\n });\n }\n }, {\n key: \"editComponent\",\n value: function editComponent(component, parent, isNew, isJsonEdit, original) {\n var _ComponentClass$build,\n _this14 = this;\n var flags = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};\n if (!component.key) {\n return;\n }\n this.saved = false;\n var componentCopy = (0, _utils.fastCloneDeep)(component);\n var ComponentClass = _Components[\"default\"].components[componentCopy.type];\n var isCustom = ComponentClass === undefined;\n isJsonEdit = isJsonEdit || isCustom;\n ComponentClass = isCustom ? _Components[\"default\"].components.unknown : ComponentClass;\n // Make sure we only have one dialog open at a time.\n if (this.dialog) {\n this.dialog.close();\n this.highlightInvalidComponents();\n }\n\n // This is the render step.\n var editFormOptions = _lodash[\"default\"].clone(_lodash[\"default\"].get(this, 'options.editForm', {}));\n if (this.editForm) {\n this.editForm.destroy();\n }\n\n // Allow editForm overrides per component.\n var overrides = _lodash[\"default\"].get(this.options, \"editForm.\".concat(componentCopy.type), {});\n\n // Pass along the form being edited.\n editFormOptions.editForm = this.form;\n editFormOptions.editComponent = component;\n editFormOptions.flags = flags;\n this.hook('editComponentParentInstance', editFormOptions, parent);\n this.editForm = new _Webform[\"default\"](_objectSpread(_objectSpread({}, _lodash[\"default\"].omit(this.options, ['hooks', 'builder', 'events', 'attachMode', 'skipInit'])), {}, {\n language: this.options.language\n }, editFormOptions));\n this.hook('editFormProperties', parent);\n this.editForm.form = isJsonEdit && !isCustom ? {\n components: [{\n type: 'textarea',\n as: 'json',\n editor: 'ace',\n weight: 10,\n input: true,\n key: 'componentJson',\n label: 'Component JSON',\n tooltip: 'Edit the JSON for this component.'\n }, {\n type: 'checkbox',\n key: 'showFullSchema',\n label: 'Full Schema'\n }]\n } : ComponentClass.editForm(_lodash[\"default\"].cloneDeep(overrides));\n var instanceOptions = {\n inFormBuilder: true\n };\n this.hook('instanceOptionsPreview', instanceOptions);\n var instance = new ComponentClass(componentCopy, instanceOptions);\n var schema = this.hook('builderComponentSchema', component, instance);\n this.editForm.submission = isJsonEdit ? {\n data: {\n componentJson: schema,\n showFullSchema: this.options.showFullJsonSchema\n }\n } : {\n data: instance.component\n };\n if (this.preview) {\n this.preview.destroy();\n }\n if (!ComponentClass.builderInfo.hasOwnProperty('preview') || ComponentClass.builderInfo.preview) {\n this.preview = new _Webform[\"default\"](_lodash[\"default\"].omit(_objectSpread(_objectSpread({}, this.options), {}, {\n preview: true\n }), ['hooks', 'builder', 'events', 'attachMode', 'calculateValue']));\n this.hook('previewFormSettitngs', schema, isJsonEdit);\n }\n this.showPreview = (_ComponentClass$build = ComponentClass.builderInfo.showPreview) !== null && _ComponentClass$build !== void 0 ? _ComponentClass$build : true;\n this.componentEdit = this.ce('div', {\n 'class': 'component-edit-container'\n });\n this.setContent(this.componentEdit, this.renderTemplate('builderEditForm', {\n componentInfo: ComponentClass.builderInfo,\n editForm: this.editForm.render(),\n preview: this.preview ? this.preview.render() : false,\n showPreview: this.showPreview,\n helplinks: this.helplinks\n }));\n this.dialog = this.createModal(this.componentEdit, _lodash[\"default\"].get(this.options, 'dialogAttr', {}));\n\n // This is the attach step.\n this.editForm.attach(this.componentEdit.querySelector('[ref=\"editForm\"]'));\n this.hook('editFormWrapper');\n this.updateComponent(componentCopy);\n this.editForm.on('change', function (event) {\n if (event.changed) {\n if (event.changed.component && event.changed.component.key === 'showFullSchema') {\n var value = event.changed.value;\n _this14.editForm.submission = {\n data: {\n componentJson: value ? instance.component : component,\n showFullSchema: value\n }\n };\n return;\n }\n // See if this is a manually modified key. Treat custom component keys as manually modified\n if (event.changed.component && event.changed.component.key === 'key' || isJsonEdit) {\n componentCopy.keyModified = true;\n }\n var isComponentLabelChanged = false;\n if (event.changed.instance) {\n isComponentLabelChanged = ['label', 'title'].includes(event.changed.instance.path);\n } else if (event.changed.component) {\n isComponentLabelChanged = ['label', 'title'].includes(event.changed.component.key);\n }\n if (isComponentLabelChanged) {\n // Ensure this component has a key.\n if (isNew) {\n if (!event.data.keyModified) {\n _this14.editForm.everyComponent(function (component) {\n if (component.key === 'key' && component.parent.component.key === 'tabs') {\n component.setValue(_this14.updateComponentKey(event.data));\n return false;\n }\n });\n }\n if (_this14.form) {\n var formComponents = _this14.findNamespaceRoot(parent.formioComponent);\n // excluding component which key uniqueness is to be checked to prevent the comparing of the same keys\n formComponents = formComponents.filter(function (comp) {\n return editFormOptions.editComponent.id !== comp.id;\n });\n\n // Set a unique key for this component.\n _builder[\"default\"].uniquify(formComponents, event.data);\n }\n }\n }\n\n // Update the component.\n _this14.updateComponent(event.data.componentJson || event.data, event.changed);\n }\n });\n this.attachEditComponentControls(component, parent, isNew, original, ComponentClass);\n var dialogClose = function dialogClose() {\n _this14.editForm.destroy(true);\n if (_this14.preview) {\n _this14.preview.destroy(true);\n _this14.preview = null;\n }\n if (isNew && !_this14.saved) {\n _this14.removeComponent(component, parent, original);\n _this14.highlightInvalidComponents();\n }\n // Clean up.\n _this14.removeEventListener(_this14.dialog, 'close', dialogClose);\n _this14.dialog = null;\n };\n this.addEventListener(this.dialog, 'close', dialogClose);\n\n // Called when we edit a component.\n this.emit('editComponent', component);\n }\n }, {\n key: \"updateComponentKey\",\n value: function updateComponentKey(data) {\n return _lodash[\"default\"].camelCase(data.title || data.label || data.placeholder || data.type).replace(/^[0-9]*/, '');\n }\n }, {\n key: \"moveComponent\",\n value: function moveComponent(component) {\n if (this.selectedComponent) {\n var _prevSelected$element;\n var prevSelected = this.selectedComponent;\n (_prevSelected$element = prevSelected.element) === null || _prevSelected$element === void 0 ? void 0 : _prevSelected$element.classList.remove('builder-component-selected');\n this.removeEventListener(document, 'keydown');\n }\n component.element.focus();\n component.element.classList.add('builder-component-selected');\n this.selectedComponent = component;\n this.addEventListener(document, 'keydown', this.moveHandler.bind(this));\n }\n }, {\n key: \"updateComponentPlacement\",\n value: function updateComponentPlacement(direction) {\n var component = this.selectedComponent;\n var index, info;\n var step = direction ? -1 : 1;\n if (component) {\n var element = component.element;\n var sibling = direction ? element.previousElementSibling : element.nextElementSibling;\n var source = element.parentNode;\n var containerLength = source.formioContainer.length;\n if (containerLength && containerLength <= 1) {\n return;\n }\n if (source.formioContainer) {\n index = _lodash[\"default\"].findIndex(source.formioContainer, {\n key: element.formioComponent.component.key\n });\n if (index !== -1) {\n info = source.formioContainer.splice(_lodash[\"default\"].findIndex(source.formioContainer, {\n key: element.formioComponent.component.key\n }), 1);\n info = info[0];\n source.removeChild(element);\n }\n }\n var len = source.formioComponent.components.length;\n index = index === -1 ? 0 : index + step;\n if (index === -1) {\n source.formioContainer.push(info);\n source.appendChild(element);\n } else if (index === len) {\n var key = source.formioContainer[0].key;\n index = _lodash[\"default\"].findIndex(source.formioComponent.components, {\n key: key\n });\n var firstElement = source.formioComponent.components[index].element;\n source.formioContainer.splice(0, 0, info);\n source.insertBefore(element, firstElement);\n } else if (index !== -1) {\n source.formioContainer.splice(index, 0, info);\n direction ? source.insertBefore(element, sibling) : source.insertBefore(element, sibling.nextElementSibling);\n }\n element.focus();\n }\n }\n }, {\n key: \"stopMoving\",\n value: function stopMoving(comp) {\n var parent = comp.element.parentNode;\n this.removeEventListener(document, 'keydown');\n parent.formioComponent.rebuild();\n this.selectedComponent = null;\n }\n }, {\n key: \"addNewComponent\",\n value: function addNewComponent(element) {\n var _source$formioCompone,\n _this15 = this;\n var source = document.querySelector('.formio-builder-form');\n var key = element.getAttribute('data-key');\n var group = element.getAttribute('data-group');\n var isNew = true;\n var info;\n if (key && group) {\n info = this.getComponentInfo(key, group);\n }\n if (isNew && !this.options.noNewEdit && !info.noNewEdit) {\n _builder[\"default\"].uniquify(this.findNamespaceRoot(source.formioComponent), info);\n this.editComponent(info, source, isNew, null, null);\n }\n var firstComponent = (_source$formioCompone = source.formioComponent.components[0]) === null || _source$formioCompone === void 0 ? void 0 : _source$formioCompone.element;\n if (firstComponent) {\n source.formioContainer.splice(0, 0, info);\n } else {\n source.formioContainer.push(info);\n }\n source.formioComponent.rebuild().then(function () {\n _this15.isComponentCreated = true;\n });\n }\n\n /**\n * Creates copy of component schema and stores it under sessionStorage.\n * @param {Component} component\n * @return {*}\n */\n }, {\n key: \"copyComponent\",\n value: function copyComponent(component) {\n if (!window.sessionStorage) {\n return console.warn('Session storage is not supported in this browser.');\n }\n this.addClass(this.refs.form, 'builder-paste-mode');\n window.sessionStorage.setItem('formio.clipboard', JSON.stringify(component.schema));\n }\n\n /**\n * Paste copied component after the current component.\n * @param {Component} component\n * @return {*}\n */\n }, {\n key: \"pasteComponent\",\n value: function pasteComponent(component) {\n if (!window.sessionStorage) {\n return console.warn('Session storage is not supported in this browser.');\n }\n this.removeClass(this.refs.form, 'builder-paste-mode');\n if (window.sessionStorage) {\n var data = window.sessionStorage.getItem('formio.clipboard');\n if (data) {\n var schema = JSON.parse(data);\n var parent = this.getParentElement(component.element);\n if (parent) {\n _builder[\"default\"].uniquify(this.findNamespaceRoot(parent.formioComponent), schema);\n var path = '';\n var index = 0;\n var isParentSaveChildMethod = this.isParentSaveChildMethod(parent.formioComponent);\n if (parent.formioContainer && !isParentSaveChildMethod) {\n index = parent.formioContainer.indexOf(component.component);\n path = this.getComponentsPath(schema, parent.formioComponent.component);\n parent.formioContainer.splice(index + 1, 0, schema);\n } else if (isParentSaveChildMethod) {\n parent.formioComponent.saveChildComponent(schema, false);\n }\n parent.formioComponent.rebuild();\n this.emitSaveComponentEvent(schema, schema, parent.formioComponent.component, path, index + 1, true, schema);\n }\n this.emit('change', this.form);\n }\n }\n }\n }, {\n key: \"isParentSaveChildMethod\",\n value: function isParentSaveChildMethod(parentComp) {\n return !!(parentComp && parentComp.saveChildComponent);\n }\n }, {\n key: \"getParentElement\",\n value: function getParentElement(element) {\n var container = element;\n do {\n container = container.parentNode;\n } while (container && !container.formioComponent);\n return container;\n }\n }, {\n key: \"addBuilderComponentInfo\",\n value: function addBuilderComponentInfo(component) {\n if (!component || !component.group || !this.groups[component.group]) {\n return;\n }\n component = _lodash[\"default\"].clone(component);\n var groupInfo = this.groups[component.group];\n if (!groupInfo.components.hasOwnProperty(component.key)) {\n groupInfo.components[component.key] = component;\n }\n return component;\n }\n }, {\n key: \"init\",\n value: function init() {\n if (this.webform) {\n this.webform.init();\n }\n return _get(_getPrototypeOf(WebformBuilder.prototype), \"init\", this).call(this);\n }\n }, {\n key: \"clear\",\n value: function clear() {\n if (this.webform.initialized) {\n this.webform.clear();\n }\n }\n }, {\n key: \"destroy\",\n value: function destroy(deleteFromGlobal) {\n if (this.webform.initialized) {\n this.webform.destroy(deleteFromGlobal);\n }\n _get(_getPrototypeOf(WebformBuilder.prototype), \"destroy\", this).call(this, deleteFromGlobal);\n }\n }, {\n key: \"addBuilderGroup\",\n value: function addBuilderGroup(name, group) {\n if (!this.groups[name]) {\n this.groups[name] = group;\n this.groupOrder.push(name);\n this.triggerRedraw();\n } else {\n this.updateBuilderGroup(name, group);\n }\n }\n }, {\n key: \"updateBuilderGroup\",\n value: function updateBuilderGroup(name, group) {\n if (this.groups[name]) {\n this.groups[name] = group;\n this.triggerRedraw();\n }\n }\n }, {\n key: \"generateKey\",\n value: function generateKey(info) {\n return info.key || _lodash[\"default\"].camelCase(info.title || info.label || info.placeholder || info.type);\n }\n }]);\n return WebformBuilder;\n}(_Component2[\"default\"]);\nexports[\"default\"] = WebformBuilder;\n\n//# sourceURL=webpack://Formio/./lib/WebformBuilder.js?"); /***/ }), @@ -136,7 +136,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.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.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.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.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\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\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.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.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.js */ \"./node_modules/core-js/modules/es.array.find.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.map.js */ \"./node_modules/core-js/modules/es.array.map.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.concat.js */ \"./node_modules/core-js/modules/es.array.concat.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.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.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.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.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 _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Webform2 = _interopRequireDefault(__webpack_require__(/*! ./Webform */ \"./lib/Webform.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 _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 _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 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 Wizard = /*#__PURE__*/function (_Webform) {\n _inherits(Wizard, _Webform);\n var _super = _createSuper(Wizard);\n /**\n * Constructor for wizard based forms\n * @param element Dom element to place this wizard.\n * @param {Object} options Options object, supported options are:\n * - breadcrumbSettings.clickable: true (default) determines if the breadcrumb bar is clickable or not\n * - buttonSettings.show*(Previous, Next, Cancel): true (default) determines if the button is shown or not\n * - allowPrevious: false (default) determines if the breadcrumb bar is clickable or not for visited tabs\n */\n function Wizard() {\n var _this;\n _classCallCheck(this, Wizard);\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 options.display = 'wizard';\n _this = _super.call(this, element, options);\n _this.pages = [];\n _this.prefixComps = [];\n _this.suffixComps = [];\n _this.components = [];\n _this.originalComponents = [];\n _this.page = 0;\n _this.currentPanel = null;\n _this.currentPanels = null;\n _this.currentNextPage = 0;\n _this._seenPages = [0];\n _this.subWizards = [];\n _this.allPages = [];\n _this.lastPromise = _nativePromiseOnly[\"default\"].resolve();\n _this.enabledIndex = 0;\n _this.editMode = false;\n _this.originalOptions = _lodash[\"default\"].cloneDeep(_this.options);\n return _this;\n }\n _createClass(Wizard, [{\n key: \"isLastPage\",\n value: function isLastPage() {\n var next = this.getNextPage();\n if (_lodash[\"default\"].isNumber(next)) {\n return next === -1;\n }\n return _lodash[\"default\"].isNull(next);\n }\n }, {\n key: \"getPages\",\n value: function getPages() {\n var _this2 = this;\n var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _args$all = args.all,\n all = _args$all === void 0 ? false : _args$all;\n var pages = this.hasExtraPages ? this.components : this.pages;\n var filteredPages = pages.filter(all ? _lodash[\"default\"].identity : function (p, index) {\n return _this2._seenPages.includes(index);\n });\n return filteredPages;\n }\n }, {\n key: \"hasExtraPages\",\n get: function get() {\n return !_lodash[\"default\"].isEmpty(this.subWizards);\n }\n }, {\n key: \"data\",\n get: function get() {\n return _get(_getPrototypeOf(Wizard.prototype), \"data\", this);\n },\n set: function set(value) {\n var _this3 = this;\n this._data = value;\n _lodash[\"default\"].each(this.getPages({\n all: true\n }), function (component) {\n component.data = _this3.componentContext(component);\n });\n }\n }, {\n key: \"localData\",\n get: function get() {\n var _this$pages$this$page, _this$pages$this$page2;\n return ((_this$pages$this$page = this.pages[this.page]) === null || _this$pages$this$page === void 0 ? void 0 : (_this$pages$this$page2 = _this$pages$this$page.root) === null || _this$pages$this$page2 === void 0 ? void 0 : _this$pages$this$page2.submission.data) || this.submission.data;\n }\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n var visible = _get(_getPrototypeOf(Wizard.prototype), \"checkConditions\", this).call(this, data, flags, row);\n this.establishPages(data);\n return visible;\n }\n }, {\n key: \"getComponents\",\n value: function getComponents() {\n return this.submitting ? this.getPages({\n all: this.isLastPage()\n }) : _get(_getPrototypeOf(Wizard.prototype), \"getComponents\", this).call(this);\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n this.getPages({\n all: true\n }).forEach(function (page) {\n return page.resetValue();\n });\n this.setPristine(true);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this$pages,\n _this4 = this;\n // Check for and initlize button settings object\n this.options.buttonSettings = _lodash[\"default\"].defaults(this.options.buttonSettings, {\n showPrevious: true,\n showNext: true,\n showSubmit: true,\n showCancel: !this.options.readOnly\n });\n if (!this.isSecondInit) {\n var _this$options, _this$options$breadcr;\n this.isClickableDefined = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : (_this$options$breadcr = _this$options.breadcrumbSettings) === null || _this$options$breadcr === void 0 ? void 0 : _this$options$breadcr.hasOwnProperty('clickable');\n this.isSecondInit = true;\n }\n this.options.breadcrumbSettings = _lodash[\"default\"].defaults(this.options.breadcrumbSettings, {\n clickable: true\n });\n this.options.allowPrevious = this.options.allowPrevious || false;\n this.page = 0;\n var onReady = _get(_getPrototypeOf(Wizard.prototype), \"init\", this).call(this);\n this.setComponentSchema();\n if ((_this$pages = this.pages) !== null && _this$pages !== void 0 && _this$pages[this.page]) {\n this.component = this.pages[this.page].component;\n }\n this.on('subWizardsUpdated', function (subForm) {\n var subWizard = _this4.subWizards.find(function (subWizard) {\n var _subWizard$subForm;\n return (subForm === null || subForm === void 0 ? void 0 : subForm.id) && ((_subWizard$subForm = subWizard.subForm) === null || _subWizard$subForm === void 0 ? void 0 : _subWizard$subForm.id) === (subForm === null || subForm === void 0 ? void 0 : subForm.id);\n });\n if (_this4.subWizards.length && subWizard) {\n subWizard.subForm.setValue(subForm._submission, {}, true);\n _this4.establishPages();\n _this4.redraw();\n }\n });\n return onReady;\n }\n }, {\n key: \"wizardKey\",\n get: function get() {\n return \"wizard-\".concat(this.id);\n }\n }, {\n key: \"wizard\",\n get: function get() {\n return this.form;\n },\n set: function set(form) {\n this.setForm(form);\n }\n }, {\n key: \"buttons\",\n get: function get() {\n var _this5 = this;\n var buttons = {};\n [{\n name: 'cancel',\n method: 'cancel'\n }, {\n name: 'previous',\n method: 'prevPage'\n }, {\n name: 'next',\n method: 'nextPage'\n }, {\n name: 'submit',\n method: 'submit'\n }].forEach(function (button) {\n if (_this5.hasButton(button.name)) {\n buttons[button.name] = button;\n }\n });\n return buttons;\n }\n }, {\n key: \"buttonOrder\",\n get: function get() {\n var _this$options$propert, _this$options$propert2, _this$options$propert3;\n var defaultButtonOrder = ['cancel', 'previous', 'next', 'submit'];\n return (_this$options$propert = (_this$options$propert2 = this.options.properties) === null || _this$options$propert2 === void 0 ? void 0 : (_this$options$propert3 = _this$options$propert2.wizardButtonOrder) === null || _this$options$propert3 === void 0 ? void 0 : _this$options$propert3.toLowerCase().split(', ')) !== null && _this$options$propert !== void 0 ? _this$options$propert : defaultButtonOrder;\n }\n }, {\n key: \"renderContext\",\n get: function get() {\n var _this$root, _this$root$component;\n return {\n disableWizardSubmit: this.form.disableWizardSubmit,\n wizardKey: this.wizardKey,\n isBreadcrumbClickable: this.isBreadcrumbClickable(),\n isSubForm: !!this.parent && !((_this$root = this.root) !== null && _this$root !== void 0 && (_this$root$component = _this$root.component) !== null && _this$root$component !== void 0 && _this$root$component.type) === 'wizard',\n panels: this.allPages.length ? this.allPages.map(function (page) {\n return page.component;\n }) : this.pages.map(function (page) {\n return page.component;\n }),\n buttons: this.buttons,\n currentPage: this.page,\n buttonOrder: this.buttonOrder\n };\n }\n }, {\n key: \"prepareNavigationSettings\",\n value: function prepareNavigationSettings(ctx) {\n var currentPanel = this.currentPanel;\n if (currentPanel && currentPanel.buttonSettings) {\n Object.keys(currentPanel.buttonSettings).forEach(function () {\n Object.keys(ctx.buttons).forEach(function (key) {\n if (typeof currentPanel.buttonSettings[key] !== 'undefined' && !currentPanel.buttonSettings[key] || ctx.isSubForm) {\n ctx.buttons[key] = null;\n }\n });\n });\n }\n return this.renderTemplate('wizardNav', ctx);\n }\n }, {\n key: \"prepareHeaderSettings\",\n value: function prepareHeaderSettings(ctx, headerType) {\n if (this.currentPanel && this.currentPanel.breadcrumb === 'none' || ctx.isSubForm) {\n return null;\n }\n return this.renderTemplate(headerType, ctx);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this6 = this;\n var ctx = this.renderContext;\n if (this.component.key) {\n ctx.panels.map(function (panel) {\n if (panel.key === _this6.component.key) {\n _this6.currentPanel = panel;\n ctx.wizardPageTooltip = _this6.getFormattedTooltip(panel.tooltip);\n }\n });\n }\n var wizardNav = this.prepareNavigationSettings(ctx);\n var wizardHeaderType = \"wizardHeader\".concat(_lodash[\"default\"].get(this.form, 'settings.wizardHeaderType', ''));\n var wizardHeaderLocation = _lodash[\"default\"].get(this.form, 'settings.wizardHeaderLocation', 'left');\n var wizardHeader = this.prepareHeaderSettings(ctx, wizardHeaderType);\n return this.renderTemplate('wizard', _objectSpread(_objectSpread({}, ctx), {}, {\n className: _get(_getPrototypeOf(Wizard.prototype), \"getClassName\", this).call(this),\n wizardHeader: wizardHeader,\n wizardHeaderType: wizardHeaderType,\n wizardHeaderLocation: wizardHeaderLocation,\n wizardNav: wizardNav,\n components: this.renderComponents([].concat(_toConsumableArray(this.prefixComps), _toConsumableArray(this.currentPage.components), _toConsumableArray(this.suffixComps)))\n }), this.builderMode ? 'builder' : 'form');\n }\n }, {\n key: \"redrawNavigation\",\n value: function redrawNavigation() {\n if (this.element) {\n var navElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-nav\"));\n if (navElement) {\n var _this$loadRefs;\n this.detachNav();\n navElement.outerHTML = this.renderTemplate('wizardNav', this.renderContext);\n navElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-nav\"));\n this.loadRefs(navElement, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-cancel\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-previous\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-next\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-submit\"), 'single'), _this$loadRefs));\n this.attachNav();\n }\n }\n }\n }, {\n key: \"redrawHeader\",\n value: function redrawHeader() {\n if (this.element) {\n var headerElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-header\"));\n if (headerElement) {\n var _this$loadRefs2;\n this.detachHeader();\n headerElement.outerHTML = this.renderTemplate(\"wizardHeader\".concat(_lodash[\"default\"].get(this.form, 'settings.wizardHeaderType', '')), this.renderContext);\n headerElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-header\"));\n this.loadRefs(headerElement, (_this$loadRefs2 = {}, _defineProperty(_this$loadRefs2, \"\".concat(this.wizardKey, \"-link\"), 'multiple'), _defineProperty(_this$loadRefs2, \"\".concat(this.wizardKey, \"-tooltip\"), 'multiple'), _this$loadRefs2));\n this.attachHeader();\n }\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs3,\n _this7 = this;\n this.element = element;\n this.loadRefs(element, (_this$loadRefs3 = {}, _defineProperty(_this$loadRefs3, this.wizardKey, 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-header\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-cancel\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-previous\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-next\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-submit\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-link\"), 'multiple'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-tooltip\"), 'multiple'), _this$loadRefs3));\n if ((this.options.readOnly || this.editMode) && !this.enabledIndex) {\n var _this$pages2;\n this.enabledIndex = ((_this$pages2 = this.pages) === null || _this$pages2 === void 0 ? void 0 : _this$pages2.length) - 1;\n }\n this.hook('attachWebform', element, this);\n var promises = this.attachComponents(this.refs[this.wizardKey], [].concat(_toConsumableArray(this.prefixComps), _toConsumableArray(this.currentPage.components), _toConsumableArray(this.suffixComps)));\n this.attachNav();\n this.attachHeader();\n return promises.then(function () {\n _this7.emit('render', {\n component: _this7.currentPage,\n page: _this7.page\n });\n if (_this7.component.scrollToTop) {\n _this7.scrollPageToTop();\n }\n });\n }\n }, {\n key: \"scrollPageToTop\",\n value: function scrollPageToTop() {\n var _this$refs;\n var pageTop = (_this$refs = this.refs[\"\".concat(this.wizardKey, \"-header\")]) !== null && _this$refs !== void 0 ? _this$refs : this.refs[this.wizardKey];\n if (!pageTop) {\n return;\n }\n if ('scrollIntoView' in pageTop) {\n pageTop.scrollIntoView(true);\n } else {\n this.scrollIntoView(pageTop);\n }\n }\n }, {\n key: \"isBreadcrumbClickable\",\n value: function isBreadcrumbClickable() {\n var _this8 = this;\n var currentPage = null;\n this.pages.map(function (page) {\n if (_lodash[\"default\"].isEqual(_this8.currentPage.component, page.component)) {\n currentPage = page;\n }\n });\n return this.isClickableDefined ? this.options.breadcrumbSettings.clickable : _lodash[\"default\"].get(currentPage, 'component.breadcrumbClickable', true);\n }\n }, {\n key: \"isAllowPrevious\",\n value: function isAllowPrevious() {\n var _this9 = this;\n var currentPage = null;\n this.pages.map(function (page) {\n if (_lodash[\"default\"].isEqual(_this9.currentPage.component, page.component)) {\n currentPage = page;\n }\n });\n return _lodash[\"default\"].get(currentPage.component, 'allowPrevious', this.options.allowPrevious);\n }\n }, {\n key: \"handleNaviageteOnEnter\",\n value: function handleNaviageteOnEnter(event) {\n if (event.keyCode === 13) {\n var clickEvent = new CustomEvent('click');\n var buttonElement = this.refs[\"\".concat(this.wizardKey, \"-\").concat(this.buttons.next.name)];\n if (buttonElement) {\n buttonElement.dispatchEvent(clickEvent);\n }\n }\n }\n }, {\n key: \"handleSaveOnEnter\",\n value: function handleSaveOnEnter(event) {\n if (event.keyCode === 13) {\n var clickEvent = new CustomEvent('click');\n var buttonElement = this.refs[\"\".concat(this.wizardKey, \"-\").concat(this.buttons.submit.name)];\n if (buttonElement) {\n buttonElement.dispatchEvent(clickEvent);\n }\n }\n }\n }, {\n key: \"attachNav\",\n value: function attachNav() {\n var _this10 = this;\n if (this.component.navigateOnEnter) {\n this.addEventListener(document, 'keyup', this.handleNaviageteOnEnter.bind(this));\n }\n if (this.component.saveOnEnter) {\n this.addEventListener(document, 'keyup', this.handleSaveOnEnter.bind(this));\n }\n _lodash[\"default\"].each(this.buttons, function (button) {\n var buttonElement = _this10.refs[\"\".concat(_this10.wizardKey, \"-\").concat(button.name)];\n _this10.addEventListener(buttonElement, 'click', function (event) {\n event.preventDefault();\n\n // Disable the button until done.\n buttonElement.setAttribute('disabled', 'disabled');\n _this10.setLoading(buttonElement, true);\n\n // Call the button method, then re-enable the button.\n _this10[button.method]().then(function () {\n buttonElement.removeAttribute('disabled');\n _this10.setLoading(buttonElement, false);\n })[\"catch\"](function () {\n buttonElement.removeAttribute('disabled');\n _this10.setLoading(buttonElement, false);\n });\n });\n });\n }\n }, {\n key: \"emitWizardPageSelected\",\n value: function emitWizardPageSelected(index) {\n this.emit('wizardPageSelected', this.pages[index], index);\n }\n }, {\n key: \"attachHeader\",\n value: function attachHeader() {\n var _this11 = this;\n var isAllowPrevious = this.isAllowPrevious();\n this.attachTooltips(this.refs[\"\".concat(this.wizardKey, \"-tooltip\")], this.currentPanel.tooltip);\n if (this.isBreadcrumbClickable() || isAllowPrevious) {\n var _this$refs2;\n (_this$refs2 = this.refs[\"\".concat(this.wizardKey, \"-link\")]) === null || _this$refs2 === void 0 ? void 0 : _this$refs2.forEach(function (link, index) {\n if (!isAllowPrevious || index <= _this11.enabledIndex) {\n _this11.addEventListener(link, 'click', function (event) {\n _this11.emit('wizardNavigationClicked', _this11.pages[index]);\n event.preventDefault();\n return _this11.setPage(index).then(function () {\n _this11.emitWizardPageSelected(index);\n });\n });\n }\n });\n }\n }\n }, {\n key: \"detachNav\",\n value: function detachNav() {\n var _this12 = this;\n if (this.component.navigateOnEnter) {\n this.removeEventListener(document, 'keyup', this.handleNaviageteOnEnter.bind(this));\n }\n if (this.component.saveOnEnter) {\n this.removeEventListener(document, 'keyup', this.handleSaveOnEnter.bind(this));\n }\n _lodash[\"default\"].each(this.buttons, function (button) {\n _this12.removeEventListener(_this12.refs[\"\".concat(_this12.wizardKey, \"-\").concat(button.name)], 'click');\n });\n }\n }, {\n key: \"detachHeader\",\n value: function detachHeader() {\n var _this13 = this;\n if (this.refs[\"\".concat(this.wizardKey, \"-link\")]) {\n this.refs[\"\".concat(this.wizardKey, \"-link\")].forEach(function (link) {\n _this13.removeEventListener(link, 'click');\n });\n }\n }\n }, {\n key: \"transformPages\",\n value: function transformPages() {\n var _this14 = this;\n var allComponents = [];\n var components = this.getSortedComponents(this);\n var defferedComponents = [];\n this.allPages = [];\n\n // Get all components including all nested components and line up in the correct order\n var getAllComponents = function getAllComponents(nestedComp, compsArr) {\n var pushAllowed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var nestedPages = [];\n var dataArrayComponents = ['datagrid', 'editgrid', 'dynamicWizard'];\n var currentComponents = nestedComp !== null && nestedComp !== void 0 && nestedComp.subForm ? _this14.getSortedComponents(nestedComp.subForm) : (nestedComp === null || nestedComp === void 0 ? void 0 : nestedComp.components) || [];\n var visibleComponents = currentComponents.filter(function (comp) {\n return comp._visible;\n });\n var filteredComponents = visibleComponents.filter(function (comp) {\n return !dataArrayComponents.includes(comp.component.type) && (comp.type !== 'form' || comp.isNestedWizard);\n });\n var additionalComponents = currentComponents.filter(function (comp) {\n var _comp$subForm;\n return ((_comp$subForm = comp.subForm) === null || _comp$subForm === void 0 ? void 0 : _comp$subForm._form.display) !== 'wizard';\n });\n var hasNested = false;\n (0, _utils.eachComponent)(filteredComponents, function (comp) {\n if (comp && comp.component) {\n if (comp.component.type === 'panel' && comp !== null && comp !== void 0 && comp.parent.wizard && !getAllComponents(comp, compsArr, false)) {\n if (pushAllowed) {\n _this14.setRootPanelId(comp);\n nestedPages.push(comp);\n }\n hasNested = true;\n }\n if (comp.isNestedWizard && comp.subForm) {\n var hasNestedForm = getAllComponents(comp, nestedPages, pushAllowed);\n if (!hasNested) {\n hasNested = hasNestedForm;\n }\n }\n }\n }, true);\n if (nestedComp.component.type === 'panel') {\n if (!hasNested && pushAllowed) {\n _this14.setRootPanelId(nestedComp);\n compsArr.push(nestedComp);\n }\n if (hasNested && additionalComponents.length) {\n var newComp = _lodash[\"default\"].clone(nestedComp);\n newComp.components = additionalComponents;\n _this14.setRootPanelId(newComp);\n defferedComponents.push(newComp);\n }\n }\n if (pushAllowed) {\n compsArr.push.apply(compsArr, _toConsumableArray(defferedComponents).concat(nestedPages));\n defferedComponents = [];\n }\n return hasNested;\n };\n components.forEach(function (component) {\n if (component.visible) {\n getAllComponents(component, allComponents);\n }\n }, []);\n\n // recalculate pages only for root wizards, including the situation when the wizard is in a wrapper\n if (this.localRoot && this.id === this.localRoot.id) {\n allComponents.forEach(function (comp, index) {\n comp.eachComponent(function (component) {\n component.page = index;\n });\n });\n }\n this.allPages = allComponents;\n }\n }, {\n key: \"getSortedComponents\",\n value: function getSortedComponents(_ref) {\n var components = _ref.components,\n originalComponents = _ref.originalComponents;\n // sorts components if they were shuffled after the conditional logic\n var currentComponents = [];\n var currentPages = [];\n if (components && components.length) {\n components.map(function (page) {\n if (page.component.type === 'panel') {\n currentPages[page.component.key || page.component.title] = page;\n }\n });\n }\n originalComponents === null || originalComponents === void 0 ? void 0 : originalComponents.forEach(function (item) {\n if (!item.key) {\n item.key = item.title;\n }\n if (currentPages[item.key]) {\n currentComponents.push(currentPages[item.key]);\n }\n });\n return currentComponents;\n }\n }, {\n key: \"findRootPanel\",\n value: function findRootPanel(component) {\n var _component$parent;\n return (_component$parent = component.parent) !== null && _component$parent !== void 0 && _component$parent.parent ? this.findRootPanel(component.parent) : component;\n }\n }, {\n key: \"setRootPanelId\",\n value: function setRootPanelId(component) {\n var _component$parent2;\n if (component.rootPanelId && component.rootPanelId !== component.id) {\n return;\n }\n var parent = (_component$parent2 = component.parent) !== null && _component$parent2 !== void 0 && _component$parent2.parent ? this.findRootPanel(component.parent) : component;\n component.rootPanelId = parent.id;\n }\n }, {\n key: \"establishPages\",\n value: function establishPages() {\n var _this15 = this;\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.data;\n this.pages = [];\n this.prefixComps = [];\n this.suffixComps = [];\n var visible = [];\n var currentPages = {};\n var pageOptions = _objectSpread(_objectSpread({}, _lodash[\"default\"].clone(this.options)), this.parent ? {\n root: this\n } : {});\n if (this.components && this.components.length) {\n this.components.forEach(function (page) {\n if (page.component.type === 'panel') {\n currentPages[page.component.key || page.component.title] = page;\n }\n });\n }\n if (this.originalComponents) {\n this.originalComponents.forEach(function (item) {\n if (item.type === 'panel') {\n if (!item.key) {\n item.key = item.title;\n }\n var page = currentPages[item.key];\n var forceShow = _this15.options.show ? _this15.options.show[item.key] : false;\n var forceHide = _this15.options.hide ? _this15.options.hide[item.key] : false;\n var isVisible = !page ? (0, _utils.checkCondition)(item, data, data, _this15.component, _this15) && !item.hidden : page.visible;\n if (forceShow) {\n isVisible = true;\n } else if (forceHide) {\n isVisible = false;\n }\n if (isVisible) {\n visible.push(item);\n if (page) {\n _this15.pages.push(page);\n }\n }\n if (!page && isVisible) {\n page = _this15.createComponent(item, pageOptions);\n page.visible = isVisible;\n _this15.pages.push(page);\n page.eachComponent(function (component) {\n component.page = _this15.pages.length - 1;\n });\n }\n } else if (item.type !== 'button') {\n if (!_this15.pages.length) {\n _this15.prefixComps.push(_this15.createComponent(item, pageOptions));\n } else {\n _this15.suffixComps.push(_this15.createComponent(item, pageOptions));\n }\n }\n });\n }\n if (this.pages.length) {\n this.emit('pagesChanged');\n }\n this.transformPages();\n if (this.allPages && this.allPages.length) {\n this.updatePages();\n }\n return visible;\n }\n }, {\n key: \"updatePages\",\n value: function updatePages() {\n this.pages = this.allPages;\n }\n }, {\n key: \"addComponents\",\n value: function addComponents() {\n this.establishPages();\n }\n }, {\n key: \"setPage\",\n value: function setPage(num) {\n var _this16 = this;\n if (num === this.page) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n if (num >= 0 && num < this.pages.length) {\n this.page = num;\n this.pageFieldLogic(num);\n this.getNextPage();\n var parentNum = num;\n if (this.hasExtraPages) {\n var pageFromPages = this.pages[num];\n var pageFromComponents = this.components[num];\n if (!pageFromComponents || (pageFromPages === null || pageFromPages === void 0 ? void 0 : pageFromPages.id) !== pageFromComponents.id) {\n parentNum = this.components.findIndex(function (comp) {\n var _this16$pages, _this16$pages$parentN;\n return comp.id === ((_this16$pages = _this16.pages) === null || _this16$pages === void 0 ? void 0 : (_this16$pages$parentN = _this16$pages[parentNum]) === null || _this16$pages$parentN === void 0 ? void 0 : _this16$pages$parentN.rootPanelId);\n });\n }\n }\n if (!this._seenPages.includes(parentNum)) {\n this._seenPages = this._seenPages.concat(parentNum);\n }\n this.redraw().then(function () {\n _this16.checkData(_this16.submission.data);\n });\n return _nativePromiseOnly[\"default\"].resolve();\n } else if (!this.pages.length) {\n this.redraw();\n return _nativePromiseOnly[\"default\"].resolve();\n }\n return _nativePromiseOnly[\"default\"].reject('Page not found');\n }\n }, {\n key: \"pageFieldLogic\",\n value: function pageFieldLogic(page) {\n var _this$pages3;\n if ((_this$pages3 = this.pages) !== null && _this$pages3 !== void 0 && _this$pages3[page]) {\n // Handle field logic on pages.\n this.component = this.pages[page].component;\n this.originalComponent = (0, _utils.fastCloneDeep)(this.component);\n this.fieldLogic(this.data);\n // If disabled changed, be sure to distribute the setting.\n this.disabled = this.shouldDisabled;\n }\n }\n }, {\n key: \"currentPage\",\n get: function get() {\n return this.pages && this.pages.length >= this.page ? this.pages[this.page] : {\n components: []\n };\n }\n }, {\n key: \"getNextPage\",\n value: function getNextPage() {\n var _this$pages4;\n if ((_this$pages4 = this.pages) !== null && _this$pages4 !== void 0 && _this$pages4[this.page]) {\n var data = this.submission.data;\n var form = this.pages[this.page].component;\n // Check conditional nextPage\n if (form) {\n var page = this.pages.length > this.page + 1 && !this.showAllErrors ? this.page + 1 : -1;\n if (form.nextPage) {\n var next = this.evaluate(form.nextPage, {\n next: page,\n data: data,\n page: page,\n form: form\n }, 'next');\n if (next === null) {\n this.currentNextPage = null;\n return null;\n }\n var pageNum = parseInt(next, 10);\n if (!isNaN(parseInt(pageNum, 10)) && isFinite(pageNum)) {\n this.currentNextPage = pageNum;\n return pageNum;\n }\n this.currentNextPage = this.getPageIndexByKey(next);\n return this.currentNextPage;\n }\n this.currentNextPage = page;\n return page;\n }\n this.currentNextPage = null;\n }\n return null;\n }\n }, {\n key: \"getPreviousPage\",\n value: function getPreviousPage() {\n return this.page - 1;\n }\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n var pages = this.getPages();\n return _nativePromiseOnly[\"default\"].all(pages.map(function (page) {\n page.options.beforeSubmit = true;\n return page.beforeSubmit();\n }));\n }\n }, {\n key: \"beforePage\",\n value: function beforePage(next) {\n var _this17 = this;\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this17.hook(next ? 'beforeNext' : 'beforePrev', _this17.currentPage, _this17.submission, function (err) {\n if (err) {\n _this17.showErrors(err, true);\n reject(err);\n }\n var form = _this17.currentPage;\n if (form) {\n form.beforePage(next).then(resolve)[\"catch\"](reject);\n } else {\n resolve();\n }\n });\n });\n }\n }, {\n key: \"emitNextPage\",\n value: function emitNextPage() {\n this.emit('nextPage', {\n page: this.page,\n submission: this.submission\n });\n }\n }, {\n key: \"nextPage\",\n value: function nextPage() {\n var _this18 = this;\n // Read-only forms should not worry about validation before going to next page, nor should they submit.\n if (this.options.readOnly) {\n return this.beforePage(true).then(function () {\n return _this18.setPage(_this18.getNextPage()).then(function () {\n _this18.emitNextPage();\n });\n });\n }\n\n // Validate the form, before go to the next page\n if (this.checkValidity(this.localData, true, this.localData, true)) {\n this.checkData(this.submission.data);\n return this.beforePage(true).then(function () {\n return _this18.setPage(_this18.getNextPage()).then(function () {\n if (!(_this18.options.readOnly || _this18.editMode) && _this18.enabledIndex < _this18.page) {\n _this18.enabledIndex = _this18.page;\n _this18.redraw();\n }\n _this18.emitNextPage();\n });\n });\n } else {\n this.currentPage.components.forEach(function (comp) {\n return comp.setPristine(false);\n });\n this.scrollIntoView(this.element);\n return _nativePromiseOnly[\"default\"].reject(this.showErrors([], true));\n }\n }\n }, {\n key: \"emitPrevPage\",\n value: function emitPrevPage() {\n this.emit('prevPage', {\n page: this.page,\n submission: this.submission\n });\n }\n }, {\n key: \"prevPage\",\n value: function prevPage() {\n var _this19 = this;\n return this.beforePage().then(function () {\n return _this19.setPage(_this19.getPreviousPage()).then(function () {\n _this19.emitPrevPage();\n });\n });\n }\n }, {\n key: \"cancel\",\n value: function cancel(noconfirm) {\n var _this20 = this;\n if (this.options.readOnly) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n if (_get(_getPrototypeOf(Wizard.prototype), \"cancel\", this).call(this, noconfirm)) {\n this.setPristine(true);\n return this.setPage(0).then(function () {\n if (_this20.enabledIndex) {\n _this20.enabledIndex = 0;\n }\n _this20.onChange();\n _this20.redraw();\n return _this20.page;\n });\n }\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"getPageIndexByKey\",\n value: function getPageIndexByKey(key) {\n var pageIndex = this.page;\n this.pages.forEach(function (page, index) {\n if (page.component.key === key) {\n pageIndex = index;\n return false;\n }\n });\n return pageIndex;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.wizard;\n }\n }, {\n key: \"setComponentSchema\",\n value: function setComponentSchema() {\n var _this21 = this;\n var pageKeys = {};\n this.originalComponents = [];\n this.component.components.map(function (item) {\n if (item.type === 'panel') {\n item.key = (0, _utils.uniqueKey)(pageKeys, item.key || 'panel');\n pageKeys[item.key] = true;\n if (_this21.wizard.full) {\n _this21.options.show = _this21.options.show || {};\n _this21.options.show[item.key] = true;\n } else if (_this21.wizard.hasOwnProperty('full') && !_lodash[\"default\"].isEqual(_this21.originalOptions.show, _this21.options.show)) {\n _this21.options.show = _objectSpread({}, _this21.originalOptions.show || {});\n }\n }\n _this21.originalComponents.push(_lodash[\"default\"].clone(item));\n });\n if (!Object.keys(pageKeys).length) {\n var newPage = {\n type: 'panel',\n title: 'Page 1',\n label: 'Page 1',\n key: 'page1',\n components: this.component.components\n };\n this.component.components = [newPage];\n this.originalComponents.push(_lodash[\"default\"].clone(newPage));\n }\n }\n }, {\n key: \"setForm\",\n value: function setForm(form, flags) {\n if (!form) {\n return;\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"setForm\", this).call(this, form, flags);\n }\n }, {\n key: \"onSetForm\",\n value: function onSetForm(clonedForm, initialForm) {\n this.component.components = (this._parentPath ? initialForm.components : clonedForm.components) || [];\n this.setComponentSchema();\n }\n }, {\n key: \"setEditMode\",\n value: function setEditMode(submission) {\n if (!this.editMode && submission._id && !this.options.readOnly) {\n this.editMode = true;\n this.redraw();\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(submission) {\n var _this22 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var ignoreEstablishment = arguments.length > 2 ? arguments[2] : undefined;\n this._submission = submission;\n if (flags && flags.fromSubmission && (this.options.readOnly || this.editMode) && !this.isHtmlRenderMode() || flags && flags.fromSubmission && (this.prefixComps.length || this.suffixComps.length) && submission._id) {\n this._data = submission.data;\n }\n if (!ignoreEstablishment) {\n this.establishPages(submission.data);\n }\n var changed = this.getPages({\n all: true\n }).reduce(function (changed, page) {\n return _this22.setNestedValue(page, submission.data, flags, changed) || changed;\n }, false);\n if (changed) {\n this.pageFieldLogic(this.page);\n }\n this.setEditMode(submission);\n return changed;\n }\n }, {\n key: \"isClickable\",\n value: function isClickable(page, index) {\n return this.page !== index && (0, _utils.firstNonNil)([_lodash[\"default\"].get(page, 'breadcrumbClickable'), this.options.breadcrumbSettings.clickable]);\n }\n }, {\n key: \"hasButton\",\n value: function hasButton(name) {\n var nextPage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getNextPage();\n // get page options with global options as default values\n var _$get = _lodash[\"default\"].get(this.currentPage, 'component.buttonSettings', {}),\n _$get$previous = _$get.previous,\n previous = _$get$previous === void 0 ? this.options.buttonSettings.showPrevious : _$get$previous,\n _$get$cancel = _$get.cancel,\n cancel = _$get$cancel === void 0 ? this.options.buttonSettings.showCancel : _$get$cancel,\n _$get$submit = _$get.submit,\n submit = _$get$submit === void 0 ? this.options.buttonSettings.showSubmit : _$get$submit,\n _$get$next = _$get.next,\n next = _$get$next === void 0 ? this.options.buttonSettings.showNext : _$get$next;\n switch (name) {\n case 'previous':\n return previous && this.getPreviousPage() > -1;\n case 'next':\n return next && nextPage !== null && nextPage !== -1;\n case 'cancel':\n return cancel && !this.options.readOnly;\n case 'submit':\n return submit && !this.options.readOnly && (nextPage === null || this.page === this.pages.length - 1);\n default:\n return true;\n }\n }\n }, {\n key: \"pageId\",\n value: function pageId(page) {\n if (page.key) {\n // Some panels have the same key....\n return \"\".concat(page.key, \"-\").concat(page.title);\n } else if (page.components && page.components.length > 0) {\n return this.pageId(page.components[0]);\n } else {\n return page.title;\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(flags, changed, modified, changes) {\n var _this23 = this;\n _get(_getPrototypeOf(Wizard.prototype), \"onChange\", this).call(this, flags, changed, modified, changes);\n if (this.alert && !this.submitted) {\n this.checkValidity(this.localData, false, this.localData, true);\n this.showErrors([], true, true);\n }\n\n // If the pages change, need to redraw the header.\n var currentPanels;\n var panels;\n var currentNextPage = this.currentNextPage;\n if (this.hasExtraPages) {\n currentPanels = this.pages.map(function (page) {\n return page.component.key;\n });\n this.establishPages();\n panels = this.pages.map(function (page) {\n return page.component.key;\n });\n } else {\n var _this$currentPanel, _this$currentPanels;\n currentPanels = this.currentPanels || this.pages.map(function (page) {\n return page.component.key;\n });\n panels = this.establishPages().map(function (panel) {\n return panel.key;\n });\n this.currentPanels = panels;\n if ((_this$currentPanel = this.currentPanel) !== null && _this$currentPanel !== void 0 && _this$currentPanel.key && (_this$currentPanels = this.currentPanels) !== null && _this$currentPanels !== void 0 && _this$currentPanels.length) {\n this.setPage(this.currentPanels.findIndex(function (panel) {\n return panel === _this23.currentPanel.key;\n }));\n }\n }\n if (!_lodash[\"default\"].isEqual(panels, currentPanels) || flags && flags.fromSubmission) {\n this.redrawHeader();\n }\n\n // If the next page changes, then make sure to redraw navigation.\n if (currentNextPage !== this.getNextPage()) {\n this.redrawNavigation();\n }\n if (this.options.readOnly && (this.prefixComps.length || this.suffixComps.length)) {\n this.redraw();\n }\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n var _this$parent, _this$parent$componen;\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 this.parent.redraw();\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"redraw\", this).call(this);\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, currentPageOnly) {\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n var components = !currentPageOnly || this.isLastPage() ? this.getComponents() : this.currentPage.components;\n return components.reduce(function (check, comp) {\n return comp.checkValidity(data, dirty, row) && check;\n }, true);\n }\n }, {\n key: \"errors\",\n get: function get() {\n if (!this.isLastPage()) {\n return this.currentPage.errors;\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"errors\", this);\n }\n }, {\n key: \"focusOnComponent\",\n value: function focusOnComponent(key) {\n var _this24 = this;\n var pageIndex = 0;\n var _this$pages$filter = this.pages.filter(function (page, index) {\n var hasComponent = false;\n page.getComponent(key, function (comp) {\n if (comp.path === key) {\n pageIndex = index;\n hasComponent = true;\n }\n });\n return hasComponent;\n }),\n _this$pages$filter2 = _slicedToArray(_this$pages$filter, 1),\n page = _this$pages$filter2[0];\n if (page && page !== this.currentPage) {\n return this.setPage(pageIndex).then(function () {\n _this24.checkValidity(_this24.submission.data, true, _this24.submission.data);\n _this24.showErrors();\n _get(_getPrototypeOf(Wizard.prototype), \"focusOnComponent\", _this24).call(_this24, key);\n });\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"focusOnComponent\", this).call(this, key);\n }\n }]);\n return Wizard;\n}(_Webform2[\"default\"]);\nexports[\"default\"] = Wizard;\nWizard.setBaseUrl = _Formio.GlobalFormio.setBaseUrl;\nWizard.setApiUrl = _Formio.GlobalFormio.setApiUrl;\nWizard.setAppUrl = _Formio.GlobalFormio.setAppUrl;\n\n//# sourceURL=webpack://Formio/./lib/Wizard.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.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.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.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.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\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\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.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.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.js */ \"./node_modules/core-js/modules/es.array.find.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.map.js */ \"./node_modules/core-js/modules/es.array.map.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.concat.js */ \"./node_modules/core-js/modules/es.array.concat.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.find-index.js */ \"./node_modules/core-js/modules/es.array.find-index.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.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.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 _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _Webform2 = _interopRequireDefault(__webpack_require__(/*! ./Webform */ \"./lib/Webform.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 _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 _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 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 Wizard = /*#__PURE__*/function (_Webform) {\n _inherits(Wizard, _Webform);\n var _super = _createSuper(Wizard);\n /**\n * Constructor for wizard based forms\n * @param element Dom element to place this wizard.\n * @param {Object} options Options object, supported options are:\n * - breadcrumbSettings.clickable: true (default) determines if the breadcrumb bar is clickable or not\n * - buttonSettings.show*(Previous, Next, Cancel): true (default) determines if the button is shown or not\n * - allowPrevious: false (default) determines if the breadcrumb bar is clickable or not for visited tabs\n */\n function Wizard() {\n var _this;\n _classCallCheck(this, Wizard);\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 options.display = 'wizard';\n _this = _super.call(this, element, options);\n _this.pages = [];\n _this.prefixComps = [];\n _this.suffixComps = [];\n _this.components = [];\n _this.originalComponents = [];\n _this.page = 0;\n _this.currentPanel = null;\n _this.currentPanels = null;\n _this.currentNextPage = 0;\n _this._seenPages = [0];\n _this.subWizards = [];\n _this.allPages = [];\n _this.lastPromise = _nativePromiseOnly[\"default\"].resolve();\n _this.enabledIndex = 0;\n _this.editMode = false;\n _this.originalOptions = _lodash[\"default\"].cloneDeep(_this.options);\n return _this;\n }\n _createClass(Wizard, [{\n key: \"isLastPage\",\n value: function isLastPage() {\n var next = this.getNextPage();\n if (_lodash[\"default\"].isNumber(next)) {\n return next === -1;\n }\n return _lodash[\"default\"].isNull(next);\n }\n }, {\n key: \"getPages\",\n value: function getPages() {\n var _this2 = this;\n var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _args$all = args.all,\n all = _args$all === void 0 ? false : _args$all;\n var pages = this.hasExtraPages ? this.components : this.pages;\n var filteredPages = pages.filter(all ? _lodash[\"default\"].identity : function (p, index) {\n return _this2._seenPages.includes(index);\n });\n return filteredPages;\n }\n }, {\n key: \"hasExtraPages\",\n get: function get() {\n return !_lodash[\"default\"].isEmpty(this.subWizards);\n }\n }, {\n key: \"data\",\n get: function get() {\n return _get(_getPrototypeOf(Wizard.prototype), \"data\", this);\n },\n set: function set(value) {\n var _this3 = this;\n this._data = value;\n _lodash[\"default\"].each(this.getPages({\n all: true\n }), function (component) {\n component.data = _this3.componentContext(component);\n });\n }\n }, {\n key: \"localData\",\n get: function get() {\n var _this$pages$this$page, _this$pages$this$page2;\n return ((_this$pages$this$page = this.pages[this.page]) === null || _this$pages$this$page === void 0 ? void 0 : (_this$pages$this$page2 = _this$pages$this$page.root) === null || _this$pages$this$page2 === void 0 ? void 0 : _this$pages$this$page2.submission.data) || this.submission.data;\n }\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n var visible = _get(_getPrototypeOf(Wizard.prototype), \"checkConditions\", this).call(this, data, flags, row);\n this.establishPages(data);\n return visible;\n }\n }, {\n key: \"getComponents\",\n value: function getComponents() {\n return this.submitting ? this.getPages({\n all: this.isLastPage()\n }) : _get(_getPrototypeOf(Wizard.prototype), \"getComponents\", this).call(this);\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n this.getPages({\n all: true\n }).forEach(function (page) {\n return page.resetValue();\n });\n this.setPristine(true);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this$pages,\n _this4 = this;\n // Check for and initlize button settings object\n this.options.buttonSettings = _lodash[\"default\"].defaults(this.options.buttonSettings, {\n showPrevious: true,\n showNext: true,\n showSubmit: true,\n showCancel: !this.options.readOnly\n });\n if (!this.isSecondInit) {\n var _this$options, _this$options$breadcr;\n this.isClickableDefined = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : (_this$options$breadcr = _this$options.breadcrumbSettings) === null || _this$options$breadcr === void 0 ? void 0 : _this$options$breadcr.hasOwnProperty('clickable');\n this.isSecondInit = true;\n }\n this.options.breadcrumbSettings = _lodash[\"default\"].defaults(this.options.breadcrumbSettings, {\n clickable: true\n });\n this.options.allowPrevious = this.options.allowPrevious || false;\n this.page = 0;\n var onReady = _get(_getPrototypeOf(Wizard.prototype), \"init\", this).call(this);\n this.setComponentSchema();\n if ((_this$pages = this.pages) !== null && _this$pages !== void 0 && _this$pages[this.page]) {\n this.component = this.pages[this.page].component;\n }\n this.on('subWizardsUpdated', function (subForm) {\n var subWizard = _this4.subWizards.find(function (subWizard) {\n var _subWizard$subForm;\n return (subForm === null || subForm === void 0 ? void 0 : subForm.id) && ((_subWizard$subForm = subWizard.subForm) === null || _subWizard$subForm === void 0 ? void 0 : _subWizard$subForm.id) === (subForm === null || subForm === void 0 ? void 0 : subForm.id);\n });\n if (_this4.subWizards.length && subWizard) {\n subWizard.subForm.setValue(subForm._submission, {}, true);\n _this4.establishPages();\n _this4.redraw();\n }\n });\n return onReady;\n }\n }, {\n key: \"wizardKey\",\n get: function get() {\n return \"wizard-\".concat(this.id);\n }\n }, {\n key: \"wizard\",\n get: function get() {\n return this.form;\n },\n set: function set(form) {\n this.setForm(form);\n }\n }, {\n key: \"buttons\",\n get: function get() {\n var _this5 = this;\n var buttons = {};\n [{\n name: 'cancel',\n method: 'cancel'\n }, {\n name: 'previous',\n method: 'prevPage'\n }, {\n name: 'next',\n method: 'nextPage'\n }, {\n name: 'submit',\n method: 'submit'\n }].forEach(function (button) {\n if (_this5.hasButton(button.name)) {\n buttons[button.name] = button;\n }\n });\n return buttons;\n }\n }, {\n key: \"buttonOrder\",\n get: function get() {\n var _this$options$propert, _this$options$propert2, _this$options$propert3;\n var defaultButtonOrder = ['cancel', 'previous', 'next', 'submit'];\n return (_this$options$propert = (_this$options$propert2 = this.options.properties) === null || _this$options$propert2 === void 0 ? void 0 : (_this$options$propert3 = _this$options$propert2.wizardButtonOrder) === null || _this$options$propert3 === void 0 ? void 0 : _this$options$propert3.toLowerCase().split(', ')) !== null && _this$options$propert !== void 0 ? _this$options$propert : defaultButtonOrder;\n }\n }, {\n key: \"renderContext\",\n get: function get() {\n var _this$root, _this$root$component;\n return {\n disableWizardSubmit: this.form.disableWizardSubmit,\n wizardKey: this.wizardKey,\n isBreadcrumbClickable: this.isBreadcrumbClickable(),\n isSubForm: !!this.parent && !((_this$root = this.root) !== null && _this$root !== void 0 && (_this$root$component = _this$root.component) !== null && _this$root$component !== void 0 && _this$root$component.type) === 'wizard',\n panels: this.allPages.length ? this.allPages.map(function (page) {\n return page.component;\n }) : this.pages.map(function (page) {\n return page.component;\n }),\n buttons: this.buttons,\n currentPage: this.page,\n buttonOrder: this.buttonOrder\n };\n }\n }, {\n key: \"prepareNavigationSettings\",\n value: function prepareNavigationSettings(ctx) {\n var currentPanel = this.currentPanel;\n if (currentPanel && currentPanel.buttonSettings) {\n Object.keys(currentPanel.buttonSettings).forEach(function () {\n Object.keys(ctx.buttons).forEach(function (key) {\n if (typeof currentPanel.buttonSettings[key] !== 'undefined' && !currentPanel.buttonSettings[key] || ctx.isSubForm) {\n ctx.buttons[key] = null;\n }\n });\n });\n }\n return this.renderTemplate('wizardNav', ctx);\n }\n }, {\n key: \"prepareHeaderSettings\",\n value: function prepareHeaderSettings(ctx, headerType) {\n if (this.currentPanel && this.currentPanel.breadcrumb === 'none' || ctx.isSubForm) {\n return null;\n }\n return this.renderTemplate(headerType, ctx);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this6 = this;\n var ctx = this.renderContext;\n if (this.component.key) {\n ctx.panels.map(function (panel) {\n if (panel.key === _this6.component.key) {\n _this6.currentPanel = panel;\n ctx.wizardPageTooltip = _this6.getFormattedTooltip(panel.tooltip);\n }\n });\n }\n var wizardNav = this.prepareNavigationSettings(ctx);\n var wizardHeaderType = \"wizardHeader\".concat(_lodash[\"default\"].get(this.form, 'settings.wizardHeaderType', ''));\n var wizardHeaderLocation = _lodash[\"default\"].get(this.form, 'settings.wizardHeaderLocation', 'left');\n var wizardHeader = this.prepareHeaderSettings(ctx, wizardHeaderType);\n return this.renderTemplate('wizard', _objectSpread(_objectSpread({}, ctx), {}, {\n className: _get(_getPrototypeOf(Wizard.prototype), \"getClassName\", this).call(this),\n wizardHeader: wizardHeader,\n wizardHeaderType: wizardHeaderType,\n wizardHeaderLocation: wizardHeaderLocation,\n wizardNav: wizardNav,\n components: this.renderComponents([].concat(_toConsumableArray(this.prefixComps), _toConsumableArray(this.currentPage.components), _toConsumableArray(this.suffixComps)))\n }), this.builderMode ? 'builder' : 'form');\n }\n }, {\n key: \"redrawNavigation\",\n value: function redrawNavigation() {\n if (this.element) {\n var navElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-nav\"));\n if (navElement) {\n var _this$loadRefs;\n this.detachNav();\n navElement.outerHTML = this.renderTemplate('wizardNav', this.renderContext);\n navElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-nav\"));\n this.loadRefs(navElement, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-cancel\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-previous\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-next\"), 'single'), _defineProperty(_this$loadRefs, \"\".concat(this.wizardKey, \"-submit\"), 'single'), _this$loadRefs));\n this.attachNav();\n }\n }\n }\n }, {\n key: \"redrawHeader\",\n value: function redrawHeader() {\n if (this.element) {\n var headerElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-header\"));\n if (headerElement) {\n var _this$loadRefs2;\n this.detachHeader();\n headerElement.outerHTML = this.renderTemplate(\"wizardHeader\".concat(_lodash[\"default\"].get(this.form, 'settings.wizardHeaderType', '')), this.renderContext);\n headerElement = this.element.querySelector(\"#\".concat(this.wizardKey, \"-header\"));\n this.loadRefs(headerElement, (_this$loadRefs2 = {}, _defineProperty(_this$loadRefs2, \"\".concat(this.wizardKey, \"-link\"), 'multiple'), _defineProperty(_this$loadRefs2, \"\".concat(this.wizardKey, \"-tooltip\"), 'multiple'), _this$loadRefs2));\n this.attachHeader();\n }\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs3,\n _this7 = this;\n this.element = element;\n this.loadRefs(element, (_this$loadRefs3 = {}, _defineProperty(_this$loadRefs3, this.wizardKey, 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-header\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-cancel\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-previous\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-next\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-submit\"), 'single'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-link\"), 'multiple'), _defineProperty(_this$loadRefs3, \"\".concat(this.wizardKey, \"-tooltip\"), 'multiple'), _this$loadRefs3));\n if ((this.options.readOnly || this.editMode) && !this.enabledIndex) {\n var _this$pages2;\n this.enabledIndex = ((_this$pages2 = this.pages) === null || _this$pages2 === void 0 ? void 0 : _this$pages2.length) - 1;\n }\n this.hook('attachWebform', element, this);\n var promises = this.attachComponents(this.refs[this.wizardKey], [].concat(_toConsumableArray(this.prefixComps), _toConsumableArray(this.currentPage.components), _toConsumableArray(this.suffixComps)));\n this.attachNav();\n this.attachHeader();\n return promises.then(function () {\n _this7.emit('render', {\n component: _this7.currentPage,\n page: _this7.page\n });\n if (_this7.component.scrollToTop) {\n _this7.scrollPageToTop();\n }\n });\n }\n }, {\n key: \"scrollPageToTop\",\n value: function scrollPageToTop() {\n var _this$refs;\n var pageTop = (_this$refs = this.refs[\"\".concat(this.wizardKey, \"-header\")]) !== null && _this$refs !== void 0 ? _this$refs : this.refs[this.wizardKey];\n if (!pageTop) {\n return;\n }\n if ('scrollIntoView' in pageTop) {\n pageTop.scrollIntoView(true);\n } else {\n this.scrollIntoView(pageTop);\n }\n }\n }, {\n key: \"isBreadcrumbClickable\",\n value: function isBreadcrumbClickable() {\n var _this8 = this;\n var currentPage = null;\n this.pages.map(function (page) {\n if (_lodash[\"default\"].isEqual(_this8.currentPage.component, page.component)) {\n currentPage = page;\n }\n });\n return this.isClickableDefined ? this.options.breadcrumbSettings.clickable : _lodash[\"default\"].get(currentPage, 'component.breadcrumbClickable', true);\n }\n }, {\n key: \"isAllowPrevious\",\n value: function isAllowPrevious() {\n var _this9 = this;\n var currentPage = null;\n this.pages.map(function (page) {\n if (_lodash[\"default\"].isEqual(_this9.currentPage.component, page.component)) {\n currentPage = page;\n }\n });\n return _lodash[\"default\"].get(currentPage.component, 'allowPrevious', this.options.allowPrevious);\n }\n }, {\n key: \"handleNaviageteOnEnter\",\n value: function handleNaviageteOnEnter(event) {\n if (event.keyCode === 13) {\n var clickEvent = new CustomEvent('click');\n var buttonElement = this.refs[\"\".concat(this.wizardKey, \"-\").concat(this.buttons.next.name)];\n if (buttonElement) {\n buttonElement.dispatchEvent(clickEvent);\n }\n }\n }\n }, {\n key: \"handleSaveOnEnter\",\n value: function handleSaveOnEnter(event) {\n if (event.keyCode === 13) {\n var clickEvent = new CustomEvent('click');\n var buttonElement = this.refs[\"\".concat(this.wizardKey, \"-\").concat(this.buttons.submit.name)];\n if (buttonElement) {\n buttonElement.dispatchEvent(clickEvent);\n }\n }\n }\n }, {\n key: \"attachNav\",\n value: function attachNav() {\n var _this10 = this;\n if (this.component.navigateOnEnter) {\n this.addEventListener(document, 'keyup', this.handleNaviageteOnEnter.bind(this));\n }\n if (this.component.saveOnEnter) {\n this.addEventListener(document, 'keyup', this.handleSaveOnEnter.bind(this));\n }\n _lodash[\"default\"].each(this.buttons, function (button) {\n var buttonElement = _this10.refs[\"\".concat(_this10.wizardKey, \"-\").concat(button.name)];\n _this10.addEventListener(buttonElement, 'click', function (event) {\n event.preventDefault();\n\n // Disable the button until done.\n buttonElement.setAttribute('disabled', 'disabled');\n _this10.setLoading(buttonElement, true);\n\n // Call the button method, then re-enable the button.\n _this10[button.method]().then(function () {\n buttonElement.removeAttribute('disabled');\n _this10.setLoading(buttonElement, false);\n })[\"catch\"](function () {\n buttonElement.removeAttribute('disabled');\n _this10.setLoading(buttonElement, false);\n });\n });\n });\n }\n }, {\n key: \"emitWizardPageSelected\",\n value: function emitWizardPageSelected(index) {\n this.emit('wizardPageSelected', this.pages[index], index);\n }\n }, {\n key: \"attachHeader\",\n value: function attachHeader() {\n var _this11 = this;\n var isAllowPrevious = this.isAllowPrevious();\n this.attachTooltips(this.refs[\"\".concat(this.wizardKey, \"-tooltip\")], this.currentPanel.tooltip);\n if (this.isBreadcrumbClickable() || isAllowPrevious) {\n var _this$refs2;\n (_this$refs2 = this.refs[\"\".concat(this.wizardKey, \"-link\")]) === null || _this$refs2 === void 0 ? void 0 : _this$refs2.forEach(function (link, index) {\n if (!isAllowPrevious || index <= _this11.enabledIndex) {\n _this11.addEventListener(link, 'click', function (event) {\n _this11.emit('wizardNavigationClicked', _this11.pages[index]);\n event.preventDefault();\n return _this11.setPage(index).then(function () {\n _this11.emitWizardPageSelected(index);\n });\n });\n }\n });\n }\n }\n }, {\n key: \"detachNav\",\n value: function detachNav() {\n var _this12 = this;\n if (this.component.navigateOnEnter) {\n this.removeEventListener(document, 'keyup', this.handleNaviageteOnEnter.bind(this));\n }\n if (this.component.saveOnEnter) {\n this.removeEventListener(document, 'keyup', this.handleSaveOnEnter.bind(this));\n }\n _lodash[\"default\"].each(this.buttons, function (button) {\n _this12.removeEventListener(_this12.refs[\"\".concat(_this12.wizardKey, \"-\").concat(button.name)], 'click');\n });\n }\n }, {\n key: \"detachHeader\",\n value: function detachHeader() {\n var _this13 = this;\n if (this.refs[\"\".concat(this.wizardKey, \"-link\")]) {\n this.refs[\"\".concat(this.wizardKey, \"-link\")].forEach(function (link) {\n _this13.removeEventListener(link, 'click');\n });\n }\n }\n }, {\n key: \"transformPages\",\n value: function transformPages() {\n var _this14 = this;\n var allComponents = [];\n var components = this.getSortedComponents(this);\n var defferedComponents = [];\n this.allPages = [];\n\n // Get all components including all nested components and line up in the correct order\n var getAllComponents = function getAllComponents(nestedComp, compsArr) {\n var pushAllowed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var nestedPages = [];\n var dataArrayComponents = ['datagrid', 'editgrid', 'dynamicWizard'];\n var currentComponents = nestedComp !== null && nestedComp !== void 0 && nestedComp.subForm ? _this14.getSortedComponents(nestedComp.subForm) : (nestedComp === null || nestedComp === void 0 ? void 0 : nestedComp.components) || [];\n var visibleComponents = currentComponents.filter(function (comp) {\n return comp._visible;\n });\n var filteredComponents = visibleComponents.filter(function (comp) {\n return !dataArrayComponents.includes(comp.component.type) && (comp.type !== 'form' || comp.isNestedWizard);\n });\n var additionalComponents = currentComponents.filter(function (comp) {\n var _comp$subForm;\n return ((_comp$subForm = comp.subForm) === null || _comp$subForm === void 0 ? void 0 : _comp$subForm._form.display) !== 'wizard';\n });\n var hasNested = false;\n (0, _utils.eachComponent)(filteredComponents, function (comp) {\n if (comp && comp.component) {\n if (comp.component.type === 'panel' && comp !== null && comp !== void 0 && comp.parent.wizard && !getAllComponents(comp, compsArr, false)) {\n if (pushAllowed) {\n _this14.setRootPanelId(comp);\n nestedPages.push(comp);\n }\n hasNested = true;\n }\n if (comp.isNestedWizard && comp.subForm) {\n var hasNestedForm = getAllComponents(comp, nestedPages, pushAllowed);\n if (!hasNested) {\n hasNested = hasNestedForm;\n }\n }\n }\n }, true);\n if (nestedComp.component.type === 'panel') {\n if (!hasNested && pushAllowed) {\n _this14.setRootPanelId(nestedComp);\n compsArr.push(nestedComp);\n }\n if (hasNested && additionalComponents.length) {\n var newComp = _lodash[\"default\"].clone(nestedComp);\n newComp.components = additionalComponents;\n _this14.setRootPanelId(newComp);\n defferedComponents.push(newComp);\n }\n }\n if (pushAllowed) {\n compsArr.push.apply(compsArr, _toConsumableArray(defferedComponents).concat(nestedPages));\n defferedComponents = [];\n }\n return hasNested;\n };\n components.forEach(function (component) {\n if (component.visible) {\n getAllComponents(component, allComponents);\n }\n }, []);\n\n // recalculate pages only for root wizards, including the situation when the wizard is in a wrapper\n if (this.localRoot && this.id === this.localRoot.id) {\n allComponents.forEach(function (comp, index) {\n comp.eachComponent(function (component) {\n component.page = index;\n });\n });\n }\n this.allPages = allComponents;\n }\n }, {\n key: \"getSortedComponents\",\n value: function getSortedComponents(_ref) {\n var components = _ref.components,\n originalComponents = _ref.originalComponents;\n // sorts components if they were shuffled after the conditional logic\n var currentComponents = [];\n var currentPages = [];\n if (components && components.length) {\n components.map(function (page) {\n if (page.component.type === 'panel') {\n currentPages[page.component.key || page.component.title] = page;\n }\n });\n }\n originalComponents === null || originalComponents === void 0 ? void 0 : originalComponents.forEach(function (item) {\n if (!item.key) {\n item.key = item.title;\n }\n if (currentPages[item.key]) {\n currentComponents.push(currentPages[item.key]);\n }\n });\n return currentComponents;\n }\n }, {\n key: \"findRootPanel\",\n value: function findRootPanel(component) {\n var _component$parent;\n return (_component$parent = component.parent) !== null && _component$parent !== void 0 && _component$parent.parent ? this.findRootPanel(component.parent) : component;\n }\n }, {\n key: \"setRootPanelId\",\n value: function setRootPanelId(component) {\n var _component$parent2;\n if (component.rootPanelId && component.rootPanelId !== component.id) {\n return;\n }\n var parent = (_component$parent2 = component.parent) !== null && _component$parent2 !== void 0 && _component$parent2.parent ? this.findRootPanel(component.parent) : component;\n component.rootPanelId = parent.id;\n }\n }, {\n key: \"establishPages\",\n value: function establishPages() {\n var _this15 = this;\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.data;\n this.pages = [];\n this.prefixComps = [];\n this.suffixComps = [];\n var visible = [];\n var currentPages = {};\n var pageOptions = _objectSpread(_objectSpread({}, _lodash[\"default\"].clone(this.options)), this.parent ? {\n root: this\n } : {});\n if (this.components && this.components.length) {\n this.components.forEach(function (page) {\n if (page.component.type === 'panel') {\n currentPages[page.component.key || page.component.title] = page;\n }\n });\n }\n if (this.originalComponents) {\n this.originalComponents.forEach(function (item) {\n if (item.type === 'panel') {\n if (!item.key) {\n item.key = item.title;\n }\n var page = currentPages[item.key];\n var forceShow = _this15.shouldForceShow(item);\n var forceHide = _this15.shouldForceHide(item);\n var isVisible = !page ? (0, _utils.checkCondition)(item, data, data, _this15.component, _this15) && !item.hidden : page.visible;\n if (forceShow) {\n isVisible = true;\n } else if (forceHide) {\n isVisible = false;\n }\n if (isVisible) {\n visible.push(item);\n if (page) {\n _this15.pages.push(page);\n }\n }\n if (!page && isVisible) {\n page = _this15.createComponent(item, pageOptions);\n page.visible = isVisible;\n _this15.pages.push(page);\n page.eachComponent(function (component) {\n component.page = _this15.pages.length - 1;\n });\n }\n } else if (item.type !== 'button') {\n if (!_this15.pages.length) {\n _this15.prefixComps.push(_this15.createComponent(item, pageOptions));\n } else {\n _this15.suffixComps.push(_this15.createComponent(item, pageOptions));\n }\n }\n });\n }\n if (this.pages.length) {\n this.emit('pagesChanged');\n }\n this.transformPages();\n if (this.allPages && this.allPages.length) {\n this.updatePages();\n }\n return visible;\n }\n }, {\n key: \"updatePages\",\n value: function updatePages() {\n this.pages = this.allPages;\n }\n }, {\n key: \"addComponents\",\n value: function addComponents() {\n this.establishPages();\n }\n }, {\n key: \"setPage\",\n value: function setPage(num) {\n var _this16 = this;\n if (num === this.page) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n if (num >= 0 && num < this.pages.length) {\n this.page = num;\n this.pageFieldLogic(num);\n this.getNextPage();\n var parentNum = num;\n if (this.hasExtraPages) {\n var pageFromPages = this.pages[num];\n var pageFromComponents = this.components[num];\n if (!pageFromComponents || (pageFromPages === null || pageFromPages === void 0 ? void 0 : pageFromPages.id) !== pageFromComponents.id) {\n parentNum = this.components.findIndex(function (comp) {\n var _this16$pages, _this16$pages$parentN;\n return comp.id === ((_this16$pages = _this16.pages) === null || _this16$pages === void 0 ? void 0 : (_this16$pages$parentN = _this16$pages[parentNum]) === null || _this16$pages$parentN === void 0 ? void 0 : _this16$pages$parentN.rootPanelId);\n });\n }\n }\n if (!this._seenPages.includes(parentNum)) {\n this._seenPages = this._seenPages.concat(parentNum);\n }\n this.redraw().then(function () {\n _this16.checkData(_this16.submission.data);\n });\n return _nativePromiseOnly[\"default\"].resolve();\n } else if (!this.pages.length) {\n this.redraw();\n return _nativePromiseOnly[\"default\"].resolve();\n }\n return _nativePromiseOnly[\"default\"].reject('Page not found');\n }\n }, {\n key: \"pageFieldLogic\",\n value: function pageFieldLogic(page) {\n var _this$pages3;\n if ((_this$pages3 = this.pages) !== null && _this$pages3 !== void 0 && _this$pages3[page]) {\n // Handle field logic on pages.\n this.component = this.pages[page].component;\n this.originalComponent = (0, _utils.fastCloneDeep)(this.component);\n this.fieldLogic(this.data);\n // If disabled changed, be sure to distribute the setting.\n this.disabled = this.shouldDisabled;\n }\n }\n }, {\n key: \"currentPage\",\n get: function get() {\n return this.pages && this.pages.length >= this.page ? this.pages[this.page] : {\n components: []\n };\n }\n }, {\n key: \"getNextPage\",\n value: function getNextPage() {\n var _this$pages4;\n if ((_this$pages4 = this.pages) !== null && _this$pages4 !== void 0 && _this$pages4[this.page]) {\n var data = this.submission.data;\n var form = this.pages[this.page].component;\n // Check conditional nextPage\n if (form) {\n var page = this.pages.length > this.page + 1 && !this.showAllErrors ? this.page + 1 : -1;\n if (form.nextPage) {\n var next = this.evaluate(form.nextPage, {\n next: page,\n data: data,\n page: page,\n form: form\n }, 'next');\n if (next === null) {\n this.currentNextPage = null;\n return null;\n }\n var pageNum = parseInt(next, 10);\n if (!isNaN(parseInt(pageNum, 10)) && isFinite(pageNum)) {\n this.currentNextPage = pageNum;\n return pageNum;\n }\n this.currentNextPage = this.getPageIndexByKey(next);\n return this.currentNextPage;\n }\n this.currentNextPage = page;\n return page;\n }\n this.currentNextPage = null;\n }\n return null;\n }\n }, {\n key: \"getPreviousPage\",\n value: function getPreviousPage() {\n return this.page - 1;\n }\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n var pages = this.getPages();\n return _nativePromiseOnly[\"default\"].all(pages.map(function (page) {\n page.options.beforeSubmit = true;\n return page.beforeSubmit();\n }));\n }\n }, {\n key: \"beforePage\",\n value: function beforePage(next) {\n var _this17 = this;\n return new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this17.hook(next ? 'beforeNext' : 'beforePrev', _this17.currentPage, _this17.submission, function (err) {\n if (err) {\n _this17.showErrors(err, true);\n reject(err);\n }\n var form = _this17.currentPage;\n if (form) {\n form.beforePage(next).then(resolve)[\"catch\"](reject);\n } else {\n resolve();\n }\n });\n });\n }\n }, {\n key: \"emitNextPage\",\n value: function emitNextPage() {\n this.emit('nextPage', {\n page: this.page,\n submission: this.submission\n });\n }\n }, {\n key: \"nextPage\",\n value: function nextPage() {\n var _this18 = this;\n // Read-only forms should not worry about validation before going to next page, nor should they submit.\n if (this.options.readOnly) {\n return this.beforePage(true).then(function () {\n return _this18.setPage(_this18.getNextPage()).then(function () {\n _this18.emitNextPage();\n });\n });\n }\n\n // Validate the form, before go to the next page\n if (this.checkValidity(this.localData, true, this.localData, true)) {\n this.checkData(this.submission.data);\n return this.beforePage(true).then(function () {\n return _this18.setPage(_this18.getNextPage()).then(function () {\n if (!(_this18.options.readOnly || _this18.editMode) && _this18.enabledIndex < _this18.page) {\n _this18.enabledIndex = _this18.page;\n _this18.redraw();\n }\n _this18.emitNextPage();\n });\n });\n } else {\n this.currentPage.components.forEach(function (comp) {\n return comp.setPristine(false);\n });\n this.scrollIntoView(this.element);\n return _nativePromiseOnly[\"default\"].reject(this.showErrors([], true));\n }\n }\n }, {\n key: \"emitPrevPage\",\n value: function emitPrevPage() {\n this.emit('prevPage', {\n page: this.page,\n submission: this.submission\n });\n }\n }, {\n key: \"prevPage\",\n value: function prevPage() {\n var _this19 = this;\n return this.beforePage().then(function () {\n return _this19.setPage(_this19.getPreviousPage()).then(function () {\n _this19.emitPrevPage();\n });\n });\n }\n }, {\n key: \"cancel\",\n value: function cancel(noconfirm) {\n var _this20 = this;\n if (this.options.readOnly) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n if (_get(_getPrototypeOf(Wizard.prototype), \"cancel\", this).call(this, noconfirm)) {\n this.setPristine(true);\n return this.setPage(0).then(function () {\n if (_this20.enabledIndex) {\n _this20.enabledIndex = 0;\n }\n _this20.onChange();\n _this20.redraw();\n return _this20.page;\n });\n }\n return _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"getPageIndexByKey\",\n value: function getPageIndexByKey(key) {\n var pageIndex = this.page;\n this.pages.forEach(function (page, index) {\n if (page.component.key === key) {\n pageIndex = index;\n return false;\n }\n });\n return pageIndex;\n }\n }, {\n key: \"schema\",\n get: function get() {\n return this.wizard;\n }\n }, {\n key: \"setComponentSchema\",\n value: function setComponentSchema() {\n var _this21 = this;\n var pageKeys = {};\n this.originalComponents = [];\n this.component.components.map(function (item) {\n if (item.type === 'panel') {\n item.key = (0, _utils.uniqueKey)(pageKeys, item.key || 'panel');\n pageKeys[item.key] = true;\n if (_this21.wizard.full) {\n _this21.options.show = _this21.options.show || {};\n _this21.options.show[item.key] = true;\n } else if (_this21.wizard.hasOwnProperty('full') && !_lodash[\"default\"].isEqual(_this21.originalOptions.show, _this21.options.show)) {\n _this21.options.show = _objectSpread({}, _this21.originalOptions.show || {});\n }\n }\n _this21.originalComponents.push(_lodash[\"default\"].clone(item));\n });\n if (!Object.keys(pageKeys).length) {\n var newPage = {\n type: 'panel',\n title: 'Page 1',\n label: 'Page 1',\n key: 'page1',\n components: this.component.components\n };\n this.component.components = [newPage];\n this.originalComponents.push(_lodash[\"default\"].clone(newPage));\n }\n }\n }, {\n key: \"setForm\",\n value: function setForm(form, flags) {\n if (!form) {\n return;\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"setForm\", this).call(this, form, flags);\n }\n }, {\n key: \"onSetForm\",\n value: function onSetForm(clonedForm, initialForm) {\n this.component.components = (this._parentPath ? initialForm.components : clonedForm.components) || [];\n this.setComponentSchema();\n }\n }, {\n key: \"setEditMode\",\n value: function setEditMode(submission) {\n if (!this.editMode && submission._id && !this.options.readOnly) {\n this.editMode = true;\n this.redraw();\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(submission) {\n var _this22 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var ignoreEstablishment = arguments.length > 2 ? arguments[2] : undefined;\n this._submission = submission;\n if (flags && flags.fromSubmission && (this.options.readOnly || this.editMode) && !this.isHtmlRenderMode() || flags && flags.fromSubmission && (this.prefixComps.length || this.suffixComps.length) && submission._id || this.options.server && (this.prefixComps.length || this.suffixComps.length)) {\n this._data = submission.data;\n }\n if (!ignoreEstablishment) {\n this.establishPages(submission.data);\n }\n var changed = this.getPages({\n all: true\n }).reduce(function (changed, page) {\n return _this22.setNestedValue(page, submission.data, flags, changed) || changed;\n }, false);\n if (changed) {\n this.pageFieldLogic(this.page);\n }\n this.setEditMode(submission);\n return changed;\n }\n }, {\n key: \"isClickable\",\n value: function isClickable(page, index) {\n return this.page !== index && (0, _utils.firstNonNil)([_lodash[\"default\"].get(page, 'breadcrumbClickable'), this.options.breadcrumbSettings.clickable]);\n }\n }, {\n key: \"hasButton\",\n value: function hasButton(name) {\n var nextPage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getNextPage();\n // get page options with global options as default values\n var _$get = _lodash[\"default\"].get(this.currentPage, 'component.buttonSettings', {}),\n _$get$previous = _$get.previous,\n previous = _$get$previous === void 0 ? this.options.buttonSettings.showPrevious : _$get$previous,\n _$get$cancel = _$get.cancel,\n cancel = _$get$cancel === void 0 ? this.options.buttonSettings.showCancel : _$get$cancel,\n _$get$submit = _$get.submit,\n submit = _$get$submit === void 0 ? this.options.buttonSettings.showSubmit : _$get$submit,\n _$get$next = _$get.next,\n next = _$get$next === void 0 ? this.options.buttonSettings.showNext : _$get$next;\n switch (name) {\n case 'previous':\n return previous && this.getPreviousPage() > -1;\n case 'next':\n return next && nextPage !== null && nextPage !== -1;\n case 'cancel':\n return cancel && !this.options.readOnly;\n case 'submit':\n return submit && !this.options.readOnly && (nextPage === null || this.page === this.pages.length - 1);\n default:\n return true;\n }\n }\n }, {\n key: \"pageId\",\n value: function pageId(page) {\n if (page.key) {\n // Some panels have the same key....\n return \"\".concat(page.key, \"-\").concat(page.title);\n } else if (page.components && page.components.length > 0) {\n return this.pageId(page.components[0]);\n } else {\n return page.title;\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(flags, changed, modified, changes) {\n var _this23 = this;\n _get(_getPrototypeOf(Wizard.prototype), \"onChange\", this).call(this, flags, changed, modified, changes);\n if (this.alert && !this.submitted) {\n this.checkValidity(this.localData, false, this.localData, true);\n this.showErrors([], true, true);\n }\n\n // If the pages change, need to redraw the header.\n var currentPanels;\n var panels;\n var currentNextPage = this.currentNextPage;\n if (this.hasExtraPages) {\n currentPanels = this.pages.map(function (page) {\n return page.component.key;\n });\n this.establishPages();\n panels = this.pages.map(function (page) {\n return page.component.key;\n });\n } else {\n var _this$currentPanel, _this$currentPanels;\n currentPanels = this.currentPanels || this.pages.map(function (page) {\n return page.component.key;\n });\n panels = this.establishPages().map(function (panel) {\n return panel.key;\n });\n this.currentPanels = panels;\n if ((_this$currentPanel = this.currentPanel) !== null && _this$currentPanel !== void 0 && _this$currentPanel.key && (_this$currentPanels = this.currentPanels) !== null && _this$currentPanels !== void 0 && _this$currentPanels.length) {\n this.setPage(this.currentPanels.findIndex(function (panel) {\n return panel === _this23.currentPanel.key;\n }));\n }\n }\n if (!_lodash[\"default\"].isEqual(panels, currentPanels) || flags && flags.fromSubmission) {\n this.redrawHeader();\n }\n\n // If the next page changes, then make sure to redraw navigation.\n if (currentNextPage !== this.getNextPage()) {\n this.redrawNavigation();\n }\n if (this.options.readOnly && (this.prefixComps.length || this.suffixComps.length)) {\n this.redraw();\n }\n }\n }, {\n key: \"redraw\",\n value: function redraw() {\n var _this$parent, _this$parent$componen;\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 this.parent.redraw();\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"redraw\", this).call(this);\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, row, currentPageOnly) {\n if (!this.checkCondition(row, data)) {\n this.setCustomValidity('');\n return true;\n }\n var components = !currentPageOnly || this.isLastPage() ? this.getComponents() : this.currentPage.components;\n return components.reduce(function (check, comp) {\n return comp.checkValidity(data, dirty, row) && check;\n }, true);\n }\n }, {\n key: \"errors\",\n get: function get() {\n if (!this.isLastPage()) {\n return this.currentPage.errors;\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"errors\", this);\n }\n }, {\n key: \"focusOnComponent\",\n value: function focusOnComponent(key) {\n var _this24 = this;\n var pageIndex = 0;\n var _this$pages$filter = this.pages.filter(function (page, index) {\n var hasComponent = false;\n page.getComponent(key, function (comp) {\n if (comp.path === key) {\n pageIndex = index;\n hasComponent = true;\n }\n });\n return hasComponent;\n }),\n _this$pages$filter2 = _slicedToArray(_this$pages$filter, 1),\n page = _this$pages$filter2[0];\n if (page && page !== this.currentPage) {\n return this.setPage(pageIndex).then(function () {\n _this24.checkValidity(_this24.submission.data, true, _this24.submission.data);\n _this24.showErrors();\n _get(_getPrototypeOf(Wizard.prototype), \"focusOnComponent\", _this24).call(_this24, key);\n });\n }\n return _get(_getPrototypeOf(Wizard.prototype), \"focusOnComponent\", this).call(this, key);\n }\n }]);\n return Wizard;\n}(_Webform2[\"default\"]);\nexports[\"default\"] = Wizard;\nWizard.setBaseUrl = _Formio.GlobalFormio.setBaseUrl;\nWizard.setApiUrl = _Formio.GlobalFormio.setApiUrl;\nWizard.setAppUrl = _Formio.GlobalFormio.setAppUrl;\n\n//# sourceURL=webpack://Formio/./lib/Wizard.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.array.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.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.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\n /**\n *\n * @param value {boolean}\n */,\n set: function set(value) {\n this._parentDisabled = value;\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.options.hide && this.options.hide[this.component.key]) {\n return false;\n }\n if (this.options.show && this.options.show[this.component.key]) {\n return true;\n }\n return this._visible && this._parentVisible;\n },\n set: function set(value) {\n if (this._visible !== value) {\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 = 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 // No need to sanitize when generating PDF'S since no users interact with the form.\n if (!this.shouldSanitizeValue && !forceSanitize || this.options.pdf && !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(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 = /text|search|password|tel|url/i.test(input.type || '');\n if (input) {\n if (isInputRangeSelectable) {\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) {\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\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) || shouldBeCleared || 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 (_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;\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 = 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 = 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 // Do not check custom validation for empty data if it is not required\n function () {\n return _this20.component.validate.custom && !_this20.dataValue && !_this20.component.validate.required;\n },\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 /**\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 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 = 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(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\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) || shouldBeCleared || 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;\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 = 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 = 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 // Do not check custom validation for empty data if it is not required\n function () {\n return _this20.component.validate.custom && !_this20.dataValue && !_this20.component.validate.required;\n },\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 /**\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 {\n operators: ['isEqual', 'isNotEqual', 'isEmpty', 'isNotEmpty'],\n valueComponent: function valueComponent() {\n return {\n type: 'textfield'\n };\n }\n };\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?"); /***/ }), @@ -356,7 +356,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.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.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__(/*! ../component/Component */ \"./lib/components/_classes/component/Component.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 Field = /*#__PURE__*/function (_Component) {\n _inherits(Field, _Component);\n var _super = _createSuper(Field);\n function Field() {\n _classCallCheck(this, Field);\n return _super.apply(this, arguments);\n }\n _createClass(Field, [{\n key: \"render\",\n value: function render(element) {\n if (this.noField) {\n return _get(_getPrototypeOf(Field.prototype), \"render\", this).call(this, element);\n } else if (this.isAdvancedLabel || this.options.condensedMode) {\n return _get(_getPrototypeOf(Field.prototype), \"render\", this).call(this, this.renderTemplate('field', _objectSpread(_objectSpread({}, this.getLabelInfo(this.options.condensedMode)), {}, {\n labelMarkup: this.renderTemplate('label'),\n element: element\n }), 'align'));\n } else {\n return _get(_getPrototypeOf(Field.prototype), \"render\", this).call(this, this.renderTemplate('field', {\n labelMarkup: this.renderTemplate('label'),\n element: element\n }));\n }\n }\n }]);\n return Field;\n}(_Component2[\"default\"]);\nexports[\"default\"] = Field;\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/field/Field.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.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.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.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__(/*! ../component/Component */ \"./lib/components/_classes/component/Component.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 Field = /*#__PURE__*/function (_Component) {\n _inherits(Field, _Component);\n var _super = _createSuper(Field);\n function Field() {\n _classCallCheck(this, Field);\n return _super.apply(this, arguments);\n }\n _createClass(Field, [{\n key: \"render\",\n value: function render(element) {\n if (this.noField) {\n return _get(_getPrototypeOf(Field.prototype), \"render\", this).call(this, element);\n } else if (this.isAdvancedLabel || this.options.condensedMode) {\n return _get(_getPrototypeOf(Field.prototype), \"render\", this).call(this, this.renderTemplate('field', _objectSpread(_objectSpread({}, this.getLabelInfo(this.options.condensedMode)), {}, {\n labelMarkup: this.renderTemplate('label'),\n element: element\n }), 'align'));\n } else {\n return _get(_getPrototypeOf(Field.prototype), \"render\", this).call(this, this.renderTemplate('field', {\n labelMarkup: this.renderTemplate('label'),\n element: element\n }));\n }\n }\n\n // Saves current caret position to restore it after the component is redrawn\n }, {\n key: \"saveCaretPosition\",\n value: function saveCaretPosition(element, index) {\n var _this$root, _this$root$focusedCom;\n if (((_this$root = this.root) === null || _this$root === void 0 ? void 0 : (_this$root$focusedCom = _this$root.focusedComponent) === null || _this$root$focusedCom === void 0 ? void 0 : _this$root$focusedCom.path) === this.path) {\n try {\n this.root.currentSelection = {\n selection: [element.selectionStart, element.selectionEnd],\n index: index\n };\n } catch (e) {\n if (!(e instanceof DOMException)) {\n console.debug(e);\n }\n }\n }\n }\n }]);\n return Field;\n}(_Component2[\"default\"]);\nexports[\"default\"] = Field;\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/field/Field.js?"); /***/ }), @@ -389,7 +389,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.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\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\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.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.string.starts-with.js */ \"./node_modules/core-js/modules/es.string.starts-with.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.filter.js */ \"./node_modules/core-js/modules/es.array.filter.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 _Field2 = _interopRequireDefault(__webpack_require__(/*! ../field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _Formio = __webpack_require__(/*! ../../../Formio */ \"./lib/Formio.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.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 _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 ListComponent = /*#__PURE__*/function (_Field) {\n _inherits(ListComponent, _Field);\n var _super = _createSuper(ListComponent);\n function ListComponent() {\n _classCallCheck(this, ListComponent);\n return _super.apply(this, arguments);\n }\n _createClass(ListComponent, [{\n key: \"isSelectURL\",\n get: function get() {\n return this.component.dataSrc === 'url';\n }\n }, {\n key: \"requestHeaders\",\n get: function get() {\n var _this = this;\n // Create the headers object.\n var headers = new _Formio.GlobalFormio.Headers();\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, _this.interpolate(header.value));\n }\n });\n } catch (err) {\n console.warn(err.message);\n }\n }\n return headers;\n }\n\n // Must be implemented in child classes.\n }, {\n key: \"setItems\",\n value: function setItems() {}\n }, {\n key: \"updateCustomItems\",\n value: function updateCustomItems() {}\n }, {\n key: \"loadItems\",\n value: function loadItems() {}\n }, {\n key: \"getOptionTemplate\",\n value: function getOptionTemplate(data, value) {\n if (!this.component.template) {\n return data.label;\n }\n var options = {\n noeval: true,\n data: {}\n };\n var template = this.sanitize(this.component.template ? this.interpolate(this.component.template, {\n item: data\n }, options) : data.label, this.shouldSanitizeValue);\n var templateValue = this.component.reference && value !== null && value !== void 0 && value._id ? value._id.toString() : value;\n if (templateValue && !_lodash[\"default\"].isObject(templateValue) && options.data.item) {\n // If the value is not an object, then we need to save the template data off for when it is selected.\n this.templateData[templateValue] = options.data.item;\n }\n return template;\n }\n }, {\n key: \"itemTemplate\",\n value: function itemTemplate(data, value) {\n if (_lodash[\"default\"].isEmpty(data)) {\n return '';\n }\n var template = this.sanitize(this.getOptionTemplate(data, value), this.shouldSanitizeValue);\n if (template) {\n var _this$i18next;\n var label = template.replace(/<\\/?[^>]+(>|$)/g, '');\n var hasTranslator = (_this$i18next = this.i18next) === null || _this$i18next === void 0 ? void 0 : _this$i18next.translator;\n if (!label || hasTranslator && !this.t(label, {\n _userInput: true\n })) return;\n return hasTranslator ? template.replace(label, this.t(label, {\n _userInput: true\n })) : label;\n } else {\n return this.sanitize(JSON.stringify(data), this.shouldSanitizeValue);\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 /* eslint-disable max-statements */\n }, {\n key: \"updateItems\",\n value: function updateItems(searchInput, forceUpdate) {\n var _this2 = this;\n if (!this.component.data) {\n console.warn(\"Select component \".concat(this.key, \" does not have data configuration.\"));\n this.itemsLoadedResolve();\n return;\n }\n\n // Only load the data if it is visible.\n if (!this.visible) {\n this.itemsLoadedResolve();\n return;\n }\n switch (this.component.dataSrc) {\n case 'values':\n this.setItems(this.component.data.values);\n break;\n case 'json':\n this.setItems(this.component.data.json);\n break;\n case 'custom':\n this.updateCustomItems(forceUpdate);\n break;\n case 'resource':\n {\n // If there is no resource, or we are lazyLoading, wait until active.\n if (!this.component.data.resource || !forceUpdate && !this.active) {\n this.itemsLoadedResolve();\n return;\n }\n var resourceUrl = this.options.formio ? this.options.formio.formsUrl : \"\".concat(_Formio.GlobalFormio.getProjectUrl(), \"/form\");\n resourceUrl += \"/\".concat(this.component.data.resource, \"/submission\");\n if (forceUpdate || this.additionalResourcesAvailable || !this.serverCount) {\n try {\n this.loadItems(resourceUrl, searchInput, this.requestHeaders);\n } catch (err) {\n console.warn(\"Unable to load resources for \".concat(this.key));\n }\n } else {\n this.setItems(this.downloadedResources);\n }\n break;\n }\n case 'url':\n {\n if (!forceUpdate && !this.active && !this.calculatedValue && this.component.type === 'select') {\n // If we are lazyLoading, wait until activated.\n this.itemsLoadedResolve();\n return;\n }\n var url = this.component.data.url;\n var method;\n var body;\n if (url.startsWith('/')) {\n // if URL starts with '/project', we should use base URL to avoid issues with URL formed like //project//...\n var baseUrl = url.startsWith('/project') ? _Formio.GlobalFormio.getBaseUrl() : _Formio.GlobalFormio.getProjectUrl() || _Formio.GlobalFormio.getBaseUrl();\n url = baseUrl + url;\n }\n if (!this.component.data.method) {\n method = 'GET';\n } else {\n method = this.component.data.method;\n if (method.toUpperCase() === 'POST') {\n body = this.component.data.body;\n } else {\n body = null;\n }\n }\n var options = this.component.authenticate ? {} : {\n noToken: true\n };\n this.loadItems(url, searchInput, this.requestHeaders, options, method, body);\n break;\n }\n case 'indexeddb':\n {\n if (typeof window === 'undefined') {\n return;\n }\n if (!window.indexedDB) {\n window.alert(\"Your browser doesn't support current version of indexedDB\");\n }\n if (this.component.indexeddb && this.component.indexeddb.database && this.component.indexeddb.table) {\n var request = window.indexedDB.open(this.component.indexeddb.database);\n request.onupgradeneeded = function (event) {\n if (_this2.component.customOptions) {\n var db = event.target.result;\n var objectStore = db.createObjectStore(_this2.component.indexeddb.table, {\n keyPath: 'myKey',\n autoIncrement: true\n });\n objectStore.transaction.oncomplete = function () {\n var transaction = db.transaction(_this2.component.indexeddb.table, 'readwrite');\n _this2.component.customOptions.forEach(function (item) {\n transaction.objectStore(_this2.component.indexeddb.table).put(item);\n });\n };\n }\n };\n request.onerror = function () {\n window.alert(request.errorCode);\n };\n request.onsuccess = function (event) {\n var db = event.target.result;\n var transaction = db.transaction(_this2.component.indexeddb.table, 'readwrite');\n var objectStore = transaction.objectStore(_this2.component.indexeddb.table);\n new _nativePromiseOnly[\"default\"](function (resolve) {\n var responseItems = [];\n objectStore.getAll().onsuccess = function (event) {\n event.target.result.forEach(function (item) {\n responseItems.push(item);\n });\n resolve(responseItems);\n };\n }).then(function (items) {\n if (!_lodash[\"default\"].isEmpty(_this2.component.indexeddb.filter)) {\n items = _lodash[\"default\"].filter(items, _this2.component.indexeddb.filter);\n }\n _this2.setItems(items);\n });\n };\n }\n }\n }\n }\n /* eslint-enable max-statements */\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 dataSrc: 'values',\n authenticate: false,\n ignoreCache: false,\n template: '{{ item.label }}',\n validate: {\n onlyAvailableItems: false\n }\n }].concat(extend));\n }\n }]);\n return ListComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = ListComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/list/ListComponent.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.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\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\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.every.js */ \"./node_modules/core-js/modules/es.array.every.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.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.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.string.starts-with.js */ \"./node_modules/core-js/modules/es.string.starts-with.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.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 _Field2 = _interopRequireDefault(__webpack_require__(/*! ../field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _Formio = __webpack_require__(/*! ../../../Formio */ \"./lib/Formio.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.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 _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 ListComponent = /*#__PURE__*/function (_Field) {\n _inherits(ListComponent, _Field);\n var _super = _createSuper(ListComponent);\n function ListComponent() {\n _classCallCheck(this, ListComponent);\n return _super.apply(this, arguments);\n }\n _createClass(ListComponent, [{\n key: \"isSelectURL\",\n get: function get() {\n return this.component.dataSrc === 'url';\n }\n }, {\n key: \"selectData\",\n get: function get() {\n var selectData = _lodash[\"default\"].get(this.root, 'submission.metadata.selectData', {});\n return _lodash[\"default\"].get(selectData, this.path);\n }\n }, {\n key: \"shouldLoad\",\n get: function get() {\n if (this.loadingError) {\n return false;\n }\n // Live forms should always load.\n if (!this.options.readOnly) {\n return true;\n }\n\n // If there are template keys, then we need to see if we have the data.\n if (this.templateKeys && this.templateKeys.length) {\n // See if we already have the data we need.\n var dataValue = this.dataValue;\n var selectData = this.selectData;\n return this.templateKeys.reduce(function (shouldLoad, key) {\n var hasValue = _lodash[\"default\"].has(dataValue, key) || (_lodash[\"default\"].isArray(selectData) ? selectData.every(function (data) {\n return _lodash[\"default\"].has(data, key);\n }) : _lodash[\"default\"].has(selectData, key));\n return shouldLoad || !hasValue;\n }, false);\n }\n\n // Return that we should load.\n return true;\n }\n }, {\n key: \"getTemplateKeys\",\n value: function getTemplateKeys() {\n var _this = this;\n this.templateKeys = [];\n if (this.options.readOnly && this.component.template) {\n var keys = this.component.template.match(/({{\\s*(.*?)\\s*}})/g);\n if (keys) {\n keys.forEach(function (key) {\n var propKey = key.match(/{{\\s*item\\.(.*?)\\s*}}/);\n if (propKey && propKey.length > 1) {\n _this.templateKeys.push(propKey[1]);\n }\n });\n }\n }\n }\n }, {\n key: \"requestHeaders\",\n get: function get() {\n var _this2 = this;\n // Create the headers object.\n var headers = new _Formio.GlobalFormio.Headers();\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, _this2.interpolate(header.value));\n }\n });\n } catch (err) {\n console.warn(err.message);\n }\n }\n return headers;\n }\n\n // Must be implemented in child classes.\n }, {\n key: \"setItems\",\n value: function setItems() {}\n }, {\n key: \"updateCustomItems\",\n value: function updateCustomItems() {}\n }, {\n key: \"loadItems\",\n value: function loadItems() {}\n }, {\n key: \"getOptionTemplate\",\n value: function getOptionTemplate(data, value, index) {\n if (!this.component.template) {\n return data.label;\n }\n var options = {\n noeval: true,\n data: {}\n };\n var template = this.sanitize(this.component.template ? this.interpolate(this.component.template, {\n item: data\n }, options) : data.label, this.shouldSanitizeValue);\n var templateValue = this.component.reference && value !== null && value !== void 0 && value._id ? value._id.toString() : value;\n if (templateValue && !_lodash[\"default\"].isObject(templateValue) && options.data.item) {\n // If the value is not an object, then we need to save the template data off for when it is selected.\n this.templateData[templateValue] = options.data.item;\n }\n if (_lodash[\"default\"].isNumber(index)) {\n this.templateData[index] = options.data.item;\n }\n return template;\n }\n }, {\n key: \"itemTemplate\",\n value: function itemTemplate(data, value, index) {\n if (_lodash[\"default\"].isEmpty(data)) {\n return '';\n }\n var template = this.sanitize(this.getOptionTemplate(data, value, index), this.shouldSanitizeValue);\n if (template) {\n var _this$i18next;\n var label = template.replace(/<\\/?[^>]+(>|$)/g, '');\n var hasTranslator = (_this$i18next = this.i18next) === null || _this$i18next === void 0 ? void 0 : _this$i18next.translator;\n if (!label || hasTranslator && !this.t(label, {\n _userInput: true\n })) return;\n return hasTranslator ? template.replace(label, this.t(label, {\n _userInput: true\n })) : label;\n } else {\n return this.sanitize(JSON.stringify(data), this.shouldSanitizeValue);\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 /* eslint-disable max-statements */\n }, {\n key: \"updateItems\",\n value: function updateItems(searchInput, forceUpdate) {\n var _this3 = this;\n if (!this.component.data) {\n console.warn(\"Select component \".concat(this.key, \" does not have data configuration.\"));\n this.itemsLoadedResolve();\n return;\n }\n\n // Only load the data if it is visible.\n if (!this.visible) {\n this.itemsLoadedResolve();\n return;\n }\n switch (this.component.dataSrc) {\n case 'values':\n this.setItems(this.component.data.values);\n break;\n case 'json':\n this.setItems(this.component.data.json);\n break;\n case 'custom':\n this.updateCustomItems(forceUpdate);\n break;\n case 'resource':\n {\n // If there is no resource, or we are lazyLoading, wait until active.\n if (!this.component.data.resource || !forceUpdate && !this.active) {\n this.itemsLoadedResolve();\n return;\n }\n var resourceUrl = this.options.formio ? this.options.formio.formsUrl : \"\".concat(_Formio.GlobalFormio.getProjectUrl(), \"/form\");\n resourceUrl += \"/\".concat(this.component.data.resource, \"/submission\");\n if (forceUpdate || this.additionalResourcesAvailable || !this.serverCount) {\n try {\n this.loadItems(resourceUrl, searchInput, this.requestHeaders);\n } catch (err) {\n console.warn(\"Unable to load resources for \".concat(this.key));\n }\n } else {\n this.setItems(this.downloadedResources);\n }\n break;\n }\n case 'url':\n {\n if (!forceUpdate && !this.active && !this.calculatedValue && this.component.type === 'select') {\n // If we are lazyLoading, wait until activated.\n this.itemsLoadedResolve();\n return;\n }\n var url = this.component.data.url;\n var method;\n var body;\n if (url.startsWith('/')) {\n // if URL starts with '/project', we should use base URL to avoid issues with URL formed like //project//...\n var baseUrl = url.startsWith('/project') ? _Formio.GlobalFormio.getBaseUrl() : _Formio.GlobalFormio.getProjectUrl() || _Formio.GlobalFormio.getBaseUrl();\n url = baseUrl + url;\n }\n if (!this.component.data.method) {\n method = 'GET';\n } else {\n method = this.component.data.method;\n if (method.toUpperCase() === 'POST') {\n body = this.component.data.body;\n } else {\n body = null;\n }\n }\n var options = this.component.authenticate ? {} : {\n noToken: true\n };\n this.loadItems(url, searchInput, this.requestHeaders, options, method, body);\n break;\n }\n case 'indexeddb':\n {\n if (typeof window === 'undefined') {\n return;\n }\n if (!window.indexedDB) {\n window.alert(\"Your browser doesn't support current version of indexedDB\");\n }\n if (this.component.indexeddb && this.component.indexeddb.database && this.component.indexeddb.table) {\n var request = window.indexedDB.open(this.component.indexeddb.database);\n request.onupgradeneeded = function (event) {\n if (_this3.component.customOptions) {\n var db = event.target.result;\n var objectStore = db.createObjectStore(_this3.component.indexeddb.table, {\n keyPath: 'myKey',\n autoIncrement: true\n });\n objectStore.transaction.oncomplete = function () {\n var transaction = db.transaction(_this3.component.indexeddb.table, 'readwrite');\n _this3.component.customOptions.forEach(function (item) {\n transaction.objectStore(_this3.component.indexeddb.table).put(item);\n });\n };\n }\n };\n request.onerror = function () {\n window.alert(request.errorCode);\n };\n request.onsuccess = function (event) {\n var db = event.target.result;\n var transaction = db.transaction(_this3.component.indexeddb.table, 'readwrite');\n var objectStore = transaction.objectStore(_this3.component.indexeddb.table);\n new _nativePromiseOnly[\"default\"](function (resolve) {\n var responseItems = [];\n objectStore.getAll().onsuccess = function (event) {\n event.target.result.forEach(function (item) {\n responseItems.push(item);\n });\n resolve(responseItems);\n };\n }).then(function (items) {\n if (!_lodash[\"default\"].isEmpty(_this3.component.indexeddb.filter)) {\n items = _lodash[\"default\"].filter(items, _this3.component.indexeddb.filter);\n }\n _this3.setItems(items);\n });\n };\n }\n }\n }\n }\n /* eslint-enable max-statements */\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 dataSrc: 'values',\n authenticate: false,\n ignoreCache: false,\n template: '{{ item.label }}',\n validate: {\n onlyAvailableItems: false\n }\n }].concat(extend));\n }\n }]);\n return ListComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = ListComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/list/ListComponent.js?"); /***/ }), @@ -411,7 +411,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.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.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.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.map.js */ \"./node_modules/core-js/modules/es.array.map.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/web.timers.js */ \"./node_modules/core-js/modules/web.timers.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.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.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.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 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 Multivalue = /*#__PURE__*/function (_Field) {\n _inherits(Multivalue, _Field);\n var _super = _createSuper(Multivalue);\n function Multivalue() {\n _classCallCheck(this, Multivalue);\n return _super.apply(this, arguments);\n }\n _createClass(Multivalue, [{\n key: \"dataValue\",\n get: function get() {\n var parent = _get(_getPrototypeOf(Multivalue.prototype), \"dataValue\", this);\n if (!parent && this.component.multiple) {\n return [];\n }\n return parent;\n },\n set: function set(value) {\n _set(_getPrototypeOf(Multivalue.prototype), \"dataValue\", value, this, true);\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var value = _get(_getPrototypeOf(Multivalue.prototype), \"defaultValue\", this);\n if (this.component.multiple) {\n if (_lodash[\"default\"].isArray(value)) {\n value = !value.length ? [_get(_getPrototypeOf(Multivalue.prototype), \"emptyValue\", this)] : value;\n } else {\n value = [value];\n }\n }\n return value;\n }\n }, {\n key: \"addAnother\",\n get: function get() {\n return this.t(this.component.addAnother || 'Add Another');\n }\n }, {\n key: \"useWrapper\",\n value: function useWrapper() {\n return this.component.hasOwnProperty('multiple') && this.component.multiple;\n }\n }, {\n key: \"render\",\n value: function render() {\n // If single value field.\n if (!this.useWrapper()) {\n return _get(_getPrototypeOf(Multivalue.prototype), \"render\", this).call(this, \"
\\n \".concat(this.renderElement(this.component.type !== 'hidden' ? this.dataValue : ''), \"\\n
\"));\n }\n\n // Make sure dataValue is in the correct array format.\n var dataValue = this.dataValue;\n if (!Array.isArray(dataValue)) {\n dataValue = dataValue ? [dataValue] : [];\n }\n\n // If multiple value field.\n return _get(_getPrototypeOf(Multivalue.prototype), \"render\", this).call(this, this.renderTemplate('multiValueTable', {\n rows: dataValue.map(this.renderRow.bind(this)).join(''),\n disabled: this.disabled,\n addAnother: this.addAnother\n }));\n }\n }, {\n key: \"renderElement\",\n value: function renderElement() {\n return '';\n }\n }, {\n key: \"renderRow\",\n value: function renderRow(value, index) {\n return this.renderTemplate('multiValueRow', {\n index: index,\n disabled: this.disabled,\n element: \"\".concat(this.renderElement(value, index))\n });\n }\n }, {\n key: \"attach\",\n value: function attach(dom) {\n var _this = this;\n var superAttach = _get(_getPrototypeOf(Multivalue.prototype), \"attach\", this).call(this, dom);\n this.loadRefs(dom, {\n addButton: 'multiple',\n input: 'multiple',\n removeRow: 'multiple',\n mask: 'multiple',\n select: 'multiple'\n });\n var promises = [];\n this.refs.input.forEach(function (element, index) {\n promises.push(_this.attachElement.call(_this, element, index));\n });\n if (!this.component.multiple) {\n return _nativePromiseOnly[\"default\"].all(promises);\n }\n this.refs.removeRow.forEach(function (removeButton, index) {\n _this.addEventListener(removeButton, 'click', function (event) {\n event.preventDefault();\n _this.removeValue(index);\n });\n });\n\n // If single value field.\n this.refs.addButton.forEach(function (addButton) {\n _this.addEventListener(addButton, 'click', function (event) {\n event.preventDefault();\n _this.addValue();\n });\n });\n return superAttach.then(function () {\n return _nativePromiseOnly[\"default\"].all(promises);\n });\n }\n }, {\n key: \"detach\",\n value: function detach() {\n if (this.refs.input && this.refs.input.length) {\n this.refs.input.forEach(function (input) {\n if (input.mask) {\n input.mask.destroy();\n }\n if (input.widget) {\n input.widget.destroy();\n }\n });\n }\n if (this.refs.mask && this.refs.mask.length) {\n this.refs.mask.forEach(function (input) {\n if (input.mask) {\n input.mask.destroy();\n }\n });\n }\n _get(_getPrototypeOf(Multivalue.prototype), \"detach\", this).call(this);\n }\n\n /**\n * Attach inputs to the element.\n *\n * @param element\n * @param index\n */\n }, {\n key: \"attachElement\",\n value: function attachElement(element, index) {\n var _this2 = this;\n this.addEventListener(element, this.inputInfo.changeEvent, function () {\n // Delay update slightly to give input mask a chance to run.\n var textCase = _lodash[\"default\"].get(_this2.component, 'case', 'mixed');\n if (textCase !== 'mixed') {\n var selectionStart = element.selectionStart,\n selectionEnd = element.selectionEnd;\n if (textCase === 'uppercase' && element.value) {\n element.value = element.value.toUpperCase();\n }\n if (textCase === 'lowercase' && element.value) {\n element.value = element.value.toLowerCase();\n }\n if (element.selectionStart && element.selectionEnd) {\n element.selectionStart = selectionStart;\n element.selectionEnd = selectionEnd;\n }\n }\n try {\n _this2.saveCaretPosition(element, index);\n } catch (err) {\n console.warn('An error occurred while trying to save caret position', err);\n }\n\n // If a mask is present, delay the update to allow mask to update first.\n if (element.mask) {\n setTimeout(function () {\n return _this2.updateValue(null, {\n modified: _this2.component.type !== 'hidden'\n }, index);\n }, 1);\n } else {\n return _this2.updateValue(null, {\n modified: _this2.component.type !== 'hidden'\n }, index);\n }\n });\n if (!this.attachMultiMask(index)) {\n var applyMask = function applyMask() {\n _this2.setInputMask(element);\n var valueMask = _this2.component.inputMask;\n var displayMask = _this2.component.displayMask;\n if (valueMask && displayMask && displayMask !== valueMask && _this2.refs.valueMaskInput) {\n _this2.setInputMask(_this2.refs.valueMaskInput, valueMask);\n }\n };\n if (this.inputInfo.changeEvent === 'blur') {\n this.addEventListener(element, this.inputInfo.changeEvent, function () {\n var _document$querySelect;\n applyMask();\n _this2.dataValue = _this2.refs.input[0].value;\n var submitBtnDisabled = (_document$querySelect = document.querySelector('[name=\"data[submit]\"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.disabled;\n submitBtnDisabled = true;\n if (_this2.checkComponentValidity()) {\n _this2.updateComponentValue(_this2.refs.input[0].value);\n submitBtnDisabled = false;\n }\n });\n } else {\n applyMask();\n }\n }\n }\n\n // Saves current caret position to restore it after the component is redrawn\n }, {\n key: \"saveCaretPosition\",\n value: function saveCaretPosition(element, index) {\n var _this$root, _this$root$focusedCom;\n if (((_this$root = this.root) === null || _this$root === void 0 ? void 0 : (_this$root$focusedCom = _this$root.focusedComponent) === null || _this$root$focusedCom === void 0 ? void 0 : _this$root$focusedCom.path) === this.path) {\n this.root.currentSelection = {\n selection: [element.selectionStart, element.selectionEnd],\n index: index\n };\n }\n }\n }, {\n key: \"onSelectMaskHandler\",\n value: function onSelectMaskHandler(event) {\n this.updateMask(event.target.maskInput, this.getMaskPattern(event.target.value));\n }\n }, {\n key: \"getMaskPattern\",\n value: function getMaskPattern(maskName) {\n if (!this.multiMasks) {\n this.multiMasks = {};\n }\n if (this.multiMasks[maskName]) {\n return this.multiMasks[maskName];\n }\n var mask = this.component.inputMasks.find(function (inputMask) {\n return inputMask.label === maskName;\n });\n this.multiMasks[maskName] = mask ? mask.mask : this.component.inputMasks[0].mask;\n return this.multiMasks[maskName];\n }\n }, {\n key: \"attachMultiMask\",\n value: function attachMultiMask(index) {\n if (!(this.isMultipleMasksField && this.component.inputMasks.length && this.refs.input.length)) {\n return false;\n }\n var maskSelect = this.refs.select[index];\n maskSelect.onchange = this.onSelectMaskHandler.bind(this);\n maskSelect.maskInput = this.refs.mask[index];\n this.setInputMask(maskSelect.maskInput, this.component.inputMasks[0].mask);\n return true;\n }\n }, {\n key: \"updateMask\",\n value: function updateMask(input, mask) {\n if (!mask) {\n return;\n }\n this.setInputMask(input, mask, !this.component.placeholder);\n this.updateValue();\n }\n\n /**\n * Adds a new empty value to the data array.\n */\n }, {\n key: \"addNewValue\",\n value: function addNewValue(value) {\n if (value === undefined) {\n value = this.component.defaultValue ? this.component.defaultValue : this.emptyValue;\n // If default is an empty aray, default back to empty value.\n if (Array.isArray(value) && value.length === 0) {\n value = this.emptyValue;\n }\n }\n var dataValue = this.dataValue || [];\n if (!Array.isArray(dataValue)) {\n dataValue = [dataValue];\n }\n if (Array.isArray(value)) {\n dataValue = dataValue.concat(value);\n } else {\n dataValue.push(value);\n }\n this.dataValue = dataValue;\n }\n\n /**\n * Adds a new empty value to the data array, and add a new row to contain it.\n */\n }, {\n key: \"addValue\",\n value: function addValue() {\n this.addNewValue();\n this.redraw();\n this.checkConditions();\n if (!this.isEmpty(this.dataValue)) {\n this.restoreValue();\n }\n if (this.root) {\n this.root.onChange();\n }\n }\n }]);\n return Multivalue;\n}(_Field2[\"default\"]);\nexports[\"default\"] = Multivalue;\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/multivalue/Multivalue.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.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.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.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.map.js */ \"./node_modules/core-js/modules/es.array.map.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/web.timers.js */ \"./node_modules/core-js/modules/web.timers.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.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.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.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 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 Multivalue = /*#__PURE__*/function (_Field) {\n _inherits(Multivalue, _Field);\n var _super = _createSuper(Multivalue);\n function Multivalue() {\n _classCallCheck(this, Multivalue);\n return _super.apply(this, arguments);\n }\n _createClass(Multivalue, [{\n key: \"dataValue\",\n get: function get() {\n var parent = _get(_getPrototypeOf(Multivalue.prototype), \"dataValue\", this);\n if (!parent && this.component.multiple) {\n return [];\n }\n return parent;\n },\n set: function set(value) {\n _set(_getPrototypeOf(Multivalue.prototype), \"dataValue\", value, this, true);\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var value = _get(_getPrototypeOf(Multivalue.prototype), \"defaultValue\", this);\n if (this.component.multiple) {\n if (_lodash[\"default\"].isArray(value)) {\n value = !value.length ? [_get(_getPrototypeOf(Multivalue.prototype), \"emptyValue\", this)] : value;\n } else {\n value = [value];\n }\n }\n return value;\n }\n }, {\n key: \"addAnother\",\n get: function get() {\n return this.t(this.component.addAnother || 'Add Another');\n }\n }, {\n key: \"useWrapper\",\n value: function useWrapper() {\n return this.component.hasOwnProperty('multiple') && this.component.multiple;\n }\n }, {\n key: \"render\",\n value: function render() {\n // If single value field.\n if (!this.useWrapper()) {\n return _get(_getPrototypeOf(Multivalue.prototype), \"render\", this).call(this, \"
\\n \".concat(this.renderElement(this.component.type !== 'hidden' ? this.dataValue : ''), \"\\n
\"));\n }\n\n // Make sure dataValue is in the correct array format.\n var dataValue = this.dataValue;\n if (!Array.isArray(dataValue)) {\n dataValue = dataValue ? [dataValue] : [];\n }\n\n // If multiple value field.\n return _get(_getPrototypeOf(Multivalue.prototype), \"render\", this).call(this, this.renderTemplate('multiValueTable', {\n rows: dataValue.map(this.renderRow.bind(this)).join(''),\n disabled: this.disabled,\n addAnother: this.addAnother\n }));\n }\n }, {\n key: \"renderElement\",\n value: function renderElement() {\n return '';\n }\n }, {\n key: \"renderRow\",\n value: function renderRow(value, index) {\n return this.renderTemplate('multiValueRow', {\n index: index,\n disabled: this.disabled,\n element: \"\".concat(this.renderElement(value, index))\n });\n }\n }, {\n key: \"attach\",\n value: function attach(dom) {\n var _this = this;\n var superAttach = _get(_getPrototypeOf(Multivalue.prototype), \"attach\", this).call(this, dom);\n this.loadRefs(dom, {\n addButton: 'multiple',\n input: 'multiple',\n removeRow: 'multiple',\n mask: 'multiple',\n select: 'multiple'\n });\n var promises = [];\n this.refs.input.forEach(function (element, index) {\n promises.push(_this.attachElement.call(_this, element, index));\n });\n if (!this.component.multiple) {\n return _nativePromiseOnly[\"default\"].all(promises);\n }\n this.refs.removeRow.forEach(function (removeButton, index) {\n _this.addEventListener(removeButton, 'click', function (event) {\n event.preventDefault();\n _this.removeValue(index);\n });\n });\n\n // If single value field.\n this.refs.addButton.forEach(function (addButton) {\n _this.addEventListener(addButton, 'click', function (event) {\n event.preventDefault();\n _this.addValue();\n });\n });\n return superAttach.then(function () {\n return _nativePromiseOnly[\"default\"].all(promises);\n });\n }\n }, {\n key: \"detach\",\n value: function detach() {\n if (this.refs.input && this.refs.input.length) {\n this.refs.input.forEach(function (input) {\n if (input.mask) {\n input.mask.destroy();\n }\n if (input.widget) {\n input.widget.destroy();\n }\n });\n }\n if (this.refs.mask && this.refs.mask.length) {\n this.refs.mask.forEach(function (input) {\n if (input.mask) {\n input.mask.destroy();\n }\n });\n }\n _get(_getPrototypeOf(Multivalue.prototype), \"detach\", this).call(this);\n }\n\n /**\n * Attach inputs to the element.\n *\n * @param element\n * @param index\n */\n }, {\n key: \"attachElement\",\n value: function attachElement(element, index) {\n var _this2 = this;\n this.addEventListener(element, this.inputInfo.changeEvent, function () {\n // Delay update slightly to give input mask a chance to run.\n var textCase = _lodash[\"default\"].get(_this2.component, 'case', 'mixed');\n if (textCase !== 'mixed') {\n var selectionStart = element.selectionStart,\n selectionEnd = element.selectionEnd;\n if (textCase === 'uppercase' && element.value) {\n element.value = element.value.toUpperCase();\n }\n if (textCase === 'lowercase' && element.value) {\n element.value = element.value.toLowerCase();\n }\n if (element.selectionStart && element.selectionEnd) {\n element.selectionStart = selectionStart;\n element.selectionEnd = selectionEnd;\n }\n }\n try {\n _this2.saveCaretPosition(element, index);\n } catch (err) {\n console.warn('An error occurred while trying to save caret position', err);\n }\n\n // If a mask is present, delay the update to allow mask to update first.\n if (element.mask) {\n setTimeout(function () {\n return _this2.updateValue(null, {\n modified: _this2.component.type !== 'hidden'\n }, index);\n }, 1);\n } else {\n return _this2.updateValue(null, {\n modified: _this2.component.type !== 'hidden'\n }, index);\n }\n });\n if (!this.attachMultiMask(index)) {\n var applyMask = function applyMask() {\n _this2.setInputMask(element);\n var valueMask = _this2.component.inputMask;\n var displayMask = _this2.component.displayMask;\n if (valueMask && displayMask && displayMask !== valueMask && _this2.refs.valueMaskInput) {\n _this2.setInputMask(_this2.refs.valueMaskInput, valueMask);\n }\n };\n if (this.inputInfo.changeEvent === 'blur') {\n this.addEventListener(element, this.inputInfo.changeEvent, function () {\n var _document$querySelect;\n applyMask();\n _this2.dataValue = _this2.refs.input[0].value;\n var submitBtnDisabled = (_document$querySelect = document.querySelector('[name=\"data[submit]\"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.disabled;\n submitBtnDisabled = true;\n if (_this2.checkComponentValidity()) {\n _this2.updateComponentValue(_this2.refs.input[0].value);\n submitBtnDisabled = false;\n }\n });\n } else {\n applyMask();\n }\n }\n }\n }, {\n key: \"onSelectMaskHandler\",\n value: function onSelectMaskHandler(event) {\n this.updateMask(event.target.maskInput, this.getMaskPattern(event.target.value));\n }\n }, {\n key: \"getMaskPattern\",\n value: function getMaskPattern(maskName) {\n if (!this.multiMasks) {\n this.multiMasks = {};\n }\n if (this.multiMasks[maskName]) {\n return this.multiMasks[maskName];\n }\n var mask = this.component.inputMasks.find(function (inputMask) {\n return inputMask.label === maskName;\n });\n this.multiMasks[maskName] = mask ? mask.mask : this.component.inputMasks[0].mask;\n return this.multiMasks[maskName];\n }\n }, {\n key: \"attachMultiMask\",\n value: function attachMultiMask(index) {\n if (!(this.isMultipleMasksField && this.component.inputMasks.length && this.refs.input.length)) {\n return false;\n }\n var maskSelect = this.refs.select[index];\n maskSelect.onchange = this.onSelectMaskHandler.bind(this);\n maskSelect.maskInput = this.refs.mask[index];\n this.setInputMask(maskSelect.maskInput, this.component.inputMasks[0].mask);\n return true;\n }\n }, {\n key: \"updateMask\",\n value: function updateMask(input, mask) {\n if (!mask) {\n return;\n }\n this.setInputMask(input, mask, !this.component.placeholder);\n this.updateValue();\n }\n\n /**\n * Adds a new empty value to the data array.\n */\n }, {\n key: \"addNewValue\",\n value: function addNewValue(value) {\n if (value === undefined) {\n value = this.component.defaultValue ? this.component.defaultValue : this.emptyValue;\n // If default is an empty aray, default back to empty value.\n if (Array.isArray(value) && value.length === 0) {\n value = this.emptyValue;\n }\n }\n var dataValue = this.dataValue || [];\n if (!Array.isArray(dataValue)) {\n dataValue = [dataValue];\n }\n if (Array.isArray(value)) {\n dataValue = dataValue.concat(value);\n } else {\n dataValue.push(value);\n }\n this.dataValue = dataValue;\n }\n\n /**\n * Adds a new empty value to the data array, and add a new row to contain it.\n */\n }, {\n key: \"addValue\",\n value: function addValue() {\n this.addNewValue();\n this.redraw();\n this.checkConditions();\n if (!this.isEmpty(this.dataValue)) {\n this.restoreValue();\n }\n if (this.root) {\n this.root.onChange();\n }\n }\n }]);\n return Multivalue;\n}(_Field2[\"default\"]);\nexports[\"default\"] = Multivalue;\n\n//# sourceURL=webpack://Formio/./lib/components/_classes/multivalue/Multivalue.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.options.show && this.options.show[this.component.key];\n var forceHide = this.options.hide && this.options.hide[this.component.key];\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()) {\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.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()) {\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.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 _Field2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.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 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 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 _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 if (_lodash[\"default\"].isUndefined(value) && this.inDataTable) {\n return '';\n }\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 _objectSpread(_objectSpread({}, _get(_getPrototypeOf(CheckBoxComponent), \"serverConditionSettings\", 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 return CheckBoxComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = CheckBoxComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/checkbox/Checkbox.js?"); /***/ }), @@ -642,7 +642,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/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.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.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.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.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.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.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.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.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.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 _NestedComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": 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 _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 ColumnsComponent = /*#__PURE__*/function (_NestedComponent) {\n _inherits(ColumnsComponent, _NestedComponent);\n var _super = _createSuper(ColumnsComponent);\n function ColumnsComponent(component, options, data) {\n var _this;\n _classCallCheck(this, ColumnsComponent);\n _this = _super.call(this, component, options, data);\n _this.rows = [];\n return _this;\n }\n _createClass(ColumnsComponent, [{\n key: \"schema\",\n get: function get() {\n var _schema$columns,\n _this2 = this;\n var schema = _lodash[\"default\"].omit(_get(_getPrototypeOf(ColumnsComponent.prototype), \"schema\", this), ['components']);\n (_schema$columns = schema.columns) === null || _schema$columns === void 0 ? void 0 : _schema$columns.map(function (column, colIndex) {\n column.components.map(function (comp, compIndex) {\n var clonedComp = _lodash[\"default\"].clone(comp);\n clonedComp.internal = true;\n var component = _this2.createComponent(clonedComp);\n delete component.component.internal;\n schema.columns[colIndex].components[compIndex] = component.schema;\n });\n });\n return schema;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return ColumnsComponent.schema();\n }\n }, {\n key: \"className\",\n get: function get() {\n return \"row \".concat(_get(_getPrototypeOf(ColumnsComponent.prototype), \"className\", this));\n }\n }, {\n key: \"columnKey\",\n get: function get() {\n return \"column-\".concat(this.id);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this3 = this;\n _get(_getPrototypeOf(ColumnsComponent.prototype), \"init\", this).call(this);\n this.columns = [];\n _lodash[\"default\"].each(this.component.columns, function (column, index) {\n _this3.columns[index] = [];\n if (!column.size) {\n column.size = 'md';\n }\n column.currentWidth = column.width || 0;\n // Ensure there is a components array.\n if (!Array.isArray(column.components)) {\n column.components = [];\n }\n _lodash[\"default\"].each(column.components, function (comp) {\n var component = _this3.createComponent(comp);\n component.column = index;\n _this3.columns[index].push(component);\n });\n });\n if (this.component.autoAdjust && this.options.display !== 'pdf') {\n this.justify();\n }\n this.rows = this.groupByRow();\n }\n }, {\n key: \"labelIsHidden\",\n value: function labelIsHidden() {\n return true;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n return _get(_getPrototypeOf(ColumnsComponent.prototype), \"render\", this).call(this, this.renderTemplate('columns', {\n columnKey: this.columnKey,\n columnComponents: this.columns.map(function (column) {\n return _this4.renderComponents(column);\n })\n }));\n }\n }, {\n key: \"justifyColumn\",\n value: function justifyColumn(items, index) {\n var toAdjust = _lodash[\"default\"].every(items, function (item) {\n return !item.visible;\n });\n var column = this.component.columns[index];\n var width = toAdjust && items.length ? 0 : column.width;\n var shouldRedraw = !_lodash[\"default\"].isEqual(width, column.currentWidth);\n column.currentWidth = width;\n return shouldRedraw;\n }\n }, {\n key: \"justify\",\n value: function justify() {\n var _this5 = this;\n return this.columns.reduce(function (redraw, items, index) {\n return _this5.justifyColumn(items, index) || redraw;\n }, false);\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this6 = this;\n this.loadRefs(element, _defineProperty({}, this.columnKey, 'multiple'));\n var superAttach = _get(_getPrototypeOf(ColumnsComponent.prototype), \"attach\", this).call(this, element);\n if (this.refs[this.columnKey]) {\n this.refs[this.columnKey].forEach(function (column, index) {\n return _this6.attachComponents(column, _this6.columns[index], _this6.component.columns[index].components);\n });\n }\n return superAttach;\n }\n }, {\n key: \"gridSize\",\n get: function get() {\n return 12;\n }\n\n /**\n * Group columns in rows.\n * @return {Array.}\n */\n }, {\n key: \"groupByRow\",\n value: function groupByRow() {\n var _this7 = this;\n var initVal = {\n stack: [],\n rows: []\n };\n var width = function width(x) {\n return x.component.width;\n };\n var result = _lodash[\"default\"].reduce(this.components, function (acc, next) {\n var stack = [].concat(_toConsumableArray(acc.stack), [next]);\n if (_lodash[\"default\"].sumBy(stack, width) <= _this7.gridSize) {\n acc.stack = stack;\n return acc;\n } else {\n acc.rows = [].concat(_toConsumableArray(acc.rows), [acc.stack]);\n acc.stack = [next];\n return acc;\n }\n }, initVal);\n return _lodash[\"default\"].concat(result.rows, [result.stack]);\n }\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row, components) {\n var isValid = _get(_getPrototypeOf(ColumnsComponent.prototype), \"checkData\", this).call(this, data, flags, row, components);\n if (this.component.autoAdjust && this.options.display !== 'pdf') {\n var redraw = this.justify();\n if (redraw) {\n this.redraw();\n }\n }\n return isValid;\n }\n }, {\n key: \"detach\",\n value: function detach(all) {\n _get(_getPrototypeOf(ColumnsComponent.prototype), \"detach\", this).call(this, all);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(ColumnsComponent.prototype), \"destroy\", this).call(this);\n this.columns = [];\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 _NestedComponent2[\"default\"].schema.apply(_NestedComponent2[\"default\"], [{\n label: 'Columns',\n key: 'columns',\n type: 'columns',\n columns: [{\n components: [],\n width: 6,\n offset: 0,\n push: 0,\n pull: 0,\n size: 'md'\n }, {\n components: [],\n width: 6,\n offset: 0,\n push: 0,\n pull: 0,\n size: 'md'\n }],\n clearOnHide: false,\n input: false,\n tableView: false,\n persistent: false,\n autoAdjust: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Columns',\n icon: 'columns',\n group: 'layout',\n documentation: '/userguide/form-building/layout-components#columns',\n weight: 10,\n schema: ColumnsComponent.schema()\n };\n }\n }]);\n return ColumnsComponent;\n}(_NestedComponent2[\"default\"]);\nexports[\"default\"] = ColumnsComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/columns/Columns.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\");\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.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.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.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.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.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.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.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.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 _NestedComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": 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 _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 ColumnsComponent = /*#__PURE__*/function (_NestedComponent) {\n _inherits(ColumnsComponent, _NestedComponent);\n var _super = _createSuper(ColumnsComponent);\n function ColumnsComponent(component, options, data) {\n var _this;\n _classCallCheck(this, ColumnsComponent);\n _this = _super.call(this, component, options, data);\n _this.rows = [];\n return _this;\n }\n _createClass(ColumnsComponent, [{\n key: \"schema\",\n get: function get() {\n var _schema$columns,\n _this2 = this;\n var schema = _lodash[\"default\"].omit(_get(_getPrototypeOf(ColumnsComponent.prototype), \"schema\", this), ['components']);\n (_schema$columns = schema.columns) === null || _schema$columns === void 0 ? void 0 : _schema$columns.map(function (column, colIndex) {\n column.components.map(function (comp, compIndex) {\n var clonedComp = _lodash[\"default\"].clone(comp);\n clonedComp.internal = true;\n var component = _this2.createComponent(clonedComp);\n delete component.component.internal;\n schema.columns[colIndex].components[compIndex] = component.schema;\n });\n });\n return schema;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return ColumnsComponent.schema();\n }\n }, {\n key: \"className\",\n get: function get() {\n return \"row \".concat(_get(_getPrototypeOf(ColumnsComponent.prototype), \"className\", this));\n }\n }, {\n key: \"columnKey\",\n get: function get() {\n return \"column-\".concat(this.id);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this3 = this;\n _get(_getPrototypeOf(ColumnsComponent.prototype), \"init\", this).call(this);\n this.columns = [];\n _lodash[\"default\"].each(this.component.columns, function (column, index) {\n _this3.columns[index] = [];\n if (!column.size) {\n column.size = 'md';\n }\n column.currentWidth = column.width || 0;\n // Ensure there is a components array.\n if (!Array.isArray(column.components)) {\n column.components = [];\n }\n _lodash[\"default\"].each(column.components, function (comp) {\n var component = _this3.createComponent(comp);\n component.column = index;\n _this3.columns[index].push(component);\n });\n });\n if (this.component.autoAdjust && this.options.display !== 'pdf') {\n this.justify();\n }\n this.rows = this.groupByRow();\n }\n }, {\n key: \"labelIsHidden\",\n value: function labelIsHidden() {\n return true;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n return _get(_getPrototypeOf(ColumnsComponent.prototype), \"render\", this).call(this, this.renderTemplate('columns', {\n columnKey: this.columnKey,\n columnComponents: this.columns.map(function (column) {\n return _this4.renderComponents(column);\n })\n }));\n }\n }, {\n key: \"justifyColumn\",\n value: function justifyColumn(items, index) {\n var toAdjust = _lodash[\"default\"].every(items, function (item) {\n return !item.visible;\n });\n var column = this.component.columns[index];\n var width = toAdjust && items.length ? 0 : column.width;\n var shouldRedraw = !_lodash[\"default\"].isEqual(width, column.currentWidth);\n column.currentWidth = width;\n return shouldRedraw;\n }\n }, {\n key: \"justify\",\n value: function justify() {\n var _this5 = this;\n return this.columns.reduce(function (redraw, items, index) {\n return _this5.justifyColumn(items, index) || redraw;\n }, false);\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this6 = this;\n this.loadRefs(element, _defineProperty({}, this.columnKey, 'multiple'));\n var superAttach = _get(_getPrototypeOf(ColumnsComponent.prototype), \"attach\", this).call(this, element);\n if (this.refs[this.columnKey]) {\n this.refs[this.columnKey].forEach(function (column, index) {\n return _this6.attachComponents(column, _this6.columns[index], _this6.component.columns[index].components);\n });\n }\n return superAttach;\n }\n }, {\n key: \"gridSize\",\n get: function get() {\n return 12;\n }\n\n /**\n * Group columns in rows.\n * @return {Array.}\n */\n }, {\n key: \"groupByRow\",\n value: function groupByRow() {\n var _this7 = this;\n var initVal = {\n stack: [],\n rows: []\n };\n var width = function width(x) {\n return x.component.width;\n };\n var result = _lodash[\"default\"].reduce(this.components, function (acc, next) {\n var stack = [].concat(_toConsumableArray(acc.stack), [next]);\n if (_lodash[\"default\"].sumBy(stack, width) <= _this7.gridSize) {\n acc.stack = stack;\n return acc;\n } else {\n acc.rows = [].concat(_toConsumableArray(acc.rows), [acc.stack]);\n acc.stack = [next];\n return acc;\n }\n }, initVal);\n return _lodash[\"default\"].concat(result.rows, [result.stack]);\n }\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row, components) {\n var isValid = _get(_getPrototypeOf(ColumnsComponent.prototype), \"checkData\", this).call(this, data, flags, row, components);\n if (this.component.autoAdjust && this.options.display !== 'pdf') {\n var redraw = this.justify();\n if (redraw) {\n this.redraw();\n }\n }\n return isValid;\n }\n }, {\n key: \"detach\",\n value: function detach(all) {\n _get(_getPrototypeOf(ColumnsComponent.prototype), \"detach\", this).call(this, all);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(ColumnsComponent.prototype), \"destroy\", this).call(this);\n this.columns = [];\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 _NestedComponent2[\"default\"].schema.apply(_NestedComponent2[\"default\"], [{\n label: 'Columns',\n key: 'columns',\n type: 'columns',\n columns: [{\n components: [],\n width: 6,\n offset: 0,\n push: 0,\n pull: 0,\n size: 'md'\n }, {\n components: [],\n width: 6,\n offset: 0,\n push: 0,\n pull: 0,\n size: 'md'\n }],\n clearOnHide: false,\n input: false,\n tableView: false,\n persistent: false,\n autoAdjust: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Columns',\n icon: 'columns',\n group: 'layout',\n documentation: '/userguide/form-building/layout-components#columns',\n showPreview: false,\n weight: 10,\n schema: ColumnsComponent.schema()\n };\n }\n }]);\n return ColumnsComponent;\n}(_NestedComponent2[\"default\"]);\nexports[\"default\"] = ColumnsComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/columns/Columns.js?"); /***/ }), @@ -675,7 +675,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/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.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.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.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 _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _NestedDataComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nesteddata/NestedDataComponent */ \"./lib/components/_classes/nesteddata/NestedDataComponent.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 ContainerComponent = /*#__PURE__*/function (_NestedDataComponent) {\n _inherits(ContainerComponent, _NestedDataComponent);\n var _super = _createSuper(ContainerComponent);\n function ContainerComponent() {\n var _this;\n _classCallCheck(this, ContainerComponent);\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 = 'container';\n return _this;\n }\n _createClass(ContainerComponent, [{\n key: \"addComponents\",\n value: function addComponents(data, options) {\n return _get(_getPrototypeOf(ContainerComponent.prototype), \"addComponents\", this).call(this, this.dataValue, options);\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return ContainerComponent.schema();\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return {};\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'container';\n }\n }, {\n key: \"componentContext\",\n value: function componentContext() {\n return this.dataValue;\n }\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row, components) {\n var _this2 = this;\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n components = components && _lodash[\"default\"].isArray(components) ? components : this.getComponents();\n return components.reduce(function (valid, comp) {\n return comp.checkData(data, flags, _this2.dataValue) && valid;\n }, _Component[\"default\"].prototype.checkData.call(this, data, flags, row));\n }\n }, {\n key: \"checkChildComponentsValidity\",\n value: function checkChildComponentsValidity(data, dirty, row, silentCheck, isParentValid) {\n return _get(_getPrototypeOf(ContainerComponent.prototype), \"checkChildComponentsValidity\", this).call(this, data, dirty, this.dataValue, silentCheck, isParentValid);\n }\n }, {\n key: \"focus\",\n value: function focus() {\n var focusableElements = (0, _utils.getFocusableElements)(this.element);\n if (focusableElements && focusableElements[0]) {\n focusableElements[0].focus();\n }\n }\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n var _this3 = this;\n // check conditions of parent component first, because it may influence on visibility of it's children\n var check = _Field[\"default\"].prototype.checkConditions.call(this, data, flags, row);\n this.getComponents().forEach(function (comp) {\n return comp.checkConditions(data, flags, _this3.dataValue);\n });\n return check;\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 _NestedDataComponent2[\"default\"].schema.apply(_NestedDataComponent2[\"default\"], [{\n label: 'Container',\n type: 'container',\n key: 'container',\n clearOnHide: true,\n input: true,\n tree: true,\n hideLabel: true,\n components: []\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Container',\n icon: 'folder-open',\n group: 'data',\n documentation: '/userguide/form-building/data-components#container',\n weight: 10,\n schema: ContainerComponent.schema()\n };\n }\n }]);\n return ContainerComponent;\n}(_NestedDataComponent2[\"default\"]);\nexports[\"default\"] = ContainerComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/container/Container.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.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.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.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.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 _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _Field = _interopRequireDefault(__webpack_require__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _NestedDataComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nesteddata/NestedDataComponent */ \"./lib/components/_classes/nesteddata/NestedDataComponent.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 ContainerComponent = /*#__PURE__*/function (_NestedDataComponent) {\n _inherits(ContainerComponent, _NestedDataComponent);\n var _super = _createSuper(ContainerComponent);\n function ContainerComponent() {\n var _this;\n _classCallCheck(this, ContainerComponent);\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 = 'container';\n return _this;\n }\n _createClass(ContainerComponent, [{\n key: \"addComponents\",\n value: function addComponents(data, options) {\n return _get(_getPrototypeOf(ContainerComponent.prototype), \"addComponents\", this).call(this, this.dataValue, options);\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return ContainerComponent.schema();\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return {};\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'container';\n }\n }, {\n key: \"componentContext\",\n value: function componentContext() {\n return this.dataValue;\n }\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row, components) {\n var _this2 = this;\n data = data || this.rootValue;\n flags = flags || {};\n row = row || this.data;\n components = components && _lodash[\"default\"].isArray(components) ? components : this.getComponents();\n return components.reduce(function (valid, comp) {\n return comp.checkData(data, flags, _this2.dataValue) && valid;\n }, _Component[\"default\"].prototype.checkData.call(this, data, flags, row));\n }\n }, {\n key: \"checkChildComponentsValidity\",\n value: function checkChildComponentsValidity(data, dirty, row, silentCheck, isParentValid) {\n return _get(_getPrototypeOf(ContainerComponent.prototype), \"checkChildComponentsValidity\", this).call(this, data, dirty, this.dataValue, silentCheck, isParentValid);\n }\n }, {\n key: \"focus\",\n value: function focus() {\n var focusableElements = (0, _utils.getFocusableElements)(this.element);\n if (focusableElements && focusableElements[0]) {\n focusableElements[0].focus();\n }\n }\n }, {\n key: \"checkConditions\",\n value: function checkConditions(data, flags, row) {\n var _this3 = this;\n // check conditions of parent component first, because it may influence on visibility of it's children\n var check = _Field[\"default\"].prototype.checkConditions.call(this, data, flags, row);\n this.getComponents().forEach(function (comp) {\n return comp.checkConditions(data, flags, _this3.dataValue);\n });\n return check;\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 _NestedDataComponent2[\"default\"].schema.apply(_NestedDataComponent2[\"default\"], [{\n label: 'Container',\n type: 'container',\n key: 'container',\n clearOnHide: true,\n input: true,\n tree: true,\n hideLabel: true,\n components: []\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Container',\n icon: 'folder-open',\n group: 'data',\n documentation: '/userguide/form-building/data-components#container',\n showPreview: false,\n weight: 10,\n schema: ContainerComponent.schema()\n };\n }\n }]);\n return ContainerComponent;\n}(_NestedDataComponent2[\"default\"]);\nexports[\"default\"] = ContainerComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/container/Container.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 /**\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 focusableElements = (0, _utils.getFocusableElements)(row[key].element);\n if (focusableElements && focusableElements[0]) {\n focusableElements[0].focus();\n return true;\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 this.splice(index, {\n isReordered: true\n });\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, {\n isReordered: true\n });\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 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 /**\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 this.splice(index, {\n isReordered: true\n });\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, {\n isReordered: true\n });\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?"); /***/ }), @@ -862,7 +862,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.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.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\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = 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.array.map.js */ \"./node_modules/core-js/modules/es.array.map.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.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.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.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.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.name.js */ \"./node_modules/core-js/modules/es.function.name.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.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 _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _DataGrid = _interopRequireDefault(__webpack_require__(/*! ../datagrid/DataGrid */ \"./lib/components/datagrid/DataGrid.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _eventemitter = _interopRequireDefault(__webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.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 _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 _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 DataMapComponent = /*#__PURE__*/function (_DataGridComponent) {\n _inherits(DataMapComponent, _DataGridComponent);\n var _super = _createSuper(DataMapComponent);\n function DataMapComponent(component, options, data) {\n var _this;\n _classCallCheck(this, DataMapComponent);\n _this = _super.call(this, component, options, data);\n _this.type = 'datamap';\n return _this;\n }\n _createClass(DataMapComponent, [{\n key: \"schema\",\n get: function get() {\n var schema = _get(_getPrototypeOf(DataMapComponent.prototype), \"schema\", this);\n if (this.components && this.components.length > 0) {\n schema.valueComponent = this.components[this.components.length - 1].schema;\n }\n return _lodash[\"default\"].omit(schema, 'components');\n }\n }, {\n key: \"init\",\n value: function init() {\n this.components = [];\n this.rows = [];\n this.createRows();\n this.visibleColumns = _defineProperty({\n key: true\n }, this.valueKey, true);\n this.component.valueComponent.hideLabel = true;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return DataMapComponent.schema();\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return {};\n }\n }, {\n key: \"dataValue\",\n get: function get() {\n if (!this.key || !this.visible && this.component.clearOnHide) {\n return this.emptyValue;\n }\n if (!this.hasValue() && this.shouldAddDefaultValue) {\n this.dataValue = this.emptyValue;\n }\n return _lodash[\"default\"].get(this.data, this.key);\n },\n set: function set(value) {\n _set(_getPrototypeOf(DataMapComponent.prototype), \"dataValue\", value, this, true);\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var value = _get(_getPrototypeOf(DataMapComponent.prototype), \"defaultValue\", this);\n if (Array.isArray(value)) {\n return value[0];\n }\n return this.emptyValue;\n }\n }, {\n key: \"keySchema\",\n get: function get() {\n return {\n type: 'textfield',\n input: true,\n hideLabel: true,\n label: this.component.keyLabel || 'Key',\n key: '__key',\n disableBuilderActions: true\n };\n }\n }, {\n key: \"valueKey\",\n get: function get() {\n return this.component.valueComponent.key;\n }\n }, {\n key: \"getRowValues\",\n value: function getRowValues() {\n var dataValue = this.dataValue;\n if (this.builderMode) {\n return [dataValue];\n }\n if (_lodash[\"default\"].isEmpty(dataValue)) {\n return [];\n }\n return Object.keys(dataValue).map(function () {\n return dataValue;\n });\n }\n }, {\n key: \"getComponentsContainer\",\n value: function getComponentsContainer() {\n if (this.builderMode) {\n return this.getComponents().map(function (comp) {\n return comp.component;\n });\n }\n return _get(_getPrototypeOf(DataMapComponent.prototype), \"getComponentsContainer\", this).call(this);\n }\n }, {\n key: \"iteratableRows\",\n get: function get() {\n return this.rows.map(function (row) {\n return Object.keys(row).map(function (key) {\n return {\n components: row[key],\n data: row[key].dataValue\n };\n });\n });\n }\n }, {\n key: \"componentContext\",\n value: function componentContext(component) {\n return this.iteratableRows[component.row].find(function (comp) {\n return comp.components.key === component.key;\n }).data;\n }\n }, {\n key: \"hasHeader\",\n value: function hasHeader() {\n return true;\n }\n }, {\n key: \"hasRemoveButtons\",\n value: function hasRemoveButtons() {\n return !this.component.disableAddingRemovingRows && !this.options.readOnly && !this.disabled && this.fullMode;\n }\n }, {\n key: \"getColumns\",\n value: function getColumns() {\n var keySchema = Object.assign({}, this.keySchema);\n var valueSchema = Object.assign({}, this.component.valueComponent);\n keySchema.hideLabel = false;\n valueSchema.hideLabel = false;\n return this.component.keyBeforeValue ? [keySchema, valueSchema] : [valueSchema, keySchema];\n }\n }, {\n key: \"getRowKey\",\n value: function getRowKey(rowIndex) {\n var keys = Object.keys(this.dataValue);\n if (!keys[rowIndex]) {\n keys[rowIndex] = (0, _utils.uniqueKey)(this.dataValue, this.defaultRowKey);\n }\n return keys[rowIndex];\n }\n }, {\n key: \"defaultRowKey\",\n get: function get() {\n return 'key';\n }\n }, {\n key: \"setRowComponentsData\",\n value: function setRowComponentsData(rowIndex, rowData) {\n _lodash[\"default\"].each(this.rows[rowIndex], function (component) {\n if (component.key === '__key') {\n component.data = {\n '__key': Object.keys(rowData)[rowIndex]\n };\n } else {\n component.data = rowData;\n }\n });\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n var _this2 = this;\n if (options !== null && options !== void 0 && options.email && this.visible && !this.skipInEmail && _lodash[\"default\"].isObject(value)) {\n var result = \"\\n \\n \\n \";\n result = Object.keys(value).reduce(function (result, key) {\n result += \"\\n \\n \\n \\n \\n \");\n return result;\n }, result);\n result += \"\\n \\n
\".concat(key, \"\").concat(_this2.getView(value[key], options), \"
\\n \";\n return result;\n }\n if (_lodash[\"default\"].isEmpty(value)) {\n return '';\n }\n if (options !== null && options !== void 0 && options.modalPreview) {\n delete options.modalPreview;\n return this.getDataValueAsTable(value, options);\n }\n return _typeof(value) === 'object' ? '[Complex Data]' : value;\n }\n }, {\n key: \"getDataValueAsTable\",\n value: function getDataValueAsTable(value, options) {\n var _this3 = this;\n var result = \"\\n \\n \\n \";\n if (this.visible && _lodash[\"default\"].isObject(value)) {\n Object.keys(value).forEach(function (key) {\n result += \"\\n \\n \\n \\n \\n \");\n });\n }\n result += \"\\n \\n
\".concat(key, \"\").concat(_this3.getView(value[key], options), \"
\\n \";\n return result;\n }\n }, {\n key: \"createRowComponents\",\n value: function createRowComponents(row, rowIndex) {\n var _this4 = this;\n // Use original value component API key in builder mode to be able to edit value component\n var key = this.builderMode ? this.valueKey : this.getRowKey(rowIndex);\n\n // Create a new event emitter since fields are isolated.\n var options = _lodash[\"default\"].clone(this.options);\n options.events = new _eventemitter[\"default\"]();\n options.name += \"[\".concat(rowIndex, \"]\");\n options.row = \"\".concat(rowIndex);\n var components = {};\n components['__key'] = this.createComponent(this.keySchema, options, {\n __key: this.builderMode ? this.defaultRowKey : key\n });\n components['__key'].on('componentChange', function (event) {\n var dataValue = _this4.dataValue;\n var newKey = (0, _utils.uniqueKey)(dataValue, event.value);\n dataValue[newKey] = dataValue[key];\n delete dataValue[key];\n var comp = components[_this4.valueKey];\n comp.component.key = newKey;\n comp.path = _this4.calculateComponentPath(comp);\n key = newKey;\n });\n var valueComponent = _lodash[\"default\"].clone(this.component.valueComponent);\n valueComponent.key = key;\n var componentOptions = this.options;\n componentOptions.row = options.row;\n components[this.valueKey] = this.createComponent(valueComponent, componentOptions, this.dataValue);\n return components;\n }\n }, {\n key: \"canAddColumn\",\n get: function get() {\n return false;\n }\n }, {\n key: \"addChildComponent\",\n value: function addChildComponent(component) {\n this.component.valueComponent = component;\n }\n }, {\n key: \"saveChildComponent\",\n value: function saveChildComponent(component) {\n // Update the Value Component, the Key Component is not allowed to edit\n if (component.key !== this.keySchema.key) {\n this.component.valueComponent = component;\n }\n }\n }, {\n key: \"removeChildComponent\",\n value: function removeChildComponent() {\n var defaultSchema = DataMapComponent.schema();\n this.component.valueComponent = defaultSchema.valueComponent;\n }\n }, {\n key: \"addRow\",\n value: function addRow() {\n var index = this.rows.length;\n this.rows[index] = this.createRowComponents(this.dataValue, index);\n this.redraw();\n this.triggerChange();\n }\n }, {\n key: \"removeRow\",\n value: function removeRow(index) {\n var keys = Object.keys(this.dataValue);\n if (keys[index]) {\n delete this.dataValue[keys[index]];\n }\n this.rows.splice(index, 1);\n this.redraw();\n this.triggerChange();\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.hasChanged(value, this.dataValue);\n this.dataValue = value;\n this.createRows();\n this.updateOnChange(flags, changed);\n return changed;\n }\n }, {\n key: \"checkColumns\",\n value: function checkColumns() {\n return {\n rebuild: false,\n show: true\n };\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 _Component[\"default\"].schema.apply(_Component[\"default\"], [{\n label: 'Data Map',\n key: 'dataMap',\n type: 'datamap',\n clearOnHide: true,\n addAnother: 'Add Another',\n disableAddingRemovingRows: false,\n keyBeforeValue: true,\n valueComponent: {\n type: 'textfield',\n key: 'value',\n label: 'Value',\n input: true\n },\n input: true,\n validate: {\n maxLength: 0,\n minLength: 0\n }\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Data Map',\n icon: 'th-list',\n group: 'data',\n documentation: '/userguide/form-building/data-components#data-map',\n weight: 20,\n schema: DataMapComponent.schema()\n };\n }\n }]);\n return DataMapComponent;\n}(_DataGrid[\"default\"]);\nexports[\"default\"] = DataMapComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/datamap/DataMap.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.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\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = 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.array.map.js */ \"./node_modules/core-js/modules/es.array.map.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.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.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.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.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.name.js */ \"./node_modules/core-js/modules/es.function.name.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.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 _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _DataGrid = _interopRequireDefault(__webpack_require__(/*! ../datagrid/DataGrid */ \"./lib/components/datagrid/DataGrid.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _eventemitter = _interopRequireDefault(__webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.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 _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 _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 DataMapComponent = /*#__PURE__*/function (_DataGridComponent) {\n _inherits(DataMapComponent, _DataGridComponent);\n var _super = _createSuper(DataMapComponent);\n function DataMapComponent(component, options, data) {\n var _this;\n _classCallCheck(this, DataMapComponent);\n _this = _super.call(this, component, options, data);\n _this.type = 'datamap';\n return _this;\n }\n _createClass(DataMapComponent, [{\n key: \"schema\",\n get: function get() {\n var schema = _get(_getPrototypeOf(DataMapComponent.prototype), \"schema\", this);\n if (this.components && this.components.length > 0) {\n schema.valueComponent = this.components[this.components.length - 1].schema;\n }\n return _lodash[\"default\"].omit(schema, 'components');\n }\n }, {\n key: \"init\",\n value: function init() {\n this.components = [];\n this.rows = [];\n this.createRows();\n this.visibleColumns = _defineProperty({\n key: true\n }, this.valueKey, true);\n this.component.valueComponent.hideLabel = true;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return DataMapComponent.schema();\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return {};\n }\n }, {\n key: \"dataValue\",\n get: function get() {\n if (!this.key || !this.visible && this.component.clearOnHide) {\n return this.emptyValue;\n }\n if (!this.hasValue() && this.shouldAddDefaultValue) {\n this.dataValue = this.emptyValue;\n }\n return _lodash[\"default\"].get(this.data, this.key);\n },\n set: function set(value) {\n _set(_getPrototypeOf(DataMapComponent.prototype), \"dataValue\", value, this, true);\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var value = _get(_getPrototypeOf(DataMapComponent.prototype), \"defaultValue\", this);\n if (Array.isArray(value)) {\n return value[0];\n }\n return this.emptyValue;\n }\n }, {\n key: \"keySchema\",\n get: function get() {\n return {\n type: 'textfield',\n input: true,\n hideLabel: true,\n label: this.component.keyLabel || 'Key',\n key: '__key',\n disableBuilderActions: true\n };\n }\n }, {\n key: \"valueKey\",\n get: function get() {\n return this.component.valueComponent.key;\n }\n }, {\n key: \"getRowValues\",\n value: function getRowValues() {\n var dataValue = this.dataValue;\n if (this.builderMode) {\n return [dataValue];\n }\n if (_lodash[\"default\"].isEmpty(dataValue)) {\n return [];\n }\n return Object.keys(dataValue).map(function () {\n return dataValue;\n });\n }\n }, {\n key: \"getComponentsContainer\",\n value: function getComponentsContainer() {\n if (this.builderMode) {\n return this.getComponents().map(function (comp) {\n return comp.component;\n });\n }\n return _get(_getPrototypeOf(DataMapComponent.prototype), \"getComponentsContainer\", this).call(this);\n }\n }, {\n key: \"iteratableRows\",\n get: function get() {\n return this.rows.map(function (row) {\n return Object.keys(row).map(function (key) {\n return {\n components: row[key],\n data: row[key].dataValue\n };\n });\n });\n }\n }, {\n key: \"componentContext\",\n value: function componentContext(component) {\n return this.iteratableRows[component.row].find(function (comp) {\n return comp.components.key === component.key;\n }).data;\n }\n }, {\n key: \"hasHeader\",\n value: function hasHeader() {\n return true;\n }\n }, {\n key: \"hasRemoveButtons\",\n value: function hasRemoveButtons() {\n return !this.component.disableAddingRemovingRows && !this.options.readOnly && !this.disabled && this.fullMode;\n }\n }, {\n key: \"getColumns\",\n value: function getColumns() {\n var keySchema = Object.assign({}, this.keySchema);\n var valueSchema = Object.assign({}, this.component.valueComponent);\n keySchema.hideLabel = false;\n valueSchema.hideLabel = false;\n return this.component.keyBeforeValue ? [keySchema, valueSchema] : [valueSchema, keySchema];\n }\n }, {\n key: \"getRowKey\",\n value: function getRowKey(rowIndex) {\n var keys = Object.keys(this.dataValue);\n if (!keys[rowIndex]) {\n keys[rowIndex] = (0, _utils.uniqueKey)(this.dataValue, this.defaultRowKey);\n }\n return keys[rowIndex];\n }\n }, {\n key: \"defaultRowKey\",\n get: function get() {\n return 'key';\n }\n }, {\n key: \"setRowComponentsData\",\n value: function setRowComponentsData(rowIndex, rowData) {\n _lodash[\"default\"].each(this.rows[rowIndex], function (component) {\n if (component.key === '__key') {\n component.data = {\n '__key': Object.keys(rowData)[rowIndex]\n };\n } else {\n component.data = rowData;\n }\n });\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n var _this2 = this;\n if (options !== null && options !== void 0 && options.email && this.visible && !this.skipInEmail && _lodash[\"default\"].isObject(value)) {\n var result = \"\\n \\n \\n \";\n result = Object.keys(value).reduce(function (result, key) {\n result += \"\\n \\n \\n \\n \\n \");\n return result;\n }, result);\n result += \"\\n \\n
\".concat(key, \"\").concat(_this2.getView(value[key], options), \"
\\n \";\n return result;\n }\n if (_lodash[\"default\"].isEmpty(value)) {\n return '';\n }\n if (options !== null && options !== void 0 && options.modalPreview) {\n delete options.modalPreview;\n return this.getDataValueAsTable(value, options);\n }\n return _typeof(value) === 'object' ? '[Complex Data]' : value;\n }\n }, {\n key: \"getDataValueAsTable\",\n value: function getDataValueAsTable(value, options) {\n var _this3 = this;\n var result = \"\\n \\n \\n \";\n if (this.visible && _lodash[\"default\"].isObject(value)) {\n Object.keys(value).forEach(function (key) {\n result += \"\\n \\n \\n \\n \\n \");\n });\n }\n result += \"\\n \\n
\".concat(key, \"\").concat(_this3.getView(value[key], options), \"
\\n \";\n return result;\n }\n }, {\n key: \"createRowComponents\",\n value: function createRowComponents(row, rowIndex) {\n var _this4 = this;\n // Use original value component API key in builder mode to be able to edit value component\n var key = this.builderMode ? this.valueKey : this.getRowKey(rowIndex);\n\n // Create a new event emitter since fields are isolated.\n var options = _lodash[\"default\"].clone(this.options);\n options.events = new _eventemitter[\"default\"]();\n options.name += \"[\".concat(rowIndex, \"]\");\n options.row = \"\".concat(rowIndex);\n var components = {};\n components['__key'] = this.createComponent(this.keySchema, options, {\n __key: this.builderMode ? this.defaultRowKey : key\n });\n components['__key'].on('componentChange', function (event) {\n var dataValue = _this4.dataValue;\n var newKey = (0, _utils.uniqueKey)(dataValue, event.value);\n dataValue[newKey] = dataValue[key];\n delete dataValue[key];\n var comp = components[_this4.valueKey];\n comp.component.key = newKey;\n comp.path = _this4.calculateComponentPath(comp);\n key = newKey;\n });\n var valueComponent = _lodash[\"default\"].clone(this.component.valueComponent);\n valueComponent.key = key;\n var componentOptions = this.options;\n componentOptions.row = options.row;\n components[this.valueKey] = this.createComponent(valueComponent, componentOptions, this.dataValue);\n return components;\n }\n }, {\n key: \"canAddColumn\",\n get: function get() {\n return false;\n }\n }, {\n key: \"addChildComponent\",\n value: function addChildComponent(component) {\n this.component.valueComponent = component;\n }\n }, {\n key: \"saveChildComponent\",\n value: function saveChildComponent(component) {\n // Update the Value Component, the Key Component is not allowed to edit\n if (component.key !== this.keySchema.key) {\n this.component.valueComponent = component;\n }\n }\n }, {\n key: \"removeChildComponent\",\n value: function removeChildComponent() {\n var defaultSchema = DataMapComponent.schema();\n this.component.valueComponent = defaultSchema.valueComponent;\n }\n }, {\n key: \"addRow\",\n value: function addRow() {\n var index = this.rows.length;\n this.rows[index] = this.createRowComponents(this.dataValue, index);\n this.redraw();\n this.triggerChange();\n }\n }, {\n key: \"removeRow\",\n value: function removeRow(index) {\n var keys = Object.keys(this.dataValue);\n if (keys[index]) {\n delete this.dataValue[keys[index]];\n }\n this.rows.splice(index, 1);\n this.redraw();\n this.triggerChange();\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.hasChanged(value, this.dataValue);\n this.dataValue = value;\n this.createRows();\n this.updateOnChange(flags, changed);\n return changed;\n }\n }, {\n key: \"checkColumns\",\n value: function checkColumns() {\n return {\n rebuild: false,\n show: true\n };\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 _Component[\"default\"].schema.apply(_Component[\"default\"], [{\n label: 'Data Map',\n key: 'dataMap',\n type: 'datamap',\n clearOnHide: true,\n addAnother: 'Add Another',\n disableAddingRemovingRows: false,\n keyBeforeValue: true,\n valueComponent: {\n type: 'textfield',\n key: 'value',\n label: 'Value',\n input: true\n },\n input: true,\n validate: {\n maxLength: 0,\n minLength: 0\n }\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Data Map',\n icon: 'th-list',\n group: 'data',\n documentation: '/userguide/form-building/data-components#data-map',\n showPreview: false,\n weight: 20,\n schema: DataMapComponent.schema()\n };\n }\n }]);\n return DataMapComponent;\n}(_DataGrid[\"default\"]);\nexports[\"default\"] = DataMapComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/datamap/DataMap.js?"); /***/ }), @@ -906,7 +906,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.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.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.date.to-iso-string.js */ \"./node_modules/core-js/modules/es.date.to-iso-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.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.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.string.match.js */ \"./node_modules/core-js/modules/es.string.match.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.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 _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _Input2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/input/Input */ \"./lib/components/_classes/input/Input.js\"));\nvar _utils = _interopRequireDefault(__webpack_require__(/*! ../../utils */ \"./lib/utils/index.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 DateTimeComponent = /*#__PURE__*/function (_Input) {\n _inherits(DateTimeComponent, _Input);\n var _super = _createSuper(DateTimeComponent);\n function DateTimeComponent(component, options, data) {\n var _this;\n _classCallCheck(this, DateTimeComponent);\n _this = _super.call(this, component, options, data);\n var timezone = _this.component.timezone || _this.options.timezone;\n var time24hr = !_lodash[\"default\"].get(_this.component, 'timePicker.showMeridian', true);\n\n // Change the format to map to the settings.\n if (!_this.component.enableDate) {\n _this.component.format = _this.component.format.replace(/yyyy-MM-dd /g, '');\n }\n if (!_this.component.enableTime) {\n _this.component.format = _this.component.format.replace(/ hh:mm a$/g, '');\n } else if (time24hr) {\n _this.component.format = _this.component.format.replace(/hh:mm a$/g, 'HH:mm');\n } else {\n _this.component.format = _this.component.format.replace(/HH:mm$/g, 'hh:mm a');\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\n /* eslint-disable camelcase */\n _this.component.widget = _objectSpread({\n type: 'calendar',\n timezone: timezone,\n displayInTimezone: _lodash[\"default\"].get(_this.component, 'displayInTimezone', 'viewer'),\n locale: _this.options.language,\n useLocaleSettings: _lodash[\"default\"].get(_this.component, 'useLocaleSettings', false),\n allowInput: _lodash[\"default\"].get(_this.component, 'allowInput', true),\n mode: 'single',\n enableTime: _lodash[\"default\"].get(_this.component, 'enableTime', true),\n noCalendar: !_lodash[\"default\"].get(_this.component, 'enableDate', true),\n format: _this.component.format,\n hourIncrement: _lodash[\"default\"].get(_this.component, 'timePicker.hourStep', 1),\n minuteIncrement: _lodash[\"default\"].get(_this.component, 'timePicker.minuteStep', 5),\n time_24hr: time24hr,\n readOnly: _this.options.readOnly,\n minDate: _lodash[\"default\"].get(_this.component, 'datePicker.minDate'),\n disabledDates: _lodash[\"default\"].get(_this.component, 'datePicker.disable'),\n disableWeekends: _lodash[\"default\"].get(_this.component, 'datePicker.disableWeekends'),\n disableWeekdays: _lodash[\"default\"].get(_this.component, 'datePicker.disableWeekdays'),\n disableFunction: _lodash[\"default\"].get(_this.component, 'datePicker.disableFunction'),\n maxDate: _lodash[\"default\"].get(_this.component, 'datePicker.maxDate')\n }, customOptions);\n /* eslint-enable camelcase */\n\n // Add the validators date.\n _this.validators.push('date');\n return _this;\n }\n _createClass(DateTimeComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return DateTimeComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(DateTimeComponent.prototype), \"defaultValue\", this);\n if (!defaultValue && this.component.defaultDate) {\n defaultValue = _utils[\"default\"].getDateSetting(this.component.defaultDate);\n defaultValue = defaultValue ? defaultValue.toISOString() : '';\n }\n return defaultValue;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return '';\n }\n }, {\n key: \"momentFormat\",\n get: function get() {\n return _utils[\"default\"].convertFormatToMoment(this.component.format);\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n if (value && value.toString() === 'Invalid Date') {\n return true;\n }\n return _get(_getPrototypeOf(DateTimeComponent.prototype), \"isEmpty\", this).call(this, value);\n }\n }, {\n key: \"formatValue\",\n value: function formatValue(input) {\n var result = _moment[\"default\"].utc(input).toISOString();\n return result === 'Invalid date' ? input : result;\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) || _moment[\"default\"].utc(valueA).format(this.momentFormat) === _moment[\"default\"].utc(valueB).format(this.momentFormat);\n }\n }, {\n key: \"createWrapper\",\n value: function createWrapper() {\n return false;\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, rowData) {\n if (this.refs.input) {\n this.refs.input.forEach(function (input) {\n if (input.widget && input.widget.enteredDate) {\n dirty = true;\n }\n });\n }\n return _get(_getPrototypeOf(DateTimeComponent.prototype), \"checkValidity\", this).call(this, data, dirty, rowData);\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n var format = _utils[\"default\"].convertFormatToMoment(this.component.format);\n format += format.match(/z$/) ? '' : ' z';\n var timezone = this.timezone;\n if (value && !this.attached && timezone) {\n return _lodash[\"default\"].trim(_utils[\"default\"].momentDate(value, format, timezone).format(format));\n }\n return (value ? _lodash[\"default\"].trim((0, _moment[\"default\"])(value).format(format)) : value) || '';\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 _Input2[\"default\"].schema.apply(_Input2[\"default\"], [{\n type: 'datetime',\n label: 'Date / Time',\n key: 'dateTime',\n format: 'yyyy-MM-dd hh:mm a',\n useLocaleSettings: false,\n allowInput: true,\n enableDate: true,\n enableTime: true,\n defaultValue: '',\n defaultDate: '',\n displayInTimezone: 'viewer',\n timezone: '',\n datepickerMode: 'day',\n datePicker: {\n showWeeks: true,\n startingDay: 0,\n initDate: '',\n minMode: 'day',\n maxMode: 'year',\n yearRows: 4,\n yearColumns: 5,\n minDate: null,\n maxDate: null\n },\n timePicker: {\n hourStep: 1,\n minuteStep: 1,\n showMeridian: true,\n readonlyInput: false,\n mousewheel: true,\n arrowkeys: true\n },\n customOptions: {}\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Date / Time',\n group: 'advanced',\n icon: 'calendar',\n documentation: '/userguide/form-building/advanced-components#date-and-time',\n weight: 40,\n schema: DateTimeComponent.schema()\n };\n }\n }]);\n return DateTimeComponent;\n}(_Input2[\"default\"]);\nexports[\"default\"] = DateTimeComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/datetime/DateTime.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.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.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.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.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.date.to-iso-string.js */ \"./node_modules/core-js/modules/es.date.to-iso-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.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.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.string.match.js */ \"./node_modules/core-js/modules/es.string.match.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.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 _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _utils = _interopRequireDefault(__webpack_require__(/*! ../../utils */ \"./lib/utils/index.js\"));\nvar _Input2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/input/Input */ \"./lib/components/_classes/input/Input.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 _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 DateTimeComponent = /*#__PURE__*/function (_Input) {\n _inherits(DateTimeComponent, _Input);\n var _super = _createSuper(DateTimeComponent);\n function DateTimeComponent(component, options, data) {\n var _this;\n _classCallCheck(this, DateTimeComponent);\n _this = _super.call(this, component, options, data);\n var timezone = _this.component.timezone || _this.options.timezone;\n var time24hr = !_lodash[\"default\"].get(_this.component, 'timePicker.showMeridian', true);\n\n // Change the format to map to the settings.\n if (!_this.component.enableDate) {\n _this.component.format = _this.component.format.replace(/yyyy-MM-dd /g, '');\n } else if (_this.component.enableDate && !/[yMd]/.test(_this.component.format) && _this.builderMode) {\n _this.component.format = \"yyyy-MM-dd \".concat(_this.component.format);\n }\n if (!_this.component.enableTime) {\n _this.component.format = _this.component.format.replace(/ hh:mm a$/g, '');\n } else if (_this.component.enableTime && !/[mhH]/.test(_this.component.format) && _this.builderMode) {\n _this.component.format = \"\".concat(_this.component.format, \" hh:mm a\");\n } else if (time24hr) {\n _this.component.format = _this.component.format.replace(/hh:mm a$/g, 'HH:mm');\n } else {\n _this.component.format = _this.component.format.replace(/HH:mm$/g, 'hh:mm a');\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\n /* eslint-disable camelcase */\n _this.component.widget = _objectSpread({\n type: 'calendar',\n timezone: timezone,\n displayInTimezone: _lodash[\"default\"].get(_this.component, 'displayInTimezone', 'viewer'),\n locale: _this.options.language,\n useLocaleSettings: _lodash[\"default\"].get(_this.component, 'useLocaleSettings', false),\n allowInput: _lodash[\"default\"].get(_this.component, 'allowInput', true),\n mode: 'single',\n enableTime: _lodash[\"default\"].get(_this.component, 'enableTime', true),\n noCalendar: !_lodash[\"default\"].get(_this.component, 'enableDate', true),\n format: _this.component.format,\n hourIncrement: _lodash[\"default\"].get(_this.component, 'timePicker.hourStep', 1),\n minuteIncrement: _lodash[\"default\"].get(_this.component, 'timePicker.minuteStep', 5),\n time_24hr: time24hr,\n readOnly: _this.options.readOnly,\n minDate: _lodash[\"default\"].get(_this.component, 'datePicker.minDate'),\n disabledDates: _lodash[\"default\"].get(_this.component, 'datePicker.disable'),\n disableWeekends: _lodash[\"default\"].get(_this.component, 'datePicker.disableWeekends'),\n disableWeekdays: _lodash[\"default\"].get(_this.component, 'datePicker.disableWeekdays'),\n disableFunction: _lodash[\"default\"].get(_this.component, 'datePicker.disableFunction'),\n maxDate: _lodash[\"default\"].get(_this.component, 'datePicker.maxDate')\n }, customOptions);\n /* eslint-enable camelcase */\n\n // Add the validators date.\n _this.validators.push('date');\n return _this;\n }\n _createClass(DateTimeComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return DateTimeComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(DateTimeComponent.prototype), \"defaultValue\", this);\n if (!defaultValue && this.component.defaultDate) {\n defaultValue = _utils[\"default\"].getDateSetting(this.component.defaultDate);\n defaultValue = defaultValue ? defaultValue.toISOString() : '';\n }\n return defaultValue;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return '';\n }\n }, {\n key: \"momentFormat\",\n get: function get() {\n return _utils[\"default\"].convertFormatToMoment(this.component.format);\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n if (value && value.toString() === 'Invalid Date') {\n return true;\n }\n return _get(_getPrototypeOf(DateTimeComponent.prototype), \"isEmpty\", this).call(this, value);\n }\n }, {\n key: \"formatValue\",\n value: function formatValue(input) {\n var result = _moment[\"default\"].utc(input).toISOString();\n return result === 'Invalid date' ? input : result;\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) || _moment[\"default\"].utc(valueA).format(this.momentFormat) === _moment[\"default\"].utc(valueB).format(this.momentFormat);\n }\n }, {\n key: \"createWrapper\",\n value: function createWrapper() {\n return false;\n }\n }, {\n key: \"checkValidity\",\n value: function checkValidity(data, dirty, rowData) {\n if (this.refs.input) {\n this.refs.input.forEach(function (input) {\n if (input.widget && input.widget.enteredDate) {\n dirty = true;\n }\n });\n }\n return _get(_getPrototypeOf(DateTimeComponent.prototype), \"checkValidity\", this).call(this, data, dirty, rowData);\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n var format = _utils[\"default\"].convertFormatToMoment(this.component.format);\n format += format.match(/z$/) ? '' : ' z';\n var timezone = this.timezone;\n if (value && !this.attached && timezone) {\n return _lodash[\"default\"].trim(_utils[\"default\"].momentDate(value, format, timezone).format(format));\n }\n return (value ? _lodash[\"default\"].trim((0, _moment[\"default\"])(value).format(format)) : value) || '';\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 _Input2[\"default\"].schema.apply(_Input2[\"default\"], [{\n type: 'datetime',\n label: 'Date / Time',\n key: 'dateTime',\n format: 'yyyy-MM-dd hh:mm a',\n useLocaleSettings: false,\n allowInput: true,\n enableDate: true,\n enableTime: true,\n defaultValue: '',\n defaultDate: '',\n displayInTimezone: 'viewer',\n timezone: '',\n datepickerMode: 'day',\n datePicker: {\n showWeeks: true,\n startingDay: 0,\n initDate: '',\n minMode: 'day',\n maxMode: 'year',\n yearRows: 4,\n yearColumns: 5,\n minDate: null,\n maxDate: null\n },\n timePicker: {\n hourStep: 1,\n minuteStep: 1,\n showMeridian: true,\n readonlyInput: false,\n mousewheel: true,\n arrowkeys: true\n },\n customOptions: {}\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Date / Time',\n group: 'advanced',\n icon: 'calendar',\n documentation: '/userguide/form-building/advanced-components#date-and-time',\n weight: 40,\n schema: DateTimeComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(DateTimeComponent), \"serverConditionSettings\", this)), {}, {\n operators: ['isDateEqual', 'isNotDateEqual', 'isEmpty', 'isNotEmpty', 'dateLessThan', 'dateGreaterThan', 'dateLessThanOrEqual', 'dateGreaterThanOrEqual'],\n valueComponent: function valueComponent(classComp) {\n return _objectSpread(_objectSpread({}, classComp), {}, {\n type: 'datetime'\n });\n }\n });\n }\n }]);\n return DateTimeComponent;\n}(_Input2[\"default\"]);\nexports[\"default\"] = DateTimeComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/datetime/DateTime.js?"); /***/ }), @@ -983,7 +983,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.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.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.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.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\"] = 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.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.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.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.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.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.join.js */ \"./node_modules/core-js/modules/es.array.join.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.string.pad-start.js */ \"./node_modules/core-js/modules/es.string.pad-start.js\");\n__webpack_require__(/*! core-js/modules/es.array.reverse.js */ \"./node_modules/core-js/modules/es.array.reverse.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__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\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 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 DayComponent = /*#__PURE__*/function (_Field) {\n _inherits(DayComponent, _Field);\n var _super = _createSuper(DayComponent);\n function DayComponent() {\n _classCallCheck(this, DayComponent);\n return _super.apply(this, arguments);\n }\n _createClass(DayComponent, [{\n key: \"emptyValue\",\n get:\n /**\n * The empty value for day component.\n *\n * @return {'00/00/0000'}\n */\n function get() {\n return '00/00/0000';\n }\n }, {\n key: \"valueMask\",\n get: function get() {\n return /^\\d{2}\\/\\d{2}\\/\\d{4}$/;\n }\n }, {\n key: \"dayRequired\",\n get: function get() {\n return this.showDay && _lodash[\"default\"].get(this.component, 'fields.day.required', false);\n }\n }, {\n key: \"showDay\",\n get: function get() {\n return !_lodash[\"default\"].get(this.component, 'fields.day.hide', false);\n }\n }, {\n key: \"monthRequired\",\n get: function get() {\n return this.showMonth && _lodash[\"default\"].get(this.component, 'fields.month.required', false);\n }\n }, {\n key: \"showMonth\",\n get: function get() {\n return !_lodash[\"default\"].get(this.component, 'fields.month.hide', false);\n }\n }, {\n key: \"yearRequired\",\n get: function get() {\n return this.showYear && _lodash[\"default\"].get(this.component, 'fields.year.required', false);\n }\n }, {\n key: \"showYear\",\n get: function get() {\n return !_lodash[\"default\"].get(this.component, 'fields.year.hide', false);\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return DayComponent.schema();\n }\n }, {\n key: \"shouldDisabled\",\n get: function get() {\n return _get(_getPrototypeOf(DayComponent.prototype), \"shouldDisabled\", this) || this.parentDisabled;\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(DayComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'input';\n info.attr.type = 'hidden';\n info.changeEvent = 'input';\n return info;\n }\n }, {\n key: \"inputDefinition\",\n value: function inputDefinition(name) {\n var min, max;\n if (name === 'day') {\n min = 1;\n max = 31;\n }\n if (name === 'month') {\n min = 1;\n max = 12;\n }\n if (name === 'year') {\n min = _lodash[\"default\"].get(this.component, 'fields.year.minYear', 1900) || 1900;\n max = _lodash[\"default\"].get(this.component, 'fields.year.maxYear', 2030) || 1900;\n }\n return {\n type: 'input',\n ref: name,\n attr: {\n id: \"\".concat(this.component.key, \"-\").concat(name),\n \"class\": \"form-control \".concat(this.transform('class', \"formio-day-component-\".concat(name))),\n type: this.component.fields[name].type === 'select' ? 'select' : 'number',\n placeholder: this.component.fields[name].placeholder,\n step: 1,\n min: min,\n max: max\n }\n };\n }\n }, {\n key: \"selectDefinition\",\n value: function selectDefinition(name) {\n return {\n multiple: false,\n ref: name,\n widget: 'html5',\n attr: {\n id: \"\".concat(this.component.key, \"-\").concat(name),\n \"class\": 'form-control',\n name: name,\n lang: this.options.language\n }\n };\n }\n }, {\n key: \"days\",\n get: function get() {\n if (this._days) {\n return this._days;\n }\n this._days = [{\n value: '',\n label: _lodash[\"default\"].get(this.component, 'fields.day.placeholder', '')\n }];\n for (var x = 1; x <= 31; x++) {\n this._days.push({\n value: x,\n label: x.toString()\n });\n }\n return this._days;\n }\n }, {\n key: \"months\",\n get: function get() {\n if (this._months) {\n return this._months;\n }\n this._months = [{\n value: '',\n label: _lodash[\"default\"].get(this.component, 'fields.month.placeholder') || (this.hideInputLabels ? this.t('Month') : '')\n }, {\n value: 1,\n label: 'January'\n }, {\n value: 2,\n label: 'February'\n }, {\n value: 3,\n label: 'March'\n }, {\n value: 4,\n label: 'April'\n }, {\n value: 5,\n label: 'May'\n }, {\n value: 6,\n label: 'June'\n }, {\n value: 7,\n label: 'July'\n }, {\n value: 8,\n label: 'August'\n }, {\n value: 9,\n label: 'September'\n }, {\n value: 10,\n label: 'October'\n }, {\n value: 11,\n label: 'November'\n }, {\n value: 12,\n label: 'December'\n }];\n return this._months;\n }\n }, {\n key: \"years\",\n get: function get() {\n if (this._years) {\n return this._years;\n }\n this._years = [{\n value: '',\n label: _lodash[\"default\"].get(this.component, 'fields.year.placeholder', '')\n }];\n var minYears = _lodash[\"default\"].get(this.component, 'fields.year.minYear', 1900) || 1900;\n var maxYears = _lodash[\"default\"].get(this.component, 'fields.year.maxYear', 2030) || 2030;\n for (var x = minYears; x <= maxYears; x++) {\n this._years.push({\n value: x,\n label: x.toString()\n });\n }\n return this._years;\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(elements, dirty, hasError) {\n _get(_getPrototypeOf(DayComponent.prototype), \"setErrorClasses\", this).call(this, elements, dirty, hasError);\n _get(_getPrototypeOf(DayComponent.prototype), \"setErrorClasses\", this).call(this, [this.refs.day, this.refs.month, this.refs.year], dirty, hasError);\n }\n }, {\n key: \"removeInputError\",\n value: function removeInputError(elements) {\n _get(_getPrototypeOf(DayComponent.prototype), \"removeInputError\", this).call(this, [this.refs.day, this.refs.month, this.refs.year]);\n _get(_getPrototypeOf(DayComponent.prototype), \"removeInputError\", this).call(this, elements);\n }\n }, {\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(DayComponent.prototype), \"init\", this).call(this);\n this.validators = this.validators.concat(['day', 'maxDate', 'minDate', 'minYear', 'maxYear']);\n var minYear = this.component.fields.year.minYear;\n var maxYear = this.component.fields.year.maxYear;\n this.component.maxYear = maxYear;\n this.component.minYear = minYear;\n var dateFormatInfo = (0, _utils.getLocaleDateFormatInfo)(this.options.language);\n this.dayFirst = this.component.useLocaleSettings ? dateFormatInfo.dayFirst : this.component.dayFirst;\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.isHtmlRenderMode()) {\n return _get(_getPrototypeOf(DayComponent.prototype), \"render\", this).call(this, this.renderTemplate('input'));\n }\n return _get(_getPrototypeOf(DayComponent.prototype), \"render\", this).call(this, this.renderTemplate('day', {\n dayFirst: this.dayFirst,\n showDay: this.showDay,\n showMonth: this.showMonth,\n showYear: this.showYear,\n day: this.renderField('day'),\n month: this.renderField('month'),\n year: this.renderField('year')\n }));\n }\n }, {\n key: \"renderField\",\n value: function renderField(name) {\n var _this = this;\n if (this.component.fields[name].type === 'select') {\n return this.renderTemplate('select', {\n input: this.selectDefinition(name),\n selectOptions: this[\"\".concat(name, \"s\")].reduce(function (html, option) {\n return html + _this.renderTemplate('selectOption', {\n option: option,\n selected: false,\n attrs: {}\n });\n }, '')\n });\n } else {\n return this.renderTemplate('input', {\n prefix: this.prefix,\n suffix: this.suffix,\n input: this.inputDefinition(name)\n });\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this2 = this;\n this.loadRefs(element, {\n day: 'single',\n month: 'single',\n year: 'single',\n input: 'multiple'\n });\n var superAttach = _get(_getPrototypeOf(DayComponent.prototype), \"attach\", this).call(this, element);\n if (this.shouldDisabled) {\n this.setDisabled(this.refs.day, true);\n this.setDisabled(this.refs.month, true);\n this.setDisabled(this.refs.year, true);\n if (this.refs.input) {\n this.refs.input.forEach(function (input) {\n return _this2.setDisabled(input, true);\n });\n }\n } else {\n this.addEventListener(this.refs.day, 'input', function () {\n return _this2.updateValue(null, {\n modified: true\n });\n });\n // TODO: Need to rework this to work with day select as well.\n // Change day max input when month changes.\n this.addEventListener(this.refs.month, 'input', function () {\n var maxDay = _this2.refs.year ? parseInt(new Date(_this2.refs.year.value, _this2.refs.month.value, 0).getDate(), 10) : '';\n var day = _this2.getFieldValue('day');\n if (!_this2.component.fields.day.hide && maxDay) {\n _this2.refs.day.max = maxDay;\n }\n if (maxDay && day > maxDay) {\n _this2.refs.day.value = _this2.refs.day.max;\n }\n _this2.updateValue(null, {\n modified: true\n });\n });\n this.addEventListener(this.refs.year, 'input', function () {\n return _this2.updateValue(null, {\n modified: true\n });\n });\n this.addEventListener(this.refs.input, this.info.changeEvent, function () {\n return _this2.updateValue(null, {\n modified: true\n });\n });\n }\n this.setValue(this.dataValue);\n // Force the disabled state with getters and setters.\n this.disabled = this.shouldDisabled;\n return superAttach;\n }\n }, {\n key: \"validateRequired\",\n value: function validateRequired(setting, value) {\n var _this$parts = this.parts,\n day = _this$parts.day,\n month = _this$parts.month,\n year = _this$parts.year;\n if (this.dayRequired && !day) {\n return false;\n }\n if (this.monthRequired && !month) {\n return false;\n }\n if (this.yearRequired && !year) {\n return false;\n }\n if (!(0, _utils.boolValue)(setting)) {\n return true;\n }\n return !this.isEmpty(value);\n }\n }, {\n key: \"disabled\",\n set: function set(disabled) {\n _set(_getPrototypeOf(DayComponent.prototype), \"disabled\", disabled, this, true);\n if (!this.refs.year || !this.refs.month || !this.refs.day) {\n return;\n }\n if (disabled) {\n this.refs.year.setAttribute('disabled', 'disabled');\n this.refs.month.setAttribute('disabled', 'disabled');\n this.refs.day.setAttribute('disabled', 'disabled');\n } else {\n this.refs.year.removeAttribute('disabled');\n this.refs.month.removeAttribute('disabled');\n this.refs.day.removeAttribute('disabled');\n }\n }\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n if (!value || this.valueMask.test(value)) {\n return value;\n }\n var dateParts = [];\n var valueParts = value.split('/');\n var _ref = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2],\n _ref2 = _slicedToArray(_ref, 3),\n DAY = _ref2[0],\n MONTH = _ref2[1],\n YEAR = _ref2[2];\n var defaultValue = this.component.defaultValue ? this.component.defaultValue.split('/') : '';\n var getNextPart = function getNextPart(shouldTake, defaultValue) {\n return dateParts.push(shouldTake ? valueParts.shift() : defaultValue);\n };\n if (this.dayFirst) {\n getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '00');\n if (!this.dayFirst) {\n getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '0000');\n return dateParts.join('/');\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 // temporary solution to avoid input reset\n // on invalid date.\n if (!value || value === 'Invalid date') {\n return null;\n }\n var parts = value.split('/');\n var day;\n if (this.component.dayFirst) {\n day = parts.shift();\n }\n var month = parts.shift();\n if (!this.component.dayFirst) {\n day = parts.shift();\n }\n var year = parts.shift();\n if (this.refs.day && this.showDay) {\n this.refs.day.value = day === '00' ? '' : parseInt(day, 10);\n }\n if (this.refs.month && this.showMonth) {\n this.refs.month.value = month === '00' ? '' : parseInt(month, 10);\n }\n if (this.refs.year && this.showYear) {\n this.refs.year.value = year === '0000' ? '' : parseInt(year, 10);\n }\n }\n }, {\n key: \"getFieldValue\",\n value: function getFieldValue(name) {\n var parts = this.dataValue ? this.dataValue.split('/') : [];\n var val = 0;\n switch (name) {\n case 'month':\n val = parts[this.dayFirst ? 1 : 0];\n break;\n case 'day':\n val = parts[this.dayFirst ? 0 : 1];\n break;\n case 'year':\n val = parts[2];\n break;\n }\n val = parseInt(val, 10);\n return !_lodash[\"default\"].isNaN(val) && _lodash[\"default\"].isNumber(val) ? val : 0;\n }\n }, {\n key: \"parts\",\n get: function get() {\n return {\n day: this.getFieldValue('day'),\n month: this.getFieldValue('month'),\n year: this.getFieldValue('year')\n };\n }\n\n /**\n * Get the format for the value string.\n * @returns {string}\n */\n }, {\n key: \"format\",\n get: function get() {\n var format = '';\n if (this.component.dayFirst && this.showDay) {\n format += 'D/';\n }\n if (this.showMonth) {\n format += 'M/';\n }\n if (!this.component.dayFirst && this.showDay) {\n format += 'D/';\n }\n if (this.showYear) {\n format += 'YYYY';\n return format;\n } else {\n // Trim off the \"/\" from the end of the format string.\n return format.length ? format.substring(0, format.length - 1) : format;\n }\n }\n\n /**\n * Return the date for this component.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"getDate\",\n value: function getDate(value) {\n var defaults = [],\n day,\n month,\n year;\n // Map positions to identifiers to get default values for each part of day\n var _ref3 = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2],\n _ref4 = _slicedToArray(_ref3, 3),\n DAY = _ref4[0],\n MONTH = _ref4[1],\n YEAR = _ref4[2];\n var defaultValue = value || this.component.defaultValue;\n if (defaultValue) {\n defaults = defaultValue.split('/').map(function (x) {\n return parseInt(x, 10);\n });\n }\n if (this.showDay && this.refs.day) {\n day = parseInt(this.refs.day.value, 10);\n }\n if (day === undefined || _lodash[\"default\"].isNaN(day)) {\n day = defaults[DAY] && !_lodash[\"default\"].isNaN(defaults[DAY]) ? defaults[DAY] : 0;\n }\n if (this.showMonth && this.refs.month) {\n // Months are 0 indexed.\n month = parseInt(this.refs.month.value, 10);\n }\n if (month === undefined || _lodash[\"default\"].isNaN(month)) {\n month = defaults[MONTH] && !_lodash[\"default\"].isNaN(defaults[MONTH]) ? defaults[MONTH] : 0;\n }\n if (this.showYear && this.refs.year) {\n year = parseInt(this.refs.year.value);\n }\n if (year === undefined || _lodash[\"default\"].isNaN(year)) {\n year = defaults[YEAR] && !_lodash[\"default\"].isNaN(defaults[YEAR]) ? defaults[YEAR] : 0;\n }\n var result;\n if (!day && !month && !year) {\n return null;\n }\n\n // add trailing zeros if the data is showed\n day = this.showDay ? day.toString().padStart(2, 0) : '';\n month = this.showMonth ? month.toString().padStart(2, 0) : '';\n year = this.showYear ? year.toString().padStart(4, 0) : '';\n if (this.component.dayFirst) {\n result = \"\".concat(day).concat(this.showDay && this.showMonth || this.showDay && this.showYear ? '/' : '').concat(month).concat(this.showMonth && this.showYear ? '/' : '').concat(year);\n } else {\n result = \"\".concat(month).concat(this.showDay && this.showMonth || this.showMonth && this.showYear ? '/' : '').concat(day).concat(this.showDay && this.showYear ? '/' : '').concat(year);\n }\n return result;\n }\n\n /**\n * Return the date object for this component.\n * @returns {Date}\n */\n }, {\n key: \"date\",\n get: function get() {\n return this.getDate();\n }\n }, {\n key: \"normalizeMinMaxDates\",\n value: function normalizeMinMaxDates() {\n return [this.component.minDate, this.component.maxDate].map(function (date) {\n return date ? date.split('-').reverse().join('/') : date;\n });\n }\n\n /**\n * Return the raw value.\n *\n * @returns {Date}\n */\n }, {\n key: \"validationValue\",\n get: function get() {\n var _ref5 = this.dayFirst ? this.normalizeMinMaxDates() : [this.component.minDate, this.component.maxDate];\n var _ref6 = _slicedToArray(_ref5, 2);\n this.component.minDate = _ref6[0];\n this.component.maxDate = _ref6[1];\n return this.dataValue;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n var result = _get(_getPrototypeOf(DayComponent.prototype), \"getValue\", this).call(this);\n return !result ? this.dataValue : result;\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 date = this.date || this.emptyValue;\n if (date) {\n this.refs.input[index].value = date;\n return this.refs.input[index].value;\n } else {\n this.refs.input[index].value = '';\n return null;\n }\n }\n\n /**\n * Get the input value of the date.\n *\n * @param value\n * @return {null}\n */\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n return this.getDate(value) || '';\n }\n }, {\n key: \"focus\",\n value: function focus() {\n if (this.dayFirst && this.showDay || !this.dayFirst && !this.showMonth && this.showDay) {\n var _this$refs$day;\n (_this$refs$day = this.refs.day) === null || _this$refs$day === void 0 ? void 0 : _this$refs$day.focus();\n } else if (this.dayFirst && !this.showDay && this.showMonth || !this.dayFirst && this.showMonth) {\n var _this$refs$month;\n (_this$refs$month = this.refs.month) === null || _this$refs$month === void 0 ? void 0 : _this$refs$month.focus();\n } else if (!this.showDay && !this.showDay && this.showYear) {\n var _this$refs$year;\n (_this$refs$year = this.refs.year) === null || _this$refs$year === void 0 ? void 0 : _this$refs$year.focus();\n }\n }\n }, {\n key: \"isPartialDay\",\n value: function isPartialDay(value) {\n if (!value) {\n return false;\n }\n var _ref7 = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2],\n _ref8 = _slicedToArray(_ref7, 3),\n DAY = _ref8[0],\n MONTH = _ref8[1],\n YEAR = _ref8[2];\n var values = value.split('/');\n return values[DAY] === '00' || values[MONTH] === '00' || values[YEAR] === '0000';\n }\n }, {\n key: \"getValidationFormat\",\n value: function getValidationFormat() {\n return this.dayFirst ? 'DD-MM-YYYY' : 'MM-DD-YYYY';\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: 'day',\n label: 'Day',\n key: 'day',\n fields: {\n day: {\n type: 'number',\n placeholder: '',\n required: false\n },\n month: {\n type: 'select',\n placeholder: '',\n required: false\n },\n year: {\n type: 'number',\n placeholder: '',\n required: false\n }\n },\n dayFirst: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Day',\n group: 'advanced',\n icon: 'calendar',\n documentation: '/userguide/form-building/advanced-components#day',\n weight: 50,\n schema: DayComponent.schema()\n };\n }\n }]);\n return DayComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = DayComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/day/Day.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.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.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.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.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\");\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\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n__webpack_require__(/*! core-js/modules/es.date.to-iso-string.js */ \"./node_modules/core-js/modules/es.date.to-iso-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.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.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.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.parse-int.js */ \"./node_modules/core-js/modules/es.parse-int.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.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.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.map.js */ \"./node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.string.pad-start.js */ \"./node_modules/core-js/modules/es.string.pad-start.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 _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.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 _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 _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 _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 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 DayComponent = /*#__PURE__*/function (_Field) {\n _inherits(DayComponent, _Field);\n var _super = _createSuper(DayComponent);\n function DayComponent(component, options, data) {\n _classCallCheck(this, DayComponent);\n if (component.maxDate) {\n component.maxDate = (0, _moment[\"default\"])(component.maxDate, 'YYYY-MM-DD').toISOString();\n }\n if (component.minDate) {\n component.minDate = (0, _moment[\"default\"])(component.minDate, 'YYYY-MM-DD').toISOString();\n }\n return _super.call(this, component, options, data);\n }\n _createClass(DayComponent, [{\n key: \"emptyValue\",\n get:\n /**\n * The empty value for day component.\n *\n * @return {'00/00/0000'}\n */\n function get() {\n return '00/00/0000';\n }\n }, {\n key: \"valueMask\",\n get: function get() {\n return /^\\d{2}\\/\\d{2}\\/\\d{4}$/;\n }\n }, {\n key: \"dayRequired\",\n get: function get() {\n return this.showDay && _lodash[\"default\"].get(this.component, 'fields.day.required', false);\n }\n }, {\n key: \"showDay\",\n get: function get() {\n return !_lodash[\"default\"].get(this.component, 'fields.day.hide', false);\n }\n }, {\n key: \"monthRequired\",\n get: function get() {\n return this.showMonth && _lodash[\"default\"].get(this.component, 'fields.month.required', false);\n }\n }, {\n key: \"showMonth\",\n get: function get() {\n return !_lodash[\"default\"].get(this.component, 'fields.month.hide', false);\n }\n }, {\n key: \"yearRequired\",\n get: function get() {\n return this.showYear && _lodash[\"default\"].get(this.component, 'fields.year.required', false);\n }\n }, {\n key: \"showYear\",\n get: function get() {\n return !_lodash[\"default\"].get(this.component, 'fields.year.hide', false);\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return DayComponent.schema();\n }\n }, {\n key: \"shouldDisabled\",\n get: function get() {\n return _get(_getPrototypeOf(DayComponent.prototype), \"shouldDisabled\", this) || this.parentDisabled;\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(DayComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'input';\n info.attr.type = 'hidden';\n info.changeEvent = 'input';\n return info;\n }\n }, {\n key: \"inputDefinition\",\n value: function inputDefinition(name) {\n var min, max;\n if (name === 'day') {\n min = 1;\n max = 31;\n }\n if (name === 'month') {\n min = 1;\n max = 12;\n }\n if (name === 'year') {\n min = _lodash[\"default\"].get(this.component, 'fields.year.minYear', 1900) || 1900;\n max = _lodash[\"default\"].get(this.component, 'fields.year.maxYear', 2030) || 1900;\n }\n return {\n type: 'input',\n ref: name,\n attr: {\n id: \"\".concat(this.component.key, \"-\").concat(name),\n \"class\": \"form-control \".concat(this.transform('class', \"formio-day-component-\".concat(name))),\n type: this.component.fields[name].type === 'select' ? 'select' : 'number',\n placeholder: this.component.fields[name].placeholder,\n step: 1,\n min: min,\n max: max\n }\n };\n }\n }, {\n key: \"selectDefinition\",\n value: function selectDefinition(name) {\n return {\n multiple: false,\n ref: name,\n widget: 'html5',\n attr: {\n id: \"\".concat(this.component.key, \"-\").concat(name),\n \"class\": 'form-control',\n name: name,\n lang: this.options.language\n }\n };\n }\n }, {\n key: \"days\",\n get: function get() {\n if (this._days) {\n return this._days;\n }\n this._days = [{\n value: '',\n label: _lodash[\"default\"].get(this.component, 'fields.day.placeholder', '')\n }];\n for (var x = 1; x <= 31; x++) {\n this._days.push({\n value: x,\n label: x.toString()\n });\n }\n return this._days;\n }\n }, {\n key: \"months\",\n get: function get() {\n if (this._months) {\n return this._months;\n }\n this._months = [{\n value: '',\n label: _lodash[\"default\"].get(this.component, 'fields.month.placeholder') || (this.hideInputLabels ? this.t('Month') : '')\n }, {\n value: 1,\n label: 'January'\n }, {\n value: 2,\n label: 'February'\n }, {\n value: 3,\n label: 'March'\n }, {\n value: 4,\n label: 'April'\n }, {\n value: 5,\n label: 'May'\n }, {\n value: 6,\n label: 'June'\n }, {\n value: 7,\n label: 'July'\n }, {\n value: 8,\n label: 'August'\n }, {\n value: 9,\n label: 'September'\n }, {\n value: 10,\n label: 'October'\n }, {\n value: 11,\n label: 'November'\n }, {\n value: 12,\n label: 'December'\n }];\n return this._months;\n }\n }, {\n key: \"years\",\n get: function get() {\n if (this._years) {\n return this._years;\n }\n this._years = [{\n value: '',\n label: _lodash[\"default\"].get(this.component, 'fields.year.placeholder', '')\n }];\n var minYears = _lodash[\"default\"].get(this.component, 'fields.year.minYear', 1900) || 1900;\n var maxYears = _lodash[\"default\"].get(this.component, 'fields.year.maxYear', 2030) || 2030;\n for (var x = minYears; x <= maxYears; x++) {\n this._years.push({\n value: x,\n label: x.toString()\n });\n }\n return this._years;\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(elements, dirty, hasError) {\n _get(_getPrototypeOf(DayComponent.prototype), \"setErrorClasses\", this).call(this, elements, dirty, hasError);\n _get(_getPrototypeOf(DayComponent.prototype), \"setErrorClasses\", this).call(this, [this.refs.day, this.refs.month, this.refs.year], dirty, hasError);\n }\n }, {\n key: \"removeInputError\",\n value: function removeInputError(elements) {\n _get(_getPrototypeOf(DayComponent.prototype), \"removeInputError\", this).call(this, [this.refs.day, this.refs.month, this.refs.year]);\n _get(_getPrototypeOf(DayComponent.prototype), \"removeInputError\", this).call(this, elements);\n }\n }, {\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(DayComponent.prototype), \"init\", this).call(this);\n this.validators = this.validators.concat(['day', 'maxDate', 'minDate', 'minYear', 'maxYear']);\n var minYear = this.component.fields.year.minYear;\n var maxYear = this.component.fields.year.maxYear;\n this.component.maxYear = maxYear;\n this.component.minYear = minYear;\n var dateFormatInfo = (0, _utils.getLocaleDateFormatInfo)(this.options.language);\n this.dayFirst = this.component.useLocaleSettings ? dateFormatInfo.dayFirst : this.component.dayFirst;\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.isHtmlRenderMode()) {\n return _get(_getPrototypeOf(DayComponent.prototype), \"render\", this).call(this, this.renderTemplate('input'));\n }\n return _get(_getPrototypeOf(DayComponent.prototype), \"render\", this).call(this, this.renderTemplate('day', {\n dayFirst: this.dayFirst,\n showDay: this.showDay,\n showMonth: this.showMonth,\n showYear: this.showYear,\n day: this.renderField('day'),\n month: this.renderField('month'),\n year: this.renderField('year')\n }));\n }\n }, {\n key: \"renderField\",\n value: function renderField(name) {\n var _this = this;\n if (this.component.fields[name].type === 'select') {\n return this.renderTemplate('select', {\n input: this.selectDefinition(name),\n selectOptions: this[\"\".concat(name, \"s\")].reduce(function (html, option) {\n return html + _this.renderTemplate('selectOption', {\n option: option,\n selected: false,\n attrs: {}\n });\n }, '')\n });\n } else {\n return this.renderTemplate('input', {\n prefix: this.prefix,\n suffix: this.suffix,\n input: this.inputDefinition(name)\n });\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this2 = this;\n this.loadRefs(element, {\n day: 'single',\n month: 'single',\n year: 'single',\n input: 'multiple'\n });\n var superAttach = _get(_getPrototypeOf(DayComponent.prototype), \"attach\", this).call(this, element);\n var updateValueAndSaveFocus = function updateValueAndSaveFocus(element, name) {\n return function () {\n try {\n _this2.saveCaretPosition(element, name);\n } catch (err) {\n console.warn('An error occurred while trying to save caret position', err);\n }\n _this2.updateValue(null, {\n modified: true\n });\n };\n };\n if (this.shouldDisabled) {\n this.setDisabled(this.refs.day, true);\n this.setDisabled(this.refs.month, true);\n this.setDisabled(this.refs.year, true);\n if (this.refs.input) {\n this.refs.input.forEach(function (input) {\n return _this2.setDisabled(input, true);\n });\n }\n } else {\n this.addEventListener(this.refs.day, 'input', updateValueAndSaveFocus(this.refs.day, 'day'));\n // TODO: Need to rework this to work with day select as well.\n // Change day max input when month changes.\n this.addEventListener(this.refs.month, 'input', function () {\n var maxDay = _this2.refs.year ? parseInt(new Date(_this2.refs.year.value, _this2.refs.month.value, 0).getDate(), 10) : '';\n var day = _this2.getFieldValue('day');\n if (!_this2.component.fields.day.hide && maxDay) {\n _this2.refs.day.max = maxDay;\n }\n if (maxDay && day > maxDay) {\n _this2.refs.day.value = _this2.refs.day.max;\n }\n updateValueAndSaveFocus(_this2.refs.month, 'month')();\n });\n this.addEventListener(this.refs.year, 'input', updateValueAndSaveFocus(this.refs.year, 'year'));\n this.addEventListener(this.refs.input, this.info.changeEvent, function () {\n return _this2.updateValue(null, {\n modified: true\n });\n });\n [this.refs.day, this.refs.month, this.refs.year].filter(function (element) {\n return !!element;\n }).forEach(function (element) {\n _get(_getPrototypeOf(DayComponent.prototype), \"addFocusBlurEvents\", _this2).call(_this2, element);\n });\n }\n this.setValue(this.dataValue);\n // Force the disabled state with getters and setters.\n this.disabled = this.shouldDisabled;\n return superAttach;\n }\n }, {\n key: \"validateRequired\",\n value: function validateRequired(setting, value) {\n var _this$parts = this.parts,\n day = _this$parts.day,\n month = _this$parts.month,\n year = _this$parts.year;\n if (this.dayRequired && !day) {\n return false;\n }\n if (this.monthRequired && !month) {\n return false;\n }\n if (this.yearRequired && !year) {\n return false;\n }\n if (!(0, _utils.boolValue)(setting)) {\n return true;\n }\n return !this.isEmpty(value);\n }\n }, {\n key: \"disabled\",\n set: function set(disabled) {\n _set(_getPrototypeOf(DayComponent.prototype), \"disabled\", disabled, this, true);\n if (!this.refs.year || !this.refs.month || !this.refs.day) {\n return;\n }\n if (disabled) {\n this.refs.year.setAttribute('disabled', 'disabled');\n this.refs.month.setAttribute('disabled', 'disabled');\n this.refs.day.setAttribute('disabled', 'disabled');\n } else {\n this.refs.year.removeAttribute('disabled');\n this.refs.month.removeAttribute('disabled');\n this.refs.day.removeAttribute('disabled');\n }\n }\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n if (!value || this.valueMask.test(value)) {\n return value;\n }\n var dateParts = [];\n var valueParts = value.split('/');\n var _ref = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2],\n _ref2 = _slicedToArray(_ref, 3),\n DAY = _ref2[0],\n MONTH = _ref2[1],\n YEAR = _ref2[2];\n var defaultValue = this.component.defaultValue ? this.component.defaultValue.split('/') : '';\n var getNextPart = function getNextPart(shouldTake, defaultValue) {\n return dateParts.push(shouldTake ? valueParts.shift() : defaultValue);\n };\n if (this.dayFirst) {\n getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '00');\n if (!this.dayFirst) {\n getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '0000');\n return dateParts.join('/');\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 // temporary solution to avoid input reset\n // on invalid date.\n if (!value || value === 'Invalid date') {\n return null;\n }\n var parts = value.split('/');\n var day;\n if (this.component.dayFirst) {\n day = parts.shift();\n }\n var month = parts.shift();\n if (!this.component.dayFirst) {\n day = parts.shift();\n }\n var year = parts.shift();\n if (this.refs.day && this.showDay) {\n this.refs.day.value = day === '00' ? '' : parseInt(day, 10);\n }\n if (this.refs.month && this.showMonth) {\n this.refs.month.value = month === '00' ? '' : parseInt(month, 10);\n }\n if (this.refs.year && this.showYear) {\n this.refs.year.value = year === '0000' ? '' : parseInt(year, 10);\n }\n }\n }, {\n key: \"getFieldValue\",\n value: function getFieldValue(name) {\n var parts = this.dataValue ? this.dataValue.split('/') : [];\n var val = 0;\n switch (name) {\n case 'month':\n val = parts[this.dayFirst ? 1 : 0];\n break;\n case 'day':\n val = parts[this.dayFirst ? 0 : 1];\n break;\n case 'year':\n val = parts[2];\n break;\n }\n val = parseInt(val, 10);\n return !_lodash[\"default\"].isNaN(val) && _lodash[\"default\"].isNumber(val) ? val : 0;\n }\n }, {\n key: \"parts\",\n get: function get() {\n return {\n day: this.getFieldValue('day'),\n month: this.getFieldValue('month'),\n year: this.getFieldValue('year')\n };\n }\n\n /**\n * Get the format for the value string.\n * @returns {string}\n */\n }, {\n key: \"format\",\n get: function get() {\n var format = '';\n if (this.component.dayFirst && this.showDay) {\n format += 'D/';\n }\n if (this.showMonth) {\n format += 'M/';\n }\n if (!this.component.dayFirst && this.showDay) {\n format += 'D/';\n }\n if (this.showYear) {\n format += 'YYYY';\n return format;\n } else {\n // Trim off the \"/\" from the end of the format string.\n return format.length ? format.substring(0, format.length - 1) : format;\n }\n }\n\n /**\n * Return the date for this component.\n *\n * @param value\n * @return {*}\n */\n }, {\n key: \"getDate\",\n value: function getDate(value) {\n var defaults = [],\n day,\n month,\n year;\n // Map positions to identifiers to get default values for each part of day\n var _ref3 = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2],\n _ref4 = _slicedToArray(_ref3, 3),\n DAY = _ref4[0],\n MONTH = _ref4[1],\n YEAR = _ref4[2];\n var defaultValue = value || this.component.defaultValue;\n if (defaultValue) {\n defaults = defaultValue.split('/').map(function (x) {\n return parseInt(x, 10);\n });\n }\n if (this.showDay && this.refs.day) {\n day = parseInt(this.refs.day.value, 10);\n }\n if (day === undefined || _lodash[\"default\"].isNaN(day)) {\n day = defaults[DAY] && !_lodash[\"default\"].isNaN(defaults[DAY]) ? defaults[DAY] : 0;\n }\n if (this.showMonth && this.refs.month) {\n // Months are 0 indexed.\n month = parseInt(this.refs.month.value, 10);\n }\n if (month === undefined || _lodash[\"default\"].isNaN(month)) {\n month = defaults[MONTH] && !_lodash[\"default\"].isNaN(defaults[MONTH]) ? defaults[MONTH] : 0;\n }\n if (this.showYear && this.refs.year) {\n year = parseInt(this.refs.year.value);\n }\n if (year === undefined || _lodash[\"default\"].isNaN(year)) {\n year = defaults[YEAR] && !_lodash[\"default\"].isNaN(defaults[YEAR]) ? defaults[YEAR] : 0;\n }\n var result;\n if (!day && !month && !year) {\n return null;\n }\n\n // add trailing zeros if the data is showed\n day = this.showDay ? day.toString().padStart(2, 0) : '';\n month = this.showMonth ? month.toString().padStart(2, 0) : '';\n year = this.showYear ? year.toString().padStart(4, 0) : '';\n if (this.component.dayFirst) {\n result = \"\".concat(day).concat(this.showDay && this.showMonth || this.showDay && this.showYear ? '/' : '').concat(month).concat(this.showMonth && this.showYear ? '/' : '').concat(year);\n } else {\n result = \"\".concat(month).concat(this.showDay && this.showMonth || this.showMonth && this.showYear ? '/' : '').concat(day).concat(this.showDay && this.showYear ? '/' : '').concat(year);\n }\n return result;\n }\n\n /**\n * Return the date object for this component.\n * @returns {Date}\n */\n }, {\n key: \"date\",\n get: function get() {\n return this.getDate();\n }\n\n /**\n * Return the raw value.\n *\n * @returns {Date}\n */\n }, {\n key: \"validationValue\",\n get: function get() {\n return this.dataValue;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n var result = _get(_getPrototypeOf(DayComponent.prototype), \"getValue\", this).call(this);\n return !result ? this.dataValue : result;\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 date = this.date || this.emptyValue;\n if (date) {\n this.refs.input[index].value = date;\n return this.refs.input[index].value;\n } else {\n this.refs.input[index].value = '';\n return null;\n }\n }\n\n /**\n * Get the input value of the date.\n *\n * @param value\n * @return {null}\n */\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n return this.getDate(value) || '';\n }\n }, {\n key: \"focus\",\n value: function focus(field) {\n if (field && typeof field === 'string' && this.refs[field]) {\n this.refs[field].focus();\n } else if (this.dayFirst && this.showDay || !this.dayFirst && !this.showMonth && this.showDay) {\n var _this$refs$day;\n (_this$refs$day = this.refs.day) === null || _this$refs$day === void 0 ? void 0 : _this$refs$day.focus();\n } else if (this.dayFirst && !this.showDay && this.showMonth || !this.dayFirst && this.showMonth) {\n var _this$refs$month;\n (_this$refs$month = this.refs.month) === null || _this$refs$month === void 0 ? void 0 : _this$refs$month.focus();\n } else if (!this.showDay && !this.showDay && this.showYear) {\n var _this$refs$year;\n (_this$refs$year = this.refs.year) === null || _this$refs$year === void 0 ? void 0 : _this$refs$year.focus();\n }\n }\n }, {\n key: \"restoreCaretPosition\",\n value: function restoreCaretPosition() {\n var _this$root;\n if ((_this$root = this.root) !== null && _this$root !== void 0 && _this$root.currentSelection) {\n var _this$root$currentSel = this.root.currentSelection,\n selection = _this$root$currentSel.selection,\n index = _this$root$currentSel.index;\n if (this.refs[index]) {\n var input = this.refs[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 (isInputRangeSelectable(input)) {\n input.setSelectionRange.apply(input, _toConsumableArray(selection));\n }\n }\n }\n }\n }, {\n key: \"isPartialDay\",\n value: function isPartialDay(value) {\n if (!value) {\n return false;\n }\n var _ref5 = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2],\n _ref6 = _slicedToArray(_ref5, 3),\n DAY = _ref6[0],\n MONTH = _ref6[1],\n YEAR = _ref6[2];\n var values = value.split('/');\n return values[DAY] === '00' || values[MONTH] === '00' || values[YEAR] === '0000';\n }\n }, {\n key: \"getValidationFormat\",\n value: function getValidationFormat() {\n return this.dayFirst ? 'DD-MM-YYYY' : 'MM-DD-YYYY';\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: 'day',\n label: 'Day',\n key: 'day',\n fields: {\n day: {\n type: 'number',\n placeholder: '',\n required: false\n },\n month: {\n type: 'select',\n placeholder: '',\n required: false\n },\n year: {\n type: 'number',\n placeholder: '',\n required: false\n }\n },\n dayFirst: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Day',\n group: 'advanced',\n icon: 'calendar',\n documentation: '/userguide/form-building/advanced-components#day',\n weight: 50,\n schema: DayComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(DayComponent), \"serverConditionSettings\", this)), {}, {\n operators: ['isDateEqual', 'isNotDateEqual', 'isEmpty', 'isNotEmpty', 'dateLessThan', 'dateGreaterThan', 'dateLessThanOrEqual', 'dateGreaterThanOrEqual']\n });\n }\n }]);\n return DayComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = DayComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/day/Day.js?"); /***/ }), @@ -1071,7 +1071,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.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.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.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.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.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.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.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.map.js */ \"./node_modules/core-js/modules/es.array.map.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.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.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.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.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.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.regexp.constructor.js */ \"./node_modules/core-js/modules/es.regexp.constructor.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.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.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.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.splice.js */ \"./node_modules/core-js/modules/es.array.splice.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.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.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 _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _NestedArrayComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nestedarray/NestedArrayComponent */ \"./lib/components/_classes/nestedarray/NestedArrayComponent.js\"));\nvar _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _Alert = _interopRequireDefault(__webpack_require__(/*! ../alert/Alert */ \"./lib/components/alert/Alert.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _templates = _interopRequireDefault(__webpack_require__(/*! ./templates */ \"./lib/components/editgrid/templates/index.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 _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 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar EditRowState = {\n New: 'new',\n Editing: 'editing',\n Saved: 'saved',\n Viewing: 'viewing',\n Removed: 'removed',\n Draft: 'draft'\n};\nvar EditGridComponent = /*#__PURE__*/function (_NestedArrayComponent) {\n _inherits(EditGridComponent, _NestedArrayComponent);\n var _super = _createSuper(EditGridComponent);\n function EditGridComponent() {\n var _this;\n _classCallCheck(this, EditGridComponent);\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 = 'editgrid';\n return _this;\n }\n _createClass(EditGridComponent, [{\n key: \"defaultDialogTemplate\",\n get: function get() {\n return \"\\n

\".concat(this.t('Do you want to clear data?'), \"

\\n
\\n \\n \\n
\\n \");\n }\n }, {\n key: \"defaultRowTemplate\",\n get: function get() {\n return this.displayAsTable ? EditGridComponent.defaultTableRowTemplate : EditGridComponent.defaultRowTemplate;\n }\n }, {\n key: \"defaultHeaderTemplate\",\n get: function get() {\n return this.displayAsTable ? EditGridComponent.defaultTableHeaderTemplate : EditGridComponent.defaultHeaderTemplate;\n }\n }, {\n key: \"rowTemplate\",\n get: function get() {\n var rowTemplate;\n if (_utils.Evaluator.noeval) {\n rowTemplate = this.displayAsTable ? _templates[\"default\"].tableRow : _templates[\"default\"].row;\n } else {\n rowTemplate = this.displayAsTable ? _lodash[\"default\"].get(this.component, 'templates.tableRow', this.defaultRowTemplate) : _lodash[\"default\"].get(this.component, 'templates.row', this.defaultRowTemplate);\n }\n return rowTemplate;\n }\n }, {\n key: \"headerTemplate\",\n get: function get() {\n var headerTemplate;\n if (_utils.Evaluator.noeval) {\n headerTemplate = this.displayAsTable ? _templates[\"default\"].tableHeader : _templates[\"default\"].header;\n } else {\n headerTemplate = this.displayAsTable ? _lodash[\"default\"].get(this.component, 'templates.tableHeader', this.defaultHeaderTemplate) : _lodash[\"default\"].get(this.component, 'templates.header', this.defaultHeaderTemplate);\n }\n return headerTemplate;\n }\n\n /**\n * Returns true if the component has nested components which don't trigger changes on the root level\n */\n }, {\n key: \"hasScopedChildren\",\n get: function get() {\n return !this.inlineEditMode;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return EditGridComponent.schema();\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return [];\n }\n }, {\n key: \"editgridKey\",\n get: function get() {\n return \"editgrid-\".concat(this.key);\n }\n }, {\n key: \"rowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-row\");\n }\n }, {\n key: \"rowElements\",\n get: function get() {\n return this.refs[this.rowRef];\n }\n }, {\n key: \"rowRefs\",\n get: function get() {\n return this.refs[\"editgrid-\".concat(this.component.key, \"-row\")];\n }\n }, {\n key: \"addRowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-addRow\");\n }\n }, {\n key: \"addRowElements\",\n get: function get() {\n return this.refs[this.addRowRef];\n }\n }, {\n key: \"saveRowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-saveRow\");\n }\n }, {\n key: \"saveRowElements\",\n get: function get() {\n return this.refs[this.saveRowRef];\n }\n }, {\n key: \"cancelRowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-cancelRow\");\n }\n }, {\n key: \"cancelRowElements\",\n get: function get() {\n return this.refs[this.cancelRowRef];\n }\n }, {\n key: \"inlineEditMode\",\n get: function get() {\n return this.component.inlineEdit;\n }\n }, {\n key: \"saveEditMode\",\n get: function get() {\n return !this.inlineEditMode;\n }\n }, {\n key: \"minLength\",\n get: function get() {\n return _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }, {\n key: \"data\",\n get: function get() {\n return this._data;\n },\n set: function set(value) {\n this._data = value;\n var data = this.dataValue;\n (this.editRows || []).forEach(function (row, index) {\n if (!data[index] && row.state !== EditRowState.New) {\n data[index] = {};\n }\n var rowData = data[index] || {};\n row.data = rowData;\n row.components.forEach(function (component) {\n component.data = rowData;\n });\n });\n }\n }, {\n key: \"dataValue\",\n get: function get() {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"dataValue\", this) || [];\n },\n set: function set(value) {\n _set(_getPrototypeOf(EditGridComponent.prototype), \"dataValue\", value, this, true);\n }\n }, {\n key: \"displayAsTable\",\n get: function get() {\n return this.component.displayAsTable;\n }\n }, {\n key: \"iteratableRows\",\n get: function get() {\n return this.editRows;\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var value = _get(_getPrototypeOf(EditGridComponent.prototype), \"defaultValue\", this);\n var defaultValue = Array.isArray(value) ? value : [];\n _lodash[\"default\"].times(this.minLength - defaultValue.length, function () {\n return defaultValue.push({});\n });\n return defaultValue;\n }\n }, {\n key: \"hasRemoveButtons\",\n value: function hasRemoveButtons() {\n return !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: \"init\",\n value: function init() {\n var _this2 = this;\n if (this.builderMode) {\n this.editRows = [];\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"init\", this).call(this);\n }\n this.components = this.components || [];\n var dataValue = this.dataValue;\n var openWhenEmpty = !dataValue.length && this.component.openWhenEmpty;\n if (openWhenEmpty) {\n var dataObj = {};\n this.editRows = [];\n this.createRow(dataObj, 0);\n } else {\n this.editRows = dataValue.map(function (row, rowIndex) {\n return {\n components: _this2.lazyLoad ? [] : _this2.createRowComponents(row, rowIndex),\n data: row,\n state: EditRowState.Saved,\n backup: null,\n error: null,\n rowIndex: rowIndex\n };\n });\n }\n this.prevHasAddButton = this.hasAddButton();\n this.checkData();\n this.setVariableTypeComponents();\n if (this.variableTypeComponentsIndexes.length) {\n _lodash[\"default\"].each(this.editRows || [], function (editRow, rowIndex) {\n return _this2.checkRowVariableTypeComponents(editRow, rowIndex);\n });\n }\n }\n }, {\n key: \"checkRowVariableTypeComponents\",\n value: function checkRowVariableTypeComponents(editRow, rowIndex) {\n var rowComponents = editRow.components;\n if (_lodash[\"default\"].some(this.variableTypeComponentsIndexes, function (compIndex) {\n var variableTypeComp = rowComponents[compIndex];\n return variableTypeComp.type !== variableTypeComp.component.type;\n })) {\n editRow.components = this.createRowComponents(editRow.data, rowIndex, true);\n }\n }\n }, {\n key: \"setVariableTypeComponents\",\n value: function setVariableTypeComponents() {\n var _this3 = this;\n //set components which type is changing within a row (e.g.,by mergeComponentSchema action)\n this.variableTypeComponentsIndexes = [];\n _lodash[\"default\"].each(this.component.components, function (comp, index) {\n if (comp.typeChangeEnabled) {\n _this3.variableTypeComponentsIndexes.push(index);\n }\n });\n }\n }, {\n key: \"isOpen\",\n value: function isOpen(editRow) {\n return [EditRowState.New, EditRowState.Editing, EditRowState.Viewing].includes(editRow.state);\n }\n }, {\n key: \"isComponentVisibleInSomeRow\",\n value: function isComponentVisibleInSomeRow(component) {\n var _this4 = this;\n var rows = this.editRows;\n var savedStates = [EditRowState.Saved, EditRowState.Editing, EditRowState.Draft];\n var savedRows = rows.filter(function (row) {\n return _lodash[\"default\"].includes(savedStates, row.state);\n });\n this.visibleInHeader = this.visibleInHeader || [];\n var changeVisibleInHeader = function changeVisibleInHeader(component, isVisible) {\n if (!isVisible) {\n _lodash[\"default\"].remove(_this4.visibleInHeader, function (key) {\n return key === component.key;\n });\n }\n if (isVisible && !_lodash[\"default\"].includes(_this4.visibleInHeader, component.key)) {\n _this4.visibleInHeader.push(component.key);\n }\n };\n if (_lodash[\"default\"].isEmpty(rows)) {\n var rowComponents = this.createRowComponents({}, 0);\n var checkComponent;\n (0, _utils.eachComponent)(rowComponents, function (comp) {\n if (comp.component.key === component.key) {\n checkComponent = comp;\n }\n comp.checkConditions();\n });\n var isVisible = checkComponent ? checkComponent.visible : true;\n _toConsumableArray(this.components).forEach(function (comp) {\n return _this4.removeComponent(comp, _this4.components);\n });\n changeVisibleInHeader(component, isVisible);\n return isVisible;\n }\n var isOpenRowWhenEmpty = _lodash[\"default\"].get(this.component, 'openWhenEmpty') && rows.length === 1 && rows[0].state === EditRowState.New;\n if (!_lodash[\"default\"].isEmpty(rows) && _lodash[\"default\"].isEmpty(savedRows) && !isOpenRowWhenEmpty) {\n return _lodash[\"default\"].includes(this.visibleInHeader, component.key);\n }\n return _lodash[\"default\"].some(isOpenRowWhenEmpty ? rows : savedRows, function (row, index) {\n var editingRow = row.state === EditRowState.Editing;\n var isVisible;\n if (!editingRow) {\n var flattenedComponents = _this4.flattenComponents(index);\n var instance = flattenedComponents[component.key];\n isVisible = instance ? instance.visible : true;\n changeVisibleInHeader(component, isVisible);\n } else {\n isVisible = _lodash[\"default\"].includes(_this4.visibleInHeader, component.key);\n }\n return isVisible;\n });\n }\n }, {\n key: \"render\",\n value: function render(children) {\n var _this5 = this;\n if (this.builderMode) {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"render\", this).call(this);\n }\n var dataValue = this.dataValue;\n var headerTemplate = this.headerTemplate;\n var t = this.t.bind(this);\n var templateName = this.displayAsTable ? 'editgridTable' : 'editgrid';\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"render\", this).call(this, children || this.renderTemplate(templateName, {\n ref: {\n row: this.rowRef,\n addRow: this.addRowRef,\n saveRow: this.saveRowRef,\n cancelRow: this.cancelRowRef\n },\n header: this.renderString(headerTemplate, {\n displayValue: function displayValue(component) {\n return _this5.displayComponentValue(component, true);\n },\n components: this.component.components,\n value: dataValue,\n t: t\n }),\n footer: this.renderString(_lodash[\"default\"].get(this.component, 'templates.footer'), {\n components: this.component.components,\n value: dataValue,\n t: t\n }),\n rows: this.editRows.map(this.renderRow.bind(this)),\n openRows: this.editRows.map(function (row) {\n return _this5.isOpen(row);\n }),\n errors: this.editRows.map(function (row) {\n return row.error;\n }),\n hasAddButton: this.hasAddButton(),\n hasRemoveButtons: this.hasRemoveButtons()\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 var templateName = this.displayAsTable && this.prevHasAddButton ? 'tableComponents' : 'components';\n return this.renderTemplate(templateName, {\n children: children,\n components: components\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs,\n _this6 = this;\n if (this.builderMode) {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"attach\", this).call(this, element);\n }\n this.loadRefs(element, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, this.addRowRef, 'multiple'), _defineProperty(_this$loadRefs, this.saveRowRef, 'multiple'), _defineProperty(_this$loadRefs, this.cancelRowRef, 'multiple'), _defineProperty(_this$loadRefs, this.rowRef, 'multiple'), _this$loadRefs));\n this.addRowElements.forEach(function (addButton) {\n _this6.addEventListener(addButton, 'click', function () {\n return _this6.addRow();\n });\n });\n var openRowCount = 0;\n this.rowElements.forEach(function (row, rowIndex) {\n var editRow = _this6.editRows[rowIndex];\n if (editRow !== null && editRow !== void 0 && editRow.isRowSelected) {\n row.classList.add('selected');\n }\n if (_this6.isOpen(editRow)) {\n _this6.attachComponents(row, editRow.components);\n _this6.addEventListener(_this6.saveRowElements[openRowCount], 'click', function () {\n return _this6.saveRow(rowIndex, true);\n });\n _this6.addEventListener(_this6.cancelRowElements[openRowCount], 'click', function () {\n return _this6.cancelRow(rowIndex);\n });\n openRowCount++;\n } else {\n // Attach edit and remove button events.\n [{\n className: 'removeRow',\n event: 'click',\n action: function action() {\n return _this6.removeRow(rowIndex, true);\n }\n }, {\n className: 'editRow',\n event: 'click',\n action: function action() {\n _this6.editRow(rowIndex).then(function () {\n if (_this6.component.rowDrafts) {\n var _this6$root;\n _this6.validateRow(editRow, false);\n var hasErrors = editRow.errors && !!editRow.errors.length;\n var shouldShowRowErrorsAlert = _this6.component.modal && hasErrors && ((_this6$root = _this6.root) === null || _this6$root === void 0 ? void 0 : _this6$root.submitted);\n if (shouldShowRowErrorsAlert) {\n _this6.alert.showErrors(editRow.errors, false);\n editRow.alerts = true;\n }\n }\n });\n }\n }, {\n className: 'row',\n event: 'click',\n action: function action() {\n row.classList.toggle('selected');\n var eventName = 'editGridSelectRow';\n if (Array.from(row.classList).includes('selected')) {\n editRow.isRowSelected = true;\n } else {\n delete editRow.isRowSelected;\n eventName = 'editGridUnSelectRow';\n }\n _this6.emit(eventName, {\n component: _this6.component,\n data: _this6.dataValue[rowIndex]\n });\n }\n }].forEach(function (_ref) {\n var className = _ref.className,\n event = _ref.event,\n action = _ref.action;\n var elements = row.getElementsByClassName(className);\n Array.prototype.forEach.call(elements, function (element) {\n _this6.addEventListener(element, event, action);\n });\n });\n }\n });\n\n // Add open class to the element if any edit grid row is open\n if (openRowCount) {\n this.addClass(this.refs.component, \"formio-component-\".concat(this.component.type, \"-row-open\"));\n } else {\n this.removeClass(this.refs.component, \"formio-component-\".concat(this.component.type, \"-row-open\"));\n }\n var superAttach = _get(_getPrototypeOf(EditGridComponent.prototype), \"attach\", this).call(this, element);\n this.loadRefs(element, {\n messageContainer: 'single-scope'\n });\n return superAttach;\n }\n }, {\n key: \"flattenRowDataValue\",\n value: function flattenRowDataValue(dataValue) {\n var _this7 = this;\n var flattened = {};\n Object.keys(dataValue).forEach(function (key) {\n if (_lodash[\"default\"].isObject(dataValue[key]) && !_lodash[\"default\"].isNil(dataValue[key])) {\n Object.assign(flattened, _this7.flattenRowDataValue(dataValue[key]));\n } else {\n flattened[key] = dataValue[key];\n }\n });\n return flattened;\n }\n }, {\n key: \"isComponentVisibleInRow\",\n value: function isComponentVisibleInRow(component, flattenedComponents) {\n var instance = flattenedComponents[component.key];\n return instance ? instance.visible : true;\n }\n }, {\n key: \"displayComponentValue\",\n value: function displayComponentValue(component, header) {\n return !!((!component.hasOwnProperty('tableView') || component.tableView) && header ? this.isComponentVisibleInSomeRow(component) : _lodash[\"default\"].includes(this.visibleInHeader, component.key));\n }\n }, {\n key: \"renderRow\",\n value: function renderRow(row, rowIndex) {\n var _this8 = this;\n var dataValue = this.dataValue;\n if (this.isOpen(row)) {\n return this.renderComponents(row.components);\n } else {\n var flattenedComponents = this.flattenComponents(rowIndex);\n var rowTemplate = this.rowTemplate;\n return this.renderString(rowTemplate, {\n row: dataValue[rowIndex] || {},\n data: this.data,\n rowIndex: rowIndex,\n components: this.component.components,\n flattenedComponents: flattenedComponents,\n displayValue: function displayValue(component) {\n return _this8.displayComponentValue(component);\n },\n isVisibleInRow: function isVisibleInRow(component) {\n return _this8.isComponentVisibleInRow(component, flattenedComponents);\n },\n getView: function getView(component, data) {\n var _instance$component, _instance$component2;\n var instance = flattenedComponents[component.key];\n var view = instance ? instance.getView(data || instance.dataValue) : '';\n\n // If there is an html tag in view, don't allow it to be injected in template\n var htmlTagRegExp = new RegExp('<(.*?)>');\n return typeof view === 'string' && view.length && !((_instance$component = instance.component) !== null && _instance$component !== void 0 && _instance$component.template) && htmlTagRegExp.test(view) && ((_instance$component2 = instance.component) === null || _instance$component2 === void 0 ? void 0 : _instance$component2.inputFormat) !== 'html' ? \"\") : view;\n },\n state: this.editRows[rowIndex].state,\n t: this.t.bind(this)\n });\n }\n }\n }, {\n key: \"eachComponent\",\n value: function eachComponent(fn, rowIndex) {\n _lodash[\"default\"].each(this.getComponents(rowIndex), function (component, index) {\n if (fn(component, index) === false) {\n return false;\n }\n });\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this9 = this;\n this.getComponents().forEach(function (component) {\n var _this9$editRows$compo;\n var rowData = _this9.dataValue[component.rowIndex];\n var editRowData = (_this9$editRows$compo = _this9.editRows[component.rowIndex]) === null || _this9$editRows$compo === void 0 ? void 0 : _this9$editRows$compo.data;\n component.data = rowData || editRowData;\n });\n }\n }, {\n key: \"flattenComponents\",\n value: function flattenComponents(rowIndex) {\n var result = {};\n this.everyComponent(function (component) {\n result[component.component.flattenAs || component.key] = component;\n }, rowIndex);\n return result;\n }\n }, {\n key: \"getComponents\",\n value: function getComponents(rowIndex) {\n // Ensure editrows is set.\n this.editRows = this.editRows || [];\n return this.builderMode ? _get(_getPrototypeOf(EditGridComponent.prototype), \"getComponents\", this).call(this) : _lodash[\"default\"].isNumber(rowIndex) ? this.editRows[rowIndex].components || [] : this.editRows.reduce(function (result, row) {\n return result.concat(row.components || []);\n }, []);\n }\n }, {\n key: \"destroyComponents\",\n value: function destroyComponents(rowIndex) {\n var _this10 = this;\n if (this.builderMode) {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"destroyComponents\", this).call(this);\n }\n var components = this.getComponents(rowIndex).slice();\n components.forEach(function (comp) {\n return _this10.removeComponent(comp, _this10.components);\n });\n }\n }, {\n key: \"createRow\",\n value: function createRow(dataObj, rowIndex) {\n var editRow = {\n components: this.createRowComponents(dataObj, rowIndex),\n data: dataObj,\n state: EditRowState.New,\n backup: null,\n error: null,\n rowIndex: rowIndex\n };\n this.editRows.push(editRow);\n if (this.inlineEditMode) {\n this.dataValue.push(dataObj);\n }\n return editRow;\n }\n }, {\n key: \"addRow\",\n value: function addRow() {\n if (this.options.readOnly) {\n return;\n }\n var dataObj = {};\n var rowIndex = this.editRows.length;\n var editRow = this.createRow(dataObj, rowIndex);\n if (this.inlineEditMode) {\n this.triggerChange();\n }\n this.emit('editGridAddRow', {\n component: this.component,\n row: editRow\n });\n this.checkRow('checkData', null, {}, editRow.data, editRow.components);\n if (this.component.modal) {\n this.addRowModal(rowIndex);\n } else {\n this.redraw();\n }\n return editRow;\n }\n }, {\n key: \"addRowModal\",\n value: function addRowModal(rowIndex) {\n var _this11 = this;\n var modalContent = this.ce('div');\n var editRow = this.editRows[rowIndex];\n editRow.willBeSaved = false;\n var components = editRow.components;\n modalContent.innerHTML = this.renderComponents(components);\n var dialog = this.component.modal ? this.createModal(modalContent, {}, function () {\n return _this11.showDialog(rowIndex);\n }) : undefined;\n dialog.classList.add(\"editgrid-row-modal-\".concat(this.id));\n editRow.dialog = dialog;\n if (this.alert) {\n this.alert.clear();\n this.alert = null;\n }\n this.alert = new _Alert[\"default\"](dialog.refs.dialogContents, this);\n this.addEventListener(dialog, 'close', function () {\n if (!editRow.willBeSaved) {\n if (_this11.editRows[rowIndex] && _this11.editRows[rowIndex].state !== EditRowState.New) {\n _this11.editRows[rowIndex].components.forEach(function (comp) {\n comp.setPristine(true);\n });\n }\n _this11.cancelRow(rowIndex);\n }\n if (_this11.alert) {\n _this11.alert.clear();\n _this11.alert = null;\n }\n\n // Remove references to dialog elements to prevent possible in some cases memory leaks\n delete editRow.confirmationDialog;\n delete editRow.dialog;\n });\n dialog.refs.dialogContents.appendChild(this.ce('button', {\n \"class\": 'btn btn-primary',\n onClick: function onClick() {\n // After an attempt to save, all the components inside the row should become not pristine\n if (!_this11.component.rowDrafts) {\n editRow.components.forEach(function (comp) {\n return comp.setPristine(false);\n });\n }\n if (_this11.validateRow(editRow, true) || _this11.component.rowDrafts) {\n editRow.willBeSaved = true;\n dialog.close();\n _this11.saveRow(rowIndex, true);\n } else {\n _this11.alert.showErrors(editRow.errors, false);\n editRow.alerts = true;\n }\n }\n }, this.component.saveRow || 'Save'));\n return this.attachComponents(modalContent, components);\n }\n }, {\n key: \"showDialog\",\n value: function showDialog(rowIndex) {\n var editRow = this.editRows[rowIndex];\n if (_lodash[\"default\"].isEqual(editRow.backup, editRow.data)) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n var wrapper = this.ce('div', {\n ref: 'confirmationDialog'\n });\n var dialogContent = this.component.dialogTemplate || this.defaultDialogTemplate;\n wrapper.innerHTML = dialogContent;\n wrapper.refs = {};\n this.loadRefs.call(wrapper, wrapper, {\n dialogHeader: 'single',\n dialogCancelButton: 'single',\n dialogYesButton: 'single'\n });\n var dialog = this.createModal(wrapper);\n dialog.classList.add(\"editgrid-row-modal-confirmation-\".concat(this.id));\n var close = function close(event) {\n event.preventDefault();\n dialog.close();\n };\n var dialogResult;\n var promise = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n dialogResult = {\n resolve: resolve,\n reject: reject\n };\n });\n this.addEventListener(wrapper.refs.dialogYesButton, 'click', function (event) {\n close(event);\n dialogResult.resolve();\n });\n this.addEventListener(wrapper.refs.dialogCancelButton, 'click', function (event) {\n close(event);\n dialogResult.reject();\n });\n editRow.confirmationDialog = dialog;\n return promise;\n }\n }, {\n key: \"editRow\",\n value: function editRow(rowIndex) {\n var editRow = this.editRows[rowIndex];\n var isAlreadyEditing = editRow.state === EditRowState.Editing || editRow.state === EditRowState.New;\n if (!editRow || isAlreadyEditing) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n editRow.prevState = editRow.state;\n editRow.state = this.options.readOnly ? EditRowState.Viewing : EditRowState.Editing;\n if (this.lazyLoad && editRow.components.length === 0) {\n editRow.components = this.createRowComponents(editRow.data, rowIndex);\n }\n var dataSnapshot = (0, _utils.fastCloneDeep)(editRow.data);\n if (this.inlineEditMode) {\n editRow.backup = dataSnapshot;\n } else {\n editRow.backup = (0, _utils.fastCloneDeep)(editRow.data);\n editRow.data = dataSnapshot;\n this.restoreRowContext(editRow);\n }\n if (this.component.modal) {\n return this.addRowModal(rowIndex);\n }\n return this.redraw();\n }\n }, {\n key: \"clearErrors\",\n value: function clearErrors(rowIndex) {\n var editRow = this.editRows[rowIndex];\n if (editRow && Array.isArray(editRow.components)) {\n editRow.components.forEach(function (comp) {\n comp.setPristine(true);\n comp.setCustomValidity('');\n });\n }\n }\n }, {\n key: \"cancelRow\",\n value: function cancelRow(rowIndex) {\n if (this.options.readOnly) {\n return;\n }\n var editRow = this.editRows[rowIndex];\n switch (editRow.state) {\n case EditRowState.New:\n {\n editRow.state = EditRowState.Removed;\n this.clearErrors(rowIndex);\n this.destroyComponents(rowIndex);\n if (this.inlineEditMode) {\n this.splice(rowIndex);\n }\n this.editRows.splice(rowIndex, 1);\n this.openWhenEmpty();\n break;\n }\n case EditRowState.Editing:\n {\n editRow.state = editRow.prevState;\n if (this.inlineEditMode) {\n this.dataValue[rowIndex] = editRow.backup;\n }\n editRow.data = editRow.backup;\n editRow.backup = null;\n this.restoreRowContext(editRow);\n this.clearErrors(rowIndex);\n break;\n }\n }\n this.emit('editGridCancelRow', {\n instance: this,\n component: this.component,\n editRow: editRow\n });\n this.checkValidity(null, true);\n this.redraw();\n if (this.component.rowDrafts) {\n this.checkValidity(this.data, false);\n }\n }\n }, {\n key: \"saveRow\",\n value: function saveRow(rowIndex, modified) {\n var _this12 = this;\n var editRow = this.editRows[rowIndex];\n if (this.options.readOnly) {\n return;\n }\n\n // After an attempt to save, all the components inside the row should become not pristine\n if (!this.component.rowDrafts) {\n editRow.components.forEach(function (comp) {\n return comp.setPristine(false);\n });\n }\n var isRowValid = this.validateRow(editRow, true);\n if (!this.component.rowDrafts) {\n if (!isRowValid) {\n return false;\n }\n }\n if (this.saveEditMode) {\n var _this$root, _this$root$focusedCom;\n var dataValue = this.dataValue;\n if ((_this$root = this.root) !== null && _this$root !== void 0 && (_this$root$focusedCom = _this$root.focusedComponent) !== null && _this$root$focusedCom !== void 0 && _this$root$focusedCom.component.typeChangeEnabled) {\n this.root.focusedComponent = null;\n }\n switch (editRow.state) {\n case EditRowState.New:\n {\n var newIndex = dataValue.length;\n dataValue.push(editRow.data);\n editRow.components.forEach(function (component) {\n return component.rowIndex = newIndex;\n });\n if (rowIndex !== newIndex) {\n this.editRows.splice(rowIndex, 1);\n this.editRows.splice(newIndex, 0, editRow);\n }\n break;\n }\n case EditRowState.Editing:\n {\n dataValue[rowIndex] = editRow.data;\n break;\n }\n }\n }\n editRow.state = this.component.rowDrafts && !isRowValid ? EditRowState.Draft : EditRowState.Saved;\n editRow.backup = null;\n this.updateValue();\n this.emit('editGridSaveRow', {\n component: this.component,\n row: editRow.data,\n instance: this\n });\n this.triggerChange({\n modified: modified,\n noPristineChangeOnModified: modified && this.component.rowDrafts,\n isolateRow: true\n });\n if (this.component.rowDrafts) {\n editRow.components.forEach(function (comp) {\n return comp.setPristine(_this12.pristine);\n });\n }\n this.checkValidity(null, true);\n this.redraw();\n if (editRow.alerts) {\n editRow.alerts = false;\n }\n return true;\n }\n }, {\n key: \"beforeFocus\",\n value: function beforeFocus(component) {\n if ('beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n var relativePath = this.getRelativePath(component.path);\n var arrayPath = (0, _utils.getArrayFromComponentPath)(relativePath);\n var rowIndex = arrayPath[0];\n var rowToEditIndex = arrayPath[0];\n this.editRows.forEach(function (row, indexInArray) {\n if (row.rowIndex === rowIndex) {\n rowToEditIndex = indexInArray;\n }\n });\n if (_lodash[\"default\"].isNumber(rowToEditIndex)) {\n this.editRow(rowToEditIndex);\n }\n }\n }, {\n key: \"updateComponentsRowIndex\",\n value: function updateComponentsRowIndex(components, rowIndex) {\n components.forEach(function (component, colIndex) {\n component.rowIndex = rowIndex;\n component.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n });\n }\n }, {\n key: \"updateRowsComponents\",\n value: function updateRowsComponents(rowIndex) {\n var _this13 = this;\n this.editRows.slice(rowIndex).forEach(function (row, index) {\n _this13.updateComponentsRowIndex(row.components, rowIndex + index);\n });\n }\n }, {\n key: \"baseRemoveRow\",\n value: function baseRemoveRow(rowIndex) {\n var editRow = this.editRows[rowIndex];\n editRow.state = EditRowState.Removed;\n this.destroyComponents(rowIndex);\n return editRow;\n }\n }, {\n key: \"removeRow\",\n value: function removeRow(rowIndex, modified) {\n if (this.options.readOnly) {\n return;\n }\n this.clearErrors(rowIndex);\n this.baseRemoveRow(rowIndex);\n this.splice(rowIndex);\n this.emit('editGridDeleteRow', {\n index: rowIndex\n });\n this.editRows.splice(rowIndex, 1);\n this.openWhenEmpty();\n this.updateRowsComponents(rowIndex);\n this.updateValue();\n this.triggerChange({\n modified: modified,\n noPristineChangeOnModified: modified && this.component.rowDrafts,\n isolateRow: true\n });\n this.checkValidity(null, true);\n this.checkData();\n this.redraw();\n }\n }, {\n key: \"createRowComponents\",\n value: function createRowComponents(row, rowIndex, recreatePartially) {\n var _this14 = this;\n var currentRowComponents = _lodash[\"default\"].get(this.editRows, \"[\".concat(rowIndex, \"].components\"), null);\n return this.component.components.map(function (col, colIndex) {\n if (recreatePartially && currentRowComponents && _this14.variableTypeComponentsIndexes.length) {\n var _currentComp$componen;\n var currentComp = currentRowComponents[colIndex];\n var shouldRecreate = _lodash[\"default\"].includes(_this14.variableTypeComponentsIndexes, colIndex) && (currentComp === null || currentComp === void 0 ? void 0 : currentComp.type) !== (currentComp === null || currentComp === void 0 ? void 0 : (_currentComp$componen = currentComp.component) === null || _currentComp$componen === void 0 ? void 0 : _currentComp$componen.type);\n if (!shouldRecreate) {\n return currentComp;\n }\n col = currentComp.component;\n }\n var column = _lodash[\"default\"].clone(col);\n var options = _lodash[\"default\"].clone(_this14.options);\n options.name += \"[\".concat(rowIndex, \"]\");\n options.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n options.onChange = function () {\n var _changed$instance$roo, _this14$root;\n var flags = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var changed = arguments.length > 1 ? arguments[1] : undefined;\n var modified = arguments.length > 2 ? arguments[2] : undefined;\n if ((_changed$instance$roo = changed.instance.root) !== null && _changed$instance$roo !== void 0 && _changed$instance$roo.id && ((_this14$root = _this14.root) === null || _this14$root === void 0 ? void 0 : _this14$root.id) !== changed.instance.root.id) {\n changed.instance.root.triggerChange(flags, changed, modified);\n } else if (!_this14.component.modal) {\n _this14.triggerRootChange(flags, changed, modified);\n }\n if (_this14.inlineEditMode) {\n return;\n }\n var editRow = _this14.editRows[rowIndex];\n if (editRow !== null && editRow !== void 0 && editRow.alerts) {\n _this14.checkData(null, _objectSpread(_objectSpread({}, flags), {}, {\n changed: changed,\n rowIndex: rowIndex\n }), _this14.data);\n } else if (editRow) {\n // If drafts allowed, perform validation silently if there was no attempt to submit a form\n var silentCheck = _this14.component.rowDrafts && !_this14.shouldValidateDraft(editRow);\n _this14.checkRow('checkData', null, _objectSpread(_objectSpread({}, flags), {}, {\n changed: changed,\n silentCheck: silentCheck\n }), editRow.data, editRow.components, silentCheck);\n }\n if (_this14.variableTypeComponentsIndexes.length) {\n _this14.checkRowVariableTypeComponents(editRow, rowIndex);\n _this14.redraw();\n }\n };\n var comp = _this14.createComponent(_lodash[\"default\"].assign({}, column, {\n row: options.row\n }), options, row, null, recreatePartially && currentRowComponents ? currentRowComponents[colIndex] : null);\n comp.rowIndex = rowIndex;\n comp.inEditGrid = true;\n return comp;\n });\n }\n }, {\n key: \"hasOpenRows\",\n value: function hasOpenRows() {\n var _this15 = this;\n return this.editRows.some(function (row) {\n return _this15.isOpen(row);\n });\n }\n }, {\n key: \"shouldValidateDraft\",\n value: function shouldValidateDraft(editRow) {\n var _this$root2, _this$root3;\n // Draft rows should be validated only when there was an attempt to submit a form\n return editRow.state === EditRowState.Draft && !this.pristine && !((_this$root2 = this.root) !== null && _this$root2 !== void 0 && _this$root2.pristine) && !this.hasOpenRows() || ((_this$root3 = this.root) === null || _this$root3 === void 0 ? void 0 : _this$root3.submitted);\n }\n }, {\n key: \"shouldValidateRow\",\n value: function shouldValidateRow(editRow, dirty) {\n return this.shouldValidateDraft(editRow) || editRow.state === EditRowState.Editing || editRow.alerts || dirty;\n }\n }, {\n key: \"validateRow\",\n value: function validateRow(editRow, dirty, forceSilentCheck) {\n var _this16 = this,\n _this$root4;\n var valid = true;\n var errorsSnapshot = _toConsumableArray(this.errors);\n if (this.shouldValidateRow(editRow, dirty)) {\n editRow.components.forEach(function (comp) {\n var silentCheck = _this16.component.rowDrafts && !_this16.shouldValidateDraft(editRow) || forceSilentCheck;\n valid &= comp.checkValidity(null, dirty, null, silentCheck);\n });\n }\n if (this.component.validate && this.component.validate.row) {\n valid = this.evaluate(this.component.validate.row, {\n valid: valid,\n row: editRow.data\n }, 'valid', true);\n if (valid.toString() !== 'true') {\n editRow.error = valid;\n valid = false;\n } else {\n editRow.error = null;\n }\n if (valid === null) {\n valid = \"Invalid row validation for \".concat(this.key);\n }\n }\n editRow.errors = !valid ? this.errors.filter(function (err) {\n return !errorsSnapshot.includes(err);\n }) : null;\n if (!this.component.rowDrafts || (_this$root4 = this.root) !== null && _this$root4 !== void 0 && _this$root4.submitted) {\n this.showRowErrorAlerts(editRow, !!valid);\n }\n return !!valid;\n }\n }, {\n key: \"showRowErrorAlerts\",\n value: function showRowErrorAlerts(editRow, valid) {\n if (editRow.alerts) {\n if (this.alert) {\n var _editRow$errors;\n if ((_editRow$errors = editRow.errors) !== null && _editRow$errors !== void 0 && _editRow$errors.length && !valid) {\n this.alert.showErrors(editRow.errors, false);\n editRow.alerts = true;\n } else {\n this.alert.clear();\n }\n }\n }\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 return this.checkComponentValidity(data, dirty, row, {\n silentCheck: silentCheck\n });\n }\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, row) {\n var _this17 = this,\n _this$errors,\n _this$root6;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var silentCheck = options.silentCheck;\n var errorsLength = this.errors.length;\n var superValid = _get(_getPrototypeOf(EditGridComponent.prototype), \"checkComponentValidity\", this).call(this, data, dirty, row, options);\n\n // If super tells us that component invalid and there is no need to update alerts, just return false\n if (!superValid && !this.alert && !this.hasOpenRows()) {\n return false;\n }\n if (this.shouldSkipValidation(data, dirty, row)) {\n return true;\n }\n var rowsValid = true;\n var rowsEditing = false;\n this.editRows.forEach(function (editRow, index) {\n // Trigger all errors on the row.\n var rowValid = _this17.validateRow(editRow, dirty, silentCheck);\n rowsValid &= rowValid;\n if (_this17.rowRefs) {\n var rowContainer = _this17.rowRefs[index];\n if (rowContainer) {\n var errorContainer = rowContainer.querySelector('.editgrid-row-error');\n if (!rowValid && errorContainer && (!_this17.component.rowDrafts || _this17.shouldValidateDraft(editRow))) {\n _this17.addClass(errorContainer, 'help-block');\n errorContainer.textContent = _this17.t(_this17.errorMessage('invalidRowError'));\n } else if (errorContainer) {\n errorContainer.textContent = '';\n }\n }\n }\n // If this is a dirty check, and any rows are still editing, we need to throw validation error.\n rowsEditing |= dirty && _this17.isOpen(editRow);\n });\n if (!rowsValid) {\n var _this$root5;\n if (!silentCheck && (!this.component.rowDrafts || (_this$root5 = this.root) !== null && _this$root5 !== void 0 && _this$root5.submitted)) {\n this.setCustomValidity(this.t(this.errorMessage('invalidRowsError')), dirty);\n // Delete this class, because otherwise all the components inside EditGrid will has red border even if they are valid\n this.removeClass(this.element, 'has-error');\n }\n return false;\n } else if (rowsEditing && this.saveEditMode) {\n this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);\n return false;\n }\n var message = this.invalid || this.invalidMessage(data, dirty);\n if (((_this$errors = this.errors) === null || _this$errors === void 0 ? void 0 : _this$errors.length) !== errorsLength && (_this$root6 = this.root) !== null && _this$root6 !== void 0 && _this$root6.submitted && !message) {\n this.setCustomValidity(message, dirty);\n this.root.showErrors();\n } else {\n this.setCustomValidity(message, dirty);\n }\n return superValid;\n }\n }, {\n key: \"changeState\",\n value: function changeState(changed, flags) {\n if (changed || flags.resetValue && this.component.modalEdit) {\n this.rebuild();\n } else {\n this.redraw();\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this18 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n value = this.defaultValue;\n }\n if (!Array.isArray(value)) {\n if (_typeof(value) === 'object') {\n value = [value];\n } else {\n return false;\n }\n }\n var changed = this.hasChanged(value, this.dataValue);\n flags.noValidate = !changed;\n if (this.parent) {\n this.parent.checkComponentConditions();\n }\n this.dataValue = value;\n // Refresh editRow data when data changes.\n this.dataValue.forEach(function (row, rowIndex) {\n var editRow = _this18.editRows[rowIndex];\n if (editRow) {\n editRow.data = row;\n _this18.restoreRowContext(editRow, flags);\n editRow.state = EditRowState.Saved;\n editRow.backup = null;\n editRow.error = null;\n } else {\n _this18.editRows[rowIndex] = {\n components: _this18.lazyLoad ? [] : _this18.createRowComponents(row, rowIndex),\n data: row,\n state: EditRowState.Saved,\n backup: null,\n error: null\n };\n }\n });\n var dataLength = this.dataValue.length;\n\n // If the last row is a new row, then do not remove it.\n if (this.editRows[dataLength] && this.editRows[dataLength].state === EditRowState.New) {\n dataLength = dataLength + 1;\n }\n this.editRows.slice(dataLength).forEach(function (editRow, index) {\n return _this18.baseRemoveRow(dataLength + index);\n });\n this.editRows = this.editRows.slice(0, dataLength);\n this.openWhenEmpty();\n this.updateOnChange(flags, changed);\n this.checkData();\n this.changeState(changed, flags);\n return changed;\n }\n }, {\n key: \"openWhenEmpty\",\n value: function openWhenEmpty() {\n var shouldBeOpened = !this.dataValue.length && this.component.openWhenEmpty;\n var hasNoRows = !this.editRows.length;\n if (hasNoRows && shouldBeOpened && !this.builderMode) {\n var dataObj = {};\n this.createRow(dataObj, 0);\n }\n }\n }, {\n key: \"restoreRowContext\",\n value: function restoreRowContext(editRow) {\n var _this19 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n editRow.components.forEach(function (component) {\n component.data = editRow.data;\n _this19.setNestedValue(component, editRow.data, flags);\n });\n }\n }, {\n key: \"emptyRows\",\n value: function emptyRows() {\n var _this20 = this;\n this.editRows.forEach(function (editRow, index) {\n return _this20.destroyComponents(index);\n });\n this.editRows = [];\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n _get(_getPrototypeOf(EditGridComponent.prototype), \"resetValue\", this).call(this);\n this.emptyRows();\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 type: 'editgrid',\n label: 'Edit Grid',\n key: 'editGrid',\n clearOnHide: true,\n input: true,\n tree: true,\n removeRow: 'Cancel',\n defaultOpen: false,\n openWhenEmpty: false,\n modal: false,\n components: [],\n inlineEdit: false,\n templates: {\n header: EditGridComponent.defaultHeaderTemplate,\n row: EditGridComponent.defaultRowTemplate,\n tableHeader: EditGridComponent.defaultTableHeaderTemplate,\n tableRow: EditGridComponent.defaultTableRowTemplate,\n footer: ''\n }\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Edit Grid',\n icon: 'tasks',\n group: 'data',\n documentation: '/userguide/form-building/data-components#edit-grid',\n weight: 30,\n schema: EditGridComponent.schema()\n };\n }\n }, {\n key: \"defaultHeaderTemplate\",\n get: function get() {\n return \"
\\n {% util.eachComponent(components, function(component) { %}\\n {% if (displayValue(component)) { %}\\n
{{ t(component.label) }}
\\n {% } %}\\n {% }) %}\\n
\";\n }\n }, {\n key: \"defaultTableHeaderTemplate\",\n get: function get() {\n 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 \";\n }\n }, {\n key: \"defaultRowTemplate\",\n get: function get() {\n 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
\";\n }\n }, {\n key: \"defaultTableRowTemplate\",\n get: function get() {\n 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 }\n }]);\n return EditGridComponent;\n}(_NestedArrayComponent2[\"default\"]);\nexports[\"default\"] = EditGridComponent;\nEditGridComponent.prototype.hasChanged = _Component[\"default\"].prototype.hasChanged;\n\n//# sourceURL=webpack://Formio/./lib/components/editgrid/EditGrid.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.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.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.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.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.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.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.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.map.js */ \"./node_modules/core-js/modules/es.array.map.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.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.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.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.object.keys.js */ \"./node_modules/core-js/modules/es.object.keys.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.regexp.constructor.js */ \"./node_modules/core-js/modules/es.regexp.constructor.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.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.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.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.splice.js */ \"./node_modules/core-js/modules/es.array.splice.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.date.to-string.js */ \"./node_modules/core-js/modules/es.date.to-string.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 _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _NestedArrayComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nestedarray/NestedArrayComponent */ \"./lib/components/_classes/nestedarray/NestedArrayComponent.js\"));\nvar _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _Alert = _interopRequireDefault(__webpack_require__(/*! ../alert/Alert */ \"./lib/components/alert/Alert.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _templates = _interopRequireDefault(__webpack_require__(/*! ./templates */ \"./lib/components/editgrid/templates/index.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 _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 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 _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nvar EditRowState = {\n New: 'new',\n Editing: 'editing',\n Saved: 'saved',\n Viewing: 'viewing',\n Removed: 'removed',\n Draft: 'draft'\n};\nvar EditGridComponent = /*#__PURE__*/function (_NestedArrayComponent) {\n _inherits(EditGridComponent, _NestedArrayComponent);\n var _super = _createSuper(EditGridComponent);\n function EditGridComponent() {\n var _this;\n _classCallCheck(this, EditGridComponent);\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 = 'editgrid';\n return _this;\n }\n _createClass(EditGridComponent, [{\n key: \"defaultDialogTemplate\",\n get: function get() {\n return \"\\n

\".concat(this.t('Do you want to clear data?'), \"

\\n
\\n \\n \\n
\\n \");\n }\n }, {\n key: \"defaultRowTemplate\",\n get: function get() {\n return this.displayAsTable ? EditGridComponent.defaultTableRowTemplate : EditGridComponent.defaultRowTemplate;\n }\n }, {\n key: \"defaultHeaderTemplate\",\n get: function get() {\n return this.displayAsTable ? EditGridComponent.defaultTableHeaderTemplate : EditGridComponent.defaultHeaderTemplate;\n }\n }, {\n key: \"rowTemplate\",\n get: function get() {\n var rowTemplate;\n if (_utils.Evaluator.noeval) {\n rowTemplate = this.displayAsTable ? _templates[\"default\"].tableRow : _templates[\"default\"].row;\n } else {\n rowTemplate = this.displayAsTable ? _lodash[\"default\"].get(this.component, 'templates.tableRow', this.defaultRowTemplate) : _lodash[\"default\"].get(this.component, 'templates.row', this.defaultRowTemplate);\n }\n return rowTemplate;\n }\n }, {\n key: \"headerTemplate\",\n get: function get() {\n var headerTemplate;\n if (_utils.Evaluator.noeval) {\n headerTemplate = this.displayAsTable ? _templates[\"default\"].tableHeader : _templates[\"default\"].header;\n } else {\n headerTemplate = this.displayAsTable ? _lodash[\"default\"].get(this.component, 'templates.tableHeader', this.defaultHeaderTemplate) : _lodash[\"default\"].get(this.component, 'templates.header', this.defaultHeaderTemplate);\n }\n return headerTemplate;\n }\n\n /**\n * Returns true if the component has nested components which don't trigger changes on the root level\n */\n }, {\n key: \"hasScopedChildren\",\n get: function get() {\n return !this.inlineEditMode;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return EditGridComponent.schema();\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return [];\n }\n }, {\n key: \"editgridKey\",\n get: function get() {\n return \"editgrid-\".concat(this.key);\n }\n }, {\n key: \"rowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-row\");\n }\n }, {\n key: \"rowElements\",\n get: function get() {\n return this.refs[this.rowRef];\n }\n }, {\n key: \"rowRefs\",\n get: function get() {\n return this.refs[\"editgrid-\".concat(this.component.key, \"-row\")];\n }\n }, {\n key: \"addRowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-addRow\");\n }\n }, {\n key: \"addRowElements\",\n get: function get() {\n return this.refs[this.addRowRef];\n }\n }, {\n key: \"saveRowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-saveRow\");\n }\n }, {\n key: \"saveRowElements\",\n get: function get() {\n return this.refs[this.saveRowRef];\n }\n }, {\n key: \"cancelRowRef\",\n get: function get() {\n return \"\".concat(this.editgridKey, \"-cancelRow\");\n }\n }, {\n key: \"cancelRowElements\",\n get: function get() {\n return this.refs[this.cancelRowRef];\n }\n }, {\n key: \"inlineEditMode\",\n get: function get() {\n return this.component.inlineEdit;\n }\n }, {\n key: \"saveEditMode\",\n get: function get() {\n return !this.inlineEditMode;\n }\n }, {\n key: \"minLength\",\n get: function get() {\n return this.builderMode ? 0 : _lodash[\"default\"].get(this.component, 'validate.minLength', 0);\n }\n }, {\n key: \"data\",\n get: function get() {\n return this._data;\n },\n set: function set(value) {\n this._data = value;\n var data = this.dataValue;\n (this.editRows || []).forEach(function (row, index) {\n if (!data[index] && row.state !== EditRowState.New) {\n data[index] = {};\n }\n var rowData = data[index] || {};\n row.data = rowData;\n row.components.forEach(function (component) {\n component.data = rowData;\n });\n });\n }\n }, {\n key: \"dataValue\",\n get: function get() {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"dataValue\", this) || [];\n },\n set: function set(value) {\n _set(_getPrototypeOf(EditGridComponent.prototype), \"dataValue\", value, this, true);\n }\n }, {\n key: \"displayAsTable\",\n get: function get() {\n return this.component.displayAsTable;\n }\n }, {\n key: \"iteratableRows\",\n get: function get() {\n return this.editRows;\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var value = _get(_getPrototypeOf(EditGridComponent.prototype), \"defaultValue\", this);\n var defaultValue = Array.isArray(value) ? value : [];\n _lodash[\"default\"].times(this.minLength - defaultValue.length, function () {\n return defaultValue.push({});\n });\n return defaultValue;\n }\n }, {\n key: \"hasRemoveButtons\",\n value: function hasRemoveButtons() {\n return !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: \"init\",\n value: function init() {\n var _this2 = this;\n if (this.builderMode) {\n this.editRows = [];\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"init\", this).call(this);\n }\n this.components = this.components || [];\n var dataValue = this.dataValue;\n var openWhenEmpty = !dataValue.length && this.component.openWhenEmpty;\n if (openWhenEmpty) {\n var dataObj = {};\n this.editRows = [];\n this.createRow(dataObj, 0);\n } else {\n this.editRows = dataValue.map(function (row, rowIndex) {\n return {\n components: _this2.lazyLoad ? [] : _this2.createRowComponents(row, rowIndex),\n data: row,\n state: EditRowState.Saved,\n backup: null,\n error: null,\n rowIndex: rowIndex\n };\n });\n }\n this.prevHasAddButton = this.hasAddButton();\n this.checkData();\n this.setVariableTypeComponents();\n if (this.variableTypeComponentsIndexes.length) {\n _lodash[\"default\"].each(this.editRows || [], function (editRow, rowIndex) {\n return _this2.checkRowVariableTypeComponents(editRow, rowIndex);\n });\n }\n }\n }, {\n key: \"checkRowVariableTypeComponents\",\n value: function checkRowVariableTypeComponents(editRow, rowIndex) {\n var rowComponents = editRow.components;\n if (_lodash[\"default\"].some(this.variableTypeComponentsIndexes, function (compIndex) {\n var variableTypeComp = rowComponents[compIndex];\n return variableTypeComp.type !== variableTypeComp.component.type;\n })) {\n editRow.components = this.createRowComponents(editRow.data, rowIndex, true);\n }\n }\n }, {\n key: \"setVariableTypeComponents\",\n value: function setVariableTypeComponents() {\n var _this3 = this;\n //set components which type is changing within a row (e.g.,by mergeComponentSchema action)\n this.variableTypeComponentsIndexes = [];\n _lodash[\"default\"].each(this.component.components, function (comp, index) {\n if (comp.typeChangeEnabled) {\n _this3.variableTypeComponentsIndexes.push(index);\n }\n });\n }\n }, {\n key: \"isOpen\",\n value: function isOpen(editRow) {\n return [EditRowState.New, EditRowState.Editing, EditRowState.Viewing].includes(editRow.state);\n }\n }, {\n key: \"isComponentVisibleInSomeRow\",\n value: function isComponentVisibleInSomeRow(component) {\n var _this4 = this;\n var rows = this.editRows;\n var savedStates = [EditRowState.Saved, EditRowState.Editing, EditRowState.Draft];\n var savedRows = rows.filter(function (row) {\n return _lodash[\"default\"].includes(savedStates, row.state);\n });\n this.visibleInHeader = this.visibleInHeader || [];\n var changeVisibleInHeader = function changeVisibleInHeader(component, isVisible) {\n if (!isVisible) {\n _lodash[\"default\"].remove(_this4.visibleInHeader, function (key) {\n return key === component.key;\n });\n }\n if (isVisible && !_lodash[\"default\"].includes(_this4.visibleInHeader, component.key)) {\n _this4.visibleInHeader.push(component.key);\n }\n };\n if (_lodash[\"default\"].isEmpty(rows)) {\n var rowComponents = this.createRowComponents({}, 0);\n var checkComponent;\n (0, _utils.eachComponent)(rowComponents, function (comp) {\n if (comp.component.key === component.key) {\n checkComponent = comp;\n }\n comp.checkConditions();\n });\n var isVisible = checkComponent ? checkComponent.visible : true;\n _toConsumableArray(this.components).forEach(function (comp) {\n return _this4.removeComponent(comp, _this4.components);\n });\n changeVisibleInHeader(component, isVisible);\n return isVisible;\n }\n var isOpenRowWhenEmpty = _lodash[\"default\"].get(this.component, 'openWhenEmpty') && rows.length === 1 && rows[0].state === EditRowState.New;\n if (!_lodash[\"default\"].isEmpty(rows) && _lodash[\"default\"].isEmpty(savedRows) && !isOpenRowWhenEmpty) {\n return _lodash[\"default\"].includes(this.visibleInHeader, component.key);\n }\n return _lodash[\"default\"].some(isOpenRowWhenEmpty ? rows : savedRows, function (row, index) {\n var editingRow = row.state === EditRowState.Editing;\n var isVisible;\n if (!editingRow) {\n var flattenedComponents = _this4.flattenComponents(index);\n var instance = flattenedComponents[component.key];\n isVisible = instance ? instance.visible : true;\n changeVisibleInHeader(component, isVisible);\n } else {\n isVisible = _lodash[\"default\"].includes(_this4.visibleInHeader, component.key);\n }\n return isVisible;\n });\n }\n }, {\n key: \"render\",\n value: function render(children) {\n var _this5 = this;\n if (this.builderMode) {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"render\", this).call(this);\n }\n var dataValue = this.dataValue;\n var headerTemplate = this.headerTemplate;\n var t = this.t.bind(this);\n var templateName = this.displayAsTable ? 'editgridTable' : 'editgrid';\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"render\", this).call(this, children || this.renderTemplate(templateName, {\n ref: {\n row: this.rowRef,\n addRow: this.addRowRef,\n saveRow: this.saveRowRef,\n cancelRow: this.cancelRowRef\n },\n header: this.renderString(headerTemplate, {\n displayValue: function displayValue(component) {\n return _this5.displayComponentValue(component, true);\n },\n components: this.component.components,\n value: dataValue,\n t: t\n }),\n footer: this.renderString(_lodash[\"default\"].get(this.component, 'templates.footer'), {\n components: this.component.components,\n value: dataValue,\n t: t\n }),\n rows: this.editRows.map(this.renderRow.bind(this)),\n openRows: this.editRows.map(function (row) {\n return _this5.isOpen(row);\n }),\n errors: this.editRows.map(function (row) {\n return row.error;\n }),\n hasAddButton: this.hasAddButton(),\n hasRemoveButtons: this.hasRemoveButtons()\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 var templateName = this.displayAsTable && this.prevHasAddButton ? 'tableComponents' : 'components';\n return this.renderTemplate(templateName, {\n children: children,\n components: components\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs,\n _this6 = this;\n if (this.builderMode) {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"attach\", this).call(this, element);\n }\n this.loadRefs(element, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, this.addRowRef, 'multiple'), _defineProperty(_this$loadRefs, this.saveRowRef, 'multiple'), _defineProperty(_this$loadRefs, this.cancelRowRef, 'multiple'), _defineProperty(_this$loadRefs, this.rowRef, 'multiple'), _this$loadRefs));\n this.addRowElements.forEach(function (addButton) {\n _this6.addEventListener(addButton, 'click', function () {\n return _this6.addRow();\n });\n });\n var openRowCount = 0;\n this.rowElements.forEach(function (row, rowIndex) {\n var editRow = _this6.editRows[rowIndex];\n if (editRow !== null && editRow !== void 0 && editRow.isRowSelected) {\n row.classList.add('selected');\n }\n if (_this6.isOpen(editRow)) {\n _this6.attachComponents(row, editRow.components);\n _this6.addEventListener(_this6.saveRowElements[openRowCount], 'click', function () {\n return _this6.saveRow(rowIndex, true);\n });\n _this6.addEventListener(_this6.cancelRowElements[openRowCount], 'click', function () {\n return _this6.cancelRow(rowIndex);\n });\n openRowCount++;\n } else {\n // Attach edit and remove button events.\n [{\n className: 'removeRow',\n event: 'click',\n action: function action() {\n return _this6.removeRow(rowIndex, true);\n }\n }, {\n className: 'editRow',\n event: 'click',\n action: function action() {\n _this6.editRow(rowIndex).then(function () {\n if (_this6.component.rowDrafts) {\n var _this6$root;\n _this6.validateRow(editRow, false);\n var hasErrors = editRow.errors && !!editRow.errors.length;\n var shouldShowRowErrorsAlert = _this6.component.modal && hasErrors && ((_this6$root = _this6.root) === null || _this6$root === void 0 ? void 0 : _this6$root.submitted);\n if (shouldShowRowErrorsAlert) {\n _this6.alert.showErrors(editRow.errors, false);\n editRow.alerts = true;\n }\n }\n });\n }\n }, {\n className: 'row',\n event: 'click',\n action: function action() {\n row.classList.toggle('selected');\n var eventName = 'editGridSelectRow';\n if (Array.from(row.classList).includes('selected')) {\n editRow.isRowSelected = true;\n } else {\n delete editRow.isRowSelected;\n eventName = 'editGridUnSelectRow';\n }\n _this6.emit(eventName, {\n component: _this6.component,\n data: _this6.dataValue[rowIndex]\n });\n }\n }].forEach(function (_ref) {\n var className = _ref.className,\n event = _ref.event,\n action = _ref.action;\n var elements = row.getElementsByClassName(className);\n Array.prototype.forEach.call(elements, function (element) {\n if (_this6.options.readOnly && _lodash[\"default\"].intersection(element.classList, ['editRow', 'removeRow']).length) {\n element.style.display = 'none';\n } else {\n _this6.addEventListener(element, event, action);\n }\n });\n });\n }\n });\n\n // Add open class to the element if any edit grid row is open\n if (openRowCount) {\n this.addClass(this.refs.component, \"formio-component-\".concat(this.component.type, \"-row-open\"));\n } else {\n this.removeClass(this.refs.component, \"formio-component-\".concat(this.component.type, \"-row-open\"));\n }\n var superAttach = _get(_getPrototypeOf(EditGridComponent.prototype), \"attach\", this).call(this, element);\n this.loadRefs(element, {\n messageContainer: 'single-scope'\n });\n return superAttach;\n }\n }, {\n key: \"flattenRowDataValue\",\n value: function flattenRowDataValue(dataValue) {\n var _this7 = this;\n var flattened = {};\n Object.keys(dataValue).forEach(function (key) {\n if (_lodash[\"default\"].isObject(dataValue[key]) && !_lodash[\"default\"].isNil(dataValue[key])) {\n Object.assign(flattened, _this7.flattenRowDataValue(dataValue[key]));\n } else {\n flattened[key] = dataValue[key];\n }\n });\n return flattened;\n }\n }, {\n key: \"isComponentVisibleInRow\",\n value: function isComponentVisibleInRow(component, flattenedComponents) {\n var instance = flattenedComponents[component.key];\n return instance ? instance.visible : true;\n }\n }, {\n key: \"displayComponentValue\",\n value: function displayComponentValue(component, header) {\n return !!((!component.hasOwnProperty('tableView') || component.tableView) && header ? this.isComponentVisibleInSomeRow(component) : _lodash[\"default\"].includes(this.visibleInHeader, component.key));\n }\n }, {\n key: \"renderRow\",\n value: function renderRow(row, rowIndex) {\n var _this8 = this;\n var dataValue = this.dataValue;\n if (this.isOpen(row)) {\n return this.renderComponents(row.components);\n } else {\n var flattenedComponents = this.flattenComponents(rowIndex);\n var rowTemplate = this.rowTemplate;\n return this.renderString(rowTemplate, {\n row: dataValue[rowIndex] || {},\n data: this.data,\n rowIndex: rowIndex,\n components: this.component.components,\n flattenedComponents: flattenedComponents,\n displayValue: function displayValue(component) {\n return _this8.displayComponentValue(component);\n },\n isVisibleInRow: function isVisibleInRow(component) {\n return _this8.isComponentVisibleInRow(component, flattenedComponents);\n },\n getView: function getView(component, data) {\n var _instance$component, _instance$component2;\n var instance = flattenedComponents[component.key];\n var view = instance ? instance.getView(data || instance.dataValue) : '';\n\n // If there is an html tag in view, don't allow it to be injected in template\n var htmlTagRegExp = new RegExp('<(.*?)>');\n return typeof view === 'string' && view.length && !((_instance$component = instance.component) !== null && _instance$component !== void 0 && _instance$component.template) && htmlTagRegExp.test(view) && ((_instance$component2 = instance.component) === null || _instance$component2 === void 0 ? void 0 : _instance$component2.inputFormat) !== 'html' ? \"\") : view;\n },\n state: this.editRows[rowIndex].state,\n t: this.t.bind(this)\n });\n }\n }\n }, {\n key: \"eachComponent\",\n value: function eachComponent(fn, rowIndex) {\n _lodash[\"default\"].each(this.getComponents(rowIndex), function (component, index) {\n if (fn(component, index) === false) {\n return false;\n }\n });\n }\n }, {\n key: \"restoreComponentsContext\",\n value: function restoreComponentsContext() {\n var _this9 = this;\n this.getComponents().forEach(function (component) {\n var _this9$editRows$compo;\n var rowData = _this9.dataValue[component.rowIndex];\n var editRowData = (_this9$editRows$compo = _this9.editRows[component.rowIndex]) === null || _this9$editRows$compo === void 0 ? void 0 : _this9$editRows$compo.data;\n component.data = rowData || editRowData;\n });\n }\n }, {\n key: \"flattenComponents\",\n value: function flattenComponents(rowIndex) {\n var result = {};\n this.everyComponent(function (component) {\n result[component.component.flattenAs || component.key] = component;\n }, rowIndex);\n return result;\n }\n }, {\n key: \"getComponents\",\n value: function getComponents(rowIndex) {\n // Ensure editrows is set.\n this.editRows = this.editRows || [];\n return this.builderMode ? _get(_getPrototypeOf(EditGridComponent.prototype), \"getComponents\", this).call(this) : _lodash[\"default\"].isNumber(rowIndex) ? this.editRows[rowIndex].components || [] : this.editRows.reduce(function (result, row) {\n return result.concat(row.components || []);\n }, []);\n }\n }, {\n key: \"destroyComponents\",\n value: function destroyComponents(rowIndex) {\n var _this10 = this;\n if (this.builderMode) {\n return _get(_getPrototypeOf(EditGridComponent.prototype), \"destroyComponents\", this).call(this);\n }\n var components = this.getComponents(rowIndex).slice();\n components.forEach(function (comp) {\n return _this10.removeComponent(comp, _this10.components);\n });\n }\n }, {\n key: \"createRow\",\n value: function createRow(dataObj, rowIndex) {\n var editRow = {\n components: this.createRowComponents(dataObj, rowIndex),\n data: dataObj,\n state: EditRowState.New,\n backup: null,\n error: null,\n rowIndex: rowIndex\n };\n this.editRows.push(editRow);\n if (this.inlineEditMode) {\n this.dataValue.push(dataObj);\n }\n return editRow;\n }\n }, {\n key: \"addRow\",\n value: function addRow() {\n if (this.options.readOnly) {\n return;\n }\n var dataObj = {};\n var rowIndex = this.editRows.length;\n var editRow = this.createRow(dataObj, rowIndex);\n if (this.inlineEditMode) {\n this.triggerChange();\n }\n this.emit('editGridAddRow', {\n component: this.component,\n row: editRow\n });\n this.checkRow('checkData', null, {}, editRow.data, editRow.components);\n if (this.component.modal) {\n this.addRowModal(rowIndex);\n } else {\n this.redraw();\n }\n return editRow;\n }\n }, {\n key: \"addRowModal\",\n value: function addRowModal(rowIndex) {\n var _this11 = this;\n var modalContent = this.ce('div');\n var editRow = this.editRows[rowIndex];\n editRow.willBeSaved = false;\n var components = editRow.components;\n modalContent.innerHTML = this.renderComponents(components);\n var dialog = this.component.modal ? this.createModal(modalContent, {}, function () {\n return _this11.showDialog(rowIndex);\n }) : undefined;\n dialog.classList.add(\"editgrid-row-modal-\".concat(this.id));\n editRow.dialog = dialog;\n if (this.alert) {\n this.alert.clear();\n this.alert = null;\n }\n this.alert = new _Alert[\"default\"](dialog.refs.dialogContents, this);\n this.addEventListener(dialog, 'close', function () {\n if (!editRow.willBeSaved) {\n if (_this11.editRows[rowIndex] && _this11.editRows[rowIndex].state !== EditRowState.New) {\n _this11.editRows[rowIndex].components.forEach(function (comp) {\n comp.setPristine(true);\n });\n }\n _this11.cancelRow(rowIndex);\n }\n if (_this11.alert) {\n _this11.alert.clear();\n _this11.alert = null;\n }\n\n // Remove references to dialog elements to prevent possible in some cases memory leaks\n delete editRow.confirmationDialog;\n delete editRow.dialog;\n });\n dialog.refs.dialogContents.appendChild(this.ce('button', {\n \"class\": 'btn btn-primary',\n onClick: function onClick() {\n // After an attempt to save, all the components inside the row should become not pristine\n if (!_this11.component.rowDrafts) {\n editRow.components.forEach(function (comp) {\n return comp.setPristine(false);\n });\n }\n if (_this11.validateRow(editRow, true) || _this11.component.rowDrafts) {\n editRow.willBeSaved = true;\n dialog.close();\n _this11.saveRow(rowIndex, true);\n } else {\n _this11.alert.showErrors(editRow.errors, false);\n editRow.alerts = true;\n }\n }\n }, this.component.saveRow || 'Save'));\n return this.attachComponents(modalContent, components);\n }\n }, {\n key: \"showDialog\",\n value: function showDialog(rowIndex) {\n var editRow = this.editRows[rowIndex];\n if (_lodash[\"default\"].isEqual(editRow.backup, editRow.data)) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n var wrapper = this.ce('div', {\n ref: 'confirmationDialog'\n });\n var dialogContent = this.component.dialogTemplate || this.defaultDialogTemplate;\n wrapper.innerHTML = dialogContent;\n wrapper.refs = {};\n this.loadRefs.call(wrapper, wrapper, {\n dialogHeader: 'single',\n dialogCancelButton: 'single',\n dialogYesButton: 'single'\n });\n var dialog = this.createModal(wrapper);\n dialog.classList.add(\"editgrid-row-modal-confirmation-\".concat(this.id));\n var close = function close(event) {\n event.preventDefault();\n dialog.close();\n };\n var dialogResult;\n var promise = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n dialogResult = {\n resolve: resolve,\n reject: reject\n };\n });\n this.addEventListener(wrapper.refs.dialogYesButton, 'click', function (event) {\n close(event);\n dialogResult.resolve();\n });\n this.addEventListener(wrapper.refs.dialogCancelButton, 'click', function (event) {\n close(event);\n dialogResult.reject();\n });\n editRow.confirmationDialog = dialog;\n return promise;\n }\n }, {\n key: \"editRow\",\n value: function editRow(rowIndex) {\n var editRow = this.editRows[rowIndex];\n var isAlreadyEditing = editRow.state === EditRowState.Editing || editRow.state === EditRowState.New;\n if (!editRow || isAlreadyEditing) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n editRow.prevState = editRow.state;\n editRow.state = this.options.readOnly ? EditRowState.Viewing : EditRowState.Editing;\n if (this.lazyLoad && editRow.components.length === 0) {\n editRow.components = this.createRowComponents(editRow.data, rowIndex);\n }\n var dataSnapshot = (0, _utils.fastCloneDeep)(editRow.data);\n if (this.inlineEditMode) {\n editRow.backup = dataSnapshot;\n } else {\n editRow.backup = (0, _utils.fastCloneDeep)(editRow.data);\n editRow.data = dataSnapshot;\n this.restoreRowContext(editRow);\n }\n if (this.component.modal) {\n return this.addRowModal(rowIndex);\n }\n return this.redraw();\n }\n }, {\n key: \"clearErrors\",\n value: function clearErrors(rowIndex) {\n var editRow = this.editRows[rowIndex];\n if (editRow && Array.isArray(editRow.components)) {\n editRow.components.forEach(function (comp) {\n comp.setPristine(true);\n comp.setCustomValidity('');\n });\n }\n }\n }, {\n key: \"cancelRow\",\n value: function cancelRow(rowIndex) {\n if (this.options.readOnly) {\n return;\n }\n var editRow = this.editRows[rowIndex];\n switch (editRow.state) {\n case EditRowState.New:\n {\n editRow.state = EditRowState.Removed;\n this.clearErrors(rowIndex);\n this.destroyComponents(rowIndex);\n if (this.inlineEditMode) {\n this.splice(rowIndex);\n }\n this.editRows.splice(rowIndex, 1);\n this.openWhenEmpty();\n break;\n }\n case EditRowState.Editing:\n {\n editRow.state = editRow.prevState;\n if (this.inlineEditMode) {\n this.dataValue[rowIndex] = editRow.backup;\n }\n editRow.data = editRow.backup;\n editRow.backup = null;\n this.restoreRowContext(editRow);\n this.clearErrors(rowIndex);\n break;\n }\n }\n this.emit('editGridCancelRow', {\n instance: this,\n component: this.component,\n editRow: editRow\n });\n this.checkValidity(null, true);\n this.redraw();\n if (this.component.rowDrafts) {\n this.checkValidity(this.data, false);\n }\n }\n }, {\n key: \"saveRow\",\n value: function saveRow(rowIndex, modified) {\n var _this12 = this;\n var editRow = this.editRows[rowIndex];\n if (this.options.readOnly) {\n return;\n }\n\n // After an attempt to save, all the components inside the row should become not pristine\n if (!this.component.rowDrafts) {\n editRow.components.forEach(function (comp) {\n return comp.setPristine(false);\n });\n }\n var isRowValid = this.validateRow(editRow, true);\n if (!this.component.rowDrafts) {\n if (!isRowValid) {\n return false;\n }\n }\n if (this.saveEditMode) {\n var _this$root, _this$root$focusedCom;\n var dataValue = this.dataValue;\n if ((_this$root = this.root) !== null && _this$root !== void 0 && (_this$root$focusedCom = _this$root.focusedComponent) !== null && _this$root$focusedCom !== void 0 && _this$root$focusedCom.component.typeChangeEnabled) {\n this.root.focusedComponent = null;\n }\n switch (editRow.state) {\n case EditRowState.New:\n {\n var newIndex = dataValue.length;\n dataValue.push(editRow.data);\n editRow.components.forEach(function (component) {\n return component.rowIndex = newIndex;\n });\n if (rowIndex !== newIndex) {\n this.editRows.splice(rowIndex, 1);\n this.editRows.splice(newIndex, 0, editRow);\n }\n break;\n }\n case EditRowState.Editing:\n {\n dataValue[rowIndex] = editRow.data;\n break;\n }\n }\n }\n editRow.state = this.component.rowDrafts && !isRowValid ? EditRowState.Draft : EditRowState.Saved;\n editRow.backup = null;\n this.updateValue();\n this.emit('editGridSaveRow', {\n component: this.component,\n row: editRow.data,\n instance: this\n });\n this.triggerChange({\n modified: modified,\n noPristineChangeOnModified: modified && this.component.rowDrafts,\n isolateRow: true\n });\n if (this.component.rowDrafts) {\n editRow.components.forEach(function (comp) {\n return comp.setPristine(_this12.pristine);\n });\n }\n this.checkValidity(null, true);\n this.redraw();\n if (editRow.alerts) {\n editRow.alerts = false;\n }\n return true;\n }\n }, {\n key: \"beforeFocus\",\n value: function beforeFocus(component) {\n if ('beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n var relativePath = this.getRelativePath(component.path);\n var arrayPath = (0, _utils.getArrayFromComponentPath)(relativePath);\n var rowIndex = arrayPath[0];\n var rowToEditIndex = arrayPath[0];\n this.editRows.forEach(function (row, indexInArray) {\n if (row.rowIndex === rowIndex) {\n rowToEditIndex = indexInArray;\n }\n });\n if (_lodash[\"default\"].isNumber(rowToEditIndex)) {\n this.editRow(rowToEditIndex);\n }\n }\n }, {\n key: \"updateComponentsRowIndex\",\n value: function updateComponentsRowIndex(components, rowIndex) {\n components.forEach(function (component, colIndex) {\n component.rowIndex = rowIndex;\n component.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n });\n }\n }, {\n key: \"updateRowsComponents\",\n value: function updateRowsComponents(rowIndex) {\n var _this13 = this;\n this.editRows.slice(rowIndex).forEach(function (row, index) {\n _this13.updateComponentsRowIndex(row.components, rowIndex + index);\n });\n }\n }, {\n key: \"baseRemoveRow\",\n value: function baseRemoveRow(rowIndex) {\n var editRow = this.editRows[rowIndex];\n editRow.state = EditRowState.Removed;\n this.destroyComponents(rowIndex);\n return editRow;\n }\n }, {\n key: \"removeRow\",\n value: function removeRow(rowIndex, modified) {\n if (this.options.readOnly) {\n return;\n }\n this.clearErrors(rowIndex);\n this.baseRemoveRow(rowIndex);\n this.splice(rowIndex);\n this.emit('editGridDeleteRow', {\n index: rowIndex\n });\n this.editRows.splice(rowIndex, 1);\n this.openWhenEmpty();\n this.updateRowsComponents(rowIndex);\n this.updateValue();\n this.triggerChange({\n modified: modified,\n noPristineChangeOnModified: modified && this.component.rowDrafts,\n isolateRow: true\n });\n this.checkValidity(null, true);\n this.checkData();\n this.redraw();\n }\n }, {\n key: \"createRowComponents\",\n value: function createRowComponents(row, rowIndex, recreatePartially) {\n var _this14 = this;\n var currentRowComponents = _lodash[\"default\"].get(this.editRows, \"[\".concat(rowIndex, \"].components\"), null);\n return this.component.components.map(function (col, colIndex) {\n if (recreatePartially && currentRowComponents && _this14.variableTypeComponentsIndexes.length) {\n var _currentComp$componen;\n var currentComp = currentRowComponents[colIndex];\n var shouldRecreate = _lodash[\"default\"].includes(_this14.variableTypeComponentsIndexes, colIndex) && (currentComp === null || currentComp === void 0 ? void 0 : currentComp.type) !== (currentComp === null || currentComp === void 0 ? void 0 : (_currentComp$componen = currentComp.component) === null || _currentComp$componen === void 0 ? void 0 : _currentComp$componen.type);\n if (!shouldRecreate) {\n return currentComp;\n }\n col = currentComp.component;\n }\n var column = _lodash[\"default\"].clone(col);\n var options = _lodash[\"default\"].clone(_this14.options);\n options.name += \"[\".concat(rowIndex, \"]\");\n options.row = \"\".concat(rowIndex, \"-\").concat(colIndex);\n options.onChange = function () {\n var _changed$instance$roo, _this14$root;\n var flags = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var changed = arguments.length > 1 ? arguments[1] : undefined;\n var modified = arguments.length > 2 ? arguments[2] : undefined;\n if ((_changed$instance$roo = changed.instance.root) !== null && _changed$instance$roo !== void 0 && _changed$instance$roo.id && ((_this14$root = _this14.root) === null || _this14$root === void 0 ? void 0 : _this14$root.id) !== changed.instance.root.id) {\n changed.instance.root.triggerChange(flags, changed, modified);\n } else if (!_this14.component.modal) {\n _this14.triggerRootChange(flags, changed, modified);\n }\n if (_this14.inlineEditMode) {\n return;\n }\n var editRow = _this14.editRows[rowIndex];\n if (editRow !== null && editRow !== void 0 && editRow.alerts) {\n _this14.checkData(null, _objectSpread(_objectSpread({}, flags), {}, {\n changed: changed,\n rowIndex: rowIndex\n }), _this14.data);\n } else if (editRow) {\n // If drafts allowed, perform validation silently if there was no attempt to submit a form\n var silentCheck = _this14.component.rowDrafts && !_this14.shouldValidateDraft(editRow);\n _this14.checkRow('checkData', null, _objectSpread(_objectSpread({}, flags), {}, {\n changed: changed,\n silentCheck: silentCheck\n }), editRow.data, editRow.components, silentCheck);\n }\n if (_this14.variableTypeComponentsIndexes.length) {\n _this14.checkRowVariableTypeComponents(editRow, rowIndex);\n _this14.redraw();\n }\n };\n var comp = _this14.createComponent(_lodash[\"default\"].assign({}, column, {\n row: options.row\n }), options, row, null, recreatePartially && currentRowComponents ? currentRowComponents[colIndex] : null);\n comp.rowIndex = rowIndex;\n comp.inEditGrid = true;\n return comp;\n });\n }\n }, {\n key: \"hasOpenRows\",\n value: function hasOpenRows() {\n var _this15 = this;\n return this.editRows.some(function (row) {\n return _this15.isOpen(row);\n });\n }\n }, {\n key: \"shouldValidateDraft\",\n value: function shouldValidateDraft(editRow) {\n var _this$root2, _this$root3;\n // Draft rows should be validated only when there was an attempt to submit a form\n return editRow.state === EditRowState.Draft && !this.pristine && !((_this$root2 = this.root) !== null && _this$root2 !== void 0 && _this$root2.pristine) && !this.hasOpenRows() || ((_this$root3 = this.root) === null || _this$root3 === void 0 ? void 0 : _this$root3.submitted);\n }\n }, {\n key: \"shouldValidateRow\",\n value: function shouldValidateRow(editRow, dirty) {\n return this.shouldValidateDraft(editRow) || editRow.state === EditRowState.Editing || editRow.alerts || dirty;\n }\n }, {\n key: \"validateRow\",\n value: function validateRow(editRow, dirty, forceSilentCheck) {\n var _this16 = this,\n _this$root4;\n var valid = true;\n var errorsSnapshot = _toConsumableArray(this.errors);\n if (this.shouldValidateRow(editRow, dirty)) {\n editRow.components.forEach(function (comp) {\n var silentCheck = _this16.component.rowDrafts && !_this16.shouldValidateDraft(editRow) || forceSilentCheck;\n valid &= comp.checkValidity(null, dirty, null, silentCheck);\n });\n }\n if (this.component.validate && this.component.validate.row) {\n valid = this.evaluate(this.component.validate.row, {\n valid: valid,\n row: editRow.data\n }, 'valid', true);\n if (valid.toString() !== 'true') {\n editRow.error = valid;\n valid = false;\n } else {\n editRow.error = null;\n }\n if (valid === null) {\n valid = \"Invalid row validation for \".concat(this.key);\n }\n }\n editRow.errors = !valid ? this.errors.filter(function (err) {\n return !errorsSnapshot.includes(err);\n }) : null;\n if (!this.component.rowDrafts || (_this$root4 = this.root) !== null && _this$root4 !== void 0 && _this$root4.submitted) {\n this.showRowErrorAlerts(editRow, !!valid);\n }\n return !!valid;\n }\n }, {\n key: \"showRowErrorAlerts\",\n value: function showRowErrorAlerts(editRow, valid) {\n if (editRow.alerts) {\n if (this.alert) {\n var _editRow$errors;\n if ((_editRow$errors = editRow.errors) !== null && _editRow$errors !== void 0 && _editRow$errors.length && !valid) {\n this.alert.showErrors(editRow.errors, false);\n editRow.alerts = true;\n } else {\n this.alert.clear();\n }\n }\n }\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 return this.checkComponentValidity(data, dirty, row, {\n silentCheck: silentCheck\n });\n }\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, row) {\n var _this17 = this,\n _this$errors,\n _this$root6;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var silentCheck = options.silentCheck;\n var errorsLength = this.errors.length;\n var superValid = _get(_getPrototypeOf(EditGridComponent.prototype), \"checkComponentValidity\", this).call(this, data, dirty, row, options);\n\n // If super tells us that component invalid and there is no need to update alerts, just return false\n if (!superValid && !this.alert && !this.hasOpenRows()) {\n return false;\n }\n if (this.shouldSkipValidation(data, dirty, row)) {\n return true;\n }\n var rowsValid = true;\n var rowsEditing = false;\n this.editRows.forEach(function (editRow, index) {\n // Trigger all errors on the row.\n var rowValid = _this17.validateRow(editRow, dirty, silentCheck);\n rowsValid &= rowValid;\n if (_this17.rowRefs) {\n var rowContainer = _this17.rowRefs[index];\n if (rowContainer) {\n var errorContainer = rowContainer.querySelector('.editgrid-row-error');\n if (!rowValid && errorContainer && (!_this17.component.rowDrafts || _this17.shouldValidateDraft(editRow))) {\n _this17.addClass(errorContainer, 'help-block');\n errorContainer.textContent = _this17.t(_this17.errorMessage('invalidRowError'));\n } else if (errorContainer) {\n errorContainer.textContent = '';\n }\n }\n }\n // If this is a dirty check, and any rows are still editing, we need to throw validation error.\n rowsEditing |= dirty && _this17.isOpen(editRow);\n });\n if (!rowsValid) {\n var _this$root5;\n if (!silentCheck && (!this.component.rowDrafts || (_this$root5 = this.root) !== null && _this$root5 !== void 0 && _this$root5.submitted)) {\n this.setCustomValidity(this.t(this.errorMessage('invalidRowsError')), dirty);\n // Delete this class, because otherwise all the components inside EditGrid will has red border even if they are valid\n this.removeClass(this.element, 'has-error');\n }\n return false;\n } else if (rowsEditing && this.saveEditMode) {\n this.setCustomValidity(this.t(this.errorMessage('unsavedRowsError')), dirty);\n return false;\n }\n var message = this.invalid || this.invalidMessage(data, dirty);\n if (((_this$errors = this.errors) === null || _this$errors === void 0 ? void 0 : _this$errors.length) !== errorsLength && (_this$root6 = this.root) !== null && _this$root6 !== void 0 && _this$root6.submitted && !message) {\n this.setCustomValidity(message, dirty);\n this.root.showErrors();\n } else {\n this.setCustomValidity(message, dirty);\n }\n return superValid;\n }\n }, {\n key: \"changeState\",\n value: function changeState(changed, flags) {\n if (changed || flags.resetValue && this.component.modalEdit) {\n this.rebuild();\n } else {\n this.redraw();\n }\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this18 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n value = this.defaultValue;\n }\n if (!Array.isArray(value)) {\n if (_typeof(value) === 'object') {\n value = [value];\n } else {\n return false;\n }\n }\n var changed = this.hasChanged(value, this.dataValue);\n flags.noValidate = !changed;\n if (this.parent) {\n this.parent.checkComponentConditions();\n }\n this.dataValue = value;\n // Refresh editRow data when data changes.\n this.dataValue.forEach(function (row, rowIndex) {\n var editRow = _this18.editRows[rowIndex];\n if (editRow) {\n editRow.data = row;\n _this18.restoreRowContext(editRow, flags);\n editRow.state = EditRowState.Saved;\n editRow.backup = null;\n editRow.error = null;\n } else {\n _this18.editRows[rowIndex] = {\n components: _this18.lazyLoad ? [] : _this18.createRowComponents(row, rowIndex),\n data: row,\n state: EditRowState.Saved,\n backup: null,\n error: null\n };\n }\n });\n var dataLength = this.dataValue.length;\n\n // If the last row is a new row, then do not remove it.\n if (this.editRows[dataLength] && this.editRows[dataLength].state === EditRowState.New) {\n dataLength = dataLength + 1;\n }\n this.editRows.slice(dataLength).forEach(function (editRow, index) {\n return _this18.baseRemoveRow(dataLength + index);\n });\n this.editRows = this.editRows.slice(0, dataLength);\n this.openWhenEmpty();\n this.updateOnChange(flags, changed);\n this.checkData();\n this.changeState(changed, flags);\n return changed;\n }\n }, {\n key: \"openWhenEmpty\",\n value: function openWhenEmpty() {\n var shouldBeOpened = !this.dataValue.length && this.component.openWhenEmpty;\n var hasNoRows = !this.editRows.length;\n if (hasNoRows && shouldBeOpened && !this.builderMode) {\n var dataObj = {};\n this.createRow(dataObj, 0);\n }\n }\n }, {\n key: \"restoreRowContext\",\n value: function restoreRowContext(editRow) {\n var _this19 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n editRow.components.forEach(function (component) {\n component.data = editRow.data;\n _this19.setNestedValue(component, editRow.data, flags);\n });\n }\n }, {\n key: \"emptyRows\",\n value: function emptyRows() {\n var _this20 = this;\n this.editRows.forEach(function (editRow, index) {\n return _this20.destroyComponents(index);\n });\n this.editRows = [];\n }\n }, {\n key: \"resetValue\",\n value: function resetValue() {\n _get(_getPrototypeOf(EditGridComponent.prototype), \"resetValue\", this).call(this);\n this.emptyRows();\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 type: 'editgrid',\n label: 'Edit Grid',\n key: 'editGrid',\n clearOnHide: true,\n input: true,\n tree: true,\n removeRow: 'Cancel',\n defaultOpen: false,\n openWhenEmpty: false,\n modal: false,\n components: [],\n inlineEdit: false,\n templates: {\n header: EditGridComponent.defaultHeaderTemplate,\n row: EditGridComponent.defaultRowTemplate,\n tableHeader: EditGridComponent.defaultTableHeaderTemplate,\n tableRow: EditGridComponent.defaultTableRowTemplate,\n footer: ''\n }\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Edit Grid',\n icon: 'tasks',\n group: 'data',\n documentation: '/userguide/form-building/data-components#edit-grid',\n showPreview: false,\n weight: 30,\n schema: EditGridComponent.schema()\n };\n }\n }, {\n key: \"defaultHeaderTemplate\",\n get: function get() {\n return \"
\\n {% util.eachComponent(components, function(component) { %}\\n {% if (displayValue(component)) { %}\\n
{{ t(component.label) }}
\\n {% } %}\\n {% }) %}\\n
\";\n }\n }, {\n key: \"defaultTableHeaderTemplate\",\n get: function get() {\n 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 \";\n }\n }, {\n key: \"defaultRowTemplate\",\n get: function get() {\n 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
\";\n }\n }, {\n key: \"defaultTableRowTemplate\",\n get: function get() {\n 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 }\n }]);\n return EditGridComponent;\n}(_NestedArrayComponent2[\"default\"]);\nexports[\"default\"] = EditGridComponent;\nEditGridComponent.prototype.hasChanged = _Component[\"default\"].prototype.hasChanged;\n\n//# sourceURL=webpack://Formio/./lib/components/editgrid/EditGrid.js?"); /***/ }), @@ -1212,7 +1212,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.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.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.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 _NestedComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.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 _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 FieldsetComponent = /*#__PURE__*/function (_NestedComponent) {\n _inherits(FieldsetComponent, _NestedComponent);\n var _super = _createSuper(FieldsetComponent);\n function FieldsetComponent() {\n var _this;\n _classCallCheck(this, FieldsetComponent);\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.noField = true;\n return _this;\n }\n _createClass(FieldsetComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return FieldsetComponent.schema();\n }\n }, {\n key: \"className\",\n get: function get() {\n return \"\".concat(this.transform('class', 'form-group'), \" \").concat(_get(_getPrototypeOf(FieldsetComponent.prototype), \"className\", this));\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'fieldset';\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 _NestedComponent2[\"default\"].schema.apply(_NestedComponent2[\"default\"], [{\n label: 'Field Set',\n key: 'fieldSet',\n type: 'fieldset',\n legend: '',\n components: [],\n input: false,\n persistent: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Field Set',\n icon: 'th-large',\n group: 'layout',\n documentation: '/userguide/form-building/layout-components#field-set',\n weight: 20,\n schema: FieldsetComponent.schema()\n };\n }\n }]);\n return FieldsetComponent;\n}(_NestedComponent2[\"default\"]);\nexports[\"default\"] = FieldsetComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/fieldset/Fieldset.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.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.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.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.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.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 _NestedComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.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 _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 FieldsetComponent = /*#__PURE__*/function (_NestedComponent) {\n _inherits(FieldsetComponent, _NestedComponent);\n var _super = _createSuper(FieldsetComponent);\n function FieldsetComponent() {\n var _this;\n _classCallCheck(this, FieldsetComponent);\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.noField = true;\n return _this;\n }\n _createClass(FieldsetComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return FieldsetComponent.schema();\n }\n }, {\n key: \"className\",\n get: function get() {\n return \"\".concat(this.transform('class', 'form-group'), \" \").concat(_get(_getPrototypeOf(FieldsetComponent.prototype), \"className\", this));\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'fieldset';\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 _NestedComponent2[\"default\"].schema.apply(_NestedComponent2[\"default\"], [{\n label: 'Field Set',\n key: 'fieldSet',\n type: 'fieldset',\n legend: '',\n components: [],\n input: false,\n persistent: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Field Set',\n icon: 'th-large',\n group: 'layout',\n documentation: '/userguide/form-building/layout-components#field-set',\n showPreview: false,\n weight: 20,\n schema: FieldsetComponent.schema()\n };\n }\n }]);\n return FieldsetComponent;\n}(_NestedComponent2[\"default\"]);\nexports[\"default\"] = FieldsetComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/fieldset/Fieldset.js?"); /***/ }), @@ -1245,7 +1245,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.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\");\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.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.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.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.symbol.async-iterator.js */ \"./node_modules/core-js/modules/es.symbol.async-iterator.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-string-tag.js */ \"./node_modules/core-js/modules/es.symbol.to-string-tag.js\");\n__webpack_require__(/*! core-js/modules/es.json.to-string-tag.js */ \"./node_modules/core-js/modules/es.json.to-string-tag.js\");\n__webpack_require__(/*! core-js/modules/es.math.to-string-tag.js */ \"./node_modules/core-js/modules/es.math.to-string-tag.js\");\n__webpack_require__(/*! core-js/modules/es.array.reverse.js */ \"./node_modules/core-js/modules/es.array.reverse.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\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/web.timers.js */ \"./node_modules/core-js/modules/web.timers.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.array-buffer.slice.js */ \"./node_modules/core-js/modules/es.array-buffer.slice.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.typed-array.uint8-array.js */ \"./node_modules/core-js/modules/es.typed-array.uint8-array.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.copy-within.js */ \"./node_modules/core-js/modules/es.typed-array.copy-within.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.every.js */ \"./node_modules/core-js/modules/es.typed-array.every.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.fill.js */ \"./node_modules/core-js/modules/es.typed-array.fill.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.filter.js */ \"./node_modules/core-js/modules/es.typed-array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.find.js */ \"./node_modules/core-js/modules/es.typed-array.find.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.find-index.js */ \"./node_modules/core-js/modules/es.typed-array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.for-each.js */ \"./node_modules/core-js/modules/es.typed-array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.includes.js */ \"./node_modules/core-js/modules/es.typed-array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.index-of.js */ \"./node_modules/core-js/modules/es.typed-array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.iterator.js */ \"./node_modules/core-js/modules/es.typed-array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.join.js */ \"./node_modules/core-js/modules/es.typed-array.join.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.last-index-of.js */ \"./node_modules/core-js/modules/es.typed-array.last-index-of.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.map.js */ \"./node_modules/core-js/modules/es.typed-array.map.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.reduce.js */ \"./node_modules/core-js/modules/es.typed-array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.reduce-right.js */ \"./node_modules/core-js/modules/es.typed-array.reduce-right.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.reverse.js */ \"./node_modules/core-js/modules/es.typed-array.reverse.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.set.js */ \"./node_modules/core-js/modules/es.typed-array.set.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.slice.js */ \"./node_modules/core-js/modules/es.typed-array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.some.js */ \"./node_modules/core-js/modules/es.typed-array.some.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.sort.js */ \"./node_modules/core-js/modules/es.typed-array.sort.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.subarray.js */ \"./node_modules/core-js/modules/es.typed-array.subarray.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.to-locale-string.js */ \"./node_modules/core-js/modules/es.typed-array.to-locale-string.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.to-string.js */ \"./node_modules/core-js/modules/es.typed-array.to-string.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.map.js */ \"./node_modules/core-js/modules/es.array.map.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/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.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.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.date.now.js */ \"./node_modules/core-js/modules/es.date.now.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.string.trim.js */ \"./node_modules/core-js/modules/es.string.trim.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.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.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.number.to-fixed.js */ \"./node_modules/core-js/modules/es.number.to-fixed.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.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.search.js */ \"./node_modules/core-js/modules/es.string.search.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.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.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/esnext.string.replace-all.js */ \"./node_modules/core-js/modules/esnext.string.replace-all.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.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.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _downloadjs = _interopRequireDefault(__webpack_require__(/*! downloadjs */ \"./node_modules/downloadjs/download.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _fileProcessor = _interopRequireDefault(__webpack_require__(/*! ../../providers/processor/fileProcessor */ \"./lib/providers/processor/fileProcessor.js\"));\nvar _browserMd5File = _interopRequireDefault(__webpack_require__(/*! browser-md5-file */ \"./node_modules/browser-md5-file/dist/index.umd.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, \"throw\" === methodName && delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method) || \"return\" !== methodName && (context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a '\" + methodName + \"' method\")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\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 Camera;\nvar webViewCamera = navigator.camera || Camera;\n\n// canvas.toBlob polyfill.\n\nvar htmlCanvasElement;\nif (typeof window !== 'undefined') {\n htmlCanvasElement = window.HTMLCanvasElement;\n} else if (typeof __webpack_require__.g !== 'undefined') {\n htmlCanvasElement = __webpack_require__.g.HTMLCanvasElement;\n}\nif (htmlCanvasElement && !htmlCanvasElement.prototype.toBlob) {\n Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {\n value: function value(callback, type, quality) {\n var canvas = this;\n setTimeout(function () {\n var binStr = atob(canvas.toDataURL(type, quality).split(',')[1]),\n len = binStr.length,\n arr = new Uint8Array(len);\n for (var i = 0; i < len; i++) {\n arr[i] = binStr.charCodeAt(i);\n }\n callback(new Blob([arr], {\n type: type || 'image/png'\n }));\n });\n }\n });\n}\nvar FileComponent = /*#__PURE__*/function (_Field) {\n _inherits(FileComponent, _Field);\n var _super = _createSuper(FileComponent);\n function FileComponent() {\n _classCallCheck(this, FileComponent);\n return _super.apply(this, arguments);\n }\n _createClass(FileComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(FileComponent.prototype), \"init\", this).call(this);\n webViewCamera = navigator.camera || Camera;\n var fileReaderSupported = typeof FileReader !== 'undefined';\n var formDataSupported = typeof window !== 'undefined' ? Boolean(window.FormData) : false;\n var progressSupported = typeof window !== 'undefined' && window.XMLHttpRequest ? 'upload' in new XMLHttpRequest() : false;\n this.support = {\n filereader: fileReaderSupported,\n formdata: formDataSupported,\n hasWarning: !fileReaderSupported || !formDataSupported || !progressSupported,\n progress: progressSupported\n };\n this.cameraMode = false;\n this.statuses = [];\n this.fileDropHidden = false;\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n return this.filesReady || _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return FileComponent.schema();\n }\n }, {\n key: \"loadImage\",\n value: function loadImage(fileInfo) {\n if (this.component.privateDownload) {\n fileInfo[\"private\"] = true;\n }\n return this.fileService.downloadFile(fileInfo).then(function (result) {\n return result.url;\n });\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return [];\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (_lodash[\"default\"].isArray(value)) {\n return _lodash[\"default\"].map(value, 'originalName').join(', ');\n }\n return _lodash[\"default\"].get(value, 'originalName', '');\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.dataValue;\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var value = _get(_getPrototypeOf(FileComponent.prototype), \"defaultValue\", this);\n return Array.isArray(value) ? value : [];\n }\n }, {\n key: \"hasTypes\",\n get: function get() {\n return this.component.fileTypes && Array.isArray(this.component.fileTypes) && this.component.fileTypes.length !== 0 && (this.component.fileTypes[0].label !== '' || this.component.fileTypes[0].value !== '');\n }\n }, {\n key: \"fileDropHidden\",\n get: function get() {\n return this._fileBrowseHidden;\n },\n set: function set(value) {\n if (typeof value !== 'boolean' || this.component.multiple) {\n return;\n }\n this._fileBrowseHidden = value;\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(FileComponent.prototype), \"render\", this).call(this, this.renderTemplate('file', {\n fileSize: this.fileSize,\n files: this.dataValue || [],\n statuses: this.statuses,\n disabled: this.disabled,\n support: this.support,\n fileDropHidden: this.fileDropHidden\n }));\n }\n }, {\n key: \"getVideoStream\",\n value: function getVideoStream(constraints) {\n return navigator.mediaDevices.getUserMedia({\n video: _objectSpread({\n width: {\n min: 640,\n ideal: 1920\n },\n height: {\n min: 360,\n ideal: 1080\n },\n aspectRatio: {\n ideal: 16 / 9\n }\n }, constraints),\n audio: false\n });\n }\n }, {\n key: \"stopVideoStream\",\n value: function stopVideoStream(videoStream) {\n videoStream.getVideoTracks().forEach(function (track) {\n return track.stop();\n });\n }\n }, {\n key: \"getFrame\",\n value: function getFrame(videoPlayer) {\n return new _nativePromiseOnly[\"default\"](function (resolve) {\n var canvas = document.createElement('canvas');\n canvas.height = videoPlayer.videoHeight;\n canvas.width = videoPlayer.videoWidth;\n var context = canvas.getContext('2d');\n context.drawImage(videoPlayer, 0, 0);\n canvas.toBlob(resolve);\n });\n }\n }, {\n key: \"startVideo\",\n value: function startVideo() {\n var _this = this;\n this.getVideoStream().then(function (stream) {\n _this.videoStream = stream;\n var videoPlayer = _this.refs.videoPlayer;\n if (!videoPlayer) {\n console.warn('Video player not found in template.');\n _this.cameraMode = false;\n _this.redraw();\n return;\n }\n videoPlayer.srcObject = stream;\n var width = parseInt(_this.component.webcamSize) || 320;\n videoPlayer.setAttribute('width', width);\n videoPlayer.play();\n })[\"catch\"](function (err) {\n console.error(err);\n _this.cameraMode = false;\n _this.redraw();\n });\n }\n }, {\n key: \"stopVideo\",\n value: function stopVideo() {\n if (this.videoStream) {\n this.stopVideoStream(this.videoStream);\n this.videoStream = null;\n }\n }\n }, {\n key: \"takePicture\",\n value: function takePicture() {\n var _this2 = this;\n var videoPlayer = this.refs.videoPlayer;\n if (!videoPlayer) {\n console.warn('Video player not found in template.');\n this.cameraMode = false;\n this.redraw();\n return;\n }\n this.getFrame(videoPlayer).then(function (frame) {\n frame.name = \"photo-\".concat(Date.now(), \".png\");\n _this2.upload([frame]);\n _this2.cameraMode = false;\n _this2.redraw();\n });\n }\n }, {\n key: \"browseFiles\",\n value: function browseFiles() {\n var _this3 = this;\n var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return new _nativePromiseOnly[\"default\"](function (resolve) {\n var fileInput = _this3.ce('input', _objectSpread({\n type: 'file',\n style: 'height: 0; width: 0; visibility: hidden;',\n tabindex: '-1'\n }, attrs));\n document.body.appendChild(fileInput);\n fileInput.addEventListener('change', function () {\n resolve(fileInput.files);\n document.body.removeChild(fileInput);\n }, true);\n\n // There is no direct way to trigger a file dialog. To work around this, create an input of type file and trigger\n // a click event on it.\n if (typeof fileInput.trigger === 'function') {\n fileInput.trigger('click');\n } else {\n fileInput.click();\n }\n });\n }\n }, {\n key: \"cameraMode\",\n get: function get() {\n return this._cameraMode;\n },\n set: function set(value) {\n this._cameraMode = value;\n if (value) {\n this.startVideo();\n } else {\n this.stopVideo();\n }\n }\n }, {\n key: \"useWebViewCamera\",\n get: function get() {\n return this.imageUpload && webViewCamera;\n }\n }, {\n key: \"imageUpload\",\n get: function get() {\n return Boolean(this.component.image);\n }\n }, {\n key: \"browseOptions\",\n get: function get() {\n var options = {};\n if (this.component.multiple) {\n options.multiple = true;\n }\n //use \"accept\" attribute only for desktop devices because of its limited support by mobile browsers\n if (!this.isMobile.any) {\n var filePattern = this.component.filePattern.trim() || '';\n var imagesPattern = 'image/*';\n if (this.imageUpload && (!filePattern || filePattern === '*')) {\n options.accept = imagesPattern;\n } else if (this.imageUpload && !filePattern.includes(imagesPattern)) {\n options.accept = \"\".concat(imagesPattern, \",\").concat(filePattern);\n } else {\n options.accept = filePattern;\n }\n }\n return options;\n }\n }, {\n key: \"deleteFile\",\n value: function deleteFile(fileInfo) {\n var _this$component$optio = this.component.options,\n options = _this$component$optio === void 0 ? {} : _this$component$optio;\n if (fileInfo && ['url', 'indexeddb'].includes(this.component.storage)) {\n var fileService = this.fileService;\n if (fileService && typeof fileService.deleteFile === 'function') {\n fileService.deleteFile(fileInfo, options);\n } else {\n var formio = this.options.formio || this.root && this.root.formio;\n if (formio) {\n formio.makeRequest('', fileInfo.url, 'delete');\n }\n }\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this4 = this;\n this.loadRefs(element, {\n fileDrop: 'single',\n fileBrowse: 'single',\n galleryButton: 'single',\n cameraButton: 'single',\n takePictureButton: 'single',\n toggleCameraMode: 'single',\n videoPlayer: 'single',\n fileLink: 'multiple',\n removeLink: 'multiple',\n fileStatusRemove: 'multiple',\n fileImage: 'multiple',\n fileType: 'multiple',\n fileProcessingLoader: 'single'\n });\n // Ensure we have an empty input refs. We need this for the setValue method to redraw the control when it is set.\n this.refs.input = [];\n var superAttach = _get(_getPrototypeOf(FileComponent.prototype), \"attach\", this).call(this, element);\n if (this.refs.fileDrop) {\n if (!this.statuses.length) {\n this.refs.fileDrop.removeAttribute('hidden');\n }\n var _element = this;\n this.addEventListener(this.refs.fileDrop, 'dragover', function (event) {\n this.className = 'fileSelector fileDragOver';\n event.preventDefault();\n });\n this.addEventListener(this.refs.fileDrop, 'dragleave', function (event) {\n this.className = 'fileSelector';\n event.preventDefault();\n });\n this.addEventListener(this.refs.fileDrop, 'drop', function (event) {\n this.className = 'fileSelector';\n event.preventDefault();\n _element.upload(event.dataTransfer.files);\n });\n }\n if (this.refs.fileBrowse) {\n this.addEventListener(this.refs.fileBrowse, 'click', function (event) {\n event.preventDefault();\n _this4.browseFiles(_this4.browseOptions).then(function (files) {\n _this4.upload(files);\n });\n });\n }\n this.refs.fileLink.forEach(function (fileLink, index) {\n _this4.addEventListener(fileLink, 'click', function (event) {\n event.preventDefault();\n _this4.getFile(_this4.dataValue[index]);\n });\n });\n this.refs.removeLink.forEach(function (removeLink, index) {\n _this4.addEventListener(removeLink, 'click', function (event) {\n var fileInfo = _this4.dataValue[index];\n _this4.deleteFile(fileInfo);\n event.preventDefault();\n _this4.splice(index);\n _this4.redraw();\n });\n });\n this.refs.fileStatusRemove.forEach(function (fileStatusRemove, index) {\n _this4.addEventListener(fileStatusRemove, 'click', function (event) {\n event.preventDefault();\n if (_this4.abortUpload) {\n _this4.abortUpload();\n }\n _this4.statuses.splice(index, 1);\n _this4.redraw();\n });\n });\n if (this.refs.galleryButton && webViewCamera) {\n this.addEventListener(this.refs.galleryButton, 'click', function (event) {\n event.preventDefault();\n webViewCamera.getPicture(function (success) {\n window.resolveLocalFileSystemURL(success, function (fileEntry) {\n fileEntry.file(function (file) {\n var reader = new FileReader();\n reader.onloadend = function (evt) {\n var blob = new Blob([new Uint8Array(evt.target.result)], {\n type: file.type\n });\n blob.name = file.name;\n _this4.upload([blob]);\n };\n reader.readAsArrayBuffer(file);\n });\n });\n }, function (err) {\n console.error(err);\n }, {\n sourceType: webViewCamera.PictureSourceType.PHOTOLIBRARY\n });\n });\n }\n if (this.refs.cameraButton && webViewCamera) {\n this.addEventListener(this.refs.cameraButton, 'click', function (event) {\n event.preventDefault();\n webViewCamera.getPicture(function (success) {\n window.resolveLocalFileSystemURL(success, function (fileEntry) {\n fileEntry.file(function (file) {\n var reader = new FileReader();\n reader.onloadend = function (evt) {\n var blob = new Blob([new Uint8Array(evt.target.result)], {\n type: file.type\n });\n blob.name = file.name;\n _this4.upload([blob]);\n };\n reader.readAsArrayBuffer(file);\n });\n });\n }, function (err) {\n console.error(err);\n }, {\n sourceType: webViewCamera.PictureSourceType.CAMERA,\n encodingType: webViewCamera.EncodingType.PNG,\n mediaType: webViewCamera.MediaType.PICTURE,\n saveToPhotoAlbum: true,\n correctOrientation: false\n });\n });\n }\n if (this.refs.takePictureButton) {\n this.addEventListener(this.refs.takePictureButton, 'click', function (event) {\n event.preventDefault();\n _this4.takePicture();\n });\n }\n if (this.refs.toggleCameraMode) {\n this.addEventListener(this.refs.toggleCameraMode, 'click', function (event) {\n event.preventDefault();\n _this4.cameraMode = !_this4.cameraMode;\n _this4.redraw();\n });\n }\n this.refs.fileType.forEach(function (fileType, index) {\n _this4.dataValue[index].fileType = _this4.dataValue[index].fileType || _this4.component.fileTypes[0].label;\n _this4.addEventListener(fileType, 'change', function (event) {\n event.preventDefault();\n var fileType = _this4.component.fileTypes.find(function (typeObj) {\n return typeObj.value === event.target.value;\n });\n _this4.dataValue[index].fileType = fileType.label;\n });\n });\n var fileService = this.fileService;\n if (fileService) {\n var loadingImages = [];\n this.filesReady = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this4.filesReadyResolve = resolve;\n _this4.filesReadyReject = reject;\n });\n this.refs.fileImage.forEach(function (image, index) {\n loadingImages.push(_this4.loadImage(_this4.dataValue[index]).then(function (url) {\n return image.src = url;\n }));\n });\n if (loadingImages.length) {\n _nativePromiseOnly[\"default\"].all(loadingImages).then(function () {\n _this4.filesReadyResolve();\n })[\"catch\"](function () {\n return _this4.filesReadyReject();\n });\n } else {\n this.filesReadyResolve();\n }\n }\n return superAttach;\n }\n\n /* eslint-disable max-len */\n }, {\n key: \"fileSize\",\n value: function fileSize(a, b, c, d, e) {\n return \"\".concat((b = Math, c = b.log, d = 1024, e = c(a) / c(d) | 0, a / b.pow(d, e)).toFixed(2), \" \").concat(e ? \"\".concat('kMGTPEZY'[--e], \"B\") : 'Bytes');\n }\n\n /* eslint-enable max-len */\n\n /* eslint-disable max-depth */\n }, {\n key: \"globStringToRegex\",\n value: function globStringToRegex(str) {\n str = str.replace(/\\s/g, '');\n var regexp = '',\n excludes = [];\n if (str.length > 2 && str[0] === '/' && str[str.length - 1] === '/') {\n regexp = str.substring(1, str.length - 1);\n } else {\n var split = str.split(',');\n if (split.length > 1) {\n for (var i = 0; i < split.length; i++) {\n var r = this.globStringToRegex(split[i]);\n if (r.regexp) {\n regexp += \"(\".concat(r.regexp, \")\");\n if (i < split.length - 1) {\n regexp += '|';\n }\n } else {\n excludes = excludes.concat(r.excludes);\n }\n }\n } else {\n if (str.startsWith('!')) {\n excludes.push(\"^((?!\".concat(this.globStringToRegex(str.substring(1)).regexp, \").)*$\"));\n } else {\n if (str.startsWith('.')) {\n str = \"*\".concat(str);\n }\n regexp = \"^\".concat(str.replace(new RegExp('[.\\\\\\\\+*?\\\\[\\\\^\\\\]$(){}=!<>|:\\\\-]', 'g'), '\\\\$&'), \"$\");\n regexp = regexp.replace(/\\\\\\*/g, '.*').replace(/\\\\\\?/g, '.');\n }\n }\n }\n return {\n regexp: regexp,\n excludes: excludes\n };\n }\n\n /* eslint-enable max-depth */\n }, {\n key: \"translateScalars\",\n value: function translateScalars(str) {\n if (typeof str === 'string') {\n if (str.search(/kb/i) === str.length - 2) {\n return parseFloat(str.substring(0, str.length - 2) * 1024);\n }\n if (str.search(/mb/i) === str.length - 2) {\n return parseFloat(str.substring(0, str.length - 2) * 1024 * 1024);\n }\n if (str.search(/gb/i) === str.length - 2) {\n return parseFloat(str.substring(0, str.length - 2) * 1024 * 1024 * 1024);\n }\n if (str.search(/b/i) === str.length - 1) {\n return parseFloat(str.substring(0, str.length - 1));\n }\n if (str.search(/s/i) === str.length - 1) {\n return parseFloat(str.substring(0, str.length - 1));\n }\n if (str.search(/m/i) === str.length - 1) {\n return parseFloat(str.substring(0, str.length - 1) * 60);\n }\n if (str.search(/h/i) === str.length - 1) {\n return parseFloat(str.substring(0, str.length - 1) * 3600);\n }\n }\n return str;\n }\n }, {\n key: \"validatePattern\",\n value: function validatePattern(file, val) {\n if (!val) {\n return true;\n }\n var pattern = this.globStringToRegex(val);\n var valid = true;\n if (pattern.regexp && pattern.regexp.length) {\n var regexp = new RegExp(pattern.regexp, 'i');\n valid = !_lodash[\"default\"].isNil(file.type) && regexp.test(file.type) || !_lodash[\"default\"].isNil(file.name) && regexp.test(file.name);\n }\n valid = pattern.excludes.reduce(function (result, excludePattern) {\n var exclude = new RegExp(excludePattern, 'i');\n return result && (_lodash[\"default\"].isNil(file.type) || !exclude.test(file.type)) && (_lodash[\"default\"].isNil(file.name) || !exclude.test(file.name));\n }, valid);\n return valid;\n }\n }, {\n key: \"validateMinSize\",\n value: function validateMinSize(file, val) {\n return file.size + 0.1 >= this.translateScalars(val);\n }\n }, {\n key: \"validateMaxSize\",\n value: function validateMaxSize(file, val) {\n return file.size - 0.1 <= this.translateScalars(val);\n }\n }, {\n key: \"upload\",\n value: function upload(files) {\n var _this5 = this;\n // Only allow one upload if not multiple.\n if (!this.component.multiple) {\n if (this.statuses.length) {\n this.statuses = [];\n }\n files = Array.prototype.slice.call(files, 0, 1);\n }\n if (this.component.storage && files && files.length) {\n this.fileDropHidden = true;\n\n // files is not really an array and does not have a forEach method, so fake it.\n /* eslint-disable max-statements */\n Array.prototype.forEach.call(files, /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {\n var fileName, escapedFileName, fileUpload, bmf, hash, fileWithSameNameUploading, fileWithSameNameUploaded, fileWithSameNameUploadedWithError, dir, fileService, _this5$component, storage, _this5$component$opti, options, url, groupKey, groupPermissions, fileKey, groupResourceId, processedFile, fileProcessorHandler, filePromise;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n fileName = (0, _utils.uniqueName)(file.name, _this5.component.fileNameTemplate, _this5.evalContext());\n escapedFileName = file.name ? file.name.replaceAll('<', '<').replaceAll('>', '>') : file.name;\n fileUpload = {\n originalName: escapedFileName,\n name: fileName,\n size: file.size,\n status: 'info',\n message: _this5.t('Processing file. Please wait...'),\n hash: ''\n };\n if (!(_this5.root.form.submissionRevisions === 'true')) {\n _context.next = 12;\n break;\n }\n _this5.statuses.push(fileUpload);\n _this5.redraw();\n bmf = new _browserMd5File[\"default\"]();\n _context.next = 9;\n return new Promise(function (resolve, reject) {\n _this5.emit('fileUploadingStart');\n bmf.md5(file, function (err, md5) {\n if (err) {\n return reject(err);\n }\n return resolve(md5);\n });\n });\n case 9:\n hash = _context.sent;\n _this5.emit('fileUploadingEnd');\n fileUpload.hash = hash;\n case 12:\n // Check if file with the same name is being uploaded\n if (!_this5.filesUploading) {\n _this5.filesUploading = [];\n }\n fileWithSameNameUploading = _this5.filesUploading.some(function (fileUploading) {\n return fileUploading === file.name;\n });\n _this5.filesUploading.push(file.name);\n fileWithSameNameUploaded = _this5.dataValue.some(function (fileStatus) {\n return fileStatus.originalName === file.name;\n });\n fileWithSameNameUploadedWithError = _this5.statuses.findIndex(function (fileStatus) {\n return fileStatus.originalName === file.name && fileStatus.status === 'error';\n });\n if (fileWithSameNameUploaded || fileWithSameNameUploading) {\n fileUpload.status = 'error';\n fileUpload.message = _this5.t(\"File with the same name is already \".concat(fileWithSameNameUploading ? 'being ' : '', \"uploaded\"));\n }\n if (fileWithSameNameUploadedWithError !== -1) {\n _this5.statuses.splice(fileWithSameNameUploadedWithError, 1);\n _this5.redraw();\n }\n\n // Check file pattern\n if (_this5.component.filePattern && !_this5.validatePattern(file, _this5.component.filePattern)) {\n fileUpload.status = 'error';\n fileUpload.message = _this5.t('File is the wrong type; it must be {{ pattern }}', {\n pattern: _this5.component.filePattern\n });\n }\n\n // Check file minimum size\n if (_this5.component.fileMinSize && !_this5.validateMinSize(file, _this5.component.fileMinSize)) {\n fileUpload.status = 'error';\n fileUpload.message = _this5.t('File is too small; it must be at least {{ size }}', {\n size: _this5.component.fileMinSize\n });\n }\n\n // Check file maximum size\n if (_this5.component.fileMaxSize && !_this5.validateMaxSize(file, _this5.component.fileMaxSize)) {\n fileUpload.status = 'error';\n fileUpload.message = _this5.t('File is too big; it must be at most {{ size }}', {\n size: _this5.component.fileMaxSize\n });\n }\n\n // Get a unique name for this file to keep file collisions from occurring.\n dir = _this5.interpolate(_this5.component.dir || '');\n fileService = _this5.fileService;\n if (!fileService) {\n fileUpload.status = 'error';\n fileUpload.message = _this5.t('File Service not provided.');\n }\n if (_this5.root.form.submissionRevisions !== 'true') {\n _this5.statuses.push(fileUpload);\n _this5.redraw();\n }\n if (!(fileUpload.status !== 'error')) {\n _context.next = 60;\n break;\n }\n if (_this5.component.privateDownload) {\n file[\"private\"] = true;\n }\n _this5$component = _this5.component, storage = _this5$component.storage, _this5$component$opti = _this5$component.options, options = _this5$component$opti === void 0 ? {} : _this5$component$opti;\n url = _this5.interpolate(_this5.component.url, {\n file: fileUpload\n });\n groupKey = null;\n groupPermissions = null; //Iterate through form components to find group resource if one exists\n _this5.root.everyComponent(function (element) {\n var _element$component, _element$component2;\n if ((_element$component = element.component) !== null && _element$component !== void 0 && _element$component.submissionAccess || (_element$component2 = element.component) !== null && _element$component2 !== void 0 && _element$component2.defaultPermission) {\n groupPermissions = !element.component.submissionAccess ? [{\n type: element.component.defaultPermission,\n roles: []\n }] : element.component.submissionAccess;\n groupPermissions.forEach(function (permission) {\n groupKey = ['admin', 'write', 'create'].includes(permission.type) ? element.component.key : null;\n });\n }\n });\n fileKey = _this5.component.fileKey || 'file';\n groupResourceId = groupKey ? _this5.currentForm.submission.data[groupKey]._id : null;\n processedFile = null;\n if (!_this5.root.options.fileProcessor) {\n _context.next = 55;\n break;\n }\n _context.prev = 37;\n if (_this5.refs.fileProcessingLoader) {\n _this5.refs.fileProcessingLoader.style.display = 'block';\n }\n fileProcessorHandler = (0, _fileProcessor[\"default\"])(_this5.fileService, _this5.root.options.fileProcessor);\n _context.next = 42;\n return fileProcessorHandler(file, _this5.component.properties);\n case 42:\n processedFile = _context.sent;\n _context.next = 52;\n break;\n case 45:\n _context.prev = 45;\n _context.t0 = _context[\"catch\"](37);\n fileUpload.status = 'error';\n fileUpload.message = _this5.t('File processing has been failed.');\n _this5.fileDropHidden = false;\n _this5.redraw();\n return _context.abrupt(\"return\");\n case 52:\n _context.prev = 52;\n if (_this5.refs.fileProcessingLoader) {\n _this5.refs.fileProcessingLoader.style.display = 'none';\n }\n return _context.finish(52);\n case 55:\n fileUpload.message = _this5.t('Starting upload.');\n _this5.redraw();\n filePromise = fileService.uploadFile(storage, processedFile || file, fileName, dir,\n // Progress callback\n function (evt) {\n fileUpload.status = 'progress';\n fileUpload.progress = parseInt(100.0 * evt.loaded / evt.total);\n delete fileUpload.message;\n _this5.redraw();\n }, url, options, fileKey, groupPermissions, groupResourceId,\n // Upload start callback\n function () {\n _this5.emit('fileUploadingStart', filePromise);\n },\n // Abort upload callback\n function (abort) {\n return _this5.abortUpload = abort;\n }).then(function (fileInfo) {\n var index = _this5.statuses.indexOf(fileUpload);\n if (index !== -1) {\n _this5.statuses.splice(index, 1);\n }\n fileInfo.originalName = escapedFileName;\n fileInfo.hash = fileUpload.hash;\n if (!_this5.hasValue()) {\n _this5.dataValue = [];\n }\n _this5.dataValue.push(fileInfo);\n _lodash[\"default\"].pull(_this5.filesUploading, fileInfo.originalName);\n _this5.fileDropHidden = false;\n _this5.redraw();\n _this5.triggerChange();\n _this5.emit('fileUploadingEnd', filePromise);\n })[\"catch\"](function (response) {\n fileUpload.status = 'error';\n fileUpload.message = typeof response === 'string' ? response : response.toString();\n delete fileUpload.progress;\n _this5.fileDropHidden = false;\n _lodash[\"default\"].pull(_this5.filesUploading, file.name);\n _this5.redraw();\n _this5.emit('fileUploadingEnd', filePromise);\n });\n _context.next = 61;\n break;\n case 60:\n _this5.filesUploading.splice(_this5.filesUploading.indexOf(file.name), 1);\n case 61:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[37, 45, 52, 55]]);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n }\n }\n }, {\n key: \"getFile\",\n value: function getFile(fileInfo) {\n var _this$component$optio2 = this.component.options,\n options = _this$component$optio2 === void 0 ? {} : _this$component$optio2;\n var fileService = this.fileService;\n if (!fileService) {\n return alert('File Service not provided');\n }\n if (this.component.privateDownload) {\n fileInfo[\"private\"] = true;\n }\n fileService.downloadFile(fileInfo, options).then(function (file) {\n if (file) {\n if (['base64', 'indexeddb'].includes(file.storage)) {\n (0, _downloadjs[\"default\"])(file.url, file.originalName || file.name, file.type);\n } else {\n window.open(file.url, '_blank');\n }\n }\n })[\"catch\"](function (response) {\n // Is alert the best way to do this?\n // User is expecting an immediate notification due to attempting to download a file.\n alert(response);\n });\n }\n }, {\n key: \"focus\",\n value: function focus() {\n if ('beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n if (this.refs.fileBrowse) {\n this.refs.fileBrowse.focus();\n }\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.stopVideo();\n _get(_getPrototypeOf(FileComponent.prototype), \"destroy\", this).call(this);\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: 'file',\n label: 'Upload',\n key: 'file',\n image: false,\n privateDownload: false,\n imageSize: '200',\n filePattern: '*',\n fileMinSize: '0KB',\n fileMaxSize: '1GB',\n uploadOnly: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'File',\n group: 'premium',\n icon: 'file',\n documentation: '/userguide/form-building/premium-components#file',\n weight: 100,\n schema: FileComponent.schema()\n };\n }\n }]);\n return FileComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = FileComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/file/File.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.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\");\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.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.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.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.symbol.async-iterator.js */ \"./node_modules/core-js/modules/es.symbol.async-iterator.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-string-tag.js */ \"./node_modules/core-js/modules/es.symbol.to-string-tag.js\");\n__webpack_require__(/*! core-js/modules/es.json.to-string-tag.js */ \"./node_modules/core-js/modules/es.json.to-string-tag.js\");\n__webpack_require__(/*! core-js/modules/es.math.to-string-tag.js */ \"./node_modules/core-js/modules/es.math.to-string-tag.js\");\n__webpack_require__(/*! core-js/modules/es.array.reverse.js */ \"./node_modules/core-js/modules/es.array.reverse.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\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/web.timers.js */ \"./node_modules/core-js/modules/web.timers.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.array-buffer.slice.js */ \"./node_modules/core-js/modules/es.array-buffer.slice.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.typed-array.uint8-array.js */ \"./node_modules/core-js/modules/es.typed-array.uint8-array.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.copy-within.js */ \"./node_modules/core-js/modules/es.typed-array.copy-within.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.every.js */ \"./node_modules/core-js/modules/es.typed-array.every.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.fill.js */ \"./node_modules/core-js/modules/es.typed-array.fill.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.filter.js */ \"./node_modules/core-js/modules/es.typed-array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.find.js */ \"./node_modules/core-js/modules/es.typed-array.find.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.find-index.js */ \"./node_modules/core-js/modules/es.typed-array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.for-each.js */ \"./node_modules/core-js/modules/es.typed-array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.includes.js */ \"./node_modules/core-js/modules/es.typed-array.includes.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.index-of.js */ \"./node_modules/core-js/modules/es.typed-array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.iterator.js */ \"./node_modules/core-js/modules/es.typed-array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.join.js */ \"./node_modules/core-js/modules/es.typed-array.join.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.last-index-of.js */ \"./node_modules/core-js/modules/es.typed-array.last-index-of.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.map.js */ \"./node_modules/core-js/modules/es.typed-array.map.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.reduce.js */ \"./node_modules/core-js/modules/es.typed-array.reduce.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.reduce-right.js */ \"./node_modules/core-js/modules/es.typed-array.reduce-right.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.reverse.js */ \"./node_modules/core-js/modules/es.typed-array.reverse.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.set.js */ \"./node_modules/core-js/modules/es.typed-array.set.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.slice.js */ \"./node_modules/core-js/modules/es.typed-array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.some.js */ \"./node_modules/core-js/modules/es.typed-array.some.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.sort.js */ \"./node_modules/core-js/modules/es.typed-array.sort.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.subarray.js */ \"./node_modules/core-js/modules/es.typed-array.subarray.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.to-locale-string.js */ \"./node_modules/core-js/modules/es.typed-array.to-locale-string.js\");\n__webpack_require__(/*! core-js/modules/es.typed-array.to-string.js */ \"./node_modules/core-js/modules/es.typed-array.to-string.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.map.js */ \"./node_modules/core-js/modules/es.array.map.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/web.dom-collections.for-each.js */ \"./node_modules/core-js/modules/web.dom-collections.for-each.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.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.date.now.js */ \"./node_modules/core-js/modules/es.date.now.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.string.trim.js */ \"./node_modules/core-js/modules/es.string.trim.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.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.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\n__webpack_require__(/*! core-js/modules/es.number.to-fixed.js */ \"./node_modules/core-js/modules/es.number.to-fixed.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.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.search.js */ \"./node_modules/core-js/modules/es.string.search.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.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.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/esnext.string.replace-all.js */ \"./node_modules/core-js/modules/esnext.string.replace-all.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.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.index-of.js */ \"./node_modules/core-js/modules/es.array.index-of.js\");\nvar _Field2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _downloadjs = _interopRequireDefault(__webpack_require__(/*! downloadjs */ \"./node_modules/downloadjs/download.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nvar _fileProcessor = _interopRequireDefault(__webpack_require__(/*! ../../providers/processor/fileProcessor */ \"./lib/providers/processor/fileProcessor.js\"));\nvar _browserMd5File = _interopRequireDefault(__webpack_require__(/*! browser-md5-file */ \"./node_modules/browser-md5-file/dist/index.umd.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, \"throw\" === methodName && delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method) || \"return\" !== methodName && (context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a '\" + methodName + \"' method\")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\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 Camera;\nvar webViewCamera = navigator.camera || Camera;\n\n// canvas.toBlob polyfill.\n\nvar htmlCanvasElement;\nif (typeof window !== 'undefined') {\n htmlCanvasElement = window.HTMLCanvasElement;\n} else if (typeof __webpack_require__.g !== 'undefined') {\n htmlCanvasElement = __webpack_require__.g.HTMLCanvasElement;\n}\nif (htmlCanvasElement && !htmlCanvasElement.prototype.toBlob) {\n Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {\n value: function value(callback, type, quality) {\n var canvas = this;\n setTimeout(function () {\n var binStr = atob(canvas.toDataURL(type, quality).split(',')[1]),\n len = binStr.length,\n arr = new Uint8Array(len);\n for (var i = 0; i < len; i++) {\n arr[i] = binStr.charCodeAt(i);\n }\n callback(new Blob([arr], {\n type: type || 'image/png'\n }));\n });\n }\n });\n}\nvar FileComponent = /*#__PURE__*/function (_Field) {\n _inherits(FileComponent, _Field);\n var _super = _createSuper(FileComponent);\n function FileComponent() {\n _classCallCheck(this, FileComponent);\n return _super.apply(this, arguments);\n }\n _createClass(FileComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(FileComponent.prototype), \"init\", this).call(this);\n webViewCamera = navigator.camera || Camera;\n var fileReaderSupported = typeof FileReader !== 'undefined';\n var formDataSupported = typeof window !== 'undefined' ? Boolean(window.FormData) : false;\n var progressSupported = typeof window !== 'undefined' && window.XMLHttpRequest ? 'upload' in new XMLHttpRequest() : false;\n this.support = {\n filereader: fileReaderSupported,\n formdata: formDataSupported,\n hasWarning: !fileReaderSupported || !formDataSupported || !progressSupported,\n progress: progressSupported\n };\n this.cameraMode = false;\n this.statuses = [];\n this.fileDropHidden = false;\n }\n }, {\n key: \"dataReady\",\n get: function get() {\n return this.filesReady || _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return FileComponent.schema();\n }\n }, {\n key: \"loadImage\",\n value: function loadImage(fileInfo) {\n if (this.component.privateDownload) {\n fileInfo[\"private\"] = true;\n }\n return this.fileService.downloadFile(fileInfo).then(function (result) {\n return result.url;\n });\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return [];\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (_lodash[\"default\"].isArray(value)) {\n return _lodash[\"default\"].map(value, 'originalName').join(', ');\n }\n return _lodash[\"default\"].get(value, 'originalName', '');\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.dataValue;\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var value = _get(_getPrototypeOf(FileComponent.prototype), \"defaultValue\", this);\n return Array.isArray(value) ? value : [];\n }\n }, {\n key: \"hasTypes\",\n get: function get() {\n return this.component.fileTypes && Array.isArray(this.component.fileTypes) && this.component.fileTypes.length !== 0 && (this.component.fileTypes[0].label !== '' || this.component.fileTypes[0].value !== '');\n }\n }, {\n key: \"fileDropHidden\",\n get: function get() {\n return this._fileBrowseHidden;\n },\n set: function set(value) {\n if (typeof value !== 'boolean' || this.component.multiple) {\n return;\n }\n this._fileBrowseHidden = value;\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(FileComponent.prototype), \"render\", this).call(this, this.renderTemplate('file', {\n fileSize: this.fileSize,\n files: this.dataValue || [],\n statuses: this.statuses,\n disabled: this.disabled,\n support: this.support,\n fileDropHidden: this.fileDropHidden\n }));\n }\n }, {\n key: \"getVideoStream\",\n value: function getVideoStream(constraints) {\n return navigator.mediaDevices.getUserMedia({\n video: _objectSpread({\n width: {\n min: 640,\n ideal: 1920\n },\n height: {\n min: 360,\n ideal: 1080\n },\n aspectRatio: {\n ideal: 16 / 9\n }\n }, constraints),\n audio: false\n });\n }\n }, {\n key: \"stopVideoStream\",\n value: function stopVideoStream(videoStream) {\n videoStream.getVideoTracks().forEach(function (track) {\n return track.stop();\n });\n }\n }, {\n key: \"getFrame\",\n value: function getFrame(videoPlayer) {\n return new _nativePromiseOnly[\"default\"](function (resolve) {\n var canvas = document.createElement('canvas');\n canvas.height = videoPlayer.videoHeight;\n canvas.width = videoPlayer.videoWidth;\n var context = canvas.getContext('2d');\n context.drawImage(videoPlayer, 0, 0);\n canvas.toBlob(resolve);\n });\n }\n }, {\n key: \"startVideo\",\n value: function startVideo() {\n var _this = this;\n this.getVideoStream().then(function (stream) {\n _this.videoStream = stream;\n var videoPlayer = _this.refs.videoPlayer;\n if (!videoPlayer) {\n console.warn('Video player not found in template.');\n _this.cameraMode = false;\n _this.redraw();\n return;\n }\n videoPlayer.srcObject = stream;\n var width = parseInt(_this.component.webcamSize) || 320;\n videoPlayer.setAttribute('width', width);\n videoPlayer.play();\n })[\"catch\"](function (err) {\n console.error(err);\n _this.cameraMode = false;\n _this.redraw();\n });\n }\n }, {\n key: \"stopVideo\",\n value: function stopVideo() {\n if (this.videoStream) {\n this.stopVideoStream(this.videoStream);\n this.videoStream = null;\n }\n }\n }, {\n key: \"takePicture\",\n value: function takePicture() {\n var _this2 = this;\n var videoPlayer = this.refs.videoPlayer;\n if (!videoPlayer) {\n console.warn('Video player not found in template.');\n this.cameraMode = false;\n this.redraw();\n return;\n }\n this.getFrame(videoPlayer).then(function (frame) {\n frame.name = \"photo-\".concat(Date.now(), \".png\");\n _this2.upload([frame]);\n _this2.cameraMode = false;\n _this2.redraw();\n });\n }\n }, {\n key: \"browseFiles\",\n value: function browseFiles() {\n var _this3 = this;\n var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return new _nativePromiseOnly[\"default\"](function (resolve) {\n var fileInput = _this3.ce('input', _objectSpread({\n type: 'file',\n style: 'height: 0; width: 0; visibility: hidden;',\n tabindex: '-1'\n }, attrs));\n document.body.appendChild(fileInput);\n fileInput.addEventListener('change', function () {\n resolve(fileInput.files);\n document.body.removeChild(fileInput);\n }, true);\n\n // There is no direct way to trigger a file dialog. To work around this, create an input of type file and trigger\n // a click event on it.\n if (typeof fileInput.trigger === 'function') {\n fileInput.trigger('click');\n } else {\n fileInput.click();\n }\n });\n }\n }, {\n key: \"cameraMode\",\n get: function get() {\n return this._cameraMode;\n },\n set: function set(value) {\n this._cameraMode = value;\n if (value) {\n this.startVideo();\n } else {\n this.stopVideo();\n }\n }\n }, {\n key: \"useWebViewCamera\",\n get: function get() {\n return this.imageUpload && webViewCamera;\n }\n }, {\n key: \"imageUpload\",\n get: function get() {\n return Boolean(this.component.image);\n }\n }, {\n key: \"browseOptions\",\n get: function get() {\n var options = {};\n if (this.component.multiple) {\n options.multiple = true;\n }\n //use \"accept\" attribute only for desktop devices because of its limited support by mobile browsers\n if (!this.isMobile.any) {\n var filePattern = this.component.filePattern.trim() || '';\n var imagesPattern = 'image/*';\n if (this.imageUpload && (!filePattern || filePattern === '*')) {\n options.accept = imagesPattern;\n } else if (this.imageUpload && !filePattern.includes(imagesPattern)) {\n options.accept = \"\".concat(imagesPattern, \",\").concat(filePattern);\n } else {\n options.accept = filePattern;\n }\n }\n return options;\n }\n }, {\n key: \"deleteFile\",\n value: function deleteFile(fileInfo) {\n var _this$component$optio = this.component.options,\n options = _this$component$optio === void 0 ? {} : _this$component$optio;\n if (fileInfo && ['url', 'indexeddb'].includes(this.component.storage)) {\n var fileService = this.fileService;\n if (fileService && typeof fileService.deleteFile === 'function') {\n fileService.deleteFile(fileInfo, options);\n } else {\n var formio = this.options.formio || this.root && this.root.formio;\n if (formio) {\n formio.makeRequest('', fileInfo.url, 'delete');\n }\n }\n }\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this4 = this;\n this.loadRefs(element, {\n fileDrop: 'single',\n fileBrowse: 'single',\n galleryButton: 'single',\n cameraButton: 'single',\n takePictureButton: 'single',\n toggleCameraMode: 'single',\n videoPlayer: 'single',\n fileLink: 'multiple',\n removeLink: 'multiple',\n fileStatusRemove: 'multiple',\n fileImage: 'multiple',\n fileType: 'multiple',\n fileProcessingLoader: 'single'\n });\n // Ensure we have an empty input refs. We need this for the setValue method to redraw the control when it is set.\n this.refs.input = [];\n var superAttach = _get(_getPrototypeOf(FileComponent.prototype), \"attach\", this).call(this, element);\n if (this.refs.fileDrop) {\n if (!this.statuses.length) {\n this.refs.fileDrop.removeAttribute('hidden');\n }\n var _element = this;\n this.addEventListener(this.refs.fileDrop, 'dragover', function (event) {\n this.className = 'fileSelector fileDragOver';\n event.preventDefault();\n });\n this.addEventListener(this.refs.fileDrop, 'dragleave', function (event) {\n this.className = 'fileSelector';\n event.preventDefault();\n });\n this.addEventListener(this.refs.fileDrop, 'drop', function (event) {\n this.className = 'fileSelector';\n event.preventDefault();\n _element.upload(event.dataTransfer.files);\n });\n }\n if (this.refs.fileBrowse) {\n this.addEventListener(this.refs.fileBrowse, 'click', function (event) {\n event.preventDefault();\n _this4.browseFiles(_this4.browseOptions).then(function (files) {\n _this4.upload(files);\n });\n });\n }\n this.refs.fileLink.forEach(function (fileLink, index) {\n _this4.addEventListener(fileLink, 'click', function (event) {\n event.preventDefault();\n _this4.getFile(_this4.dataValue[index]);\n });\n });\n this.refs.removeLink.forEach(function (removeLink, index) {\n _this4.addEventListener(removeLink, 'click', function (event) {\n var fileInfo = _this4.dataValue[index];\n _this4.deleteFile(fileInfo);\n event.preventDefault();\n _this4.splice(index);\n _this4.redraw();\n });\n });\n this.refs.fileStatusRemove.forEach(function (fileStatusRemove, index) {\n _this4.addEventListener(fileStatusRemove, 'click', function (event) {\n event.preventDefault();\n if (_this4.abortUpload) {\n _this4.abortUpload();\n }\n _this4.statuses.splice(index, 1);\n _this4.redraw();\n });\n });\n if (this.refs.galleryButton && webViewCamera) {\n this.addEventListener(this.refs.galleryButton, 'click', function (event) {\n event.preventDefault();\n webViewCamera.getPicture(function (success) {\n window.resolveLocalFileSystemURL(success, function (fileEntry) {\n fileEntry.file(function (file) {\n var reader = new FileReader();\n reader.onloadend = function (evt) {\n var blob = new Blob([new Uint8Array(evt.target.result)], {\n type: file.type\n });\n blob.name = file.name;\n _this4.upload([blob]);\n };\n reader.readAsArrayBuffer(file);\n });\n });\n }, function (err) {\n console.error(err);\n }, {\n sourceType: webViewCamera.PictureSourceType.PHOTOLIBRARY\n });\n });\n }\n if (this.refs.cameraButton && webViewCamera) {\n this.addEventListener(this.refs.cameraButton, 'click', function (event) {\n event.preventDefault();\n webViewCamera.getPicture(function (success) {\n window.resolveLocalFileSystemURL(success, function (fileEntry) {\n fileEntry.file(function (file) {\n var reader = new FileReader();\n reader.onloadend = function (evt) {\n var blob = new Blob([new Uint8Array(evt.target.result)], {\n type: file.type\n });\n blob.name = file.name;\n _this4.upload([blob]);\n };\n reader.readAsArrayBuffer(file);\n });\n });\n }, function (err) {\n console.error(err);\n }, {\n sourceType: webViewCamera.PictureSourceType.CAMERA,\n encodingType: webViewCamera.EncodingType.PNG,\n mediaType: webViewCamera.MediaType.PICTURE,\n saveToPhotoAlbum: true,\n correctOrientation: false\n });\n });\n }\n if (this.refs.takePictureButton) {\n this.addEventListener(this.refs.takePictureButton, 'click', function (event) {\n event.preventDefault();\n _this4.takePicture();\n });\n }\n if (this.refs.toggleCameraMode) {\n this.addEventListener(this.refs.toggleCameraMode, 'click', function (event) {\n event.preventDefault();\n _this4.cameraMode = !_this4.cameraMode;\n _this4.redraw();\n });\n }\n this.refs.fileType.forEach(function (fileType, index) {\n _this4.dataValue[index].fileType = _this4.dataValue[index].fileType || _this4.component.fileTypes[0].label;\n _this4.addEventListener(fileType, 'change', function (event) {\n event.preventDefault();\n var fileType = _this4.component.fileTypes.find(function (typeObj) {\n return typeObj.value === event.target.value;\n });\n _this4.dataValue[index].fileType = fileType.label;\n });\n });\n var fileService = this.fileService;\n if (fileService) {\n var loadingImages = [];\n this.filesReady = new _nativePromiseOnly[\"default\"](function (resolve, reject) {\n _this4.filesReadyResolve = resolve;\n _this4.filesReadyReject = reject;\n });\n this.refs.fileImage.forEach(function (image, index) {\n loadingImages.push(_this4.loadImage(_this4.dataValue[index]).then(function (url) {\n return image.src = url;\n }));\n });\n if (loadingImages.length) {\n _nativePromiseOnly[\"default\"].all(loadingImages).then(function () {\n _this4.filesReadyResolve();\n })[\"catch\"](function () {\n return _this4.filesReadyReject();\n });\n } else {\n this.filesReadyResolve();\n }\n }\n return superAttach;\n }\n\n /* eslint-disable max-len */\n }, {\n key: \"fileSize\",\n value: function fileSize(a, b, c, d, e) {\n return \"\".concat((b = Math, c = b.log, d = 1024, e = c(a) / c(d) | 0, a / b.pow(d, e)).toFixed(2), \" \").concat(e ? \"\".concat('kMGTPEZY'[--e], \"B\") : 'Bytes');\n }\n\n /* eslint-enable max-len */\n\n /* eslint-disable max-depth */\n }, {\n key: \"globStringToRegex\",\n value: function globStringToRegex(str) {\n str = str.replace(/\\s/g, '');\n var regexp = '',\n excludes = [];\n if (str.length > 2 && str[0] === '/' && str[str.length - 1] === '/') {\n regexp = str.substring(1, str.length - 1);\n } else {\n var split = str.split(',');\n if (split.length > 1) {\n for (var i = 0; i < split.length; i++) {\n var r = this.globStringToRegex(split[i]);\n if (r.regexp) {\n regexp += \"(\".concat(r.regexp, \")\");\n if (i < split.length - 1) {\n regexp += '|';\n }\n } else {\n excludes = excludes.concat(r.excludes);\n }\n }\n } else {\n if (str.startsWith('!')) {\n excludes.push(\"^((?!\".concat(this.globStringToRegex(str.substring(1)).regexp, \").)*$\"));\n } else {\n if (str.startsWith('.')) {\n str = \"*\".concat(str);\n }\n regexp = \"^\".concat(str.replace(new RegExp('[.\\\\\\\\+*?\\\\[\\\\^\\\\]$(){}=!<>|:\\\\-]', 'g'), '\\\\$&'), \"$\");\n regexp = regexp.replace(/\\\\\\*/g, '.*').replace(/\\\\\\?/g, '.');\n }\n }\n }\n return {\n regexp: regexp,\n excludes: excludes\n };\n }\n\n /* eslint-enable max-depth */\n }, {\n key: \"translateScalars\",\n value: function translateScalars(str) {\n if (typeof str === 'string') {\n if (str.search(/kb/i) === str.length - 2) {\n return parseFloat(str.substring(0, str.length - 2) * 1024);\n }\n if (str.search(/mb/i) === str.length - 2) {\n return parseFloat(str.substring(0, str.length - 2) * 1024 * 1024);\n }\n if (str.search(/gb/i) === str.length - 2) {\n return parseFloat(str.substring(0, str.length - 2) * 1024 * 1024 * 1024);\n }\n if (str.search(/b/i) === str.length - 1) {\n return parseFloat(str.substring(0, str.length - 1));\n }\n if (str.search(/s/i) === str.length - 1) {\n return parseFloat(str.substring(0, str.length - 1));\n }\n if (str.search(/m/i) === str.length - 1) {\n return parseFloat(str.substring(0, str.length - 1) * 60);\n }\n if (str.search(/h/i) === str.length - 1) {\n return parseFloat(str.substring(0, str.length - 1) * 3600);\n }\n }\n return str;\n }\n }, {\n key: \"validatePattern\",\n value: function validatePattern(file, val) {\n if (!val) {\n return true;\n }\n var pattern = this.globStringToRegex(val);\n var valid = true;\n if (pattern.regexp && pattern.regexp.length) {\n var regexp = new RegExp(pattern.regexp, 'i');\n valid = !_lodash[\"default\"].isNil(file.type) && regexp.test(file.type) || !_lodash[\"default\"].isNil(file.name) && regexp.test(file.name);\n }\n valid = pattern.excludes.reduce(function (result, excludePattern) {\n var exclude = new RegExp(excludePattern, 'i');\n return result && (_lodash[\"default\"].isNil(file.type) || !exclude.test(file.type)) && (_lodash[\"default\"].isNil(file.name) || !exclude.test(file.name));\n }, valid);\n return valid;\n }\n }, {\n key: \"validateMinSize\",\n value: function validateMinSize(file, val) {\n return file.size + 0.1 >= this.translateScalars(val);\n }\n }, {\n key: \"validateMaxSize\",\n value: function validateMaxSize(file, val) {\n return file.size - 0.1 <= this.translateScalars(val);\n }\n }, {\n key: \"upload\",\n value: function upload(files) {\n var _this5 = this;\n // Only allow one upload if not multiple.\n if (!this.component.multiple) {\n if (this.statuses.length) {\n this.statuses = [];\n }\n files = Array.prototype.slice.call(files, 0, 1);\n }\n if (this.component.storage && files && files.length) {\n this.fileDropHidden = true;\n\n // files is not really an array and does not have a forEach method, so fake it.\n /* eslint-disable max-statements */\n Array.prototype.forEach.call(files, /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {\n var fileName, escapedFileName, fileUpload, bmf, hash, fileWithSameNameUploading, fileWithSameNameUploaded, fileWithSameNameUploadedWithError, dir, fileService, _this5$component, storage, _this5$component$opti, options, url, groupKey, groupPermissions, fileKey, groupResourceId, processedFile, fileProcessorHandler, filePromise;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n fileName = (0, _utils.uniqueName)(file.name, _this5.component.fileNameTemplate, _this5.evalContext());\n escapedFileName = file.name ? file.name.replaceAll('<', '<').replaceAll('>', '>') : file.name;\n fileUpload = {\n originalName: escapedFileName,\n name: fileName,\n size: file.size,\n status: 'info',\n message: _this5.t('Processing file. Please wait...'),\n hash: ''\n };\n if (!(_this5.root.form.submissionRevisions === 'true')) {\n _context.next = 12;\n break;\n }\n _this5.statuses.push(fileUpload);\n _this5.redraw();\n bmf = new _browserMd5File[\"default\"]();\n _context.next = 9;\n return new Promise(function (resolve, reject) {\n _this5.emit('fileUploadingStart');\n bmf.md5(file, function (err, md5) {\n if (err) {\n return reject(err);\n }\n return resolve(md5);\n });\n });\n case 9:\n hash = _context.sent;\n _this5.emit('fileUploadingEnd');\n fileUpload.hash = hash;\n case 12:\n // Check if file with the same name is being uploaded\n if (!_this5.filesUploading) {\n _this5.filesUploading = [];\n }\n fileWithSameNameUploading = _this5.filesUploading.some(function (fileUploading) {\n return fileUploading === file.name;\n });\n _this5.filesUploading.push(file.name);\n fileWithSameNameUploaded = _this5.dataValue.some(function (fileStatus) {\n return fileStatus.originalName === file.name;\n });\n fileWithSameNameUploadedWithError = _this5.statuses.findIndex(function (fileStatus) {\n return fileStatus.originalName === file.name && fileStatus.status === 'error';\n });\n if (fileWithSameNameUploaded || fileWithSameNameUploading) {\n fileUpload.status = 'error';\n fileUpload.message = _this5.t(\"File with the same name is already \".concat(fileWithSameNameUploading ? 'being ' : '', \"uploaded\"));\n }\n if (fileWithSameNameUploadedWithError !== -1) {\n _this5.statuses.splice(fileWithSameNameUploadedWithError, 1);\n _this5.redraw();\n }\n\n // Check file pattern\n if (_this5.component.filePattern && !_this5.validatePattern(file, _this5.component.filePattern)) {\n fileUpload.status = 'error';\n fileUpload.message = _this5.t('File is the wrong type; it must be {{ pattern }}', {\n pattern: _this5.component.filePattern\n });\n }\n\n // Check file minimum size\n if (_this5.component.fileMinSize && !_this5.validateMinSize(file, _this5.component.fileMinSize)) {\n fileUpload.status = 'error';\n fileUpload.message = _this5.t('File is too small; it must be at least {{ size }}', {\n size: _this5.component.fileMinSize\n });\n }\n\n // Check file maximum size\n if (_this5.component.fileMaxSize && !_this5.validateMaxSize(file, _this5.component.fileMaxSize)) {\n fileUpload.status = 'error';\n fileUpload.message = _this5.t('File is too big; it must be at most {{ size }}', {\n size: _this5.component.fileMaxSize\n });\n }\n\n // Get a unique name for this file to keep file collisions from occurring.\n dir = _this5.interpolate(_this5.component.dir || '');\n fileService = _this5.fileService;\n if (!fileService) {\n fileUpload.status = 'error';\n fileUpload.message = _this5.t('File Service not provided.');\n }\n if (_this5.root.form.submissionRevisions !== 'true') {\n _this5.statuses.push(fileUpload);\n _this5.redraw();\n }\n if (!(fileUpload.status !== 'error')) {\n _context.next = 60;\n break;\n }\n if (_this5.component.privateDownload) {\n file[\"private\"] = true;\n }\n _this5$component = _this5.component, storage = _this5$component.storage, _this5$component$opti = _this5$component.options, options = _this5$component$opti === void 0 ? {} : _this5$component$opti;\n url = _this5.interpolate(_this5.component.url, {\n file: fileUpload\n });\n groupKey = null;\n groupPermissions = null; //Iterate through form components to find group resource if one exists\n _this5.root.everyComponent(function (element) {\n var _element$component, _element$component2;\n if ((_element$component = element.component) !== null && _element$component !== void 0 && _element$component.submissionAccess || (_element$component2 = element.component) !== null && _element$component2 !== void 0 && _element$component2.defaultPermission) {\n groupPermissions = !element.component.submissionAccess ? [{\n type: element.component.defaultPermission,\n roles: []\n }] : element.component.submissionAccess;\n groupPermissions.forEach(function (permission) {\n groupKey = ['admin', 'write', 'create'].includes(permission.type) ? element.component.key : null;\n });\n }\n });\n fileKey = _this5.component.fileKey || 'file';\n groupResourceId = groupKey ? _this5.currentForm.submission.data[groupKey]._id : null;\n processedFile = null;\n if (!_this5.root.options.fileProcessor) {\n _context.next = 55;\n break;\n }\n _context.prev = 37;\n if (_this5.refs.fileProcessingLoader) {\n _this5.refs.fileProcessingLoader.style.display = 'block';\n }\n fileProcessorHandler = (0, _fileProcessor[\"default\"])(_this5.fileService, _this5.root.options.fileProcessor);\n _context.next = 42;\n return fileProcessorHandler(file, _this5.component.properties);\n case 42:\n processedFile = _context.sent;\n _context.next = 52;\n break;\n case 45:\n _context.prev = 45;\n _context.t0 = _context[\"catch\"](37);\n fileUpload.status = 'error';\n fileUpload.message = _this5.t('File processing has been failed.');\n _this5.fileDropHidden = false;\n _this5.redraw();\n return _context.abrupt(\"return\");\n case 52:\n _context.prev = 52;\n if (_this5.refs.fileProcessingLoader) {\n _this5.refs.fileProcessingLoader.style.display = 'none';\n }\n return _context.finish(52);\n case 55:\n fileUpload.message = _this5.t('Starting upload.');\n _this5.redraw();\n filePromise = fileService.uploadFile(storage, processedFile || file, fileName, dir,\n // Progress callback\n function (evt) {\n fileUpload.status = 'progress';\n fileUpload.progress = parseInt(100.0 * evt.loaded / evt.total);\n delete fileUpload.message;\n _this5.redraw();\n }, url, options, fileKey, groupPermissions, groupResourceId,\n // Upload start callback\n function () {\n _this5.emit('fileUploadingStart', filePromise);\n },\n // Abort upload callback\n function (abort) {\n return _this5.abortUpload = abort;\n }).then(function (fileInfo) {\n var index = _this5.statuses.indexOf(fileUpload);\n if (index !== -1) {\n _this5.statuses.splice(index, 1);\n }\n fileInfo.originalName = escapedFileName;\n fileInfo.hash = fileUpload.hash;\n if (!_this5.hasValue()) {\n _this5.dataValue = [];\n }\n _this5.dataValue.push(fileInfo);\n _lodash[\"default\"].pull(_this5.filesUploading, fileInfo.originalName);\n _this5.fileDropHidden = false;\n _this5.redraw();\n _this5.triggerChange();\n _this5.emit('fileUploadingEnd', filePromise);\n })[\"catch\"](function (response) {\n fileUpload.status = 'error';\n fileUpload.message = typeof response === 'string' ? response : response.toString();\n delete fileUpload.progress;\n _this5.fileDropHidden = false;\n _lodash[\"default\"].pull(_this5.filesUploading, file.name);\n _this5.redraw();\n _this5.emit('fileUploadingEnd', filePromise);\n });\n _context.next = 61;\n break;\n case 60:\n _this5.filesUploading.splice(_this5.filesUploading.indexOf(file.name), 1);\n case 61:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[37, 45, 52, 55]]);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n }\n }\n }, {\n key: \"getFile\",\n value: function getFile(fileInfo) {\n var _this$component$optio2 = this.component.options,\n options = _this$component$optio2 === void 0 ? {} : _this$component$optio2;\n var fileService = this.fileService;\n if (!fileService) {\n return alert('File Service not provided');\n }\n if (this.component.privateDownload) {\n fileInfo[\"private\"] = true;\n }\n fileService.downloadFile(fileInfo, options).then(function (file) {\n if (file) {\n if (['base64', 'indexeddb'].includes(file.storage)) {\n (0, _downloadjs[\"default\"])(file.url, file.originalName || file.name, file.type);\n } else {\n window.open(file.url, '_blank');\n }\n }\n })[\"catch\"](function (response) {\n // Is alert the best way to do this?\n // User is expecting an immediate notification due to attempting to download a file.\n alert(response);\n });\n }\n }, {\n key: \"focus\",\n value: function focus() {\n if ('beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n if (this.refs.fileBrowse) {\n this.refs.fileBrowse.focus();\n }\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.stopVideo();\n _get(_getPrototypeOf(FileComponent.prototype), \"destroy\", this).call(this);\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: 'file',\n label: 'Upload',\n key: 'file',\n image: false,\n privateDownload: false,\n imageSize: '200',\n filePattern: '*',\n fileMinSize: '0KB',\n fileMaxSize: '1GB',\n uploadOnly: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'File',\n group: 'premium',\n icon: 'file',\n documentation: '/userguide/form-building/premium-components#file',\n weight: 100,\n schema: FileComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(FileComponent), \"serverConditionSettings\", this)), {}, {\n operators: ['isEmpty', 'isNotEmpty']\n });\n }\n }]);\n return FileComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = FileComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/file/File.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.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 _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 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) {\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 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 _this5 = this;\n if (this.builderMode || this.isHidden() || this.isSubFormLazyLoad() && !fromAttach) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n if (this.hasLoadedForm && !this.isRevisionChanged) {\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 _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();\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.data) && !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 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 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 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 _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();\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.data) && !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 return FormComponent;\n}(_Component2[\"default\"]);\nexports[\"default\"] = FormComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/form/Form.js?"); /***/ }), @@ -1366,7 +1366,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.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 _Input2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/input/Input */ \"./lib/components/_classes/input/Input.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 HiddenComponent = /*#__PURE__*/function (_Input) {\n _inherits(HiddenComponent, _Input);\n var _super = _createSuper(HiddenComponent);\n function HiddenComponent() {\n _classCallCheck(this, HiddenComponent);\n return _super.apply(this, arguments);\n }\n _createClass(HiddenComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return HiddenComponent.schema();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(HiddenComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'input';\n info.attr.type = 'hidden';\n info.changeEvent = 'change';\n return info;\n }\n }, {\n key: \"skipInEmail\",\n get: function get() {\n return true;\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 // Since \"arrays\" are able to be stored in hidden components, we need to turn off multiple validation.\n return false;\n }\n }, {\n key: \"labelIsHidden\",\n value: function labelIsHidden() {\n return true;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return '';\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.updateValue(value, flags);\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.dataValue;\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 _Input2[\"default\"].schema.apply(_Input2[\"default\"], [{\n type: 'hidden',\n tableView: false,\n inputType: 'hidden'\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Hidden',\n group: 'data',\n icon: 'user-secret',\n weight: 0,\n documentation: '/userguide/form-building/data-components#hidden',\n schema: HiddenComponent.schema()\n };\n }\n }]);\n return HiddenComponent;\n}(_Input2[\"default\"]);\nexports[\"default\"] = HiddenComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/hidden/Hidden.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.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.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 _Input2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/input/Input */ \"./lib/components/_classes/input/Input.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 HiddenComponent = /*#__PURE__*/function (_Input) {\n _inherits(HiddenComponent, _Input);\n var _super = _createSuper(HiddenComponent);\n function HiddenComponent() {\n _classCallCheck(this, HiddenComponent);\n return _super.apply(this, arguments);\n }\n _createClass(HiddenComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return HiddenComponent.schema();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(HiddenComponent.prototype), \"elementInfo\", this).call(this);\n info.type = 'input';\n info.attr.type = 'hidden';\n info.changeEvent = 'change';\n return info;\n }\n }, {\n key: \"skipInEmail\",\n get: function get() {\n return true;\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 // Since \"arrays\" are able to be stored in hidden components, we need to turn off multiple validation.\n return false;\n }\n }, {\n key: \"labelIsHidden\",\n value: function labelIsHidden() {\n return true;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return '';\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.updateValue(value, flags);\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.dataValue;\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 _Input2[\"default\"].schema.apply(_Input2[\"default\"], [{\n type: 'hidden',\n tableView: false,\n inputType: 'hidden'\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Hidden',\n group: 'data',\n icon: 'user-secret',\n weight: 0,\n documentation: '/userguide/form-building/data-components#hidden',\n showPreview: false,\n schema: HiddenComponent.schema()\n };\n }\n }]);\n return HiddenComponent;\n}(_Input2[\"default\"]);\nexports[\"default\"] = HiddenComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/hidden/Hidden.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 schema: HTMLComponent.schema()\n };\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.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 return HTMLComponent;\n}(_Component2[\"default\"]);\nexports[\"default\"] = HTMLComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/html/HTML.js?"); /***/ }), @@ -1465,7 +1465,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/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.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.string.split.js */ \"./node_modules/core-js/modules/es.string.split.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.parse-float.js */ \"./node_modules/core-js/modules/es.parse-float.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.string.repeat.js */ \"./node_modules/core-js/modules/es.string.repeat.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.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.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 _vanillaTextMask = __webpack_require__(/*! @formio/vanilla-text-mask */ \"./node_modules/@formio/vanilla-text-mask/dist/vanillaTextMask.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _textMaskAddons = __webpack_require__(/*! @formio/text-mask-addons */ \"./node_modules/@formio/text-mask-addons/dist/textMaskAddons.js\");\nvar _Input2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/input/Input */ \"./lib/components/_classes/input/Input.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 _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 NumberComponent = /*#__PURE__*/function (_Input) {\n _inherits(NumberComponent, _Input);\n var _super = _createSuper(NumberComponent);\n function NumberComponent() {\n var _this$options$propert;\n var _this;\n _classCallCheck(this, NumberComponent);\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.validators = _this.validators.concat(['min', 'max']);\n var separators = (0, _utils.getNumberSeparators)(_this.options.language || navigator.language);\n _this.decimalSeparator = _this.options.decimalSeparator = _this.options.decimalSeparator || ((_this$options$propert = _this.options.properties) === null || _this$options$propert === void 0 ? void 0 : _this$options$propert.decimalSeparator) || separators.decimalSeparator;\n if (_this.component.delimiter) {\n var _this$options$propert2;\n if (_this.options.hasOwnProperty('thousandsSeparator')) {\n console.warn(\"Property 'thousandsSeparator' is deprecated. Please use i18n to specify delimiter.\");\n }\n _this.delimiter = ((_this$options$propert2 = _this.options.properties) === null || _this$options$propert2 === void 0 ? void 0 : _this$options$propert2.thousandsSeparator) || _this.options.thousandsSeparator || separators.delimiter;\n } else {\n _this.delimiter = '';\n }\n var requireDecimal = _lodash[\"default\"].get(_this.component, 'requireDecimal', false);\n _this.decimalLimit = (0, _utils.getNumberDecimalLimit)(_this.component, requireDecimal ? 2 : 20);\n\n // Currencies to override BrowserLanguage Config. Object key {}\n if (_lodash[\"default\"].has(_this.options, \"languageOverride.\".concat(_this.options.language))) {\n var override = _lodash[\"default\"].get(_this.options, \"languageOverride.\".concat(_this.options.language));\n _this.decimalSeparator = override.decimalSeparator;\n _this.delimiter = override.delimiter;\n }\n _this.numberMask = _this.createNumberMask();\n return _this;\n }\n\n /**\n * Creates the number mask for normal numbers.\n *\n * @return {*}\n */\n _createClass(NumberComponent, [{\n key: \"createNumberMask\",\n value: function createNumberMask() {\n return (0, _textMaskAddons.createNumberMask)({\n prefix: '',\n suffix: '',\n requireDecimal: _lodash[\"default\"].get(this.component, 'requireDecimal', false),\n thousandsSeparatorSymbol: _lodash[\"default\"].get(this.component, 'thousandsSeparator', this.delimiter),\n decimalSymbol: _lodash[\"default\"].get(this.component, 'decimalSymbol', this.decimalSeparator),\n decimalLimit: _lodash[\"default\"].get(this.component, 'decimalLimit', this.decimalLimit),\n allowNegative: _lodash[\"default\"].get(this.component, 'allowNegative', true),\n allowDecimal: this.isDecimalAllowed()\n });\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return NumberComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(NumberComponent.prototype), \"defaultValue\", this);\n if (!defaultValue && this.component.defaultValue === 0) {\n defaultValue = this.component.defaultValue;\n }\n if (!this.component.multiple && _lodash[\"default\"].isArray(defaultValue)) {\n defaultValue = !defaultValue[0] && defaultValue[0] !== 0 ? null : defaultValue[0];\n }\n return defaultValue;\n }\n }, {\n key: \"isDecimalAllowed\",\n value: function isDecimalAllowed() {\n return _lodash[\"default\"].get(this.component, 'allowDecimal', !(this.component.validate && this.component.validate.integer));\n }\n }, {\n key: \"parseNumber\",\n value: function parseNumber(value) {\n // Remove delimiters and convert decimal separator to dot.\n value = value.split(this.delimiter).join('').replace(this.decimalSeparator, '.');\n if (this.component.validate && this.component.validate.integer) {\n return parseInt(value, 10);\n } else {\n return parseFloat(value);\n }\n }\n }, {\n key: \"setInputMask\",\n value: function setInputMask(input) {\n var numberPattern = '[0-9';\n numberPattern += this.decimalSeparator || '';\n numberPattern += this.delimiter || '';\n numberPattern += ']*';\n input.setAttribute('pattern', numberPattern);\n input.mask = (0, _vanillaTextMask.maskInput)({\n inputElement: input,\n mask: this.numberMask,\n shadowRoot: this.root ? this.root.shadowRoot : null\n });\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(NumberComponent.prototype), \"inputInfo\", this);\n if (this.component.mask) {\n info.attr.type = 'password';\n } else {\n info.attr.type = 'text';\n }\n info.attr.inputmode = this.isDecimalAllowed() ? 'decimal' : 'numeric';\n info.changeEvent = 'input';\n return info;\n }\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n if (!this.refs.input.length || !this.refs.input[index]) {\n return null;\n }\n var val = this.refs.input[index].value;\n return val && val !== '-_' ? this.parseNumber(val) : null;\n }\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n return _get(_getPrototypeOf(NumberComponent.prototype), \"setValueAt\", this).call(this, index, this.formatValue(this.parseValue(value)), flags);\n }\n }, {\n key: \"parseValue\",\n value: function parseValue(input) {\n if (typeof input === 'string') {\n input = input.split(this.delimiter).join('').replace(this.decimalSeparator, '.');\n }\n var value = parseFloat(input);\n if (!_lodash[\"default\"].isNaN(value)) {\n value = String(value).replace('.', this.decimalSeparator);\n } else {\n value = null;\n }\n return value;\n }\n }, {\n key: \"formatValue\",\n value: function formatValue(value) {\n if (this.component.requireDecimal && value && !value.includes(this.decimalSeparator)) {\n return \"\".concat(value).concat(this.decimalSeparator).concat(_lodash[\"default\"].repeat('0', this.decimalLimit));\n } else if (this.component.requireDecimal && value && value.includes(this.decimalSeparator)) {\n return \"\".concat(value).concat(_lodash[\"default\"].repeat('0', this.decimalLimit - value.split(this.decimalSeparator)[1].length));\n }\n return value;\n }\n }, {\n key: \"focus\",\n value: function focus() {\n var input = this.refs.input[0];\n if (input) {\n _get(_getPrototypeOf(NumberComponent.prototype), \"focus\", this).call(this);\n input.setSelectionRange(0, input.value.length);\n }\n }\n }, {\n key: \"getMaskedValue\",\n value: function getMaskedValue(value) {\n value = value === null ? '0' : value.toString();\n if (value.includes('.') && '.' !== this.decimalSeparator) {\n value = value.replace('.', this.decimalSeparator);\n }\n return (0, _vanillaTextMask.conformToMask)(this.formatValue(value), this.numberMask).conformedValue;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n var _this2 = this;\n if (!value && value !== 0) {\n return '';\n }\n value = this.getWidgetValueAsString(value, options);\n if (Array.isArray(value)) {\n return value.map(function (val) {\n return _this2.getMaskedValue(val);\n }).join(', ');\n }\n return this.getMaskedValue(value);\n }\n }, {\n key: \"addFocusBlurEvents\",\n value: function addFocusBlurEvents(element) {\n var _this3 = this;\n _get(_getPrototypeOf(NumberComponent.prototype), \"addFocusBlurEvents\", this).call(this, element);\n this.addEventListener(element, 'blur', function () {\n element.value = _this3.getValueAsString(_this3.formatValue(_this3.parseValue(element.value)));\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 _Input2[\"default\"].schema.apply(_Input2[\"default\"], [{\n type: 'number',\n label: 'Number',\n key: 'number',\n validate: {\n min: '',\n max: '',\n step: 'any',\n integer: ''\n }\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Number',\n icon: 'hashtag',\n group: 'basic',\n documentation: '/userguide/form-building/form-components#number',\n weight: 30,\n schema: NumberComponent.schema()\n };\n }\n }]);\n return NumberComponent;\n}(_Input2[\"default\"]);\nexports[\"default\"] = NumberComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/number/Number.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.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.array.join.js */ \"./node_modules/core-js/modules/es.array.join.js\");\n__webpack_require__(/*! core-js/modules/es.string.split.js */ \"./node_modules/core-js/modules/es.string.split.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.parse-float.js */ \"./node_modules/core-js/modules/es.parse-float.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.string.repeat.js */ \"./node_modules/core-js/modules/es.string.repeat.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.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.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 _textMaskAddons = __webpack_require__(/*! @formio/text-mask-addons */ \"./node_modules/@formio/text-mask-addons/dist/textMaskAddons.js\");\nvar _vanillaTextMask = __webpack_require__(/*! @formio/vanilla-text-mask */ \"./node_modules/@formio/vanilla-text-mask/dist/vanillaTextMask.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nvar _Input2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/input/Input */ \"./lib/components/_classes/input/Input.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 NumberComponent = /*#__PURE__*/function (_Input) {\n _inherits(NumberComponent, _Input);\n var _super = _createSuper(NumberComponent);\n function NumberComponent() {\n var _this$options$propert;\n var _this;\n _classCallCheck(this, NumberComponent);\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.validators = _this.validators.concat(['min', 'max']);\n var separators = (0, _utils.getNumberSeparators)(_this.options.language || navigator.language);\n _this.decimalSeparator = _this.options.decimalSeparator = _this.options.decimalSeparator || ((_this$options$propert = _this.options.properties) === null || _this$options$propert === void 0 ? void 0 : _this$options$propert.decimalSeparator) || separators.decimalSeparator;\n if (_this.component.delimiter) {\n var _this$options$propert2;\n if (_this.options.hasOwnProperty('thousandsSeparator')) {\n console.warn(\"Property 'thousandsSeparator' is deprecated. Please use i18n to specify delimiter.\");\n }\n _this.delimiter = ((_this$options$propert2 = _this.options.properties) === null || _this$options$propert2 === void 0 ? void 0 : _this$options$propert2.thousandsSeparator) || _this.options.thousandsSeparator || separators.delimiter;\n } else {\n _this.delimiter = '';\n }\n var requireDecimal = _lodash[\"default\"].get(_this.component, 'requireDecimal', false);\n _this.decimalLimit = (0, _utils.getNumberDecimalLimit)(_this.component, requireDecimal ? 2 : 20);\n\n // Currencies to override BrowserLanguage Config. Object key {}\n if (_lodash[\"default\"].has(_this.options, \"languageOverride.\".concat(_this.options.language))) {\n var override = _lodash[\"default\"].get(_this.options, \"languageOverride.\".concat(_this.options.language));\n _this.decimalSeparator = override.decimalSeparator;\n _this.delimiter = override.delimiter;\n }\n _this.numberMask = _this.createNumberMask();\n return _this;\n }\n\n /**\n * Creates the number mask for normal numbers.\n *\n * @return {*}\n */\n _createClass(NumberComponent, [{\n key: \"createNumberMask\",\n value: function createNumberMask() {\n return (0, _textMaskAddons.createNumberMask)({\n prefix: '',\n suffix: '',\n requireDecimal: _lodash[\"default\"].get(this.component, 'requireDecimal', false),\n thousandsSeparatorSymbol: _lodash[\"default\"].get(this.component, 'thousandsSeparator', this.delimiter),\n decimalSymbol: _lodash[\"default\"].get(this.component, 'decimalSymbol', this.decimalSeparator),\n decimalLimit: _lodash[\"default\"].get(this.component, 'decimalLimit', this.decimalLimit),\n allowNegative: _lodash[\"default\"].get(this.component, 'allowNegative', true),\n allowDecimal: this.isDecimalAllowed()\n });\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return NumberComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(NumberComponent.prototype), \"defaultValue\", this);\n if (!defaultValue && this.component.defaultValue === 0) {\n defaultValue = this.component.defaultValue;\n }\n if (!this.component.multiple && _lodash[\"default\"].isArray(defaultValue)) {\n defaultValue = !defaultValue[0] && defaultValue[0] !== 0 ? null : defaultValue[0];\n }\n return defaultValue;\n }\n }, {\n key: \"isDecimalAllowed\",\n value: function isDecimalAllowed() {\n return _lodash[\"default\"].get(this.component, 'allowDecimal', !(this.component.validate && this.component.validate.integer));\n }\n }, {\n key: \"parseNumber\",\n value: function parseNumber(value) {\n // Remove delimiters and convert decimal separator to dot.\n value = value.split(this.delimiter).join('').replace(this.decimalSeparator, '.');\n if (this.component.validate && this.component.validate.integer) {\n return parseInt(value, 10);\n } else {\n return parseFloat(value);\n }\n }\n }, {\n key: \"setInputMask\",\n value: function setInputMask(input) {\n var numberPattern = '[0-9';\n numberPattern += this.decimalSeparator || '';\n numberPattern += this.delimiter || '';\n numberPattern += ']*';\n input.setAttribute('pattern', numberPattern);\n input.mask = (0, _vanillaTextMask.maskInput)({\n inputElement: input,\n mask: this.numberMask,\n shadowRoot: this.root ? this.root.shadowRoot : null\n });\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(NumberComponent.prototype), \"inputInfo\", this);\n if (this.component.mask) {\n info.attr.type = 'password';\n } else {\n info.attr.type = 'text';\n }\n info.attr.inputmode = this.isDecimalAllowed() ? 'decimal' : 'numeric';\n info.changeEvent = 'input';\n return info;\n }\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n if (!this.refs.input.length || !this.refs.input[index]) {\n return null;\n }\n var val = this.refs.input[index].value;\n return val && val !== '-_' ? this.parseNumber(val) : null;\n }\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n return _get(_getPrototypeOf(NumberComponent.prototype), \"setValueAt\", this).call(this, index, this.formatValue(this.parseValue(value)), flags);\n }\n }, {\n key: \"parseValue\",\n value: function parseValue(input) {\n if (typeof input === 'string') {\n input = input.split(this.delimiter).join('').replace(this.decimalSeparator, '.');\n }\n var value = parseFloat(input);\n if (!_lodash[\"default\"].isNaN(value)) {\n value = String(value).replace('.', this.decimalSeparator);\n } else {\n value = null;\n }\n return value;\n }\n }, {\n key: \"formatValue\",\n value: function formatValue(value) {\n if (this.component.requireDecimal && value && !value.includes(this.decimalSeparator)) {\n return \"\".concat(value).concat(this.decimalSeparator).concat(_lodash[\"default\"].repeat('0', this.decimalLimit));\n } else if (this.component.requireDecimal && value && value.includes(this.decimalSeparator)) {\n return \"\".concat(value).concat(_lodash[\"default\"].repeat('0', this.decimalLimit - value.split(this.decimalSeparator)[1].length));\n }\n return value;\n }\n }, {\n key: \"focus\",\n value: function focus() {\n var input = this.refs.input[0];\n if (input) {\n _get(_getPrototypeOf(NumberComponent.prototype), \"focus\", this).call(this);\n input.setSelectionRange(0, input.value.length);\n }\n }\n }, {\n key: \"getMaskedValue\",\n value: function getMaskedValue(value) {\n value = value === null ? '0' : value.toString();\n if (value.includes('.') && '.' !== this.decimalSeparator) {\n value = value.replace('.', this.decimalSeparator);\n }\n return (0, _vanillaTextMask.conformToMask)(this.formatValue(value), this.numberMask).conformedValue;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n var _this2 = this;\n if (!value && value !== 0) {\n return '';\n }\n value = this.getWidgetValueAsString(value, options);\n if (Array.isArray(value)) {\n return value.map(function (val) {\n return _this2.getMaskedValue(val);\n }).join(', ');\n }\n return this.getMaskedValue(value);\n }\n }, {\n key: \"addFocusBlurEvents\",\n value: function addFocusBlurEvents(element) {\n var _this3 = this;\n _get(_getPrototypeOf(NumberComponent.prototype), \"addFocusBlurEvents\", this).call(this, element);\n this.addEventListener(element, 'blur', function () {\n element.value = _this3.getValueAsString(_this3.formatValue(_this3.parseValue(element.value)));\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 _Input2[\"default\"].schema.apply(_Input2[\"default\"], [{\n type: 'number',\n label: 'Number',\n key: 'number',\n validate: {\n min: '',\n max: '',\n step: 'any',\n integer: ''\n }\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Number',\n icon: 'hashtag',\n group: 'basic',\n documentation: '/userguide/form-building/form-components#number',\n weight: 30,\n schema: NumberComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return {\n operators: ['isEqual', 'isNotEqual', 'isEmpty', 'isNotEmpty', 'greaterThan', 'greaterThanOrEqual', 'lessThan', 'lessThanOrEqual'],\n valueComponent: function valueComponent(classComp) {\n return _objectSpread(_objectSpread({}, classComp), {}, {\n type: 'number'\n });\n }\n };\n }\n }]);\n return NumberComponent;\n}(_Input2[\"default\"]);\nexports[\"default\"] = NumberComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/number/Number.js?"); /***/ }), @@ -1619,7 +1619,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.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.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 _TextField = _interopRequireDefault(__webpack_require__(/*! ../textfield/TextField */ \"./lib/components/textfield/TextField.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 _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 PhoneNumberComponent = /*#__PURE__*/function (_TextFieldComponent) {\n _inherits(PhoneNumberComponent, _TextFieldComponent);\n var _super = _createSuper(PhoneNumberComponent);\n function PhoneNumberComponent() {\n _classCallCheck(this, PhoneNumberComponent);\n return _super.apply(this, arguments);\n }\n _createClass(PhoneNumberComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return PhoneNumberComponent.schema();\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 _TextField[\"default\"].schema.apply(_TextField[\"default\"], [{\n type: 'phoneNumber',\n label: 'Phone Number',\n key: 'phoneNumber',\n inputType: 'tel',\n inputMask: '(999) 999-9999',\n inputMode: 'decimal',\n displayMask: ''\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Phone Number',\n group: 'advanced',\n icon: 'phone-square',\n weight: 30,\n documentation: '/userguide/form-building/advanced-components#phone-number',\n schema: PhoneNumberComponent.schema()\n };\n }\n }]);\n return PhoneNumberComponent;\n}(_TextField[\"default\"]);\nexports[\"default\"] = PhoneNumberComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/phonenumber/PhoneNumber.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.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.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 _TextField = _interopRequireDefault(__webpack_require__(/*! ../textfield/TextField */ \"./lib/components/textfield/TextField.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 PhoneNumberComponent = /*#__PURE__*/function (_TextFieldComponent) {\n _inherits(PhoneNumberComponent, _TextFieldComponent);\n var _super = _createSuper(PhoneNumberComponent);\n function PhoneNumberComponent() {\n _classCallCheck(this, PhoneNumberComponent);\n return _super.apply(this, arguments);\n }\n _createClass(PhoneNumberComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return PhoneNumberComponent.schema();\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (options !== null && options !== void 0 && options.email && this.visible && !this.skipInEmail && _lodash[\"default\"].isObject(value)) {\n var result = \"\\n \\n \\n \\n \\n \\n \\n \\n
\".concat(value.maskName, \"\").concat(value.value, \"
\\n \");\n return result;\n }\n return _get(_getPrototypeOf(PhoneNumberComponent.prototype), \"getValueAsString\", this).call(this, value, options);\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 _TextField[\"default\"].schema.apply(_TextField[\"default\"], [{\n type: 'phoneNumber',\n label: 'Phone Number',\n key: 'phoneNumber',\n inputType: 'tel',\n inputMask: '(999) 999-9999',\n inputMode: 'decimal',\n displayMask: ''\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Phone Number',\n group: 'advanced',\n icon: 'phone-square',\n weight: 30,\n documentation: '/userguide/form-building/advanced-components#phone-number',\n schema: PhoneNumberComponent.schema()\n };\n }\n }]);\n return PhoneNumberComponent;\n}(_TextField[\"default\"]);\nexports[\"default\"] = PhoneNumberComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/phonenumber/PhoneNumber.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.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.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\");\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.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 _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 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: \"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.shouldLoad = true;\n this.loadedOptions = [];\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 input.checked = dataValue === input.value && (input.value || _this3.component.dataSrc !== 'url');\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 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) {\n if (input.checked) {\n value = input.value;\n }\n });\n return value;\n }\n }, {\n key: \"validateValueProperty\",\n value: function validateValueProperty() {\n var _this5 = this;\n if (this.component.dataSrc === 'values') {\n return true;\n }\n return !_lodash[\"default\"].some(this.refs.wrapper, function (wrapper, index) {\n return _this5.refs.input[index].checked && _this5.loadedOptions[index].invalid;\n });\n }\n }, {\n key: \"validateValueAvailability\",\n value: function validateValueAvailability(setting, value) {\n var _this6 = 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 _this6.normalizeValue(optionValue) === value;\n }) !== -1;\n }\n return false;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n 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 _this7 = this;\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 if (this.shouldLoad) {\n this.loading = true;\n _Formio.GlobalFormio.makeRequest(this.options.formio, 'select', url, method, body, options).then(function (response) {\n _this7.loading = false;\n _this7.error = null;\n _this7.setItems(response);\n _this7.shouldLoad = false;\n _this7.redraw();\n })[\"catch\"](function (err) {\n _this7.handleLoadingError(err);\n });\n }\n }\n }, {\n key: \"setItems\",\n value: function setItems(items) {\n var _this8 = this;\n items === null || items === void 0 ? void 0 : items.forEach(function (item, i) {\n _this8.loadedOptions[i] = {\n value: item[_this8.component.valueProperty],\n label: _this8.itemTemplate(item, item[_this8.component.valueProperty])\n };\n if (_lodash[\"default\"].isUndefined(item[_this8.component.valueProperty]) || _lodash[\"default\"].isObject(item[_this8.component.valueProperty]) || !_this8.isRadio && _lodash[\"default\"].isBoolean(item[_this8.component.valueProperty])) {\n _this8.loadedOptions[i].invalid = true;\n }\n });\n }\n }, {\n key: \"setSelectedClasses\",\n value: function setSelectedClasses() {\n var _this9 = 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 = _this9.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 _this9.addClass(wrapper, _this9.optionSelectedClass);\n //change \"checked\" attribute\n input.setAttribute('checked', 'true');\n } else {\n _this9.removeClass(wrapper, _this9.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 if (!isNaN(parseFloat(value)) && isFinite(value)) {\n value = +value;\n }\n if (value === 'true') {\n value = true;\n }\n if (value === 'false') {\n value = false;\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 return RadioComponent;\n}(_ListComponent2[\"default\"]);\nexports[\"default\"] = RadioComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/radio/Radio.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.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\");\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.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 _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 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 if (!isNaN(parseFloat(value)) && isFinite(value)) {\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 return RadioComponent;\n}(_ListComponent2[\"default\"]);\nexports[\"default\"] = RadioComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/radio/Radio.js?"); /***/ }), @@ -1740,7 +1740,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.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 _Select = _interopRequireDefault(__webpack_require__(/*! ../select/Select */ \"./lib/components/select/Select.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 ResourceComponent = /*#__PURE__*/function (_SelectComponent) {\n _inherits(ResourceComponent, _SelectComponent);\n var _super = _createSuper(ResourceComponent);\n function ResourceComponent() {\n _classCallCheck(this, ResourceComponent);\n return _super.apply(this, arguments);\n }\n _createClass(ResourceComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(ResourceComponent.prototype), \"init\", this).call(this);\n this.component.dataSrc = 'resource';\n this.component.data = {\n resource: this.component.resource\n };\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return ResourceComponent.schema();\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 _Select[\"default\"].schema.apply(_Select[\"default\"], [{\n type: 'resource',\n label: 'Resource',\n key: 'resource',\n dataSrc: 'resource',\n resource: '',\n project: '',\n template: '{{ item.data }}'\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Resource',\n group: 'premium',\n icon: 'files-o',\n weight: 90,\n documentation: '/userguide/form-building/form-components#resource',\n schema: ResourceComponent.schema()\n };\n }\n }]);\n return ResourceComponent;\n}(_Select[\"default\"]);\nexports[\"default\"] = ResourceComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/resource/Resource.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.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.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 _Select = _interopRequireDefault(__webpack_require__(/*! ../select/Select */ \"./lib/components/select/Select.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 ResourceComponent = /*#__PURE__*/function (_SelectComponent) {\n _inherits(ResourceComponent, _SelectComponent);\n var _super = _createSuper(ResourceComponent);\n function ResourceComponent() {\n _classCallCheck(this, ResourceComponent);\n return _super.apply(this, arguments);\n }\n _createClass(ResourceComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(ResourceComponent.prototype), \"init\", this).call(this);\n this.component.dataSrc = 'resource';\n this.component.data = {\n resource: this.component.resource\n };\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return ResourceComponent.schema();\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 _Select[\"default\"].schema.apply(_Select[\"default\"], [{\n type: 'resource',\n label: 'Resource',\n key: 'resource',\n dataSrc: 'resource',\n resource: '',\n project: '',\n template: '{{ item.data }}'\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Resource',\n icon: 'files-o',\n weight: 90,\n documentation: '/userguide/form-building/form-components#resource',\n schema: ResourceComponent.schema()\n };\n }\n }]);\n return ResourceComponent;\n}(_Select[\"default\"]);\nexports[\"default\"] = ResourceComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/resource/Resource.js?"); /***/ }), @@ -1751,7 +1751,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;\nvar _default = [{\n key: 'resourceInfo',\n weight: -10,\n type: 'htmlelement',\n tag: 'div',\n className: 'alert alert-danger',\n content: 'The Resource component is deprecated. Use the Select component with data source of \"Resource\" instead.'\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 label: 'Resource',\n key: 'resource',\n weight: 50,\n tooltip: 'The resource to be used with this field.'\n}, {\n type: 'tags',\n input: true,\n key: 'selectFields',\n label: 'Select Fields',\n tooltip: 'The properties on the resource to return as part of the options. If left blank, all properties will be returned.',\n placeholder: 'Enter the fields to select.',\n weight: 51\n}, {\n type: 'tags',\n input: true,\n key: 'searchFields',\n label: 'Search Fields',\n tooltip: 'A list of search filters based on the fields of the resource. See the Resource.js documentation for the format of these filters.',\n placeholder: 'The fields to query on the server',\n weight: 52\n}, {\n type: 'textfield',\n input: true,\n key: 'filter',\n label: 'Filter Query',\n weight: 53,\n description: 'The filter query for results.',\n tooltip: 'Use this to provide additional filtering using query parameters.'\n}, {\n type: 'textfield',\n input: true,\n key: 'sort',\n label: 'Sort Query',\n weight: 53,\n description: 'The sort query for results',\n tooltip: 'Use this to provide additional sorting using query parameters'\n}, {\n type: 'textarea',\n input: true,\n key: 'template',\n label: 'Item Template',\n editor: 'ace',\n as: 'html',\n rows: 3,\n weight: 53,\n tooltip: 'The HTML template for the result data items.'\n}, {\n type: 'checkbox',\n input: true,\n weight: 54,\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: 55,\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}];\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/components/resource/editForm/Resource.edit.display.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;\nvar _default = [{\n key: 'resourceInfo',\n weight: -10,\n type: 'htmlelement',\n tag: 'div',\n className: 'alert alert-danger',\n content: 'This component has been deprecated and will be removed in a future version of Formio.js.'\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 label: 'Resource',\n key: 'resource',\n weight: 50,\n tooltip: 'The resource to be used with this field.'\n}, {\n type: 'tags',\n input: true,\n key: 'selectFields',\n label: 'Select Fields',\n tooltip: 'The properties on the resource to return as part of the options. If left blank, all properties will be returned.',\n placeholder: 'Enter the fields to select.',\n weight: 51\n}, {\n type: 'tags',\n input: true,\n key: 'searchFields',\n label: 'Search Fields',\n tooltip: 'A list of search filters based on the fields of the resource. See the Resource.js documentation for the format of these filters.',\n placeholder: 'The fields to query on the server',\n weight: 52\n}, {\n type: 'textfield',\n input: true,\n key: 'filter',\n label: 'Filter Query',\n weight: 53,\n description: 'The filter query for results.',\n tooltip: 'Use this to provide additional filtering using query parameters.'\n}, {\n type: 'textfield',\n input: true,\n key: 'sort',\n label: 'Sort Query',\n weight: 53,\n description: 'The sort query for results',\n tooltip: 'Use this to provide additional sorting using query parameters'\n}, {\n type: 'textarea',\n input: true,\n key: 'template',\n label: 'Item Template',\n editor: 'ace',\n as: 'html',\n rows: 3,\n weight: 53,\n tooltip: 'The HTML template for the result data items.'\n}, {\n type: 'checkbox',\n input: true,\n weight: 54,\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: 55,\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}];\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/components/resource/editForm/Resource.edit.display.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\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.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.string.match.js */ \"./node_modules/core-js/modules/es.string.match.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.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/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.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.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.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.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 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 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: \"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 ? 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 // 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 && typeof this.component.onSetItems === 'function') {\n var newItems = this.component.onSetItems(this, 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()) {\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: \"getTemplateKeys\",\n value: function getTemplateKeys() {\n var _this6 = this;\n this.templateKeys = [];\n if (this.options.readOnly && this.component.template) {\n var keys = this.component.template.match(/({{\\s*(.*?)\\s*}})/g);\n if (keys) {\n keys.forEach(function (key) {\n var propKey = key.match(/{{\\s*item\\.(.*?)\\s*}}/);\n if (propKey && propKey.length > 1) {\n _this6.templateKeys.push(propKey[1]);\n }\n });\n }\n }\n }\n }, {\n key: \"loadingError\",\n get: function get() {\n return !this.component.refreshOn && !this.component.refreshOnBlur && this.networkError;\n }\n }, {\n key: \"selectData\",\n get: function get() {\n var selectData = _lodash[\"default\"].get(this.root, 'submission.metadata.selectData', {});\n return _lodash[\"default\"].get(selectData, this.path);\n }\n }, {\n key: \"shouldLoad\",\n get: function get() {\n if (this.loadingError) {\n return false;\n }\n // Live forms should always load.\n if (!this.options.readOnly) {\n return true;\n }\n\n // If there are template keys, then we need to see if we have the data.\n if (this.templateKeys && this.templateKeys.length) {\n // See if we already have the data we need.\n var dataValue = this.dataValue;\n var selectData = this.selectData;\n return this.templateKeys.reduce(function (shouldLoad, key) {\n var hasValue = _lodash[\"default\"].has(dataValue, key) || _lodash[\"default\"].has(selectData, key);\n return shouldLoad || !hasValue;\n }, false);\n }\n\n // Return that we should load.\n return true;\n }\n }, {\n key: \"loadItems\",\n value: function loadItems(url, search, headers, options, method, body) {\n var _this7 = 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(',') : 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 _this7.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 _this7.loading = false;\n _this7.error = null;\n _this7.setItems(response, !!search);\n })[\"catch\"](function (err) {\n if (_this7.itemsFromUrl) {\n _this7.setItems([]);\n _this7.disableInfiniteScroll();\n }\n _this7.isScrollLoading = false;\n _this7.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 _this8 = 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, _this8.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 _this9 = 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 _this9.loading = false;\n _this9.setItems(items || []);\n })[\"catch\"](function (err) {\n _this9.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 _this10 = 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 _this10.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 _this10.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.selectOptions || []);\n }\n this.focusableElement = input;\n this.addEventListener(input, 'focus', function () {\n return _this10.update();\n });\n this.addEventListener(input, 'keydown', function (event) {\n var key = event.key;\n if (['Backspace', 'Delete'].includes(key)) {\n _this10.setValue(_this10.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 _this10.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 _this10.onScroll();\n });\n }\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 _this10.isFromSearch = !!event.target.value;\n if (!event.target.value) {\n _this10.triggerUpdate();\n } else {\n _this10.serverCount = null;\n _this10.downloadedResources = [];\n }\n });\n }\n this.addEventListener(input, 'choice', function () {\n if (_this10.component.multiple && _this10.component.dataSrc === 'resource' && _this10.isFromSearch) {\n _this10.triggerUpdate();\n }\n _this10.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 _this10.triggerUpdate(evt.detail.value);\n };\n this.addEventListener(input, 'search', _lodash[\"default\"].debounce(updateComponent, debounceTimeout));\n this.addEventListener(input, 'stopSearch', function () {\n return _this10.triggerUpdate();\n });\n this.addEventListener(input, 'hideDropdown', function () {\n if (_this10.choices && _this10.choices.input && _this10.choices.input.element) {\n _this10.choices.input.element.value = '';\n }\n _this10.updateItems(null, true);\n });\n }\n this.addEventListener(input, 'showDropdown', function () {\n return _this10.update();\n });\n if (this.choices && choicesOptions.placeholderValue && this.choices._isSelectOneElement) {\n this.addPlaceholderItem(choicesOptions.placeholderValue);\n this.addEventListener(input, 'removeItem', function () {\n _this10.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 = _this10.ce('div');\n var dialog = _this10.createModal(formioForm);\n var projectUrl = _lodash[\"default\"].get(_this10.root, 'formio.projectUrl', _Formio.GlobalFormio.getProjectUrl());\n var formUrl = \"\".concat(projectUrl, \"/form/\").concat(_this10.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 = _this10.valueProperty ? _lodash[\"default\"].get(submission, _this10.valueProperty) : submission;\n if (_this10.component.multiple) {\n value = [].concat(_toConsumableArray(_this10.dataValue), [value]);\n }\n _this10.setValue(value);\n _this10.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: \"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) {\n return this.component.multiple && Array.isArray(data) ? data.map(this.asString.bind(this)).join(', ') : this.asString(data);\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 _this13 = 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 && dataValue.length) {\n dataValue.forEach(function (dataValueItem) {\n var dataValueItemValue = _this13.component.reference ? dataValueItem._id.toString() : dataValueItem;\n templateData[dataValueItemValue] = _this13.templateData[dataValueItemValue];\n });\n }\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 _this14 = this;\n if (this.component.multiple && Array.isArray(value)) {\n return value.map(function (singleValue) {\n return _this14.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 _this15 = 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, {}))) {\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 _this15.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 _this15.addValueOptions();\n _this15.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.shouldLoad && 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) {\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 _this16 = 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 = _this16.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 _this16.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 _this17 = 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 _this17.getOptionValue(_this17.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 _this18 = 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(_this18.normalizeSingleValue(value.value))\n };\n });\n }\n }, {\n key: \"asString\",\n value: function asString(value) {\n var _value3,\n _this19 = this;\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 (_this19.isBooleanOrNumber(data)) {\n data = data.toString();\n }\n if (Array.isArray(data) && data.some(function (item) {\n return _this19.isBooleanOrNumber(item);\n })) {\n data = data.map(function (item) {\n if (_this19.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 = _this19.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 if (Array.isArray(value)) {\n var _items = [];\n value.forEach(function (item) {\n return _items.push(_this19.itemTemplate(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 return !_lodash[\"default\"].isNil(value) ? this.itemTemplate(value) : '-';\n }\n }, {\n key: \"detach\",\n value: function detach() {\n _get(_getPrototypeOf(SelectComponent.prototype), \"detach\", this).call(this);\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 }\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 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.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.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.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 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 // 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 && typeof this.component.onSetItems === 'function') {\n var newItems = this.component.onSetItems(this, 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.selectOptions || []);\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 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(updateComponent, 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 return _this9.update();\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: \"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 _this10 = this;\n if (this.component.refreshOnBlur) {\n this.on('blur', function (instance) {\n _this10.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 _this11 = 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 === _this11.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 : _this11.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(_this11.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 _this11.addOption(notFoundValue.value, notFoundValue.label);\n });\n }\n return added;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(data) {\n return this.component.multiple && Array.isArray(data) ? data.map(this.asString.bind(this)).join(', ') : this.asString(data);\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 _this12 = 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 = _this12.component.reference ? dataValueItem._id.toString() : dataValueItem;\n templateData[dataValueItemValue] = _this12.templateData[dataValueItemValue];\n });\n }\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 _this13 = this;\n if (this.component.multiple && Array.isArray(value)) {\n return value.map(function (singleValue) {\n return _this13.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 _this14 = 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 _this14.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 _this14.addValueOptions();\n _this14.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 _this15 = 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 = _this15.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 _this15.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 _this16 = 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 _this16.getOptionValue(_this16.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 _this17 = 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(_this17.normalizeSingleValue(value.value))\n };\n });\n }\n }, {\n key: \"asString\",\n value: function asString(value) {\n var _value3,\n _this18 = this;\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 (_this18.isBooleanOrNumber(data)) {\n data = data.toString();\n }\n if (Array.isArray(data) && data.some(function (item) {\n return _this18.isBooleanOrNumber(item);\n })) {\n data = data.map(function (item) {\n if (_this18.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 = _this18.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 if (Array.isArray(value)) {\n var _items = [];\n value.forEach(function (item) {\n return _items.push(_this18.itemTemplate(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) ? this.itemTemplate(value) : '-';\n }\n }, {\n key: \"detach\",\n value: function detach() {\n _get(_getPrototypeOf(SelectComponent.prototype), \"detach\", this).call(this);\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 }\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 _objectSpread(_objectSpread({}, _get(_getPrototypeOf(SelectComponent), \"serverConditionSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n return _objectSpread(_objectSpread({}, classComp), {}, {\n type: 'select'\n });\n }\n });\n }\n }]);\n return SelectComponent;\n}(_ListComponent2[\"default\"]);\nexports[\"default\"] = SelectComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/select/Select.js?"); /***/ }), @@ -1828,7 +1828,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.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\");\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.function.name.js */ \"./node_modules/core-js/modules/es.function.name.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.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.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.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.map.js */ \"./node_modules/core-js/modules/es.array.map.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.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.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.find.js */ \"./node_modules/core-js/modules/es.array.find.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 _Radio = _interopRequireDefault(__webpack_require__(/*! ../radio/Radio */ \"./lib/components/radio/Radio.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\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 _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 SelectBoxesComponent = /*#__PURE__*/function (_RadioComponent) {\n _inherits(SelectBoxesComponent, _RadioComponent);\n var _super = _createSuper(SelectBoxesComponent);\n function SelectBoxesComponent() {\n var _this;\n _classCallCheck(this, SelectBoxesComponent);\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.validators = _this.validators.concat('minSelectedCount', 'maxSelectedCount', 'availableValueProperty');\n return _this;\n }\n _createClass(SelectBoxesComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(SelectBoxesComponent.prototype), \"init\", this).call(this);\n this.component.inputType = 'checkbox';\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return SelectBoxesComponent.schema();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(SelectBoxesComponent.prototype), \"elementInfo\", this).call(this);\n info.attr.name += '[]';\n info.attr.type = 'checkbox';\n info.attr[\"class\"] = 'form-check-input';\n return info;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.component.values.reduce(function (prev, value) {\n if (value.value) {\n prev[value.value] = false;\n }\n return prev;\n }, {});\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = this.emptyValue;\n if (!_lodash[\"default\"].isEmpty(this.component.defaultValue)) {\n defaultValue = this.component.defaultValue;\n }\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 /**\n * Only empty if the values are all false.\n *\n * @param value\n * @return {boolean}\n */\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n var empty = true;\n for (var key in value) {\n if (value.hasOwnProperty(key) && value[key]) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n if (this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var value = {};\n _lodash[\"default\"].each(this.refs.input, function (input) {\n value[input.value] = !!input.checked;\n });\n return value;\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 value = value || {};\n if (_typeof(value) !== 'object') {\n if (typeof value === 'string') {\n value = _defineProperty({}, value, true);\n } else {\n value = {};\n }\n }\n if (Array.isArray(value)) {\n _lodash[\"default\"].each(value, function (val) {\n value[val] = true;\n });\n }\n return value;\n }\n\n /**\n * Set the value of this component.\n *\n * @param value\n * @param flags\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.isHtmlRenderMode()) {\n if (changed) {\n this.redraw();\n }\n } else {\n _lodash[\"default\"].each(this.refs.input, function (input) {\n if (_lodash[\"default\"].isUndefined(value[input.value])) {\n value[input.value] = false;\n }\n input.checked = !!value[input.value];\n });\n }\n return changed;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (!value) {\n return '';\n }\n return (0, _lodash[\"default\"])(this.component.values || []).filter(function (v) {\n return value[v.value];\n }).map('label').join(', ');\n }\n }, {\n key: \"setSelectedClasses\",\n value: function setSelectedClasses() {\n var _this2 = this;\n if (this.refs.wrapper) {\n //add/remove selected option class\n var value = this.dataValue;\n var valuesKeys = Object.keys(value);\n this.refs.wrapper.forEach(function (wrapper, index) {\n var key = valuesKeys[index];\n var input = _this2.refs.input[index];\n if ((input === null || input === void 0 ? void 0 : input.value.toString()) !== key) {\n key = valuesKeys.find(function (k) {\n return (input === null || input === void 0 ? void 0 : input.value.toString()) === k;\n });\n }\n var isChecked = value[key];\n if (isChecked && key) {\n //add class to container when selected\n _this2.addClass(wrapper, _this2.optionSelectedClass);\n //change \"checked\" attribute\n input.setAttribute('checked', 'true');\n } else if (!isChecked && key) {\n _this2.removeClass(wrapper, _this2.optionSelectedClass);\n input.removeAttribute('checked');\n }\n });\n }\n }\n }, {\n key: \"setInputsDisabled\",\n value: function setInputsDisabled(value, onlyUnchecked) {\n if (this.refs.input) {\n this.refs.input.forEach(function (item) {\n if (onlyUnchecked && !item.checked || !onlyUnchecked) {\n item.disabled = value;\n }\n });\n }\n }\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, rowData, options) {\n var _this3 = this;\n var minCount = this.component.validate.minSelectedCount;\n var maxCount = this.component.validate.maxSelectedCount;\n var isValid = this.isValid(data, dirty);\n if ((maxCount || minCount) && !this.shouldSkipValidation(data, dirty, rowData)) {\n var count = Object.keys(this.validationValue).reduce(function (total, key) {\n if (_this3.validationValue[key]) {\n total++;\n }\n return total;\n }, 0);\n\n // Disable the rest of inputs if the max amount is already checked\n if (maxCount && count >= maxCount) {\n this.setInputsDisabled(true, true);\n } else if (maxCount && !this.shouldDisabled) {\n this.setInputsDisabled(false);\n }\n if (!isValid && maxCount && count > maxCount) {\n var message = this.t(this.component.maxSelectedCountMessage || 'You can only select up to {{maxCount}} items.', {\n maxCount: maxCount\n });\n this.setCustomValidity(message, dirty);\n return false;\n } else if (!isValid && minCount && count < minCount) {\n this.setInputsDisabled(false);\n var _message = this.t(this.component.minSelectedCountMessage || 'You must select at least {{minCount}} items.', {\n minCount: minCount\n });\n this.setCustomValidity(_message, dirty);\n return false;\n }\n }\n return _get(_getPrototypeOf(SelectBoxesComponent.prototype), \"checkComponentValidity\", this).call(this, data, dirty, rowData, options);\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 _Radio[\"default\"].schema.apply(_Radio[\"default\"], [{\n type: 'selectboxes',\n label: 'Select Boxes',\n key: 'selectBoxes',\n inline: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Select Boxes',\n group: 'basic',\n icon: 'plus-square',\n weight: 60,\n documentation: '/userguide/form-building/form-components#select-box',\n schema: SelectBoxesComponent.schema()\n };\n }\n }]);\n return SelectBoxesComponent;\n}(_Radio[\"default\"]);\nexports[\"default\"] = SelectBoxesComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/selectboxes/SelectBoxes.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.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.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.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.function.name.js */ \"./node_modules/core-js/modules/es.function.name.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.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.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.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.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.join.js */ \"./node_modules/core-js/modules/es.array.join.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.filter.js */ \"./node_modules/core-js/modules/es.array.filter.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.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.find.js */ \"./node_modules/core-js/modules/es.array.find.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 _Radio = _interopRequireDefault(__webpack_require__(/*! ../radio/Radio */ \"./lib/components/radio/Radio.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 _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 SelectBoxesComponent = /*#__PURE__*/function (_RadioComponent) {\n _inherits(SelectBoxesComponent, _RadioComponent);\n var _super = _createSuper(SelectBoxesComponent);\n function SelectBoxesComponent() {\n var _this;\n _classCallCheck(this, SelectBoxesComponent);\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.validators = _this.validators.concat('minSelectedCount', 'maxSelectedCount', 'availableValueProperty');\n return _this;\n }\n _createClass(SelectBoxesComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(SelectBoxesComponent.prototype), \"init\", this).call(this);\n this.component.inputType = 'checkbox';\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return SelectBoxesComponent.schema();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(SelectBoxesComponent.prototype), \"elementInfo\", this).call(this);\n info.attr.name += '[]';\n info.attr.type = 'checkbox';\n info.attr[\"class\"] = 'form-check-input';\n return info;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.component.values.reduce(function (prev, value) {\n if (value.value) {\n prev[value.value] = false;\n }\n return prev;\n }, {});\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = this.emptyValue;\n if (!_lodash[\"default\"].isEmpty(this.component.defaultValue)) {\n defaultValue = this.component.defaultValue;\n }\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 /**\n * Only empty if the values are all false.\n *\n * @param value\n * @return {boolean}\n */\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n var empty = true;\n for (var key in value) {\n if (value.hasOwnProperty(key) && value[key]) {\n empty = false;\n break;\n }\n }\n return empty;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n if (this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var value = {};\n _lodash[\"default\"].each(this.refs.input, function (input) {\n value[input.value] = !!input.checked;\n });\n return value;\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 _this2 = this;\n value = value || {};\n if (_typeof(value) !== 'object') {\n if (typeof value === 'string') {\n value = _defineProperty({}, value, true);\n } else {\n value = {};\n }\n }\n if (Array.isArray(value)) {\n _lodash[\"default\"].each(value, function (val) {\n value[val] = true;\n });\n }\n var checkedValues = _lodash[\"default\"].keys(_lodash[\"default\"].pickBy(value, function (val) {\n return val;\n }));\n if (this.isSelectURL && this.templateData && _lodash[\"default\"].every(checkedValues, function (val) {\n return _this2.templateData[val];\n })) {\n var submission = this.root.submission;\n if (!submission.metadata.selectData) {\n submission.metadata.selectData = {};\n }\n var selectData = [];\n checkedValues.forEach(function (value) {\n return selectData.push(_this2.templateData[value]);\n });\n _lodash[\"default\"].set(submission.metadata.selectData, this.path, selectData);\n }\n return value;\n }\n\n /**\n * Set the value of this component.\n *\n * @param value\n * @param flags\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.isHtmlRenderMode()) {\n if (changed) {\n this.redraw();\n }\n } else {\n _lodash[\"default\"].each(this.refs.input, function (input) {\n if (_lodash[\"default\"].isUndefined(value[input.value])) {\n value[input.value] = false;\n }\n input.checked = !!value[input.value];\n });\n }\n return changed;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (!value) {\n return '';\n }\n if (this.isSelectURL) {\n return (0, _lodash[\"default\"])(value).pickBy(function (val) {\n return val;\n }).keys().join(', ');\n }\n return (0, _lodash[\"default\"])(this.component.values || []).filter(function (v) {\n return value[v.value];\n }).map('label').join(', ');\n }\n }, {\n key: \"setSelectedClasses\",\n value: function setSelectedClasses() {\n var _this3 = this;\n if (this.refs.wrapper) {\n //add/remove selected option class\n var value = this.dataValue;\n var valuesKeys = Object.keys(value);\n this.refs.wrapper.forEach(function (wrapper, index) {\n var key = valuesKeys[index];\n var input = _this3.refs.input[index];\n if ((input === null || input === void 0 ? void 0 : input.value.toString()) !== key) {\n key = valuesKeys.find(function (k) {\n return (input === null || input === void 0 ? void 0 : input.value.toString()) === k;\n });\n }\n var isChecked = value[key];\n if (isChecked && key || _this3.isSelectURL && !_this3.shouldLoad && _this3.listData && _lodash[\"default\"].findIndex(_this3.selectData, _this3.listData[index]) !== -1) {\n //add class to container when selected\n _this3.addClass(wrapper, _this3.optionSelectedClass);\n //change \"checked\" attribute\n input.setAttribute('checked', 'true');\n } else if (!isChecked && key) {\n _this3.removeClass(wrapper, _this3.optionSelectedClass);\n input.removeAttribute('checked');\n }\n });\n }\n }\n }, {\n key: \"setInputsDisabled\",\n value: function setInputsDisabled(value, onlyUnchecked) {\n if (this.refs.input) {\n this.refs.input.forEach(function (item) {\n if (onlyUnchecked && !item.checked || !onlyUnchecked) {\n item.disabled = value;\n }\n });\n }\n }\n }, {\n key: \"checkComponentValidity\",\n value: function checkComponentValidity(data, dirty, rowData, options) {\n var _this4 = this;\n var minCount = this.component.validate.minSelectedCount;\n var maxCount = this.component.validate.maxSelectedCount;\n var isValid = this.isValid(data, dirty);\n if ((maxCount || minCount) && !this.shouldSkipValidation(data, dirty, rowData)) {\n var count = Object.keys(this.validationValue).reduce(function (total, key) {\n if (_this4.validationValue[key]) {\n total++;\n }\n return total;\n }, 0);\n\n // Disable the rest of inputs if the max amount is already checked\n if (maxCount && count >= maxCount) {\n this.setInputsDisabled(true, true);\n } else if (maxCount && !this.shouldDisabled) {\n this.setInputsDisabled(false);\n }\n if (!isValid && maxCount && count > maxCount) {\n var message = this.t(this.component.maxSelectedCountMessage || 'You can only select up to {{maxCount}} items.', {\n maxCount: maxCount\n });\n this.setCustomValidity(message, dirty);\n return false;\n } else if (!isValid && minCount && count < minCount) {\n this.setInputsDisabled(false);\n var _message = this.t(this.component.minSelectedCountMessage || 'You must select at least {{minCount}} items.', {\n minCount: minCount\n });\n this.setCustomValidity(_message, dirty);\n return false;\n }\n }\n return _get(_getPrototypeOf(SelectBoxesComponent.prototype), \"checkComponentValidity\", this).call(this, data, dirty, rowData, options);\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 _Radio[\"default\"].schema.apply(_Radio[\"default\"], [{\n type: 'selectboxes',\n label: 'Select Boxes',\n key: 'selectBoxes',\n inline: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Select Boxes',\n group: 'basic',\n icon: 'plus-square',\n weight: 60,\n documentation: '/userguide/form-building/form-components#select-box',\n schema: SelectBoxesComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(SelectBoxesComponent), \"serverConditionSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n return {\n type: 'select',\n dataSrc: 'custom',\n valueProperty: 'value',\n valueType: 'string',\n data: {\n custom: \"values = \".concat(classComp && classComp.values ? JSON.stringify(classComp.values) : [])\n }\n };\n }\n });\n }\n }]);\n return SelectBoxesComponent;\n}(_Radio[\"default\"]);\nexports[\"default\"] = SelectBoxesComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/selectboxes/SelectBoxes.js?"); /***/ }), @@ -1861,7 +1861,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/web.timers.js */ \"./node_modules/core-js/modules/web.timers.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.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.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _signature_pad = _interopRequireDefault(__webpack_require__(/*! signature_pad */ \"./node_modules/signature_pad/dist/signature_pad.js\"));\nvar _resizeObserverPolyfill = _interopRequireDefault(__webpack_require__(/*! resize-observer-polyfill */ \"./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js\"));\nvar _Input2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/input/Input */ \"./lib/components/_classes/input/Input.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 SignatureComponent = /*#__PURE__*/function (_Input) {\n _inherits(SignatureComponent, _Input);\n var _super = _createSuper(SignatureComponent);\n function SignatureComponent() {\n _classCallCheck(this, SignatureComponent);\n return _super.apply(this, arguments);\n }\n _createClass(SignatureComponent, [{\n key: \"init\",\n value: function init() {\n var _this$options, _this$component$overl, _this$component$overl2;\n _get(_getPrototypeOf(SignatureComponent.prototype), \"init\", this).call(this);\n this.currentWidth = 0;\n this.scale = 1;\n this.ratio = 1;\n if (!this.component.width) {\n this.component.width = '100%';\n }\n if (!this.component.height) {\n this.component.height = '200px';\n }\n if (this.component.keepOverlayRatio && ((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.display) === 'pdf' && (_this$component$overl = this.component.overlay) !== null && _this$component$overl !== void 0 && _this$component$overl.width && (_this$component$overl2 = this.component.overlay) !== null && _this$component$overl2 !== void 0 && _this$component$overl2.height) {\n var _this$component$overl3, _this$component$overl4;\n this.ratio = ((_this$component$overl3 = this.component.overlay) === null || _this$component$overl3 === void 0 ? void 0 : _this$component$overl3.width) / ((_this$component$overl4 = this.component.overlay) === null || _this$component$overl4 === void 0 ? void 0 : _this$component$overl4.height);\n this.component.width = '100%';\n this.component.height = 'auto';\n }\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return '';\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return SignatureComponent.schema();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(SignatureComponent.prototype), \"inputInfo\", this);\n info.type = 'input';\n info.attr.type = 'hidden';\n return info;\n }\n }, {\n key: \"className\",\n get: function get() {\n return \"\".concat(_get(_getPrototypeOf(SignatureComponent.prototype), \"className\", this), \" signature-pad\");\n }\n }, {\n key: \"labelIsHidden\",\n value: function labelIsHidden() {\n return this.component.hideLabel;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = _get(_getPrototypeOf(SignatureComponent.prototype), \"setValue\", this).call(this, value, flags);\n if (this.refs.signatureImage && (this.options.readOnly || this.disabled)) {\n this.refs.signatureImage.setAttribute('src', value);\n this.showCanvas(false);\n }\n if (this.signaturePad) {\n if (!value) {\n this.signaturePad.clear();\n } else if (changed) {\n this.triggerChange();\n }\n }\n if (this.signaturePad && this.dataValue && this.signaturePad.isEmpty()) {\n this.setDataToSigaturePad();\n }\n return changed;\n }\n }, {\n key: \"showCanvas\",\n value: function showCanvas(show) {\n if (show) {\n if (this.refs.canvas) {\n this.refs.canvas.style.display = 'inherit';\n }\n if (this.refs.signatureImage) {\n this.refs.signatureImage.style.display = 'none';\n }\n } else {\n if (this.refs.canvas) {\n this.refs.canvas.style.display = 'none';\n }\n if (this.refs.signatureImage) {\n this.refs.signatureImage.style.display = 'inherit';\n this.refs.signatureImage.style.maxHeight = '100%';\n }\n }\n }\n }, {\n key: \"onDisabled\",\n value: function onDisabled() {\n this.showCanvas(!_get(_getPrototypeOf(SignatureComponent.prototype), \"disabled\", this));\n if (this.signaturePad) {\n if (_get(_getPrototypeOf(SignatureComponent.prototype), \"disabled\", this)) {\n this.signaturePad.off();\n if (this.refs.refresh) {\n this.refs.refresh.classList.add('disabled');\n }\n if (this.refs.signatureImage && this.dataValue) {\n this.refs.signatureImage.setAttribute('src', this.dataValue);\n }\n } else {\n this.signaturePad.on();\n if (this.refs.refresh) {\n this.refs.refresh.classList.remove('disabled');\n }\n }\n }\n }\n }, {\n key: \"checkSize\",\n value: function checkSize(force, scale) {\n if (this.refs.padBody && (force || this.refs.padBody && this.refs.padBody.offsetWidth !== this.currentWidth)) {\n this.scale = force ? scale : this.scale;\n this.currentWidth = this.refs.padBody.offsetWidth;\n var width = this.currentWidth * this.scale;\n this.refs.canvas.width = width;\n var height = this.ratio ? width / this.ratio : this.refs.padBody.offsetHeight * this.scale;\n var maxHeight = this.refs.padBody.offsetHeight * this.scale;\n this.refs.canvas.height = height > maxHeight ? maxHeight : height;\n this.refs.canvas.style.maxWidth = \"\".concat(this.currentWidth * this.scale, \"px\");\n this.refs.canvas.style.maxHeight = \"\".concat(maxHeight, \"px\");\n var ctx = this.refs.canvas.getContext('2d');\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.scale(1 / this.scale, 1 / this.scale);\n ctx.fillStyle = this.signaturePad.backgroundColor;\n ctx.fillRect(0, 0, this.refs.canvas.width, this.refs.canvas.height);\n this.signaturePad.clear();\n if (this.dataValue) {\n this.setDataToSigaturePad();\n }\n this.showCanvas(true);\n }\n }\n }, {\n key: \"renderElement\",\n value: function renderElement(value, index) {\n return this.renderTemplate('signature', {\n element: _get(_getPrototypeOf(SignatureComponent.prototype), \"renderElement\", this).call(this, value, index),\n required: _lodash[\"default\"].get(this.component, 'validate.required', false)\n });\n }\n }, {\n key: \"hasModalSaveButton\",\n get: function get() {\n return false;\n }\n }, {\n key: \"getModalPreviewTemplate\",\n value: function getModalPreviewTemplate() {\n return this.renderTemplate('modalPreview', {\n previewText: this.dataValue ? \"\") : this.t('Click to Sign')\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this = this;\n this.loadRefs(element, {\n canvas: 'single',\n refresh: 'single',\n padBody: 'single',\n signatureImage: 'single'\n });\n var superAttach = _get(_getPrototypeOf(SignatureComponent.prototype), \"attach\", this).call(this, element);\n if (this.refs.refresh && this.options.readOnly) {\n this.refs.refresh.classList.add('disabled');\n }\n\n // Create the signature pad.\n if (this.refs.canvas) {\n this.signaturePad = new _signature_pad[\"default\"](this.refs.canvas, {\n minWidth: this.component.minWidth,\n maxWidth: this.component.maxWidth,\n penColor: this.component.penColor,\n backgroundColor: this.component.backgroundColor\n });\n this.signaturePad.addEventListener('endStroke', function () {\n return _this.setValue(_this.signaturePad.toDataURL());\n });\n this.refs.signatureImage.setAttribute('src', this.signaturePad.toDataURL());\n this.onDisabled();\n\n // Ensure the signature is always the size of its container.\n if (this.refs.padBody) {\n if (!this.refs.padBody.style.maxWidth) {\n this.refs.padBody.style.maxWidth = '100%';\n }\n if (!this.builderMode && !this.options.preview) {\n this.observer = new _resizeObserverPolyfill[\"default\"](function () {\n _this.checkSize();\n });\n this.observer.observe(this.refs.padBody);\n }\n this.addEventListener(window, 'resize', _lodash[\"default\"].debounce(function () {\n return _this.checkSize();\n }, 10));\n setTimeout(function checkWidth() {\n if (this.refs.padBody && this.refs.padBody.offsetWidth) {\n this.checkSize();\n } else {\n setTimeout(checkWidth.bind(this), 20);\n }\n }.bind(this), 20);\n }\n }\n this.addEventListener(this.refs.refresh, 'click', function (event) {\n event.preventDefault();\n _this.showCanvas(true);\n _this.signaturePad.clear();\n _this.setValue(_this.defaultValue);\n });\n this.setValue(this.dataValue);\n return superAttach;\n }\n /* eslint-enable max-statements */\n }, {\n key: \"detach\",\n value: function detach() {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n if (this.signaturePad) {\n this.signaturePad.off();\n }\n this.signaturePad = null;\n this.currentWidth = 0;\n _get(_getPrototypeOf(SignatureComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n return value ? 'Yes' : 'No';\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.refs.padBody.focus();\n }\n }, {\n key: \"setDataToSigaturePad\",\n value: function setDataToSigaturePad() {\n this.signaturePad.fromDataURL(this.dataValue, {\n ratio: 1,\n width: this.refs.canvas.width,\n height: this.refs.canvas.height\n });\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 _Input2[\"default\"].schema.apply(_Input2[\"default\"], [{\n type: 'signature',\n label: 'Signature',\n key: 'signature',\n footer: 'Sign above',\n width: '100%',\n height: '150px',\n penColor: 'black',\n backgroundColor: 'rgb(245,245,235)',\n minWidth: '0.5',\n maxWidth: '2.5',\n keepOverlayRatio: true\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Signature',\n group: 'advanced',\n icon: 'pencil',\n weight: 120,\n documentation: '/developers/integrations/esign/esign-integrations#signature-component',\n schema: SignatureComponent.schema()\n };\n }\n }]);\n return SignatureComponent;\n}(_Input2[\"default\"]);\nexports[\"default\"] = SignatureComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/signature/Signature.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.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.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/web.timers.js */ \"./node_modules/core-js/modules/web.timers.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.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.object.get-prototype-of.js */ \"./node_modules/core-js/modules/es.object.get-prototype-of.js\");\nvar _signature_pad = _interopRequireDefault(__webpack_require__(/*! signature_pad */ \"./node_modules/signature_pad/dist/signature_pad.js\"));\nvar _resizeObserverPolyfill = _interopRequireDefault(__webpack_require__(/*! resize-observer-polyfill */ \"./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js\"));\nvar _Input2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/input/Input */ \"./lib/components/_classes/input/Input.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.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 SignatureComponent = /*#__PURE__*/function (_Input) {\n _inherits(SignatureComponent, _Input);\n var _super = _createSuper(SignatureComponent);\n function SignatureComponent() {\n _classCallCheck(this, SignatureComponent);\n return _super.apply(this, arguments);\n }\n _createClass(SignatureComponent, [{\n key: \"init\",\n value: function init() {\n var _this$options, _this$component$overl, _this$component$overl2;\n _get(_getPrototypeOf(SignatureComponent.prototype), \"init\", this).call(this);\n this.currentWidth = 0;\n this.scale = 1;\n if (!this.component.width) {\n this.component.width = '100%';\n }\n if (!this.component.height) {\n this.component.height = '200px';\n }\n if (this.component.keepOverlayRatio && ((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.display) === 'pdf' && (_this$component$overl = this.component.overlay) !== null && _this$component$overl !== void 0 && _this$component$overl.width && (_this$component$overl2 = this.component.overlay) !== null && _this$component$overl2 !== void 0 && _this$component$overl2.height) {\n var _this$component$overl3, _this$component$overl4;\n this.ratio = ((_this$component$overl3 = this.component.overlay) === null || _this$component$overl3 === void 0 ? void 0 : _this$component$overl3.width) / ((_this$component$overl4 = this.component.overlay) === null || _this$component$overl4 === void 0 ? void 0 : _this$component$overl4.height);\n this.component.width = '100%';\n this.component.height = 'auto';\n }\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return '';\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return SignatureComponent.schema();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(SignatureComponent.prototype), \"inputInfo\", this);\n info.type = 'input';\n info.attr.type = 'hidden';\n return info;\n }\n }, {\n key: \"className\",\n get: function get() {\n return \"\".concat(_get(_getPrototypeOf(SignatureComponent.prototype), \"className\", this), \" signature-pad\");\n }\n }, {\n key: \"labelIsHidden\",\n value: function labelIsHidden() {\n return this.component.hideLabel;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = _get(_getPrototypeOf(SignatureComponent.prototype), \"setValue\", this).call(this, value, flags);\n if (this.refs.signatureImage && (this.options.readOnly || this.disabled)) {\n this.refs.signatureImage.setAttribute('src', value);\n this.showCanvas(false);\n }\n if (this.signaturePad) {\n if (!value) {\n this.signaturePad.clear();\n } else if (changed) {\n this.triggerChange();\n }\n }\n if (this.signaturePad && this.dataValue && this.signaturePad.isEmpty()) {\n this.setDataToSigaturePad();\n }\n return changed;\n }\n }, {\n key: \"showCanvas\",\n value: function showCanvas(show) {\n if (show) {\n if (this.refs.canvas) {\n this.refs.canvas.style.display = 'inherit';\n }\n if (this.refs.signatureImage) {\n this.refs.signatureImage.style.display = 'none';\n }\n } else {\n if (this.refs.canvas) {\n this.refs.canvas.style.display = 'none';\n }\n if (this.refs.signatureImage) {\n this.refs.signatureImage.style.display = 'inherit';\n this.refs.signatureImage.style.maxHeight = '100%';\n }\n }\n }\n }, {\n key: \"onDisabled\",\n value: function onDisabled() {\n this.showCanvas(!_get(_getPrototypeOf(SignatureComponent.prototype), \"disabled\", this));\n if (this.signaturePad) {\n if (_get(_getPrototypeOf(SignatureComponent.prototype), \"disabled\", this)) {\n this.signaturePad.off();\n if (this.refs.refresh) {\n this.refs.refresh.classList.add('disabled');\n }\n if (this.refs.signatureImage && this.dataValue) {\n this.refs.signatureImage.setAttribute('src', this.dataValue);\n }\n } else {\n this.signaturePad.on();\n if (this.refs.refresh) {\n this.refs.refresh.classList.remove('disabled');\n }\n }\n }\n }\n }, {\n key: \"checkSize\",\n value: function checkSize(force, scale) {\n if (this.refs.padBody && (force || this.refs.padBody && this.refs.padBody.offsetWidth !== this.currentWidth)) {\n this.scale = force ? scale : this.scale;\n this.currentWidth = this.refs.padBody.offsetWidth;\n var width = this.currentWidth * this.scale;\n var height = this.ratio ? width / this.ratio : this.refs.padBody.offsetHeight * this.scale;\n var maxHeight = this.ratio ? height : this.refs.padBody.offsetHeight * this.scale;\n this.refs.canvas.width = width;\n this.refs.canvas.height = height > maxHeight ? maxHeight : height;\n this.refs.canvas.style.maxWidth = \"\".concat(this.currentWidth * this.scale, \"px\");\n this.refs.canvas.style.maxHeight = \"\".concat(maxHeight, \"px\");\n var ctx = this.refs.canvas.getContext('2d');\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.scale(1 / this.scale, 1 / this.scale);\n ctx.fillStyle = this.signaturePad.backgroundColor;\n ctx.fillRect(0, 0, this.refs.canvas.width, this.refs.canvas.height);\n this.signaturePad.clear();\n if (this.dataValue) {\n this.setDataToSigaturePad();\n }\n this.showCanvas(true);\n }\n }\n }, {\n key: \"renderElement\",\n value: function renderElement(value, index) {\n return this.renderTemplate('signature', {\n element: _get(_getPrototypeOf(SignatureComponent.prototype), \"renderElement\", this).call(this, value, index),\n required: _lodash[\"default\"].get(this.component, 'validate.required', false)\n });\n }\n }, {\n key: \"hasModalSaveButton\",\n get: function get() {\n return false;\n }\n }, {\n key: \"getModalPreviewTemplate\",\n value: function getModalPreviewTemplate() {\n return this.renderTemplate('modalPreview', {\n previewText: this.dataValue ? \"\") : this.t('Click to Sign')\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this = this;\n this.loadRefs(element, {\n canvas: 'single',\n refresh: 'single',\n padBody: 'single',\n signatureImage: 'single'\n });\n var superAttach = _get(_getPrototypeOf(SignatureComponent.prototype), \"attach\", this).call(this, element);\n if (this.refs.refresh && this.options.readOnly) {\n this.refs.refresh.classList.add('disabled');\n }\n\n // Create the signature pad.\n if (this.refs.canvas) {\n this.signaturePad = new _signature_pad[\"default\"](this.refs.canvas, {\n minWidth: this.component.minWidth,\n maxWidth: this.component.maxWidth,\n penColor: this.component.penColor,\n backgroundColor: this.component.backgroundColor\n });\n this.signaturePad.addEventListener('endStroke', function () {\n return _this.setValue(_this.signaturePad.toDataURL());\n });\n this.refs.signatureImage.setAttribute('src', this.signaturePad.toDataURL());\n this.onDisabled();\n\n // Ensure the signature is always the size of its container.\n if (this.refs.padBody) {\n if (!this.refs.padBody.style.maxWidth) {\n this.refs.padBody.style.maxWidth = '100%';\n }\n if (!this.builderMode && !this.options.preview) {\n this.observer = new _resizeObserverPolyfill[\"default\"](function () {\n _this.checkSize();\n });\n this.observer.observe(this.refs.padBody);\n }\n this.addEventListener(window, 'resize', _lodash[\"default\"].debounce(function () {\n return _this.checkSize();\n }, 10));\n setTimeout(function checkWidth() {\n if (this.refs.padBody && this.refs.padBody.offsetWidth) {\n this.checkSize();\n } else {\n setTimeout(checkWidth.bind(this), 20);\n }\n }.bind(this), 20);\n }\n }\n this.addEventListener(this.refs.refresh, 'click', function (event) {\n event.preventDefault();\n _this.showCanvas(true);\n _this.signaturePad.clear();\n _this.setValue(_this.defaultValue);\n });\n this.setValue(this.dataValue);\n return superAttach;\n }\n /* eslint-enable max-statements */\n }, {\n key: \"detach\",\n value: function detach() {\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n if (this.signaturePad) {\n this.signaturePad.off();\n }\n this.signaturePad = null;\n this.currentWidth = 0;\n _get(_getPrototypeOf(SignatureComponent.prototype), \"detach\", this).call(this);\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (_lodash[\"default\"].isUndefined(value) && this.inDataTable) {\n return '';\n }\n return value ? 'Yes' : 'No';\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.refs.padBody.focus();\n }\n }, {\n key: \"setDataToSigaturePad\",\n value: function setDataToSigaturePad() {\n this.signaturePad.fromDataURL(this.dataValue, {\n ratio: 1,\n width: this.refs.canvas.width,\n height: this.refs.canvas.height\n });\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 _Input2[\"default\"].schema.apply(_Input2[\"default\"], [{\n type: 'signature',\n label: 'Signature',\n key: 'signature',\n footer: 'Sign above',\n width: '100%',\n height: '150px',\n penColor: 'black',\n backgroundColor: 'rgb(245,245,235)',\n minWidth: '0.5',\n maxWidth: '2.5',\n keepOverlayRatio: true\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Signature',\n group: 'advanced',\n icon: 'pencil',\n weight: 120,\n documentation: '/developers/integrations/esign/esign-integrations#signature-component',\n schema: SignatureComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(SignatureComponent), \"serverConditionSettings\", this)), {}, {\n operators: ['isEmpty', 'isNotEmpty']\n });\n }\n }]);\n return SignatureComponent;\n}(_Input2[\"default\"]);\nexports[\"default\"] = SignatureComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/signature/Signature.js?"); /***/ }), @@ -1916,7 +1916,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.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\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\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.function.name.js */ \"./node_modules/core-js/modules/es.function.name.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.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.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.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.js */ \"./node_modules/core-js/modules/es.array.find.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__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.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 SurveyComponent = /*#__PURE__*/function (_Field) {\n _inherits(SurveyComponent, _Field);\n var _super = _createSuper(SurveyComponent);\n function SurveyComponent() {\n _classCallCheck(this, SurveyComponent);\n return _super.apply(this, arguments);\n }\n _createClass(SurveyComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return SurveyComponent.schema();\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(SurveyComponent.prototype), \"render\", this).call(this, this.renderTemplate('survey'));\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this = this;\n this.loadRefs(element, {\n input: 'multiple'\n });\n var superAttach = _get(_getPrototypeOf(SurveyComponent.prototype), \"attach\", this).call(this, element);\n this.refs.input.forEach(function (input) {\n if (_this.disabled) {\n input.setAttribute('disabled', 'disabled');\n } else {\n _this.addEventListener(input, 'change', function () {\n return _this.updateValue(null, {\n modified: true\n });\n });\n }\n });\n this.setValue(this.dataValue);\n return superAttach;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this2 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n return false;\n }\n _lodash[\"default\"].each(this.component.questions, function (question) {\n _lodash[\"default\"].each(_this2.refs.input, function (input) {\n if (input.name === _this2.getInputName(question)) {\n input.checked = input.value === value[question.value];\n }\n });\n });\n var changed = this.updateValue(value, flags);\n if (changed && this.isHtmlRenderMode()) {\n this.redraw();\n }\n return changed;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return {};\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(SurveyComponent.prototype), \"defaultValue\", this);\n //support for default values created in old formio.js versions\n if (defaultValue && !_lodash[\"default\"].isObject(defaultValue) && this.component.values.some(function (value) {\n return value.value === defaultValue;\n })) {\n var adoptedDefaultValue = {};\n this.component.questions.forEach(function (question) {\n adoptedDefaultValue[question.value] = defaultValue;\n });\n return adoptedDefaultValue;\n }\n return defaultValue;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n var _this3 = this;\n if (this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var value = {};\n _lodash[\"default\"].each(this.component.questions, function (question) {\n _lodash[\"default\"].each(_this3.refs.input, function (input) {\n if (input.checked && input.name === _this3.getInputName(question)) {\n value[question.value] = input.value;\n return false;\n }\n });\n });\n return value;\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(SurveyComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(SurveyComponent.prototype), \"disabled\", disabled, this, true);\n _lodash[\"default\"].each(this.refs.input, function (input) {\n input.disabled = true;\n });\n }\n }, {\n key: \"validateRequired\",\n value: function validateRequired(setting, value) {\n if (!(0, _utils.boolValue)(setting)) {\n return true;\n }\n return this.component.questions.reduce(function (result, question) {\n return result && Boolean(value[question.value]);\n }, true);\n }\n }, {\n key: \"getInputName\",\n value: function getInputName(question) {\n return \"\".concat(this.options.name, \"[\").concat(question.value, \"]\");\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n var _this4 = this;\n if (options !== null && options !== void 0 && options.email) {\n var result = \"\\n \\n \\n \\n \\n \\n \\n \\n \\n \";\n _lodash[\"default\"].forIn(value, function (value, key) {\n var question = _lodash[\"default\"].find(_this4.component.questions, ['value', key]);\n var answer = _lodash[\"default\"].find(_this4.component.values, ['value', value]);\n if (!question || !answer) {\n return;\n }\n result += \"\\n \\n \\n \\n \\n \");\n });\n result += '
QuestionValue
\".concat(question.label, \"\").concat(answer.label, \"
';\n return result;\n }\n return _get(_getPrototypeOf(SurveyComponent.prototype), \"getValueAsString\", this).call(this, value, options);\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: 'survey',\n label: 'Survey',\n key: 'survey',\n questions: [],\n values: []\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Survey',\n group: 'advanced',\n icon: 'list',\n weight: 110,\n documentation: '/userguide/form-building/advanced-components#survey',\n schema: SurveyComponent.schema()\n };\n }\n }]);\n return SurveyComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = SurveyComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/survey/Survey.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.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.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.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\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.function.name.js */ \"./node_modules/core-js/modules/es.function.name.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.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.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.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.js */ \"./node_modules/core-js/modules/es.array.find.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__(/*! ../_classes/field/Field */ \"./lib/components/_classes/field/Field.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 SurveyComponent = /*#__PURE__*/function (_Field) {\n _inherits(SurveyComponent, _Field);\n var _super = _createSuper(SurveyComponent);\n function SurveyComponent() {\n _classCallCheck(this, SurveyComponent);\n return _super.apply(this, arguments);\n }\n _createClass(SurveyComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return SurveyComponent.schema();\n }\n }, {\n key: \"render\",\n value: function render() {\n return _get(_getPrototypeOf(SurveyComponent.prototype), \"render\", this).call(this, this.renderTemplate('survey'));\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this = this;\n this.loadRefs(element, {\n input: 'multiple'\n });\n var superAttach = _get(_getPrototypeOf(SurveyComponent.prototype), \"attach\", this).call(this, element);\n this.refs.input.forEach(function (input) {\n if (_this.disabled) {\n input.setAttribute('disabled', 'disabled');\n } else {\n _this.addEventListener(input, 'change', function () {\n return _this.updateValue(null, {\n modified: true\n });\n });\n }\n });\n this.setValue(this.dataValue);\n return superAttach;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this2 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!value) {\n return false;\n }\n _lodash[\"default\"].each(this.component.questions, function (question) {\n _lodash[\"default\"].each(_this2.refs.input, function (input) {\n if (input.name === _this2.getInputName(question)) {\n input.checked = input.value === value[question.value];\n }\n });\n });\n var changed = this.updateValue(value, flags);\n if (changed && this.isHtmlRenderMode()) {\n this.redraw();\n }\n return changed;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return {};\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var defaultValue = _get(_getPrototypeOf(SurveyComponent.prototype), \"defaultValue\", this);\n //support for default values created in old formio.js versions\n if (defaultValue && !_lodash[\"default\"].isObject(defaultValue) && this.component.values.some(function (value) {\n return value.value === defaultValue;\n })) {\n var adoptedDefaultValue = {};\n this.component.questions.forEach(function (question) {\n adoptedDefaultValue[question.value] = defaultValue;\n });\n return adoptedDefaultValue;\n }\n return defaultValue;\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n var _this3 = this;\n if (this.viewOnly || !this.refs.input || !this.refs.input.length) {\n return this.dataValue;\n }\n var value = {};\n _lodash[\"default\"].each(this.component.questions, function (question) {\n _lodash[\"default\"].each(_this3.refs.input, function (input) {\n if (input.checked && input.name === _this3.getInputName(question)) {\n value[question.value] = input.value;\n return false;\n }\n });\n });\n return value;\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(SurveyComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(SurveyComponent.prototype), \"disabled\", disabled, this, true);\n _lodash[\"default\"].each(this.refs.input, function (input) {\n input.disabled = true;\n });\n }\n }, {\n key: \"validateRequired\",\n value: function validateRequired(setting, value) {\n if (!(0, _utils.boolValue)(setting)) {\n return true;\n }\n return this.component.questions.reduce(function (result, question) {\n return result && Boolean(value[question.value]);\n }, true);\n }\n }, {\n key: \"getInputName\",\n value: function getInputName(question) {\n return \"\".concat(this.options.name, \"[\").concat(question.value, \"]\");\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n var _this4 = this;\n if (options !== null && options !== void 0 && options.email) {\n var result = \"\\n \\n \\n \\n \\n \\n \\n \\n \\n \";\n _lodash[\"default\"].forIn(value, function (value, key) {\n var question = _lodash[\"default\"].find(_this4.component.questions, ['value', key]);\n var answer = _lodash[\"default\"].find(_this4.component.values, ['value', value]);\n if (!question || !answer) {\n return;\n }\n result += \"\\n \\n \\n \\n \\n \");\n });\n result += '
QuestionValue
\".concat(question.label, \"\").concat(answer.label, \"
';\n return result;\n }\n return _get(_getPrototypeOf(SurveyComponent.prototype), \"getValueAsString\", this).call(this, value, options);\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: 'survey',\n label: 'Survey',\n key: 'survey',\n questions: [],\n values: []\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Survey',\n group: 'advanced',\n icon: 'list',\n weight: 110,\n documentation: '/userguide/form-building/advanced-components#survey',\n schema: SurveyComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(SurveyComponent), \"serverConditionSettings\", this)), {}, {\n operators: ['isEmpty', 'isNotEmpty']\n });\n }\n }]);\n return SurveyComponent;\n}(_Field2[\"default\"]);\nexports[\"default\"] = SurveyComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/survey/Survey.js?"); /***/ }), @@ -1971,7 +1971,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.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.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.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.slice.js */ \"./node_modules/core-js/modules/es.array.slice.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.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.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 _builder = _interopRequireDefault(__webpack_require__(/*! ../../utils/builder */ \"./lib/utils/builder.js\"));\nvar _NestedComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.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 _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 TableComponent = /*#__PURE__*/function (_NestedComponent) {\n _inherits(TableComponent, _NestedComponent);\n var _super = _createSuper(TableComponent);\n function TableComponent() {\n var _this;\n _classCallCheck(this, TableComponent);\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.noField = true;\n return _this;\n }\n _createClass(TableComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return TableComponent.schema();\n }\n }, {\n key: \"schema\",\n get: function get() {\n var _this2 = this;\n var schema = _lodash[\"default\"].omit(_get(_getPrototypeOf(TableComponent.prototype), \"schema\", this), 'components');\n schema.rows = [];\n this.eachComponent(function (component) {\n if (!schema.rows || !schema.rows.length) {\n schema.rows = TableComponent.emptyTable(_this2.component.numRows, _this2.component.numCols);\n }\n if (!schema.rows[component.tableRow]) {\n schema.rows[component.tableRow] = [];\n }\n if (!schema.rows[component.tableRow][component.tableColumn]) {\n schema.rows[component.tableRow][component.column] = {\n components: []\n };\n }\n schema.rows[component.tableRow][component.tableColumn].components.push(component.schema);\n });\n if (!schema.rows.length) {\n schema.rows = TableComponent.emptyTable(this.component.numRows, this.component.numCols);\n }\n return schema;\n }\n }, {\n key: \"className\",\n get: function get() {\n var name = \"table-responsive \".concat(_get(_getPrototypeOf(TableComponent.prototype), \"className\", this));\n if (!this.component.bordered) {\n name += ' no-top-border-table';\n }\n return name;\n }\n }, {\n key: \"cellClassName\",\n get: function get() {\n var name = '';\n if (this.component.cellAlignment) {\n name = \"cell-align-\".concat(this.component.cellAlignment);\n }\n return name;\n }\n }, {\n key: \"tableKey\",\n get: function get() {\n return \"table-\".concat(this.key);\n }\n }, {\n key: \"colWidth\",\n get: function get() {\n var numCols = this.component.numCols;\n if (!numCols || typeof numCols !== 'number') {\n return '';\n }\n return Math.floor(12 / numCols).toString();\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this3 = this;\n _get(_getPrototypeOf(TableComponent.prototype), \"init\", this).call(this);\n // Ensure component.rows has the correct number of rows and columns.\n for (var rowIndex = 0; rowIndex < this.component.numRows; rowIndex++) {\n this.component.rows[rowIndex] = this.component.rows[rowIndex] || [];\n for (var colIndex = 0; colIndex < this.component.numCols; colIndex++) {\n this.component.rows[rowIndex][colIndex] = this.component.rows[rowIndex][colIndex] || {\n components: []\n };\n }\n this.component.rows[rowIndex] = this.component.rows[rowIndex].slice(0, this.component.numCols);\n }\n this.component.rows = this.component.rows.slice(0, this.component.numRows);\n var lastNonEmptyRow = [];\n this.table = [];\n _lodash[\"default\"].each(this.component.rows, function (row, rowIndex) {\n _this3.table[rowIndex] = [];\n _lodash[\"default\"].each(row, function (column, colIndex) {\n _this3.table[rowIndex][colIndex] = [];\n if (_this3.component.cloneRows) {\n if (column.components.length) {\n lastNonEmptyRow[colIndex] = column;\n } else if (lastNonEmptyRow[colIndex]) {\n column.components = _lodash[\"default\"].cloneDeep(lastNonEmptyRow[colIndex].components);\n _builder[\"default\"].uniquify(_this3.root._form.components, column);\n }\n }\n _lodash[\"default\"].each(column.components, function (comp) {\n var columnComponent;\n if (_this3.builderMode) {\n comp.id = comp.id + rowIndex;\n columnComponent = comp;\n } else {\n columnComponent = _objectSpread(_objectSpread({}, comp), {}, {\n id: comp.id + rowIndex\n });\n }\n var component = _this3.createComponent(columnComponent);\n component.tableRow = rowIndex;\n component.tableColumn = colIndex;\n _this3.table[rowIndex][colIndex].push(component);\n });\n });\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n return _get(_getPrototypeOf(TableComponent.prototype), \"render\", this).call(this, this.renderTemplate('table', {\n cellClassName: this.cellClassName,\n tableKey: this.tableKey,\n colWidth: this.colWidth,\n tableComponents: this.table.map(function (row) {\n return row.map(function (column) {\n return _this4.renderComponents(column);\n });\n })\n }));\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this5 = this;\n var keys = this.table.reduce(function (prev, row, rowIndex) {\n prev[\"\".concat(_this5.tableKey, \"-\").concat(rowIndex)] = 'multiple';\n return prev;\n }, {});\n this.loadRefs(element, keys);\n var superAttach = _get(_getPrototypeOf(TableComponent.prototype), \"attach\", this).call(this, element);\n this.table.forEach(function (row, rowIndex) {\n row.forEach(function (column, columnIndex) {\n _this5.attachComponents(_this5.refs[\"\".concat(_this5.tableKey, \"-\").concat(rowIndex)][columnIndex], _this5.table[rowIndex][columnIndex], _this5.component.rows[rowIndex][columnIndex].components);\n });\n });\n return superAttach;\n }\n }, {\n key: \"destroy\",\n value: function destroy(all) {\n _get(_getPrototypeOf(TableComponent.prototype), \"destroy\", this).call(this, all);\n delete this.table;\n }\n }], [{\n key: \"emptyTable\",\n value: function emptyTable(numRows, numCols) {\n var rows = [];\n for (var i = 0; i < numRows; i++) {\n var cols = [];\n for (var j = 0; j < numCols; j++) {\n cols.push({\n components: []\n });\n }\n rows.push(cols);\n }\n return rows;\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 _NestedComponent2[\"default\"].schema.apply(_NestedComponent2[\"default\"], [{\n label: 'Table',\n type: 'table',\n input: false,\n key: 'table',\n numRows: 3,\n numCols: 3,\n rows: TableComponent.emptyTable(3, 3),\n header: [],\n caption: '',\n cloneRows: false,\n striped: false,\n bordered: false,\n hover: false,\n condensed: false,\n persistent: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Table',\n group: 'layout',\n icon: 'table',\n weight: 40,\n documentation: '/userguide/form-building/layout-components#table',\n schema: TableComponent.schema()\n };\n }\n }]);\n return TableComponent;\n}(_NestedComponent2[\"default\"]);\nexports[\"default\"] = TableComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/table/Table.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.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.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.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.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.slice.js */ \"./node_modules/core-js/modules/es.array.slice.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.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.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 _builder = _interopRequireDefault(__webpack_require__(/*! ../../utils/builder */ \"./lib/utils/builder.js\"));\nvar _NestedComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.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 _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 TableComponent = /*#__PURE__*/function (_NestedComponent) {\n _inherits(TableComponent, _NestedComponent);\n var _super = _createSuper(TableComponent);\n function TableComponent() {\n var _this;\n _classCallCheck(this, TableComponent);\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.noField = true;\n return _this;\n }\n _createClass(TableComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return TableComponent.schema();\n }\n }, {\n key: \"schema\",\n get: function get() {\n var _this2 = this;\n var schema = _lodash[\"default\"].omit(_get(_getPrototypeOf(TableComponent.prototype), \"schema\", this), 'components');\n schema.rows = [];\n this.eachComponent(function (component) {\n if (!schema.rows || !schema.rows.length) {\n schema.rows = TableComponent.emptyTable(_this2.component.numRows, _this2.component.numCols);\n }\n if (!schema.rows[component.tableRow]) {\n schema.rows[component.tableRow] = [];\n }\n if (!schema.rows[component.tableRow][component.tableColumn]) {\n schema.rows[component.tableRow][component.column] = {\n components: []\n };\n }\n schema.rows[component.tableRow][component.tableColumn].components.push(component.schema);\n });\n if (!schema.rows.length) {\n schema.rows = TableComponent.emptyTable(this.component.numRows, this.component.numCols);\n }\n return schema;\n }\n }, {\n key: \"className\",\n get: function get() {\n var name = \"table-responsive \".concat(_get(_getPrototypeOf(TableComponent.prototype), \"className\", this));\n if (!this.component.bordered) {\n name += ' no-top-border-table';\n }\n return name;\n }\n }, {\n key: \"cellClassName\",\n get: function get() {\n var name = '';\n if (this.component.cellAlignment) {\n name = \"cell-align-\".concat(this.component.cellAlignment);\n }\n return name;\n }\n }, {\n key: \"tableKey\",\n get: function get() {\n return \"table-\".concat(this.key);\n }\n }, {\n key: \"colWidth\",\n get: function get() {\n var numCols = this.component.numCols;\n if (!numCols || typeof numCols !== 'number') {\n return '';\n }\n return Math.floor(12 / numCols).toString();\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this3 = this;\n _get(_getPrototypeOf(TableComponent.prototype), \"init\", this).call(this);\n // Ensure component.rows has the correct number of rows and columns.\n for (var rowIndex = 0; rowIndex < this.component.numRows; rowIndex++) {\n this.component.rows[rowIndex] = this.component.rows[rowIndex] || [];\n for (var colIndex = 0; colIndex < this.component.numCols; colIndex++) {\n this.component.rows[rowIndex][colIndex] = this.component.rows[rowIndex][colIndex] || {\n components: []\n };\n }\n this.component.rows[rowIndex] = this.component.rows[rowIndex].slice(0, this.component.numCols);\n }\n this.component.rows = this.component.rows.slice(0, this.component.numRows);\n var lastNonEmptyRow = [];\n this.table = [];\n _lodash[\"default\"].each(this.component.rows, function (row, rowIndex) {\n _this3.table[rowIndex] = [];\n _lodash[\"default\"].each(row, function (column, colIndex) {\n _this3.table[rowIndex][colIndex] = [];\n if (_this3.component.cloneRows) {\n if (column.components.length) {\n lastNonEmptyRow[colIndex] = column;\n } else if (lastNonEmptyRow[colIndex]) {\n column.components = _lodash[\"default\"].cloneDeep(lastNonEmptyRow[colIndex].components);\n _builder[\"default\"].uniquify(_this3.root._form.components, column);\n }\n }\n _lodash[\"default\"].each(column.components, function (comp) {\n var columnComponent;\n if (_this3.builderMode) {\n comp.id = comp.id + rowIndex;\n columnComponent = comp;\n } else {\n columnComponent = _objectSpread(_objectSpread({}, comp), {}, {\n id: comp.id + rowIndex\n });\n }\n var component = _this3.createComponent(columnComponent);\n component.tableRow = rowIndex;\n component.tableColumn = colIndex;\n _this3.table[rowIndex][colIndex].push(component);\n });\n });\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n return _get(_getPrototypeOf(TableComponent.prototype), \"render\", this).call(this, this.renderTemplate('table', {\n cellClassName: this.cellClassName,\n tableKey: this.tableKey,\n colWidth: this.colWidth,\n tableComponents: this.table.map(function (row) {\n return row.map(function (column) {\n return _this4.renderComponents(column);\n });\n })\n }));\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this5 = this;\n var keys = this.table.reduce(function (prev, row, rowIndex) {\n prev[\"\".concat(_this5.tableKey, \"-\").concat(rowIndex)] = 'multiple';\n return prev;\n }, {});\n this.loadRefs(element, keys);\n var superAttach = _get(_getPrototypeOf(TableComponent.prototype), \"attach\", this).call(this, element);\n this.table.forEach(function (row, rowIndex) {\n row.forEach(function (column, columnIndex) {\n _this5.attachComponents(_this5.refs[\"\".concat(_this5.tableKey, \"-\").concat(rowIndex)][columnIndex], _this5.table[rowIndex][columnIndex], _this5.component.rows[rowIndex][columnIndex].components);\n });\n });\n return superAttach;\n }\n }, {\n key: \"destroy\",\n value: function destroy(all) {\n _get(_getPrototypeOf(TableComponent.prototype), \"destroy\", this).call(this, all);\n delete this.table;\n }\n }], [{\n key: \"emptyTable\",\n value: function emptyTable(numRows, numCols) {\n var rows = [];\n for (var i = 0; i < numRows; i++) {\n var cols = [];\n for (var j = 0; j < numCols; j++) {\n cols.push({\n components: []\n });\n }\n rows.push(cols);\n }\n return rows;\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 _NestedComponent2[\"default\"].schema.apply(_NestedComponent2[\"default\"], [{\n label: 'Table',\n type: 'table',\n input: false,\n key: 'table',\n numRows: 3,\n numCols: 3,\n rows: TableComponent.emptyTable(3, 3),\n header: [],\n caption: '',\n cloneRows: false,\n striped: false,\n bordered: false,\n hover: false,\n condensed: false,\n persistent: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Table',\n group: 'layout',\n icon: 'table',\n weight: 40,\n documentation: '/userguide/form-building/layout-components#table',\n showPreview: false,\n schema: TableComponent.schema()\n };\n }\n }]);\n return TableComponent;\n}(_NestedComponent2[\"default\"]);\nexports[\"default\"] = TableComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/table/Table.js?"); /***/ }), @@ -2004,7 +2004,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.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\");\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.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.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.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/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.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.array.some.js */ \"./node_modules/core-js/modules/es.array.some.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.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.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.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.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 _NestedComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": 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 _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 _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 TabsComponent = /*#__PURE__*/function (_NestedComponent) {\n _inherits(TabsComponent, _NestedComponent);\n var _super = _createSuper(TabsComponent);\n function TabsComponent() {\n var _this;\n _classCallCheck(this, TabsComponent);\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.currentTab = 0;\n _this.noField = true;\n return _this;\n }\n _createClass(TabsComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return TabsComponent.schema();\n }\n }, {\n key: \"schema\",\n get: function get() {\n var _this2 = this;\n var schema = _get(_getPrototypeOf(TabsComponent.prototype), \"schema\", this);\n // We need to clone this because the builder uses the \"components\" reference and this would reset that reference.\n var components = _lodash[\"default\"].cloneDeep(this.component.components);\n schema.components = components.map(function (tab, index) {\n tab.components = _this2.tabs[index].map(function (component) {\n return component.schema;\n });\n return tab;\n });\n return schema;\n }\n }, {\n key: \"tabKey\",\n get: function get() {\n return \"tab-\".concat(this.key);\n }\n }, {\n key: \"tabLikey\",\n get: function get() {\n return \"tabLi-\".concat(this.key);\n }\n }, {\n key: \"tabLinkKey\",\n get: function get() {\n return \"tabLink-\".concat(this.key);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this3 = this;\n this.components = [];\n this.tabs = [];\n _lodash[\"default\"].each(this.component.components, function (tab, index) {\n _this3.tabs[index] = [];\n // Initialize empty tabs.\n tab.components = tab.components || [];\n _lodash[\"default\"].each(tab.components, function (comp) {\n var component = _this3.createComponent(comp);\n component.tab = index;\n _this3.tabs[index].push(component);\n });\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n return _get(_getPrototypeOf(TabsComponent.prototype), \"render\", this).call(this, this.renderTemplate('tab', {\n tabKey: this.tabKey,\n tabLikey: this.tabLikey,\n tabLinkKey: this.tabLinkKey,\n currentTab: this.currentTab,\n tabComponents: this.tabs.map(function (tab) {\n return _this4.renderComponents(tab);\n })\n }, this.options.flatten || this.options.pdf ? 'flat' : null));\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs,\n _this5 = this;\n this.loadRefs(element, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, this.tabLinkKey, 'multiple'), _defineProperty(_this$loadRefs, this.tabKey, 'multiple'), _defineProperty(_this$loadRefs, this.tabLikey, 'multiple'), _this$loadRefs));\n ['change', 'error'].forEach(function (event) {\n return _this5.on(event, _this5.handleTabsValidation.bind(_this5));\n });\n var superAttach = _get(_getPrototypeOf(TabsComponent.prototype), \"attach\", this).call(this, element);\n this.refs[this.tabLinkKey].forEach(function (tabLink, index) {\n _this5.addEventListener(tabLink, 'click', function (event) {\n event.preventDefault();\n _this5.setTab(index);\n });\n });\n this.refs[this.tabKey].forEach(function (tab, index) {\n _this5.attachComponents(tab, _this5.tabs[index], _this5.component.components[index].components);\n });\n return superAttach;\n }\n }, {\n key: \"detach\",\n value: function detach(all) {\n _get(_getPrototypeOf(TabsComponent.prototype), \"detach\", this).call(this, all);\n }\n\n /**\n * Set the current tab.\n *\n * @param index\n */\n }, {\n key: \"setTab\",\n value: function setTab(index) {\n var _this6 = this;\n if (!this.tabs || !this.tabs[index] || !this.refs[this.tabKey] || !this.refs[this.tabKey][index]) {\n return;\n }\n this.currentTab = index;\n _lodash[\"default\"].each(this.refs[this.tabKey], function (tab) {\n _this6.removeClass(tab, 'formio-tab-panel-active');\n tab.style.display = 'none';\n });\n this.addClass(this.refs[this.tabKey][index], 'formio-tab-panel-active');\n this.refs[this.tabKey][index].style.display = 'block';\n _lodash[\"default\"].each(this.refs[this.tabLinkKey], function (tabLink, tabIndex) {\n if (_this6.refs[_this6.tabLinkKey][tabIndex]) {\n _this6.removeClass(tabLink, 'formio-tab-link-active');\n }\n if (_this6.refs[_this6.tabLikey][tabIndex]) {\n _this6.removeClass(_this6.refs[_this6.tabLikey][tabIndex], 'formio-tab-link-container-active');\n }\n });\n if (this.refs[this.tabLikey][index]) {\n this.addClass(this.refs[this.tabLikey][index], 'formio-tab-link-container-active');\n }\n if (this.refs[this.tabLinkKey][index]) {\n this.addClass(this.refs[this.tabLinkKey][index], 'formio-tab-link-active');\n }\n this.triggerChange();\n }\n }, {\n key: \"beforeFocus\",\n value: function beforeFocus(component) {\n if ('beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n var tabIndex = this.tabs.findIndex(function (tab) {\n return tab.some(function (comp) {\n return comp === component;\n });\n });\n if (tabIndex !== -1 && this.currentTab !== tabIndex) {\n this.setTab(tabIndex);\n }\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(elements, dirty, hasErrors, hasMessages) {\n var _this7 = this;\n var element = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.element;\n if (this.component.modalEdit) {\n _get(_getPrototypeOf(TabsComponent.prototype), \"setErrorClasses\", this).call(this, elements, dirty, hasErrors, hasMessages, element);\n }\n elements.forEach(function (element) {\n _this7.addClass(element, 'is-invalid');\n if (element.getAttribute('ref') !== 'openModal') {\n if (_this7.options.highlightErrors) {\n _this7.addClass(element, 'tab-error');\n } else {\n _this7.addClass(element, 'has-error');\n }\n }\n });\n }\n }, {\n key: \"clearErrorClasses\",\n value: function clearErrorClasses(elements) {\n var _this8 = this;\n if (this.options.server || !this.rendered) {\n return;\n }\n if (this.component.modalEdit) {\n var element = Array.isArray(elements) || elements instanceof NodeList ? this.element : elements;\n _get(_getPrototypeOf(TabsComponent.prototype), \"clearErrorClasses\", this).call(this, element);\n }\n elements = Array.isArray(elements) || elements instanceof NodeList ? elements : [elements];\n elements.forEach(function (element) {\n _this8.removeClass(element, 'is-invalid');\n _this8.removeClass(element, 'tab-error');\n _this8.removeClass(element, 'has-error');\n });\n }\n }, {\n key: \"handleTabsValidation\",\n value: function handleTabsValidation() {\n if (!this.refs[this.tabLinkKey] || !this.refs[this.tabLinkKey].length || !this.tabs.length) {\n return;\n }\n this.clearErrorClasses(this.refs[this.tabLinkKey]);\n var invalidTabsIndexes = this.tabs.reduce(function (invalidTabs, tab, tabIndex) {\n var hasComponentWithError = tab.some(function (comp) {\n return !!comp.error;\n });\n return hasComponentWithError ? [].concat(_toConsumableArray(invalidTabs), [tabIndex]) : invalidTabs;\n }, []);\n if (!invalidTabsIndexes.length) {\n return;\n }\n var invalidTabs = _toConsumableArray(this.refs[this.tabLinkKey]).filter(function (_, tabIndex) {\n return invalidTabsIndexes.includes(tabIndex);\n });\n this.setErrorClasses(invalidTabs);\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 _NestedComponent2[\"default\"].schema.apply(_NestedComponent2[\"default\"], [{\n label: 'Tabs',\n type: 'tabs',\n input: false,\n key: 'tabs',\n persistent: false,\n tableView: false,\n components: [{\n label: 'Tab 1',\n key: 'tab1',\n components: []\n }],\n verticalLayout: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Tabs',\n group: 'layout',\n icon: 'folder-o',\n weight: 50,\n documentation: '/userguide/form-building/layout-components#tabs',\n schema: TabsComponent.schema()\n };\n }\n }]);\n return TabsComponent;\n}(_NestedComponent2[\"default\"]);\nexports[\"default\"] = TabsComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/tabs/Tabs.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.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.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\");\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.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.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.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/es.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.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.array.some.js */ \"./node_modules/core-js/modules/es.array.some.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.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.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.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.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 _NestedComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": 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 _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 _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 TabsComponent = /*#__PURE__*/function (_NestedComponent) {\n _inherits(TabsComponent, _NestedComponent);\n var _super = _createSuper(TabsComponent);\n function TabsComponent() {\n var _this;\n _classCallCheck(this, TabsComponent);\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.currentTab = 0;\n _this.noField = true;\n return _this;\n }\n _createClass(TabsComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return TabsComponent.schema();\n }\n }, {\n key: \"schema\",\n get: function get() {\n var _this2 = this;\n var schema = _get(_getPrototypeOf(TabsComponent.prototype), \"schema\", this);\n // We need to clone this because the builder uses the \"components\" reference and this would reset that reference.\n var components = _lodash[\"default\"].cloneDeep(this.component.components);\n schema.components = components.map(function (tab, index) {\n tab.components = _this2.tabs[index].map(function (component) {\n return component.schema;\n });\n return tab;\n });\n return schema;\n }\n }, {\n key: \"tabKey\",\n get: function get() {\n return \"tab-\".concat(this.key);\n }\n }, {\n key: \"tabLikey\",\n get: function get() {\n return \"tabLi-\".concat(this.key);\n }\n }, {\n key: \"tabLinkKey\",\n get: function get() {\n return \"tabLink-\".concat(this.key);\n }\n }, {\n key: \"init\",\n value: function init() {\n var _this3 = this;\n this.components = [];\n this.tabs = [];\n _lodash[\"default\"].each(this.component.components, function (tab, index) {\n _this3.tabs[index] = [];\n // Initialize empty tabs.\n tab.components = tab.components || [];\n _lodash[\"default\"].each(tab.components, function (comp) {\n var component = _this3.createComponent(comp);\n component.tab = index;\n _this3.tabs[index].push(component);\n });\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n return _get(_getPrototypeOf(TabsComponent.prototype), \"render\", this).call(this, this.renderTemplate('tab', {\n tabKey: this.tabKey,\n tabLikey: this.tabLikey,\n tabLinkKey: this.tabLinkKey,\n currentTab: this.currentTab,\n tabComponents: this.tabs.map(function (tab) {\n return _this4.renderComponents(tab);\n })\n }, this.options.flatten || this.options.pdf ? 'flat' : null));\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n var _this$loadRefs,\n _this5 = this;\n this.loadRefs(element, (_this$loadRefs = {}, _defineProperty(_this$loadRefs, this.tabLinkKey, 'multiple'), _defineProperty(_this$loadRefs, this.tabKey, 'multiple'), _defineProperty(_this$loadRefs, this.tabLikey, 'multiple'), _this$loadRefs));\n ['change', 'error'].forEach(function (event) {\n return _this5.on(event, _this5.handleTabsValidation.bind(_this5));\n });\n var superAttach = _get(_getPrototypeOf(TabsComponent.prototype), \"attach\", this).call(this, element);\n this.refs[this.tabLinkKey].forEach(function (tabLink, index) {\n _this5.addEventListener(tabLink, 'click', function (event) {\n event.preventDefault();\n _this5.setTab(index);\n });\n });\n this.refs[this.tabKey].forEach(function (tab, index) {\n _this5.attachComponents(tab, _this5.tabs[index], _this5.component.components[index].components);\n });\n return superAttach;\n }\n }, {\n key: \"detach\",\n value: function detach(all) {\n _get(_getPrototypeOf(TabsComponent.prototype), \"detach\", this).call(this, all);\n }\n\n /**\n * Set the current tab.\n *\n * @param index\n */\n }, {\n key: \"setTab\",\n value: function setTab(index) {\n var _this6 = this;\n if (!this.tabs || !this.tabs[index] || !this.refs[this.tabKey] || !this.refs[this.tabKey][index]) {\n return;\n }\n this.currentTab = index;\n _lodash[\"default\"].each(this.refs[this.tabKey], function (tab) {\n _this6.removeClass(tab, 'formio-tab-panel-active');\n tab.style.display = 'none';\n });\n this.addClass(this.refs[this.tabKey][index], 'formio-tab-panel-active');\n this.refs[this.tabKey][index].style.display = 'block';\n _lodash[\"default\"].each(this.refs[this.tabLinkKey], function (tabLink, tabIndex) {\n if (_this6.refs[_this6.tabLinkKey][tabIndex]) {\n _this6.removeClass(tabLink, 'formio-tab-link-active');\n }\n if (_this6.refs[_this6.tabLikey][tabIndex]) {\n _this6.removeClass(_this6.refs[_this6.tabLikey][tabIndex], 'formio-tab-link-container-active');\n }\n });\n if (this.refs[this.tabLikey][index]) {\n this.addClass(this.refs[this.tabLikey][index], 'formio-tab-link-container-active');\n }\n if (this.refs[this.tabLinkKey][index]) {\n this.addClass(this.refs[this.tabLinkKey][index], 'formio-tab-link-active');\n }\n this.triggerChange();\n }\n }, {\n key: \"beforeFocus\",\n value: function beforeFocus(component) {\n if ('beforeFocus' in this.parent) {\n this.parent.beforeFocus(this);\n }\n var tabIndex = this.tabs.findIndex(function (tab) {\n return tab.some(function (comp) {\n return comp === component;\n });\n });\n if (tabIndex !== -1 && this.currentTab !== tabIndex) {\n this.setTab(tabIndex);\n }\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(elements, dirty, hasErrors, hasMessages) {\n var _this7 = this;\n var element = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.element;\n if (this.component.modalEdit) {\n _get(_getPrototypeOf(TabsComponent.prototype), \"setErrorClasses\", this).call(this, elements, dirty, hasErrors, hasMessages, element);\n }\n elements.forEach(function (element) {\n _this7.addClass(element, 'is-invalid');\n if (element.getAttribute('ref') !== 'openModal') {\n if (_this7.options.highlightErrors) {\n _this7.addClass(element, 'tab-error');\n } else {\n _this7.addClass(element, 'has-error');\n }\n }\n });\n }\n }, {\n key: \"clearErrorClasses\",\n value: function clearErrorClasses(elements) {\n var _this8 = this;\n if (this.options.server || !this.rendered) {\n return;\n }\n if (this.component.modalEdit) {\n var element = Array.isArray(elements) || elements instanceof NodeList ? this.element : elements;\n _get(_getPrototypeOf(TabsComponent.prototype), \"clearErrorClasses\", this).call(this, element);\n }\n elements = Array.isArray(elements) || elements instanceof NodeList ? elements : [elements];\n elements.forEach(function (element) {\n _this8.removeClass(element, 'is-invalid');\n _this8.removeClass(element, 'tab-error');\n _this8.removeClass(element, 'has-error');\n });\n }\n }, {\n key: \"handleTabsValidation\",\n value: function handleTabsValidation() {\n if (!this.refs[this.tabLinkKey] || !this.refs[this.tabLinkKey].length || !this.tabs.length) {\n return;\n }\n this.clearErrorClasses(this.refs[this.tabLinkKey]);\n var invalidTabsIndexes = this.tabs.reduce(function (invalidTabs, tab, tabIndex) {\n var hasComponentWithError = tab.some(function (comp) {\n return !!comp.error;\n });\n return hasComponentWithError ? [].concat(_toConsumableArray(invalidTabs), [tabIndex]) : invalidTabs;\n }, []);\n if (!invalidTabsIndexes.length) {\n return;\n }\n var invalidTabs = _toConsumableArray(this.refs[this.tabLinkKey]).filter(function (_, tabIndex) {\n return invalidTabsIndexes.includes(tabIndex);\n });\n this.setErrorClasses(invalidTabs);\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 _NestedComponent2[\"default\"].schema.apply(_NestedComponent2[\"default\"], [{\n label: 'Tabs',\n type: 'tabs',\n input: false,\n key: 'tabs',\n persistent: false,\n tableView: false,\n components: [{\n label: 'Tab 1',\n key: 'tab1',\n components: []\n }],\n verticalLayout: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Tabs',\n group: 'layout',\n icon: 'folder-o',\n weight: 50,\n documentation: '/userguide/form-building/layout-components#tabs',\n showPreview: false,\n schema: TabsComponent.schema()\n };\n }\n }]);\n return TabsComponent;\n}(_NestedComponent2[\"default\"]);\nexports[\"default\"] = TabsComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/tabs/Tabs.js?"); /***/ }), @@ -2037,7 +2037,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.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.some.js */ \"./node_modules/core-js/modules/es.array.some.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.string.trim.js */ \"./node_modules/core-js/modules/es.string.trim.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.join.js */ \"./node_modules/core-js/modules/es.array.join.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.regexp.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.string.split.js */ \"./node_modules/core-js/modules/es.string.split.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.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.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 _Input2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/input/Input */ \"./lib/components/_classes/input/Input.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 Choices;\nif (typeof window !== 'undefined') {\n Choices = __webpack_require__(/*! @formio/choices.js */ \"./node_modules/@formio/choices.js/public/assets/scripts/choices.js\");\n}\nvar TagsComponent = /*#__PURE__*/function (_Input) {\n _inherits(TagsComponent, _Input);\n var _super = _createSuper(TagsComponent);\n function TagsComponent() {\n _classCallCheck(this, TagsComponent);\n return _super.apply(this, arguments);\n }\n _createClass(TagsComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(TagsComponent.prototype), \"init\", this).call(this);\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.component.storeas === 'string' ? '' : [];\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return TagsComponent.schema();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(TagsComponent.prototype), \"inputInfo\", this);\n info.type = 'input';\n info.attr.type = 'text';\n info.changeEvent = 'change';\n return info;\n }\n }, {\n key: \"delimiter\",\n get: function get() {\n return this.component.delimeter || ',';\n }\n }, {\n key: \"attachElement\",\n value: function attachElement(element, index) {\n var _this = this;\n _get(_getPrototypeOf(TagsComponent.prototype), \"attachElement\", this).call(this, element, index);\n if (!element) {\n return;\n }\n element.setAttribute('dir', this.i18next.dir());\n if (this.choices) {\n this.choices.destroy();\n }\n if (!Choices) {\n return;\n }\n var hasPlaceholder = !!this.component.placeholder;\n this.choices = new Choices(element, {\n delimiter: this.delimiter,\n editItems: true,\n allowHTML: true,\n maxItemCount: this.component.maxTags,\n removeItemButton: true,\n duplicateItemsAllowed: false,\n shadowRoot: this.root ? this.root.shadowRoot : null,\n placeholder: hasPlaceholder,\n placeholderValue: hasPlaceholder ? this.t(this.component.placeholder, {\n _userInput: true\n }) : null\n });\n this.choices.itemList.element.tabIndex = element.tabIndex;\n this.addEventListener(this.choices.input.element, 'blur', function () {\n var value = _this.choices.input.value;\n var maxTagsNumber = _this.component.maxTags;\n var valuesCount = _this.choices.getValue(true).length;\n var isRepeatedValue = _this.choices.getValue(true).some(function (existingValue) {\n return existingValue.trim() === value.trim();\n });\n if (value) {\n if (maxTagsNumber && valuesCount === maxTagsNumber) {\n _this.choices.addItems = false;\n _this.choices.clearInput();\n } else if (isRepeatedValue) {\n _this.choices.clearInput();\n } else {\n _this.choices.setValue([value]);\n _this.choices.clearInput();\n _this.choices.hideDropdown(true);\n _this.updateValue(null, {\n modified: true\n });\n }\n }\n });\n }\n }, {\n key: \"detach\",\n value: function detach() {\n _get(_getPrototypeOf(TagsComponent.prototype), \"detach\", this).call(this);\n if (this.choices) {\n this.choices.destroy();\n this.choices = null;\n }\n }\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n if (this.component.storeas === 'string' && Array.isArray(value)) {\n return value.join(this.delimiter);\n } else if (this.component.storeas === 'array' && typeof value === 'string') {\n return value.split(this.delimiter).filter(function (result) {\n return result;\n });\n }\n return value;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this2 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = _get(_getPrototypeOf(TagsComponent.prototype), \"setValue\", this).call(this, value, flags);\n if (this.choices) {\n var dataValue = this.dataValue;\n this.choices.removeActiveItems();\n if (dataValue) {\n if (typeof dataValue === 'string') {\n dataValue = dataValue.split(this.delimiter).filter(function (result) {\n return result;\n });\n }\n var _value = Array.isArray(dataValue) ? dataValue : [dataValue];\n this.choices.setValue(_value.map(function (val) {\n return _this2.sanitize(val, _this2.shouldSanitizeValue);\n }));\n }\n }\n return changed;\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(TagsComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(TagsComponent.prototype), \"disabled\", disabled, this, true);\n if (!this.choices) {\n return;\n }\n if (disabled) {\n this.choices.disable();\n } else {\n this.choices.enable();\n }\n }\n }, {\n key: \"focus\",\n value: function focus() {\n if (this.refs.input && this.refs.input.length) {\n this.refs.input[0].parentNode.lastChild.focus();\n }\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (!value) {\n return '';\n }\n if (Array.isArray(value)) {\n return value.join(\"\".concat(this.delimiter || ',', \" \"));\n }\n var stringValue = value.toString();\n return this.sanitize(stringValue, this.shouldSanitizeValue);\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 _Input2[\"default\"].schema.apply(_Input2[\"default\"], [{\n type: 'tags',\n label: 'Tags',\n key: 'tags',\n delimeter: ',',\n storeas: 'string',\n maxTags: 0\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Tags',\n icon: 'tags',\n group: 'advanced',\n documentation: '/userguide/form-building/advanced-components#tags',\n weight: 30,\n schema: TagsComponent.schema()\n };\n }\n }]);\n return TagsComponent;\n}(_Input2[\"default\"]);\nexports[\"default\"] = TagsComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/tags/Tags.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.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.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\");\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\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\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.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.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.is-array.js */ \"./node_modules/core-js/modules/es.array.is-array.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.filter.js */ \"./node_modules/core-js/modules/es.array.filter.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.split.js */ \"./node_modules/core-js/modules/es.string.split.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.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.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 _Input2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/input/Input */ \"./lib/components/_classes/input/Input.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": 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 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 Choices;\nif (typeof window !== 'undefined') {\n Choices = __webpack_require__(/*! @formio/choices.js */ \"./node_modules/@formio/choices.js/public/assets/scripts/choices.js\");\n}\nvar TagsComponent = /*#__PURE__*/function (_Input) {\n _inherits(TagsComponent, _Input);\n var _super = _createSuper(TagsComponent);\n function TagsComponent() {\n _classCallCheck(this, TagsComponent);\n return _super.apply(this, arguments);\n }\n _createClass(TagsComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(TagsComponent.prototype), \"init\", this).call(this);\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return this.component.storeas === 'string' ? '' : [];\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return TagsComponent.schema();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(TagsComponent.prototype), \"inputInfo\", this);\n info.type = 'input';\n info.attr.type = 'text';\n info.changeEvent = 'change';\n return info;\n }\n }, {\n key: \"delimiter\",\n get: function get() {\n return this.component.delimeter || ',';\n }\n }, {\n key: \"attachElement\",\n value: function attachElement(element, index) {\n var _this = this;\n _get(_getPrototypeOf(TagsComponent.prototype), \"attachElement\", this).call(this, element, index);\n if (!element) {\n return;\n }\n element.setAttribute('dir', this.i18next.dir());\n if (this.choices) {\n this.choices.destroy();\n }\n if (!Choices) {\n return;\n }\n var hasPlaceholder = !!this.component.placeholder;\n this.choices = new Choices(element, {\n delimiter: this.delimiter,\n editItems: true,\n allowHTML: true,\n maxItemCount: this.component.maxTags,\n removeItemButton: true,\n duplicateItemsAllowed: false,\n shadowRoot: this.root ? this.root.shadowRoot : null,\n placeholder: hasPlaceholder,\n placeholderValue: hasPlaceholder ? this.t(this.component.placeholder, {\n _userInput: true\n }) : null\n });\n this.choices.itemList.element.tabIndex = element.tabIndex;\n this.addEventListener(this.choices.input.element, 'blur', function () {\n var value = _this.choices.input.value;\n var maxTagsNumber = _this.component.maxTags;\n var valuesCount = _this.choices.getValue(true).length;\n var isRepeatedValue = _this.choices.getValue(true).some(function (existingValue) {\n return existingValue.trim() === value.trim();\n });\n if (value) {\n if (maxTagsNumber && valuesCount === maxTagsNumber) {\n _this.choices.addItems = false;\n _this.choices.clearInput();\n } else if (isRepeatedValue) {\n _this.choices.clearInput();\n } else {\n _this.choices.setValue([value]);\n _this.choices.clearInput();\n _this.choices.hideDropdown(true);\n _this.updateValue(null, {\n modified: true\n });\n }\n }\n });\n }\n }, {\n key: \"detach\",\n value: function detach() {\n _get(_getPrototypeOf(TagsComponent.prototype), \"detach\", this).call(this);\n if (this.choices) {\n this.choices.destroy();\n this.choices = null;\n }\n }\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n if (this.component.storeas === 'string' && Array.isArray(value)) {\n return value.join(this.delimiter);\n } else if (this.component.storeas === 'array' && typeof value === 'string') {\n return value.split(this.delimiter).filter(function (result) {\n return result;\n });\n }\n return value;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var _this2 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var changed = _get(_getPrototypeOf(TagsComponent.prototype), \"setValue\", this).call(this, value, flags);\n if (this.choices) {\n var dataValue = this.dataValue;\n this.choices.removeActiveItems();\n if (dataValue) {\n if (typeof dataValue === 'string') {\n dataValue = dataValue.split(this.delimiter).filter(function (result) {\n return result;\n });\n }\n var _value = Array.isArray(dataValue) ? dataValue : [dataValue];\n this.choices.setValue(_value.map(function (val) {\n return _this2.sanitize(val, _this2.shouldSanitizeValue);\n }));\n }\n }\n return changed;\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(TagsComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(TagsComponent.prototype), \"disabled\", disabled, this, true);\n if (!this.choices) {\n return;\n }\n if (disabled) {\n this.choices.disable();\n } else {\n this.choices.enable();\n }\n }\n }, {\n key: \"focus\",\n value: function focus() {\n if (this.refs.input && this.refs.input.length) {\n this.refs.input[0].parentNode.lastChild.focus();\n }\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n if (!value) {\n return '';\n }\n if (Array.isArray(value)) {\n return value.join(\"\".concat(this.delimiter || ',', \" \"));\n }\n var stringValue = value.toString();\n return this.sanitize(stringValue, this.shouldSanitizeValue);\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 _Input2[\"default\"].schema.apply(_Input2[\"default\"], [{\n type: 'tags',\n label: 'Tags',\n key: 'tags',\n delimeter: ',',\n storeas: 'string',\n maxTags: 0\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Tags',\n icon: 'tags',\n group: 'advanced',\n documentation: '/userguide/form-building/advanced-components#tags',\n weight: 30,\n schema: TagsComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(TagsComponent), \"serverConditionSettings\", this)), {}, {\n operators: [].concat(_toConsumableArray(_get(_getPrototypeOf(TagsComponent), \"serverConditionSettings\", this).operators), ['includes', 'notIncludes'])\n });\n }\n }]);\n return TagsComponent;\n}(_Input2[\"default\"]);\nexports[\"default\"] = TagsComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/tags/Tags.js?"); /***/ }), @@ -2114,7 +2114,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.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.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\");\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.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.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.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.string.trim.js */ \"./node_modules/core-js/modules/es.string.trim.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/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 _Input2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/input/Input */ \"./lib/components/_classes/input/Input.js\"));\nvar _vanillaTextMask = __webpack_require__(/*! @formio/vanilla-text-mask */ \"./node_modules/@formio/vanilla-text-mask/dist/vanillaTextMask.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 _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 _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 _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 TextFieldComponent = /*#__PURE__*/function (_Input) {\n _inherits(TextFieldComponent, _Input);\n var _super = _createSuper(TextFieldComponent);\n function TextFieldComponent(component, options, data) {\n var _this$component$widge, _this$component$widge2, _this$component$widge3;\n var _this;\n _classCallCheck(this, TextFieldComponent);\n _this = _super.call(this, component, options, data);\n var timezone = ((_this$component$widge = _this.component.widget) === null || _this$component$widge === void 0 ? void 0 : _this$component$widge.timezone) || _this.options.timezone;\n var displayInTimezone = ((_this$component$widge2 = _this.component.widget) === null || _this$component$widge2 === void 0 ? void 0 : _this$component$widge2.displayInTimezone) || 'viewer';\n if (((_this$component$widge3 = _this.component.widget) === null || _this$component$widge3 === void 0 ? void 0 : _this$component$widge3.type) === 'calendar') {\n _this.component.widget = _objectSpread(_objectSpread({}, _this.component.widget), {}, {\n readOnly: _this.options.readOnly,\n timezone: timezone,\n displayInTimezone: displayInTimezone,\n locale: _this.component.widget.locale || _this.options.language,\n saveAs: 'text'\n });\n }\n return _this;\n }\n _createClass(TextFieldComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return TextFieldComponent.schema();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(TextFieldComponent.prototype), \"inputInfo\", this);\n info.type = 'input';\n if (this.component.hasOwnProperty('spellcheck')) {\n info.attr.spellcheck = this.component.spellcheck;\n }\n if (this.component.mask) {\n info.attr.type = 'password';\n } else {\n info.attr.type = this.component.inputType === 'password' ? 'password' : 'text';\n }\n info.changeEvent = this.component.applyMaskOn === 'blur' ? 'blur' : 'input';\n return info;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return '';\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n this.loadRefs(element, {\n valueMaskInput: 'single'\n });\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"attach\", this).call(this, element);\n }\n\n /**\n * Returns the mask value object.\n *\n * @param value\n * @param flags\n * @return {*}\n */\n }, {\n key: \"maskValue\",\n value: function maskValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n // Convert it into the correct format.\n if (!value || _typeof(value) !== 'object') {\n value = {\n value: value,\n maskName: this.component.inputMasks[0].label\n };\n }\n\n // If no value is provided, then set the defaultValue.\n if (!value.value) {\n var defaultValue = flags.noDefault ? this.emptyValue : this.defaultValue;\n value.value = Array.isArray(defaultValue) ? defaultValue[0] : defaultValue;\n }\n return value;\n }\n\n /**\n * Normalize the value set in the data object.\n *\n * @param value\n * @param flags\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n var _this2 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!this.isMultipleMasksField) {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"normalizeValue\", this).call(this, value);\n }\n if (Array.isArray(value)) {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"normalizeValue\", this).call(this, value.map(function (val) {\n return _this2.maskValue(val, flags);\n }));\n }\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"normalizeValue\", this).call(this, this.maskValue(value, flags));\n }\n\n /**\n * Sets the value at this index.\n *\n * @param index\n * @param value\n * @param flags\n */\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!this.isMultipleMasksField) {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"setValueAt\", this).call(this, index, value, flags);\n }\n value = this.maskValue(value, flags);\n var textValue = value.value || '';\n var textInput = this.refs.mask ? this.refs.mask[index] : null;\n var maskInput = this.refs.select ? this.refs.select[index] : null;\n var mask = this.getMaskPattern(value.maskName);\n if (textInput && maskInput && mask) {\n var placeholderChar = this.placeholderChar;\n textInput.value = (0, _vanillaTextMask.conformToMask)(textValue, FormioUtils.getInputMask(mask), {\n placeholderChar: placeholderChar\n }).conformedValue;\n maskInput.value = value.maskName;\n } else {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"setValueAt\", this).call(this, index, textValue, flags);\n }\n }\n }, {\n key: \"unmaskValue\",\n value: function unmaskValue(value) {\n var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.component.displayMask;\n var mask = FormioUtils.getInputMask(format, this.placeholderChar);\n return FormioUtils.unmaskValue(value, mask, this.placeholderChar);\n }\n\n /**\n * Returns the value at this index.\n *\n * @param index\n * @return {*}\n */\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n if (!this.isMultipleMasksField) {\n var _this$refs$valueMaskI;\n var value = _get(_getPrototypeOf(TextFieldComponent.prototype), \"getValueAt\", this).call(this, index);\n var valueMask = this.component.inputMask;\n var displayMask = this.component.displayMask;\n\n // If the input has only the valueMask or the displayMask is the same as the valueMask,\n // just return the value which is already formatted\n if (valueMask && !displayMask || displayMask === valueMask) {\n return value;\n }\n\n // If there is only the displayMask, return the raw (unmasked) value\n if (displayMask && !valueMask) {\n return this.unmaskValue(value, displayMask);\n }\n if ((_this$refs$valueMaskI = this.refs.valueMaskInput) !== null && _this$refs$valueMaskI !== void 0 && _this$refs$valueMaskI.mask) {\n var _this$refs$valueMaskI2;\n this.refs.valueMaskInput.mask.textMaskInputElement.update(value);\n return (_this$refs$valueMaskI2 = this.refs.valueMaskInput) === null || _this$refs$valueMaskI2 === void 0 ? void 0 : _this$refs$valueMaskI2.value;\n }\n return value;\n }\n var textInput = this.refs.mask ? this.refs.mask[index] : null;\n var maskInput = this.refs.select ? this.refs.select[index] : null;\n return {\n value: textInput ? textInput.value : undefined,\n maskName: maskInput ? maskInput.value : undefined\n };\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (value && this.component.inputFormat === 'plain' && /<[^<>]+>/g.test(value)) {\n value = value.replaceAll('<', '<').replaceAll('>', '>');\n }\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"getValueAsString\", this).call(this, value, options);\n }\n }, {\n key: \"isHtmlRenderMode\",\n value: function isHtmlRenderMode() {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"isHtmlRenderMode\", this).call(this) || (this.options.readOnly || this.disabled) && this.component.inputFormat === 'html' && this.type === 'textfield';\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n if (!this.isMultipleMasksField) {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"isEmpty\", this).call(this, (value || '').toString().trim());\n }\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"isEmpty\", this).call(this, value) || (this.component.multiple ? value.length === 0 : !value.maskName || !value.value);\n }\n }, {\n key: \"truncateMultipleSpaces\",\n value: function truncateMultipleSpaces(value) {\n if (value) {\n return value.trim().replace(/\\s{2,}/g, ' ');\n }\n return value;\n }\n }, {\n key: \"validationValue\",\n get: function get() {\n var value = _get(_getPrototypeOf(TextFieldComponent.prototype), \"validationValue\", this);\n if (value && this.component.truncateMultipleSpaces) {\n return this.truncateMultipleSpaces(value);\n }\n return value;\n }\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n var _this3 = this;\n var value = this.dataValue;\n if (!this.component.truncateMultipleSpaces || !value) {\n return _nativePromiseOnly[\"default\"].resolve(value);\n }\n value = this.truncateMultipleSpaces(value);\n this.dataValue = value;\n return _nativePromiseOnly[\"default\"].resolve(value).then(function () {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"beforeSubmit\", _this3).call(_this3);\n });\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 _Input2[\"default\"].schema.apply(_Input2[\"default\"], [{\n label: 'Text Field',\n key: 'textField',\n type: 'textfield',\n mask: false,\n inputType: 'text',\n inputFormat: 'plain',\n inputMask: '',\n displayMask: '',\n tableView: true,\n spellcheck: true,\n truncateMultipleSpaces: false,\n validate: {\n minLength: '',\n maxLength: '',\n pattern: ''\n }\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Text Field',\n icon: 'terminal',\n group: 'basic',\n documentation: '/userguide/form-building/form-components#text-field',\n weight: 0,\n schema: TextFieldComponent.schema()\n };\n }\n }]);\n return TextFieldComponent;\n}(_Input2[\"default\"]);\nexports[\"default\"] = TextFieldComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/textfield/TextField.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.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\");\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.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.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.string.trim.js */ \"./node_modules/core-js/modules/es.string.trim.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/esnext.string.replace-all.js */ \"./node_modules/core-js/modules/esnext.string.replace-all.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 _Input2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/input/Input */ \"./lib/components/_classes/input/Input.js\"));\nvar _vanillaTextMask = __webpack_require__(/*! @formio/vanilla-text-mask */ \"./node_modules/@formio/vanilla-text-mask/dist/vanillaTextMask.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\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.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 _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 _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 _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 _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 TextFieldComponent = /*#__PURE__*/function (_Input) {\n _inherits(TextFieldComponent, _Input);\n var _super = _createSuper(TextFieldComponent);\n function TextFieldComponent(component, options, data) {\n var _this$component$widge, _this$component$widge2, _this$component$widge3;\n var _this;\n _classCallCheck(this, TextFieldComponent);\n _this = _super.call(this, component, options, data);\n var timezone = ((_this$component$widge = _this.component.widget) === null || _this$component$widge === void 0 ? void 0 : _this$component$widge.timezone) || _this.options.timezone;\n var displayInTimezone = ((_this$component$widge2 = _this.component.widget) === null || _this$component$widge2 === void 0 ? void 0 : _this$component$widge2.displayInTimezone) || 'viewer';\n if (((_this$component$widge3 = _this.component.widget) === null || _this$component$widge3 === void 0 ? void 0 : _this$component$widge3.type) === 'calendar') {\n _this.component.widget = _objectSpread(_objectSpread({}, _this.component.widget), {}, {\n readOnly: _this.options.readOnly,\n timezone: timezone,\n displayInTimezone: displayInTimezone,\n locale: _this.component.widget.locale || _this.options.language,\n saveAs: 'text'\n });\n }\n return _this;\n }\n _createClass(TextFieldComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return TextFieldComponent.schema();\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(TextFieldComponent.prototype), \"inputInfo\", this);\n info.type = 'input';\n if (this.component.hasOwnProperty('spellcheck')) {\n info.attr.spellcheck = this.component.spellcheck;\n }\n if (this.component.mask) {\n info.attr.type = 'password';\n } else {\n info.attr.type = this.component.inputType === 'password' ? 'password' : 'text';\n }\n info.changeEvent = this.component.applyMaskOn === 'blur' ? 'blur' : 'input';\n return info;\n }\n }, {\n key: \"emptyValue\",\n get: function get() {\n return '';\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n this.loadRefs(element, {\n valueMaskInput: 'single'\n });\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"attach\", this).call(this, element);\n }\n\n /**\n * Returns the mask value object.\n *\n * @param value\n * @param flags\n * @return {*}\n */\n }, {\n key: \"maskValue\",\n value: function maskValue(value) {\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n // Convert it into the correct format.\n if (!value || _typeof(value) !== 'object') {\n value = {\n value: value,\n maskName: this.component.inputMasks[0].label\n };\n }\n\n // If no value is provided, then set the defaultValue.\n if (!value.value) {\n var defaultValue = flags.noDefault ? this.emptyValue : this.defaultValue;\n value.value = Array.isArray(defaultValue) ? defaultValue[0] : defaultValue;\n }\n return value;\n }\n\n /**\n * Normalize the value set in the data object.\n *\n * @param value\n * @param flags\n * @return {*}\n */\n }, {\n key: \"normalizeValue\",\n value: function normalizeValue(value) {\n var _this2 = this;\n var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!this.isMultipleMasksField) {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"normalizeValue\", this).call(this, value);\n }\n if (Array.isArray(value)) {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"normalizeValue\", this).call(this, value.map(function (val) {\n return _this2.maskValue(val, flags);\n }));\n }\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"normalizeValue\", this).call(this, this.maskValue(value, flags));\n }\n\n /**\n * Sets the value at this index.\n *\n * @param index\n * @param value\n * @param flags\n */\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n var flags = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (!this.isMultipleMasksField) {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"setValueAt\", this).call(this, index, value, flags);\n }\n value = this.maskValue(value, flags);\n var textValue = value.value || '';\n var textInput = this.refs.mask ? this.refs.mask[index] : null;\n var maskInput = this.refs.select ? this.refs.select[index] : null;\n var mask = this.getMaskPattern(value.maskName);\n if (textInput && maskInput && mask) {\n var placeholderChar = this.placeholderChar;\n textInput.value = (0, _vanillaTextMask.conformToMask)(textValue, FormioUtils.getInputMask(mask), {\n placeholderChar: placeholderChar\n }).conformedValue;\n maskInput.value = value.maskName;\n } else {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"setValueAt\", this).call(this, index, textValue, flags);\n }\n }\n }, {\n key: \"unmaskValue\",\n value: function unmaskValue(value) {\n var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.component.displayMask;\n var mask = FormioUtils.getInputMask(format, this.placeholderChar);\n return FormioUtils.unmaskValue(value, mask, this.placeholderChar);\n }\n\n /**\n * Returns the value at this index.\n *\n * @param index\n * @return {*}\n */\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n if (!this.isMultipleMasksField) {\n var _this$refs$valueMaskI;\n var value = _get(_getPrototypeOf(TextFieldComponent.prototype), \"getValueAt\", this).call(this, index);\n var valueMask = this.component.inputMask;\n var displayMask = this.component.displayMask;\n\n // If the input has only the valueMask or the displayMask is the same as the valueMask,\n // just return the value which is already formatted\n if (valueMask && !displayMask || displayMask === valueMask) {\n return value;\n }\n\n // If there is only the displayMask, return the raw (unmasked) value\n if (displayMask && !valueMask) {\n return this.unmaskValue(value, displayMask);\n }\n if ((_this$refs$valueMaskI = this.refs.valueMaskInput) !== null && _this$refs$valueMaskI !== void 0 && _this$refs$valueMaskI.mask) {\n var _this$refs$valueMaskI2;\n this.refs.valueMaskInput.mask.textMaskInputElement.update(value);\n return (_this$refs$valueMaskI2 = this.refs.valueMaskInput) === null || _this$refs$valueMaskI2 === void 0 ? void 0 : _this$refs$valueMaskI2.value;\n }\n return value;\n }\n var textInput = this.refs.mask ? this.refs.mask[index] : null;\n var maskInput = this.refs.select ? this.refs.select[index] : null;\n return {\n value: textInput ? textInput.value : undefined,\n maskName: maskInput ? maskInput.value : undefined\n };\n }\n }, {\n key: \"isHtmlRenderMode\",\n value: function isHtmlRenderMode() {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"isHtmlRenderMode\", this).call(this) || (this.options.readOnly || this.disabled) && this.component.inputFormat === 'html' && this.type === 'textfield';\n }\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dataValue;\n if (!this.isMultipleMasksField) {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"isEmpty\", this).call(this, (value || '').toString().trim());\n }\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"isEmpty\", this).call(this, value) || (this.component.multiple ? value.length === 0 : !value.maskName || !value.value);\n }\n }, {\n key: \"truncateMultipleSpaces\",\n value: function truncateMultipleSpaces(value) {\n if (value) {\n return value.trim().replace(/\\s{2,}/g, ' ');\n }\n return value;\n }\n }, {\n key: \"validationValue\",\n get: function get() {\n var value = _get(_getPrototypeOf(TextFieldComponent.prototype), \"validationValue\", this);\n if (value && this.component.truncateMultipleSpaces) {\n return this.truncateMultipleSpaces(value);\n }\n return value;\n }\n }, {\n key: \"beforeSubmit\",\n value: function beforeSubmit() {\n var _this3 = this;\n var value = this.dataValue;\n if (!this.component.truncateMultipleSpaces || !value) {\n return _nativePromiseOnly[\"default\"].resolve(value);\n }\n value = this.truncateMultipleSpaces(value);\n this.dataValue = value;\n return _nativePromiseOnly[\"default\"].resolve(value).then(function () {\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"beforeSubmit\", _this3).call(_this3);\n });\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n if (options !== null && options !== void 0 && options.email && this.visible && !this.skipInEmail && _lodash[\"default\"].isObject(value)) {\n var result = \"\\n \\n \\n \\n \\n \\n \\n \\n
\".concat(value.maskName, \"\").concat(value.value, \"
\\n \");\n return result;\n }\n if (value && this.component.inputFormat === 'plain' && /<[^<>]+>/g.test(value)) {\n value = value.replaceAll('<', '<').replaceAll('>', '>');\n }\n return _get(_getPrototypeOf(TextFieldComponent.prototype), \"getValueAsString\", this).call(this, value, options);\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 _Input2[\"default\"].schema.apply(_Input2[\"default\"], [{\n label: 'Text Field',\n key: 'textField',\n type: 'textfield',\n mask: false,\n inputType: 'text',\n inputFormat: 'plain',\n inputMask: '',\n displayMask: '',\n tableView: true,\n spellcheck: true,\n truncateMultipleSpaces: false,\n validate: {\n minLength: '',\n maxLength: '',\n pattern: ''\n }\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Text Field',\n icon: 'terminal',\n group: 'basic',\n documentation: '/userguide/form-building/form-components#text-field',\n weight: 0,\n schema: TextFieldComponent.schema()\n };\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(TextFieldComponent), \"serverConditionSettings\", this)), {}, {\n operators: [].concat(_toConsumableArray(_get(_getPrototypeOf(TextFieldComponent), \"serverConditionSettings\", this).operators), ['includes', 'notIncludes', 'endsWith', 'startsWith'])\n });\n }\n }]);\n return TextFieldComponent;\n}(_Input2[\"default\"]);\nexports[\"default\"] = TextFieldComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/textfield/TextField.js?"); /***/ }), @@ -2169,7 +2169,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\");\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.function.name.js */ \"./node_modules/core-js/modules/es.function.name.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = 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.array.map.js */ \"./node_modules/core-js/modules/es.array.map.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.concat.js */ \"./node_modules/core-js/modules/es.array.concat.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.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.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 _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _TextField = _interopRequireDefault(__webpack_require__(/*! ../textfield/TextField */ \"./lib/components/textfield/TextField.js\"));\nvar _utils = __webpack_require__(/*! ../../utils/utils */ \"./lib/utils/utils.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": 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 _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 defaultDataFormat = 'HH:mm:ss';\nvar TimeComponent = /*#__PURE__*/function (_TextFieldComponent) {\n _inherits(TimeComponent, _TextFieldComponent);\n var _super = _createSuper(TimeComponent);\n function TimeComponent(component, options, data) {\n var _this;\n _classCallCheck(this, TimeComponent);\n _this = _super.call(this, component, options, data);\n var _getBrowserInfo = (0, _utils.getBrowserInfo)(),\n isEdgeBrowser = _getBrowserInfo.edge,\n edgeVersion = _getBrowserInfo.version;\n _this.component.inputMask = _this.getInputMaskFromFormat(_this.component.format);\n _this.component.inputType = isEdgeBrowser && edgeVersion <= 18 ? 'text' : _this.component.inputType || 'time';\n _this.rawData = _this.component.multiple ? [] : _this.emptyValue;\n return _this;\n }\n _createClass(TimeComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(TimeComponent.prototype), \"init\", this).call(this);\n if (this.component.inputType === 'text') {\n this.validators.push('time');\n }\n }\n }, {\n key: \"dataFormat\",\n get: function get() {\n return this.component.dataFormat || defaultDataFormat;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return TimeComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var _this2 = this;\n var value = _get(_getPrototypeOf(TimeComponent.prototype), \"defaultValue\", this);\n if (this.component.multiple && Array.isArray(value)) {\n value = value.map(function (item) {\n return item ? _this2.getStringAsValue(item) : item;\n });\n } else {\n if (value) {\n value = this.getStringAsValue(value);\n }\n }\n return value;\n }\n }, {\n key: \"validationValue\",\n get: function get() {\n if (Array.isArray(this.rawData) && !this.rawData.length || !this.rawData) {\n return this.dataValue;\n }\n return this.rawData;\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(TimeComponent.prototype), \"inputInfo\", this);\n info.attr.type = this.component.inputType;\n return info;\n }\n }, {\n key: \"skipMaskValidation\",\n get: function get() {\n return true;\n }\n }, {\n key: \"isNotCompleteInput\",\n value: function isNotCompleteInput(value) {\n return value.includes('_');\n }\n }, {\n key: \"removeValue\",\n value: function removeValue(index) {\n this.rawData = Array.isArray(this.rawData) ? [].concat(_toConsumableArray(this.rawData.slice(0, index)), _toConsumableArray(this.rawData.slice(index + 1))) : this.emptyValue;\n _get(_getPrototypeOf(TimeComponent.prototype), \"removeValue\", this).call(this, index);\n }\n }, {\n key: \"resetRawData\",\n value: function resetRawData(index) {\n if (index) {\n this.setRawValue(this.emptyValue, index);\n } else {\n this.rawData = [];\n }\n }\n }, {\n key: \"setRawValue\",\n value: function setRawValue(value, index) {\n if (Array.isArray(this.rawData)) {\n this.rawData[index] = value;\n } else {\n this.rawData = value;\n }\n }\n }, {\n key: \"getRawValue\",\n value: function getRawValue(index) {\n if (index && Array.isArray(this.rawData)) {\n return this.rawData[index] || this.emptyValue;\n } else {\n return this.rawData;\n }\n }\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n if (!this.refs.input.length || !this.refs.input[index]) {\n return this.emptyValue;\n }\n var value = this.refs.input[index].value;\n if (!value) {\n this.resetRawData(index);\n return this.emptyValue;\n }\n this.setRawValue(value, index);\n return this.getStringAsValue(value);\n }\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n this.setRawValue(value ? this.getValueAsString(value) : value, index);\n this.refs.input[index].value = this.getRawValue(index);\n }\n }, {\n key: \"getStringAsValue\",\n value: function getStringAsValue(view) {\n return view ? (0, _moment[\"default\"])(view, this.component.format).format(this.component.dataFormat) : view;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n return (value ? (0, _moment[\"default\"])(value, this.component.dataFormat).format(this.component.format) : value) || '';\n }\n }, {\n key: \"getInputMaskFromFormat\",\n value: function getInputMaskFromFormat(format) {\n if (format === 'LT') {\n return '99:99 AA';\n }\n if (format === 'LTS') {\n return '99:99:99 AA';\n }\n return format.replace(/[hHmMsSk]/g, '9').replace(/[aA]/, 'AA');\n }\n }, {\n key: \"addFocusBlurEvents\",\n value: function addFocusBlurEvents(element) {\n var _this3 = this;\n _get(_getPrototypeOf(TimeComponent.prototype), \"addFocusBlurEvents\", this).call(this, element);\n this.addEventListener(element, 'blur', function () {\n element.value = _this3.getValueAsString(element.value);\n });\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 _TextField[\"default\"].schema.apply(_TextField[\"default\"], [{\n type: 'time',\n label: 'Time',\n key: 'time',\n inputType: 'time',\n format: 'HH:mm',\n dataFormat: defaultDataFormat\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Time',\n icon: 'clock-o',\n group: 'advanced',\n documentation: '/userguide/form-building/advanced-components#time',\n weight: 55,\n schema: TimeComponent.schema()\n };\n }\n }]);\n return TimeComponent;\n}(_TextField[\"default\"]);\nexports[\"default\"] = TimeComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/time/Time.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.object.to-string.js */ \"./node_modules/core-js/modules/es.object.to-string.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.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.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.function.name.js */ \"./node_modules/core-js/modules/es.function.name.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\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = 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.array.map.js */ \"./node_modules/core-js/modules/es.array.map.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.concat.js */ \"./node_modules/core-js/modules/es.array.concat.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.string.replace.js */ \"./node_modules/core-js/modules/es.string.replace.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 _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _TextField = _interopRequireDefault(__webpack_require__(/*! ../textfield/TextField */ \"./lib/components/textfield/TextField.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 defaultDataFormat = 'HH:mm:ss';\nvar TimeComponent = /*#__PURE__*/function (_TextFieldComponent) {\n _inherits(TimeComponent, _TextFieldComponent);\n var _super = _createSuper(TimeComponent);\n function TimeComponent(component, options, data) {\n var _this;\n _classCallCheck(this, TimeComponent);\n _this = _super.call(this, component, options, data);\n var _getBrowserInfo = (0, _utils.getBrowserInfo)(),\n isEdgeBrowser = _getBrowserInfo.edge,\n edgeVersion = _getBrowserInfo.version;\n _this.component.inputMask = _this.getInputMaskFromFormat(_this.component.format);\n _this.component.inputType = isEdgeBrowser && edgeVersion <= 18 ? 'text' : _this.component.inputType || 'time';\n _this.rawData = _this.component.multiple ? [] : _this.emptyValue;\n return _this;\n }\n _createClass(TimeComponent, [{\n key: \"init\",\n value: function init() {\n _get(_getPrototypeOf(TimeComponent.prototype), \"init\", this).call(this);\n if (this.component.inputType === 'text') {\n this.validators.push('time');\n }\n }\n }, {\n key: \"dataFormat\",\n get: function get() {\n return this.component.dataFormat || defaultDataFormat;\n }\n }, {\n key: \"defaultSchema\",\n get: function get() {\n return TimeComponent.schema();\n }\n }, {\n key: \"defaultValue\",\n get: function get() {\n var _this2 = this;\n var value = _get(_getPrototypeOf(TimeComponent.prototype), \"defaultValue\", this);\n if (this.component.multiple && Array.isArray(value)) {\n value = value.map(function (item) {\n return item ? _this2.getStringAsValue(item) : item;\n });\n } else {\n if (value) {\n value = this.getStringAsValue(value);\n }\n }\n return value;\n }\n }, {\n key: \"validationValue\",\n get: function get() {\n if (Array.isArray(this.rawData) && !this.rawData.length || !this.rawData) {\n return this.dataValue;\n }\n return this.rawData;\n }\n }, {\n key: \"inputInfo\",\n get: function get() {\n var info = _get(_getPrototypeOf(TimeComponent.prototype), \"inputInfo\", this);\n info.attr.type = this.component.inputType;\n return info;\n }\n }, {\n key: \"skipMaskValidation\",\n get: function get() {\n return true;\n }\n }, {\n key: \"isNotCompleteInput\",\n value: function isNotCompleteInput(value) {\n return value.includes('_');\n }\n }, {\n key: \"removeValue\",\n value: function removeValue(index) {\n this.rawData = Array.isArray(this.rawData) ? [].concat(_toConsumableArray(this.rawData.slice(0, index)), _toConsumableArray(this.rawData.slice(index + 1))) : this.emptyValue;\n _get(_getPrototypeOf(TimeComponent.prototype), \"removeValue\", this).call(this, index);\n }\n }, {\n key: \"resetRawData\",\n value: function resetRawData(index) {\n if (index) {\n this.setRawValue(this.emptyValue, index);\n } else {\n this.rawData = [];\n }\n }\n }, {\n key: \"setRawValue\",\n value: function setRawValue(value, index) {\n if (Array.isArray(this.rawData)) {\n this.rawData[index] = value;\n } else {\n this.rawData = value;\n }\n }\n }, {\n key: \"getRawValue\",\n value: function getRawValue(index) {\n if (index && Array.isArray(this.rawData)) {\n return this.rawData[index] || this.emptyValue;\n } else {\n return this.rawData;\n }\n }\n }, {\n key: \"getValueAt\",\n value: function getValueAt(index) {\n if (!this.refs.input.length || !this.refs.input[index]) {\n return this.emptyValue;\n }\n var value = this.refs.input[index].value;\n if (!value) {\n this.resetRawData(index);\n return this.emptyValue;\n }\n this.setRawValue(value, index);\n return this.getStringAsValue(value);\n }\n }, {\n key: \"setValueAt\",\n value: function setValueAt(index, value) {\n this.setRawValue(value ? this.getValueAsString(value) : value, index);\n this.refs.input[index].value = this.getRawValue(index);\n }\n }, {\n key: \"getStringAsValue\",\n value: function getStringAsValue(view) {\n return view ? (0, _moment[\"default\"])(view, this.component.format).format(this.component.dataFormat) : view;\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value) {\n return (value ? (0, _moment[\"default\"])(value, this.component.dataFormat).format(this.component.format) : value) || '';\n }\n }, {\n key: \"getInputMaskFromFormat\",\n value: function getInputMaskFromFormat(format) {\n if (format === 'LT') {\n return '99:99 AA';\n }\n if (format === 'LTS') {\n return '99:99:99 AA';\n }\n return format.replace(/[hHmMsSk]/g, '9').replace(/[aA]/, 'AA');\n }\n }, {\n key: \"addFocusBlurEvents\",\n value: function addFocusBlurEvents(element) {\n var _this3 = this;\n _get(_getPrototypeOf(TimeComponent.prototype), \"addFocusBlurEvents\", this).call(this, element);\n this.addEventListener(element, 'blur', function () {\n element.value = _this3.getValueAsString(element.value);\n });\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 _TextField[\"default\"].schema.apply(_TextField[\"default\"], [{\n type: 'time',\n label: 'Time',\n key: 'time',\n inputType: 'time',\n format: 'HH:mm',\n dataFormat: defaultDataFormat\n }].concat(extend));\n }\n }, {\n key: \"serverConditionSettings\",\n get: function get() {\n return _objectSpread(_objectSpread({}, _get(_getPrototypeOf(TimeComponent), \"serverConditionSettings\", this)), {}, {\n valueComponent: function valueComponent(classComp) {\n return _objectSpread(_objectSpread({}, classComp), {}, {\n type: 'time'\n });\n }\n });\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Time',\n icon: 'clock-o',\n group: 'advanced',\n documentation: '/userguide/form-building/advanced-components#time-1',\n weight: 55,\n schema: TimeComponent.schema()\n };\n }\n }]);\n return TimeComponent;\n}(_TextField[\"default\"]);\nexports[\"default\"] = TimeComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/time/Time.js?"); /***/ }), @@ -2213,7 +2213,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.object.define-property.js */ \"./node_modules/core-js/modules/es.object.define-property.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = _default;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\nvar _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component.form */ \"./lib/components/_classes/component/Component.form.js\"));\nvar _TreeEdit = _interopRequireDefault(__webpack_require__(/*! ./editForm/Tree.edit.data */ \"./lib/components/tree/editForm/Tree.edit.data.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _default() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Component[\"default\"].apply(void 0, [[{\n key: 'data',\n components: _TreeEdit[\"default\"]\n }]].concat(extend));\n}\n\n//# sourceURL=webpack://Formio/./lib/components/tree/Tree.form.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\"] = _default;\n__webpack_require__(/*! core-js/modules/es.array.concat.js */ \"./node_modules/core-js/modules/es.array.concat.js\");\nvar _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component.form */ \"./lib/components/_classes/component/Component.form.js\"));\nvar _TreeEdit = _interopRequireDefault(__webpack_require__(/*! ./editForm/Tree.edit.data */ \"./lib/components/tree/editForm/Tree.edit.data.js\"));\nvar _TreeEdit2 = _interopRequireDefault(__webpack_require__(/*! ./editForm/Tree.edit.display */ \"./lib/components/tree/editForm/Tree.edit.display.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _default() {\n for (var _len = arguments.length, extend = new Array(_len), _key = 0; _key < _len; _key++) {\n extend[_key] = arguments[_key];\n }\n return _Component[\"default\"].apply(void 0, [[{\n key: 'display',\n components: _TreeEdit2[\"default\"]\n }, {\n key: 'data',\n components: _TreeEdit[\"default\"]\n }]].concat(extend));\n}\n\n//# sourceURL=webpack://Formio/./lib/components/tree/Tree.form.js?"); /***/ }), @@ -2224,7 +2224,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.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.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.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.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.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.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 _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _Components = _interopRequireDefault(__webpack_require__(/*! ../Components */ \"./lib/components/Components.js\"));\nvar _NestedDataComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nesteddata/NestedDataComponent */ \"./lib/components/_classes/nesteddata/NestedDataComponent.js\"));\nvar _Node = _interopRequireDefault(__webpack_require__(/*! ./Node */ \"./lib/components/tree/Node.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.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 TreeComponent = /*#__PURE__*/function (_NestedDataComponent) {\n _inherits(TreeComponent, _NestedDataComponent);\n var _super = _createSuper(TreeComponent);\n function TreeComponent() {\n var _this;\n _classCallCheck(this, TreeComponent);\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 = 'tree';\n return _this;\n }\n _createClass(TreeComponent, [{\n key: \"emptyValue\",\n get: function get() {\n return {};\n }\n }, {\n key: \"viewComponents\",\n get: function get() {\n if (!this.viewComponentsInstantiated) {\n this.viewComponentsInstantiated = true;\n this._viewComponents = this.createComponents({});\n }\n return this._viewComponents;\n }\n }, {\n key: \"init\",\n value: function init() {\n if (this.builderMode) {\n return _get(_getPrototypeOf(TreeComponent.prototype), \"init\", this).call(this);\n }\n this.components = [];\n this.componentOptions = _objectSpread(_objectSpread({}, this.options), {}, {\n parent: this,\n root: this.root || this\n });\n this.disabled = this.shouldDisabled;\n this.setRoot();\n this.viewComponentsInstantiated = false;\n this._viewComponents = [];\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(TreeComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(TreeComponent.prototype), \"disabled\", disabled, this, true);\n this.viewComponents.forEach(function (component) {\n return component.parentDisabled = disabled;\n });\n }\n }, {\n key: \"isDefaultValueComponent\",\n get: function get() {\n return !!this.options.editComponent && !!this.options.editForm && this.component.key === 'defaultValue';\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(TreeComponent.prototype), \"destroy\", this).call(this);\n if (!this.builderMode) {\n this.removeComponents(this._viewComponents);\n }\n }\n }, {\n key: \"createComponents\",\n value: function createComponents(data, node) {\n var _this2 = this;\n var components = this.componentComponents.map(function (component) {\n var componentInstance = _Components[\"default\"].create(component, _this2.componentOptions, data);\n componentInstance.init();\n componentInstance.parentDisabled = _this2.disabled;\n return componentInstance;\n });\n if (node) {\n this.checkNode(this.data, node);\n }\n return components;\n }\n }, {\n key: \"removeComponents\",\n value: function removeComponents(components) {\n return components.map(function (component) {\n return component.destroy();\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.builderMode) {\n return _get(_getPrototypeOf(TreeComponent.prototype), \"render\", this).call(this);\n }\n return _get(_getPrototypeOf(TreeComponent.prototype), \"render\", this).call(this, this.renderTree(this.treeRoot));\n }\n }, {\n key: \"renderTree\",\n value: function renderTree() {\n var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var odd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var childNodes = node.hasChildren && !node.collapsed ? this.renderChildNodes(node.children, !odd) : [];\n var content = node.changing ? this.renderEdit(node) : this.renderView(node);\n return this.renderTemplate('tree', {\n odd: odd,\n childNodes: childNodes,\n content: content,\n node: node\n });\n }\n }, {\n key: \"renderChildNodes\",\n value: function renderChildNodes() {\n var _this3 = this;\n var nodes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var odd = arguments.length > 1 ? arguments[1] : undefined;\n return nodes.map(function (node) {\n return _this3.renderTree(node, odd);\n });\n }\n }, {\n key: \"renderEdit\",\n value: function renderEdit() {\n var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return this.renderTemplate('treeEdit', {\n children: this.renderComponents(node.components),\n node: node\n });\n }\n }, {\n key: \"renderView\",\n value: function renderView() {\n var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return this.renderTemplate('treeView', {\n values: this.viewComponents.map(function (component) {\n component.data = node.data;\n component.checkComponentConditions(node.data);\n return component.getView(component.dataValue);\n }),\n nodeData: node.data,\n node: node\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n if (this.builderMode) {\n return _get(_getPrototypeOf(TreeComponent.prototype), \"attach\", this).call(this, element);\n }\n this.loadRefs(element, {\n root: 'single'\n });\n return _nativePromiseOnly[\"default\"].all([_get(_getPrototypeOf(TreeComponent.prototype), \"attach\", this).call(this, element), this.attachNode(this.refs.root, this.treeRoot)]);\n }\n }, {\n key: \"attachNode\",\n value: function attachNode(element, node) {\n if (!element) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n var componentsPromise = _nativePromiseOnly[\"default\"].resolve();\n var childrenPromise = _nativePromiseOnly[\"default\"].resolve();\n node.refs = _lodash[\"default\"].reduce(element.children, function (refs, child) {\n return child.hasAttribute('ref') ? _objectSpread(_objectSpread({}, refs), {}, _defineProperty({}, child.getAttribute('ref'), child)) : refs;\n }, {});\n if (node.refs.content) {\n this.attachActions(node);\n componentsPromise = this.attachComponents(node);\n }\n if (node.refs.childNodes) {\n childrenPromise = this.attachChildren(node);\n }\n return _nativePromiseOnly[\"default\"].all([componentsPromise, childrenPromise]);\n }\n }, {\n key: \"attachActions\",\n value: function attachActions(node) {\n var _node$refs$content$ch,\n _this4 = this;\n if (!node.editing) {\n this.loadRefs.call(node, node.refs.content, {\n addChild: 'single',\n editNode: 'single',\n removeNode: 'single',\n revertNode: 'single',\n toggleNode: 'single'\n });\n }\n\n //load refs correctly (if there is nested tree)\n this.loadRefs.call(node, ((_node$refs$content$ch = node.refs.content.children[0]) === null || _node$refs$content$ch === void 0 ? void 0 : _node$refs$content$ch.children[1]) || node.refs.content, {\n cancelNode: 'single',\n saveNode: 'single'\n });\n if (node.refs.addChild) {\n this.addEventListener(node.refs.addChild, 'click', function () {\n _this4.addChild(node);\n });\n }\n if (node.refs.cancelNode) {\n this.addEventListener(node.refs.cancelNode, 'click', function () {\n _this4.cancelNode(node);\n });\n }\n if (node.refs.editNode) {\n this.addEventListener(node.refs.editNode, 'click', function () {\n _this4.editNode(node);\n });\n }\n if (node.refs.removeNode) {\n this.addEventListener(node.refs.removeNode, 'click', function () {\n _this4.removeNode(node);\n });\n }\n if (node.refs.revertNode) {\n this.addEventListener(node.refs.revertNode, 'click', function () {\n _this4.revertNode(node);\n });\n }\n if (node.refs.saveNode) {\n this.addEventListener(node.refs.saveNode, 'click', function () {\n _this4.saveNode(node);\n });\n }\n if (node.refs.toggleNode) {\n this.addEventListener(node.refs.toggleNode, 'click', function () {\n _this4.toggleNode(node);\n });\n }\n }\n }, {\n key: \"attachComponents\",\n value: function attachComponents(node) {\n if (this.builderMode) {\n var _get2;\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 (_get2 = _get(_getPrototypeOf(TreeComponent.prototype), \"attachComponents\", this)).call.apply(_get2, [this, node].concat(args));\n }\n this.loadRefs.call(node, node.refs.content, {\n nodeEdit: 'single'\n });\n return node.refs.nodeEdit ? _get(_getPrototypeOf(TreeComponent.prototype), \"attachComponents\", this).call(this, node.refs.nodeEdit, node.components) : _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"attachChildren\",\n value: function attachChildren(node) {\n var _this5 = this;\n var childElements = node.refs.childNodes.children;\n return _nativePromiseOnly[\"default\"].all(_lodash[\"default\"].map(childElements, function (childElement, index) {\n return _this5.attachNode(childElement, node.children[index]);\n }));\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 this.setRoot();\n return changed;\n }\n }, {\n key: \"addChild\",\n value: function addChild(parent) {\n var _this6 = this;\n if (this.options.readOnly || parent[\"new\"]) {\n return;\n }\n this.hook('tree.addChild', {\n parent: parent,\n component: this\n }, function () {\n var child = parent.addChild();\n _this6.redraw();\n return child;\n });\n }\n }, {\n key: \"cancelNode\",\n value: function cancelNode(node) {\n var _this7 = this;\n if (this.options.readOnly) {\n return;\n }\n this.hook('tree.cancelNode', {\n node: node,\n component: this\n }, function () {\n if (node.isRoot) {\n if (node.persistentData && !_lodash[\"default\"].isEmpty(node.persistentData)) {\n node.cancel();\n _this7.redraw();\n } else {\n _this7.removeRoot();\n }\n } else {\n node.cancel();\n _this7.redraw();\n }\n return node;\n });\n }\n }, {\n key: \"editNode\",\n value: function editNode(node) {\n var _this8 = this;\n if (this.options.readOnly || node[\"new\"]) {\n return;\n }\n this.hook('tree.editNode', {\n node: node,\n component: this\n }, function () {\n node.edit();\n _this8.redraw();\n return node;\n });\n }\n }, {\n key: \"removeNode\",\n value: function removeNode(node) {\n var _this9 = this;\n if (this.options.readOnly || node[\"new\"]) {\n return;\n }\n this.hook('tree.removeNode', {\n node: node,\n component: this\n }, function () {\n if (node.isRoot) {\n _this9.removeRoot();\n } else {\n node.remove();\n _this9.updateTree();\n }\n return node;\n });\n }\n }, {\n key: \"revertNode\",\n value: function revertNode(node) {\n var _this10 = this;\n if (this.options.readOnly || !node.revertAvailable) {\n return;\n }\n this.hook('tree.revertNode', {\n node: node,\n component: this\n }, function () {\n node.revert();\n _this10.updateTree();\n return node;\n });\n }\n }, {\n key: \"saveNode\",\n value: function saveNode(node) {\n var _this11 = this;\n if (this.options.readOnly) {\n return;\n }\n this.hook('tree.saveNode', {\n node: node,\n component: this\n }, function () {\n var isSaved = node.save();\n if (isSaved) {\n _this11.updateTree();\n }\n return node;\n });\n }\n }, {\n key: \"toggleNode\",\n value: function toggleNode(node) {\n var _this12 = this;\n this.hook('tree.toggleNode', {\n node: node,\n component: this\n }, function () {\n node.collapsed = !node.collapsed;\n _this12.redraw();\n return node;\n });\n }\n }, {\n key: \"removeRoot\",\n value: function removeRoot() {\n if (this.options.readOnly) {\n return;\n }\n this.dataValue = this.defaultValue;\n this.setRoot();\n this.redraw();\n }\n }, {\n key: \"setRoot\",\n value: function setRoot() {\n var value = this.getValue();\n this.treeRoot = new _Node[\"default\"](null, value, {\n isNew: this.builderMode ? true : !value.data,\n createComponents: this.createComponents.bind(this),\n checkNode: this.checkNode.bind(this, this.data),\n removeComponents: this.removeComponents,\n parentPath: this.isDefaultValueComponent ? this.path || this.component.key : null\n });\n this.hook('tree.setRoot', {\n root: this.treeRoot,\n component: this\n });\n this.redraw();\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.dataValue || {};\n }\n }, {\n key: \"updateTree\",\n value: function updateTree() {\n this.updateValue(this.treeRoot.value);\n this.redraw();\n }\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row) {\n return this.checkNode(data, this.treeRoot, flags, row);\n }\n }, {\n key: \"checkNode\",\n value: function checkNode(data, node, flags, row) {\n var _this13 = this;\n return node.children.reduce(function (result, child) {\n return _this13.checkNode(data, child, flags, row) && result;\n }, _get(_getPrototypeOf(TreeComponent.prototype), \"checkData\", this).call(this, data, flags, node.data, node.components) && !node.editing && !node[\"new\"]);\n }\n }, {\n key: \"getComponents\",\n value: function getComponents() {\n return this.treeRoot && (this.isDefaultValueComponent || !this.isDefaultValueComponent && !this.builderMode) ? this.treeRoot.getComponents() : _get(_getPrototypeOf(TreeComponent.prototype), \"getComponents\", this).call(this);\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 _NestedDataComponent2[\"default\"].schema.apply(_NestedDataComponent2[\"default\"], [{\n label: 'Tree',\n key: 'tree',\n type: 'tree',\n clearOnHide: true,\n input: true,\n tree: true,\n components: [],\n multiple: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Tree',\n icon: 'indent',\n group: 'data',\n weight: 40,\n documentation: '/userguide/form-building/data-components#tree',\n schema: TreeComponent.schema()\n };\n }\n }]);\n return TreeComponent;\n}(_NestedDataComponent2[\"default\"]);\nexports[\"default\"] = TreeComponent;\nTreeComponent.prototype.hasChanged = _Component[\"default\"].prototype.hasChanged;\n\n//# sourceURL=webpack://Formio/./lib/components/tree/Tree.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.reflect.set.js */ \"./node_modules/core-js/modules/es.reflect.set.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.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.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.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.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.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 _Component = _interopRequireDefault(__webpack_require__(/*! ../_classes/component/Component */ \"./lib/components/_classes/component/Component.js\"));\nvar _Components = _interopRequireDefault(__webpack_require__(/*! ../Components */ \"./lib/components/Components.js\"));\nvar _NestedDataComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nesteddata/NestedDataComponent */ \"./lib/components/_classes/nesteddata/NestedDataComponent.js\"));\nvar _Node = _interopRequireDefault(__webpack_require__(/*! ./Node */ \"./lib/components/tree/Node.js\"));\nvar _nativePromiseOnly = _interopRequireDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.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 TreeComponent = /*#__PURE__*/function (_NestedDataComponent) {\n _inherits(TreeComponent, _NestedDataComponent);\n var _super = _createSuper(TreeComponent);\n function TreeComponent() {\n var _this;\n _classCallCheck(this, TreeComponent);\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 = 'tree';\n return _this;\n }\n _createClass(TreeComponent, [{\n key: \"emptyValue\",\n get: function get() {\n return {};\n }\n }, {\n key: \"viewComponents\",\n get: function get() {\n if (!this.viewComponentsInstantiated) {\n this.viewComponentsInstantiated = true;\n this._viewComponents = this.createComponents({});\n }\n return this._viewComponents;\n }\n }, {\n key: \"init\",\n value: function init() {\n if (this.builderMode) {\n return _get(_getPrototypeOf(TreeComponent.prototype), \"init\", this).call(this);\n }\n this.components = [];\n this.componentOptions = _objectSpread(_objectSpread({}, this.options), {}, {\n parent: this,\n root: this.root || this\n });\n this.disabled = this.shouldDisabled;\n this.setRoot();\n this.viewComponentsInstantiated = false;\n this._viewComponents = [];\n }\n }, {\n key: \"disabled\",\n get: function get() {\n return _get(_getPrototypeOf(TreeComponent.prototype), \"disabled\", this);\n },\n set: function set(disabled) {\n _set(_getPrototypeOf(TreeComponent.prototype), \"disabled\", disabled, this, true);\n this.viewComponents.forEach(function (component) {\n return component.parentDisabled = disabled;\n });\n }\n }, {\n key: \"isDefaultValueComponent\",\n get: function get() {\n return !!this.options.editComponent && !!this.options.editForm && this.component.key === 'defaultValue';\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(TreeComponent.prototype), \"destroy\", this).call(this);\n if (!this.builderMode) {\n this.removeComponents(this._viewComponents);\n }\n }\n }, {\n key: \"createComponents\",\n value: function createComponents(data, node) {\n var _this2 = this;\n var components = this.componentComponents.map(function (component) {\n var componentInstance = _Components[\"default\"].create(component, _this2.componentOptions, data);\n componentInstance.init();\n componentInstance.parentDisabled = _this2.disabled;\n return componentInstance;\n });\n if (node) {\n this.checkNode(this.data, node);\n }\n return components;\n }\n }, {\n key: \"removeComponents\",\n value: function removeComponents(components) {\n return components.map(function (component) {\n return component.destroy();\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n if (this.builderMode) {\n return _get(_getPrototypeOf(TreeComponent.prototype), \"render\", this).call(this);\n }\n return _get(_getPrototypeOf(TreeComponent.prototype), \"render\", this).call(this, this.renderTree(this.treeRoot));\n }\n }, {\n key: \"renderTree\",\n value: function renderTree() {\n var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var odd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var childNodes = node.hasChildren && !node.collapsed ? this.renderChildNodes(node.children, !odd) : [];\n var content = node.changing ? this.renderEdit(node) : this.renderView(node);\n return this.renderTemplate('tree', {\n odd: odd,\n childNodes: childNodes,\n content: content,\n node: node\n });\n }\n }, {\n key: \"renderChildNodes\",\n value: function renderChildNodes() {\n var _this3 = this;\n var nodes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var odd = arguments.length > 1 ? arguments[1] : undefined;\n return nodes.map(function (node) {\n return _this3.renderTree(node, odd);\n });\n }\n }, {\n key: \"renderEdit\",\n value: function renderEdit() {\n var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return this.renderTemplate('treeEdit', {\n children: this.renderComponents(node.components),\n node: node\n });\n }\n }, {\n key: \"renderView\",\n value: function renderView() {\n var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return this.renderTemplate('treeView', {\n values: this.viewComponents.map(function (component) {\n component.data = node.data;\n component.checkComponentConditions(node.data);\n return component.getView(component.dataValue);\n }),\n nodeData: node.data,\n node: node\n });\n }\n }, {\n key: \"attach\",\n value: function attach(element) {\n if (this.builderMode) {\n return _get(_getPrototypeOf(TreeComponent.prototype), \"attach\", this).call(this, element);\n }\n this.loadRefs(element, {\n root: 'single'\n });\n return _nativePromiseOnly[\"default\"].all([_get(_getPrototypeOf(TreeComponent.prototype), \"attach\", this).call(this, element), this.attachNode(this.refs.root, this.treeRoot)]);\n }\n }, {\n key: \"attachNode\",\n value: function attachNode(element, node) {\n if (!element) {\n return _nativePromiseOnly[\"default\"].resolve();\n }\n var componentsPromise = _nativePromiseOnly[\"default\"].resolve();\n var childrenPromise = _nativePromiseOnly[\"default\"].resolve();\n node.refs = _lodash[\"default\"].reduce(element.children, function (refs, child) {\n return child.hasAttribute('ref') ? _objectSpread(_objectSpread({}, refs), {}, _defineProperty({}, child.getAttribute('ref'), child)) : refs;\n }, {});\n if (node.refs.content) {\n this.attachActions(node);\n componentsPromise = this.attachComponents(node);\n }\n if (node.refs.childNodes) {\n childrenPromise = this.attachChildren(node);\n }\n return _nativePromiseOnly[\"default\"].all([componentsPromise, childrenPromise]);\n }\n }, {\n key: \"attachActions\",\n value: function attachActions(node) {\n var _node$refs$content$ch,\n _this4 = this;\n if (!node.editing) {\n this.loadRefs.call(node, node.refs.content, {\n addChild: 'single',\n editNode: 'single',\n removeNode: 'single',\n revertNode: 'single',\n toggleNode: 'single'\n });\n }\n\n //load refs correctly (if there is nested tree)\n this.loadRefs.call(node, ((_node$refs$content$ch = node.refs.content.children[0]) === null || _node$refs$content$ch === void 0 ? void 0 : _node$refs$content$ch.children[1]) || node.refs.content, {\n cancelNode: 'single',\n saveNode: 'single'\n });\n if (node.refs.addChild) {\n this.addEventListener(node.refs.addChild, 'click', function () {\n _this4.addChild(node);\n });\n }\n if (node.refs.cancelNode) {\n this.addEventListener(node.refs.cancelNode, 'click', function () {\n _this4.cancelNode(node);\n });\n }\n if (node.refs.editNode) {\n this.addEventListener(node.refs.editNode, 'click', function () {\n _this4.editNode(node);\n });\n }\n if (node.refs.removeNode) {\n this.addEventListener(node.refs.removeNode, 'click', function () {\n _this4.removeNode(node);\n });\n }\n if (node.refs.revertNode) {\n this.addEventListener(node.refs.revertNode, 'click', function () {\n _this4.revertNode(node);\n });\n }\n if (node.refs.saveNode) {\n this.addEventListener(node.refs.saveNode, 'click', function () {\n _this4.saveNode(node);\n });\n }\n if (node.refs.toggleNode) {\n this.addEventListener(node.refs.toggleNode, 'click', function () {\n _this4.toggleNode(node);\n });\n }\n }\n }, {\n key: \"attachComponents\",\n value: function attachComponents(node) {\n if (this.builderMode) {\n var _get2;\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 (_get2 = _get(_getPrototypeOf(TreeComponent.prototype), \"attachComponents\", this)).call.apply(_get2, [this, node].concat(args));\n }\n this.loadRefs.call(node, node.refs.content, {\n nodeEdit: 'single'\n });\n return node.refs.nodeEdit ? _get(_getPrototypeOf(TreeComponent.prototype), \"attachComponents\", this).call(this, node.refs.nodeEdit, node.components) : _nativePromiseOnly[\"default\"].resolve();\n }\n }, {\n key: \"attachChildren\",\n value: function attachChildren(node) {\n var _this5 = this;\n var childElements = node.refs.childNodes.children;\n return _nativePromiseOnly[\"default\"].all(_lodash[\"default\"].map(childElements, function (childElement, index) {\n return _this5.attachNode(childElement, node.children[index]);\n }));\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 this.setRoot();\n return changed;\n }\n }, {\n key: \"addChild\",\n value: function addChild(parent) {\n var _this6 = this;\n if (this.options.readOnly || parent[\"new\"]) {\n return;\n }\n this.hook('tree.addChild', {\n parent: parent,\n component: this\n }, function () {\n var child = parent.addChild();\n _this6.redraw();\n return child;\n });\n }\n }, {\n key: \"cancelNode\",\n value: function cancelNode(node) {\n var _this7 = this;\n if (this.options.readOnly) {\n return;\n }\n this.hook('tree.cancelNode', {\n node: node,\n component: this\n }, function () {\n if (node.isRoot) {\n if (node.persistentData && !_lodash[\"default\"].isEmpty(node.persistentData)) {\n node.cancel();\n _this7.redraw();\n } else {\n _this7.removeRoot();\n }\n } else {\n node.cancel();\n _this7.redraw();\n }\n return node;\n });\n }\n }, {\n key: \"editNode\",\n value: function editNode(node) {\n var _this8 = this;\n if (this.options.readOnly || node[\"new\"]) {\n return;\n }\n this.hook('tree.editNode', {\n node: node,\n component: this\n }, function () {\n node.edit();\n _this8.redraw();\n return node;\n });\n }\n }, {\n key: \"removeNode\",\n value: function removeNode(node) {\n var _this9 = this;\n if (this.options.readOnly || node[\"new\"]) {\n return;\n }\n this.hook('tree.removeNode', {\n node: node,\n component: this\n }, function () {\n if (node.isRoot) {\n _this9.removeRoot();\n } else {\n node.remove();\n _this9.updateTree();\n }\n return node;\n });\n }\n }, {\n key: \"revertNode\",\n value: function revertNode(node) {\n var _this10 = this;\n if (this.options.readOnly || !node.revertAvailable) {\n return;\n }\n this.hook('tree.revertNode', {\n node: node,\n component: this\n }, function () {\n node.revert();\n _this10.updateTree();\n return node;\n });\n }\n }, {\n key: \"saveNode\",\n value: function saveNode(node) {\n var _this11 = this;\n if (this.options.readOnly) {\n return;\n }\n this.hook('tree.saveNode', {\n node: node,\n component: this\n }, function () {\n var isSaved = node.save();\n if (isSaved) {\n _this11.updateTree();\n }\n return node;\n });\n }\n }, {\n key: \"toggleNode\",\n value: function toggleNode(node) {\n var _this12 = this;\n this.hook('tree.toggleNode', {\n node: node,\n component: this\n }, function () {\n node.collapsed = !node.collapsed;\n _this12.redraw();\n return node;\n });\n }\n }, {\n key: \"removeRoot\",\n value: function removeRoot() {\n if (this.options.readOnly) {\n return;\n }\n this.dataValue = this.defaultValue;\n this.setRoot();\n this.redraw();\n }\n }, {\n key: \"setRoot\",\n value: function setRoot() {\n var value = this.getValue();\n this.treeRoot = new _Node[\"default\"](null, value, {\n isNew: this.builderMode ? true : !value.data,\n createComponents: this.createComponents.bind(this),\n checkNode: this.checkNode.bind(this, this.data),\n removeComponents: this.removeComponents,\n parentPath: this.isDefaultValueComponent ? this.path || this.component.key : null\n });\n this.hook('tree.setRoot', {\n root: this.treeRoot,\n component: this\n });\n this.redraw();\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.dataValue || {};\n }\n }, {\n key: \"updateTree\",\n value: function updateTree() {\n this.updateValue(this.treeRoot.value);\n this.redraw();\n }\n }, {\n key: \"checkData\",\n value: function checkData(data, flags, row) {\n return this.checkNode(data, this.treeRoot, flags, row);\n }\n }, {\n key: \"checkNode\",\n value: function checkNode(data, node, flags, row) {\n var _this13 = this;\n return node.children.reduce(function (result, child) {\n return _this13.checkNode(data, child, flags, row) && result;\n }, _get(_getPrototypeOf(TreeComponent.prototype), \"checkData\", this).call(this, data, flags, node.data, node.components) && !node.editing && !node[\"new\"]);\n }\n }, {\n key: \"getComponents\",\n value: function getComponents() {\n return this.treeRoot && (this.isDefaultValueComponent || !this.isDefaultValueComponent && !this.builderMode) ? this.treeRoot.getComponents() : _get(_getPrototypeOf(TreeComponent.prototype), \"getComponents\", this).call(this);\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, options) {\n var getChildAsString = function getChildAsString(value) {\n var _value$children;\n var result = \"\\n \\n \\n \";\n result += \"\\n \\n \";\n result += Object.keys(value.data).map(function (k) {\n return \"\\n \\n \\n \\n \";\n result += \"\\n \\n
\".concat(k, \"\\n \").concat(value.data[k], \"\\n
\\n \");\n });\n if (((_value$children = value.children) === null || _value$children === void 0 ? void 0 : _value$children.length) !== 0) {\n var _value$children2;\n (_value$children2 = value.children) === null || _value$children2 === void 0 ? void 0 : _value$children2.forEach(function (v) {\n result += getChildAsString(v);\n });\n }\n result += \"\\n
\\n \";\n return result;\n };\n if (options !== null && options !== void 0 && options.email) {\n var result = '';\n result += getChildAsString(value);\n return result;\n }\n return _get(_getPrototypeOf(TreeComponent.prototype), \"getValueAsString\", this).call(this, value, options);\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 _NestedDataComponent2[\"default\"].schema.apply(_NestedDataComponent2[\"default\"], [{\n label: 'Tree',\n key: 'tree',\n type: 'tree',\n clearOnHide: true,\n input: true,\n tree: true,\n components: [],\n multiple: false\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Tree',\n icon: 'indent',\n weight: 40,\n documentation: '/userguide/form-building/data-components#tree',\n showPreview: false,\n schema: TreeComponent.schema()\n };\n }\n }]);\n return TreeComponent;\n}(_NestedDataComponent2[\"default\"]);\nexports[\"default\"] = TreeComponent;\nTreeComponent.prototype.hasChanged = _Component[\"default\"].prototype.hasChanged;\n\n//# sourceURL=webpack://Formio/./lib/components/tree/Tree.js?"); /***/ }), @@ -2239,6 +2239,17 @@ eval("\n\n__webpack_require__(/*! core-js/modules/es.object.define-property.js * /***/ }), +/***/ "./lib/components/tree/editForm/Tree.edit.display.js": +/*!***********************************************************!*\ + !*** ./lib/components/tree/editForm/Tree.edit.display.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;\nvar _default = [{\n key: 'treeInfo',\n weight: -10,\n type: 'htmlelement',\n tag: 'div',\n className: 'alert alert-danger',\n content: 'This component has been deprecated and will be removed in a future version of Formio.js.'\n}];\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/components/tree/editForm/Tree.edit.display.js?"); + +/***/ }), + /***/ "./lib/components/unknown/Unknown.form.js": /*!************************************************!*\ !*** ./lib/components/unknown/Unknown.form.js ***! @@ -2345,7 +2356,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.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.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 _NestedComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.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 _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 WellComponent = /*#__PURE__*/function (_NestedComponent) {\n _inherits(WellComponent, _NestedComponent);\n var _super = _createSuper(WellComponent);\n function WellComponent() {\n var _this;\n _classCallCheck(this, WellComponent);\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.noField = true;\n return _this;\n }\n _createClass(WellComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return WellComponent.schema();\n }\n }, {\n key: \"className\",\n get: function get() {\n return \"\".concat(this.component.customClass);\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'well';\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 _NestedComponent2[\"default\"].schema.apply(_NestedComponent2[\"default\"], [{\n type: 'well',\n key: 'well',\n input: false,\n persistent: false,\n components: []\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Well',\n icon: 'square-o',\n group: 'layout',\n documentation: '/userguide/form-building/layout-components#well',\n weight: 60,\n schema: WellComponent.schema()\n };\n }\n }]);\n return WellComponent;\n}(_NestedComponent2[\"default\"]);\nexports[\"default\"] = WellComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/well/Well.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.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.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.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 _NestedComponent2 = _interopRequireDefault(__webpack_require__(/*! ../_classes/nested/NestedComponent */ \"./lib/components/_classes/nested/NestedComponent.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 _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 WellComponent = /*#__PURE__*/function (_NestedComponent) {\n _inherits(WellComponent, _NestedComponent);\n var _super = _createSuper(WellComponent);\n function WellComponent() {\n var _this;\n _classCallCheck(this, WellComponent);\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.noField = true;\n return _this;\n }\n _createClass(WellComponent, [{\n key: \"defaultSchema\",\n get: function get() {\n return WellComponent.schema();\n }\n }, {\n key: \"className\",\n get: function get() {\n return \"\".concat(this.component.customClass);\n }\n }, {\n key: \"templateName\",\n get: function get() {\n return 'well';\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 _NestedComponent2[\"default\"].schema.apply(_NestedComponent2[\"default\"], [{\n type: 'well',\n key: 'well',\n input: false,\n persistent: false,\n components: []\n }].concat(extend));\n }\n }, {\n key: \"builderInfo\",\n get: function get() {\n return {\n title: 'Well',\n icon: 'square-o',\n group: 'layout',\n documentation: '/userguide/form-building/layout-components#well',\n showPreview: false,\n weight: 60,\n schema: WellComponent.schema()\n };\n }\n }]);\n return WellComponent;\n}(_NestedComponent2[\"default\"]);\nexports[\"default\"] = WellComponent;\n\n//# sourceURL=webpack://Formio/./lib/components/well/Well.js?"); /***/ }), @@ -3061,7 +3072,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((__t = ( col.hideLabel ? '' : ctx.t(col.label || col.title, { _userInput: true }) )) == null ? '' : __t) +\n'\\n ';\n if (col.tooltip) { ;\n__p += ' ';\n } ;\n__p += '\\n \\n ';\n }) ;\n__p += '\\n ';\n if (ctx.hasExtraColumn) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n \\n \\n ';\n } ;\n__p += '\\n \\n ';\n ctx.rows.forEach(function(row, index) { ;\n__p += '\\n ';\n if (ctx.hasGroups && ctx.groups[index]) { ;\n__p += '\\n \\n ' +\n((__t = (ctx.groups[index].label)) == null ? '' : __t) +\n'\\n \\n ';\n } ;\n__p += '\\n \\n ';\n if (ctx.component.reorder) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n ';\n ctx.columns.forEach(function(col) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n ';\n if (ctx.canAddColumn) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n ';\n } ;\n__p += '\\n \\n ';\n }) ;\n__p += '\\n \\n ';\n if (!ctx.builder && ctx.hasAddButton && ctx.hasBottomSubmit) { ;\n__p += '\\n \\n \\n \\n \\n \\n ';\n } ;\n__p += '\\n
\\n ' +\n((__t = ( ctx.t('Add/Remove') )) == null ? '' : __t) +\n'\\n ';\n if (!ctx.builder && ctx.hasAddButton && ctx.hasTopSubmit) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n
\\n \\n \\n ';\n }) ;\n__p += '\\n ';\n if (ctx.hasExtraColumn) { ;\n__p += '\\n ';\n if (ctx.hasRemoveButtons) { ;\n__p += '\\n \\n \\n \\n ' +\n((__t = (ctx.placeholder)) == null ? '' : __t) +\n'\\n
\\n \\n
\\n';\nreturn __p\n}\n\n//# sourceURL=webpack://Formio/./lib/templates/bootstrap/datagrid/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((__t = ( col.hideLabel ? '' : ctx.t(col.label || col.title, { _userInput: true }) )) == null ? '' : __t) +\n'\\n ';\n if (col.tooltip) { ;\n__p += ' ';\n } ;\n__p += '\\n \\n ';\n }) ;\n__p += '\\n ';\n if (ctx.hasExtraColumn) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n \\n \\n ';\n } ;\n__p += '\\n \\n ';\n ctx.rows.forEach(function(row, index) { ;\n__p += '\\n ';\n if (ctx.hasGroups && ctx.groups[index]) { ;\n__p += '\\n \\n ' +\n((__t = (ctx.groups[index].label)) == null ? '' : __t) +\n'\\n \\n ';\n } ;\n__p += '\\n \\n ';\n if (ctx.component.reorder) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n ';\n ctx.columns.forEach(function(col) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n ';\n if (ctx.canAddColumn) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n ';\n } ;\n__p += '\\n \\n ';\n }) ;\n__p += '\\n \\n ';\n if (!ctx.builder && ctx.hasAddButton && ctx.hasBottomSubmit) { ;\n__p += '\\n \\n \\n \\n \\n \\n ';\n } ;\n__p += '\\n
\\n ' +\n((__t = ( ctx.t('Add/Remove') )) == null ? '' : __t) +\n'\\n ';\n if (!ctx.builder && ctx.hasAddButton && ctx.hasTopSubmit) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n
\\n \\n \\n ';\n }) ;\n__p += '\\n ';\n if (ctx.hasExtraColumn) { ;\n__p += '\\n ';\n if (ctx.hasRemoveButtons) { ;\n__p += '\\n \\n \\n \\n ' +\n((__t = (ctx.placeholder)) == null ? '' : __t) +\n'\\n
\\n \\n
\\n';\nreturn __p\n}\n\n//# sourceURL=webpack://Formio/./lib/templates/bootstrap/datagrid/form.ejs.js?"); /***/ }), @@ -3700,7 +3711,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 ';\n }) ;\n__p += '\\n\\n';\nreturn __p\n}\n\n//# sourceURL=webpack://Formio/./lib/templates/bootstrap/radio/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 ';\n }) ;\n__p += '\\n\\n';\nreturn __p\n}\n\n//# sourceURL=webpack://Formio/./lib/templates/bootstrap/radio/form.ejs.js?"); /***/ }), @@ -4475,7 +4486,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\"] = exports.KEY_CODES = 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.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.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.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.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 _choices = _interopRequireDefault(__webpack_require__(/*! @formio/choices.js */ \"./node_modules/@formio/choices.js/public/assets/scripts/choices.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\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); }\n/**\n * TODO: REMOVE THIS ONCE THE PULL REQUEST HAS BEEN RESOLVED.\n *\n * https://github.com/jshjohnson/Choices/pull/788\n *\n * This is intentionally not part of the extended class, since other components use Choices and need this fix as well.\n * @type {Choices._generatePlaceholderValue}\n * @private\n */\n_choices[\"default\"].prototype._generatePlaceholderValue = function () {\n if (this._isSelectElement && this.passedElement.placeholderOption) {\n var placeholderOption = this.passedElement.placeholderOption;\n return placeholderOption ? placeholderOption.text : false;\n }\n var _this$config = this.config,\n placeholder = _this$config.placeholder,\n placeholderValue = _this$config.placeholderValue;\n var dataset = this.passedElement.element.dataset;\n if (placeholder) {\n if (placeholderValue) {\n return placeholderValue;\n }\n if (dataset.placeholder) {\n return dataset.placeholder;\n }\n }\n return false;\n};\nvar KEY_CODES = {\n BACK_KEY: 46,\n DELETE_KEY: 8,\n TAB_KEY: 9,\n ENTER_KEY: 13,\n A_KEY: 65,\n ESC_KEY: 27,\n UP_KEY: 38,\n DOWN_KEY: 40,\n PAGE_UP_KEY: 33,\n PAGE_DOWN_KEY: 34\n};\nexports.KEY_CODES = KEY_CODES;\nvar ChoicesWrapper = /*#__PURE__*/function (_Choices) {\n _inherits(ChoicesWrapper, _Choices);\n var _super = _createSuper(ChoicesWrapper);\n function ChoicesWrapper() {\n var _this;\n _classCallCheck(this, ChoicesWrapper);\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._onTabKey = _this._onTabKey.bind(_assertThisInitialized(_this));\n _this.isDirectionUsing = false;\n _this.shouldOpenDropDown = true;\n return _this;\n }\n _createClass(ChoicesWrapper, [{\n key: \"_handleButtonAction\",\n value: function _handleButtonAction(activeItems, element) {\n if (!this._isSelectOneElement) {\n return _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_handleButtonAction\", this).call(this, activeItems, element);\n }\n if (!activeItems || !element || !this.config.removeItems || !this.config.removeItemButton) {\n return;\n }\n _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_handleButtonAction\", this).call(this, activeItems, element);\n }\n }, {\n key: \"_onEnterKey\",\n value: function _onEnterKey(args) {\n // Prevent dropdown form opening when removeItemButton was pressed using 'Enter' on keyboard\n if (args.event.target.className === 'choices__button') {\n this.shouldOpenDropDown = false;\n }\n _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_onEnterKey\", this).call(this, args);\n }\n }, {\n key: \"_onDirectionKey\",\n value: function _onDirectionKey() {\n var _get3,\n _this2 = this;\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (!this._isSelectOneElement) {\n var _get2;\n return (_get2 = _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_onDirectionKey\", this)).call.apply(_get2, [this].concat(args));\n }\n this.isDirectionUsing = true;\n (_get3 = _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_onDirectionKey\", this)).call.apply(_get3, [this].concat(args));\n this.onSelectValue.apply(this, args);\n clearTimeout(this.timeout);\n this.timeout = setTimeout(function () {\n _this2.isDirectionUsing = false;\n }, 250);\n }\n }, {\n key: \"_onTabKey\",\n value: function _onTabKey(_ref) {\n var activeItems = _ref.activeItems,\n hasActiveDropdown = _ref.hasActiveDropdown;\n if (hasActiveDropdown) {\n this._selectHighlightedChoice(activeItems);\n }\n }\n }, {\n key: \"_selectHighlightedChoice\",\n value: function _selectHighlightedChoice(activeItems) {\n var highlightedChoice = this.dropdown.getChild(\".\".concat(this.config.classNames.highlightedState));\n if (highlightedChoice) {\n this._handleChoiceAction(activeItems, highlightedChoice);\n }\n event.preventDefault();\n }\n }, {\n key: \"_onKeyDown\",\n value: function _onKeyDown(event) {\n var _keyDownActions;\n if (!this._isSelectOneElement) {\n return _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_onKeyDown\", this).call(this, event);\n }\n var target = event.target,\n keyCode = event.keyCode,\n ctrlKey = event.ctrlKey,\n metaKey = event.metaKey;\n if (target !== this.input.element && !this.containerOuter.element.contains(target)) {\n return;\n }\n var activeItems = this._store.activeItems;\n var hasFocusedInput = this.input.isFocussed;\n var hasActiveDropdown = this.dropdown.isActive;\n var hasItems = this.itemList.hasChildren;\n var keyString = String.fromCharCode(keyCode);\n var BACK_KEY = KEY_CODES.BACK_KEY,\n DELETE_KEY = KEY_CODES.DELETE_KEY,\n TAB_KEY = KEY_CODES.TAB_KEY,\n ENTER_KEY = KEY_CODES.ENTER_KEY,\n A_KEY = KEY_CODES.A_KEY,\n ESC_KEY = KEY_CODES.ESC_KEY,\n UP_KEY = KEY_CODES.UP_KEY,\n DOWN_KEY = KEY_CODES.DOWN_KEY,\n PAGE_UP_KEY = KEY_CODES.PAGE_UP_KEY,\n PAGE_DOWN_KEY = KEY_CODES.PAGE_DOWN_KEY;\n var hasCtrlDownKeyPressed = ctrlKey || metaKey;\n\n // If a user is typing and the dropdown is not active\n if (!hasActiveDropdown && !this._isTextElement && /[a-zA-Z0-9-_ ]/.test(keyString)) {\n var currentValue = this.input.element.value;\n this.input.element.value = currentValue ? \"\".concat(currentValue).concat(keyString) : keyString;\n this.showDropdown();\n }\n\n // Map keys to key actions\n var keyDownActions = (_keyDownActions = {}, _defineProperty(_keyDownActions, A_KEY, this._onAKey), _defineProperty(_keyDownActions, TAB_KEY, this._onTabKey), _defineProperty(_keyDownActions, ENTER_KEY, this._onEnterKey), _defineProperty(_keyDownActions, ESC_KEY, this._onEscapeKey), _defineProperty(_keyDownActions, UP_KEY, this._onDirectionKey), _defineProperty(_keyDownActions, PAGE_UP_KEY, this._onDirectionKey), _defineProperty(_keyDownActions, DOWN_KEY, this._onDirectionKey), _defineProperty(_keyDownActions, PAGE_DOWN_KEY, this._onDirectionKey), _defineProperty(_keyDownActions, DELETE_KEY, this._onDeleteKey), _defineProperty(_keyDownActions, BACK_KEY, this._onDeleteKey), _keyDownActions);\n\n // If keycode has a function, run it\n if (keyDownActions[keyCode]) {\n keyDownActions[keyCode]({\n event: event,\n target: target,\n keyCode: keyCode,\n metaKey: metaKey,\n activeItems: activeItems,\n hasFocusedInput: hasFocusedInput,\n hasActiveDropdown: hasActiveDropdown,\n hasItems: hasItems,\n hasCtrlDownKeyPressed: hasCtrlDownKeyPressed\n });\n }\n }\n }, {\n key: \"onSelectValue\",\n value: function onSelectValue(_ref2) {\n var event = _ref2.event,\n activeItems = _ref2.activeItems,\n hasActiveDropdown = _ref2.hasActiveDropdown;\n if (hasActiveDropdown) {\n this._selectHighlightedChoice(activeItems);\n } else if (this._isSelectOneElement) {\n this.showDropdown();\n event.preventDefault();\n }\n }\n }, {\n key: \"showDropdown\",\n value: function showDropdown() {\n var _get4;\n if (!this.shouldOpenDropDown) {\n this.shouldOpenDropDown = true;\n return;\n }\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n (_get4 = _get(_getPrototypeOf(ChoicesWrapper.prototype), \"showDropdown\", this)).call.apply(_get4, [this].concat(args));\n }\n }, {\n key: \"hideDropdown\",\n value: function hideDropdown() {\n var _get5;\n if (this.isDirectionUsing) {\n return;\n }\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n (_get5 = _get(_getPrototypeOf(ChoicesWrapper.prototype), \"hideDropdown\", this)).call.apply(_get5, [this].concat(args));\n }\n }, {\n key: \"_onBlur\",\n value: function _onBlur() {\n var _get6;\n if (this._isScrollingOnIe) {\n return;\n }\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n (_get6 = _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_onBlur\", this)).call.apply(_get6, [this].concat(args));\n }\n }]);\n return ChoicesWrapper;\n}(_choices[\"default\"]);\nvar _default = ChoicesWrapper;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/utils/ChoicesWrapper.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.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\"] = exports.KEY_CODES = 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.function.bind.js */ \"./node_modules/core-js/modules/es.function.bind.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.exec.js */ \"./node_modules/core-js/modules/es.regexp.exec.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 _choices = _interopRequireDefault(__webpack_require__(/*! @formio/choices.js */ \"./node_modules/@formio/choices.js/public/assets/scripts/choices.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\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); }\n/**\n * TODO: REMOVE THIS ONCE THE PULL REQUEST HAS BEEN RESOLVED.\n *\n * https://github.com/jshjohnson/Choices/pull/788\n *\n * This is intentionally not part of the extended class, since other components use Choices and need this fix as well.\n * @type {Choices._generatePlaceholderValue}\n * @private\n */\n_choices[\"default\"].prototype._generatePlaceholderValue = function () {\n if (this._isSelectElement && this.passedElement.placeholderOption) {\n var placeholderOption = this.passedElement.placeholderOption;\n return placeholderOption ? placeholderOption.text : false;\n }\n var _this$config = this.config,\n placeholder = _this$config.placeholder,\n placeholderValue = _this$config.placeholderValue;\n var dataset = this.passedElement.element.dataset;\n if (placeholder) {\n if (placeholderValue) {\n return placeholderValue;\n }\n if (dataset.placeholder) {\n return dataset.placeholder;\n }\n }\n return false;\n};\nvar KEY_CODES = {\n BACK_KEY: 46,\n DELETE_KEY: 8,\n TAB_KEY: 9,\n ENTER_KEY: 13,\n A_KEY: 65,\n ESC_KEY: 27,\n UP_KEY: 38,\n DOWN_KEY: 40,\n PAGE_UP_KEY: 33,\n PAGE_DOWN_KEY: 34\n};\nexports.KEY_CODES = KEY_CODES;\nvar ChoicesWrapper = /*#__PURE__*/function (_Choices) {\n _inherits(ChoicesWrapper, _Choices);\n var _super = _createSuper(ChoicesWrapper);\n function ChoicesWrapper() {\n var _this;\n _classCallCheck(this, ChoicesWrapper);\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._onTabKey = _this._onTabKey.bind(_assertThisInitialized(_this));\n _this.isDirectionUsing = false;\n _this.shouldOpenDropDown = true;\n return _this;\n }\n _createClass(ChoicesWrapper, [{\n key: \"_onTouchEnd\",\n value: function _onTouchEnd(event) {\n var target = (event || event.touches[0]).target;\n var touchWasWithinContainer = this._wasTap && this.containerOuter.element.contains(target);\n if (touchWasWithinContainer) {\n var containerWasExactTarget = target === this.containerOuter.element || target === this.containerInner.element;\n if (containerWasExactTarget) {\n if (this._isTextElement) {\n this.input.focus();\n } else if (this._isSelectMultipleElement) {\n this.input.focus();\n this.showDropdown();\n }\n }\n // Prevents focus event firing\n event.stopPropagation();\n }\n this._wasTap = true;\n }\n }, {\n key: \"_handleButtonAction\",\n value: function _handleButtonAction(activeItems, element) {\n if (!this._isSelectOneElement) {\n return _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_handleButtonAction\", this).call(this, activeItems, element);\n }\n if (!activeItems || !element || !this.config.removeItems || !this.config.removeItemButton) {\n return;\n }\n _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_handleButtonAction\", this).call(this, activeItems, element);\n }\n }, {\n key: \"_onEnterKey\",\n value: function _onEnterKey(args) {\n // Prevent dropdown form opening when removeItemButton was pressed using 'Enter' on keyboard\n if (args.event.target.className === 'choices__button') {\n this.shouldOpenDropDown = false;\n }\n _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_onEnterKey\", this).call(this, args);\n }\n }, {\n key: \"_onDirectionKey\",\n value: function _onDirectionKey() {\n var _get3,\n _this2 = this;\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (!this._isSelectOneElement) {\n var _get2;\n return (_get2 = _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_onDirectionKey\", this)).call.apply(_get2, [this].concat(args));\n }\n this.isDirectionUsing = true;\n (_get3 = _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_onDirectionKey\", this)).call.apply(_get3, [this].concat(args));\n this.onSelectValue.apply(this, args);\n clearTimeout(this.timeout);\n this.timeout = setTimeout(function () {\n _this2.isDirectionUsing = false;\n }, 250);\n }\n }, {\n key: \"_onTabKey\",\n value: function _onTabKey(_ref) {\n var activeItems = _ref.activeItems,\n hasActiveDropdown = _ref.hasActiveDropdown;\n if (hasActiveDropdown) {\n this._selectHighlightedChoice(activeItems);\n }\n }\n }, {\n key: \"_selectHighlightedChoice\",\n value: function _selectHighlightedChoice(activeItems) {\n var highlightedChoice = this.dropdown.getChild(\".\".concat(this.config.classNames.highlightedState));\n if (highlightedChoice) {\n this._handleChoiceAction(activeItems, highlightedChoice);\n }\n event.preventDefault();\n }\n }, {\n key: \"_onKeyDown\",\n value: function _onKeyDown(event) {\n var _keyDownActions;\n if (!this._isSelectOneElement) {\n return _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_onKeyDown\", this).call(this, event);\n }\n var target = event.target,\n keyCode = event.keyCode,\n ctrlKey = event.ctrlKey,\n metaKey = event.metaKey;\n if (target !== this.input.element && !this.containerOuter.element.contains(target)) {\n return;\n }\n var activeItems = this._store.activeItems;\n var hasFocusedInput = this.input.isFocussed;\n var hasActiveDropdown = this.dropdown.isActive;\n var hasItems = this.itemList.hasChildren;\n var keyString = String.fromCharCode(keyCode);\n var BACK_KEY = KEY_CODES.BACK_KEY,\n DELETE_KEY = KEY_CODES.DELETE_KEY,\n TAB_KEY = KEY_CODES.TAB_KEY,\n ENTER_KEY = KEY_CODES.ENTER_KEY,\n A_KEY = KEY_CODES.A_KEY,\n ESC_KEY = KEY_CODES.ESC_KEY,\n UP_KEY = KEY_CODES.UP_KEY,\n DOWN_KEY = KEY_CODES.DOWN_KEY,\n PAGE_UP_KEY = KEY_CODES.PAGE_UP_KEY,\n PAGE_DOWN_KEY = KEY_CODES.PAGE_DOWN_KEY;\n var hasCtrlDownKeyPressed = ctrlKey || metaKey;\n\n // If a user is typing and the dropdown is not active\n if (!hasActiveDropdown && !this._isTextElement && /[a-zA-Z0-9-_ ]/.test(keyString)) {\n var currentValue = this.input.element.value;\n this.input.element.value = currentValue ? \"\".concat(currentValue).concat(keyString) : keyString;\n this.showDropdown();\n }\n\n // Map keys to key actions\n var keyDownActions = (_keyDownActions = {}, _defineProperty(_keyDownActions, A_KEY, this._onAKey), _defineProperty(_keyDownActions, TAB_KEY, this._onTabKey), _defineProperty(_keyDownActions, ENTER_KEY, this._onEnterKey), _defineProperty(_keyDownActions, ESC_KEY, this._onEscapeKey), _defineProperty(_keyDownActions, UP_KEY, this._onDirectionKey), _defineProperty(_keyDownActions, PAGE_UP_KEY, this._onDirectionKey), _defineProperty(_keyDownActions, DOWN_KEY, this._onDirectionKey), _defineProperty(_keyDownActions, PAGE_DOWN_KEY, this._onDirectionKey), _defineProperty(_keyDownActions, DELETE_KEY, this._onDeleteKey), _defineProperty(_keyDownActions, BACK_KEY, this._onDeleteKey), _keyDownActions);\n\n // If keycode has a function, run it\n if (keyDownActions[keyCode]) {\n keyDownActions[keyCode]({\n event: event,\n target: target,\n keyCode: keyCode,\n metaKey: metaKey,\n activeItems: activeItems,\n hasFocusedInput: hasFocusedInput,\n hasActiveDropdown: hasActiveDropdown,\n hasItems: hasItems,\n hasCtrlDownKeyPressed: hasCtrlDownKeyPressed\n });\n }\n }\n }, {\n key: \"onSelectValue\",\n value: function onSelectValue(_ref2) {\n var event = _ref2.event,\n activeItems = _ref2.activeItems,\n hasActiveDropdown = _ref2.hasActiveDropdown;\n if (hasActiveDropdown) {\n this._selectHighlightedChoice(activeItems);\n } else if (this._isSelectOneElement) {\n this.showDropdown();\n event.preventDefault();\n }\n }\n }, {\n key: \"showDropdown\",\n value: function showDropdown() {\n var _get4;\n if (!this.shouldOpenDropDown) {\n this.shouldOpenDropDown = true;\n return;\n }\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n (_get4 = _get(_getPrototypeOf(ChoicesWrapper.prototype), \"showDropdown\", this)).call.apply(_get4, [this].concat(args));\n }\n }, {\n key: \"hideDropdown\",\n value: function hideDropdown() {\n var _get5;\n if (this.isDirectionUsing) {\n return;\n }\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n (_get5 = _get(_getPrototypeOf(ChoicesWrapper.prototype), \"hideDropdown\", this)).call.apply(_get5, [this].concat(args));\n }\n }, {\n key: \"_onBlur\",\n value: function _onBlur() {\n var _get6;\n if (this._isScrollingOnIe) {\n return;\n }\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n (_get6 = _get(_getPrototypeOf(ChoicesWrapper.prototype), \"_onBlur\", this)).call.apply(_get6, [this].concat(args));\n }\n }]);\n return ChoicesWrapper;\n}(_choices[\"default\"]);\nvar _default = ChoicesWrapper;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/utils/ChoicesWrapper.js?"); /***/ }), @@ -4486,7 +4497,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.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.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.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\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.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.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.array.map.js */ \"./node_modules/core-js/modules/es.array.map.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.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/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.keys.js */ \"./node_modules/core-js/modules/es.object.keys.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.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _stringHash = _interopRequireDefault(__webpack_require__(/*! string-hash */ \"./node_modules/string-hash/index.js\"));\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 _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 _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\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 _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 Evaluator = {\n noeval: false,\n protectedEval: false,\n // This property can be customized only by plugins\n cache: {},\n templateSettings: {\n evaluate: /\\{%([\\s\\S]+?)%\\}/g,\n interpolate: /\\{\\{([\\s\\S]+?)\\}\\}/g,\n escape: /\\{\\{\\{([\\s\\S]+?)\\}\\}\\}/g\n },\n evaluator: function evaluator(func) {\n for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n params[_key - 1] = arguments[_key];\n }\n if (Evaluator.noeval) {\n console.warn('No evaluations allowed for this renderer.');\n return _lodash[\"default\"].noop;\n }\n if (_typeof(params[0]) === 'object') {\n params = _lodash[\"default\"].keys(params[0]);\n }\n return _construct(Function, _toConsumableArray(params).concat([func]));\n },\n template: function template(_template, hash) {\n hash = hash || (0, _stringHash[\"default\"])(_template);\n if (Evaluator.cache[hash]) {\n return Evaluator.cache[hash];\n }\n try {\n // Ensure we handle copied templates from the ejs files.\n _template = _template.replace(/ctx\\./g, '');\n return Evaluator.cache[hash] = _lodash[\"default\"].template(_template, Evaluator.templateSettings);\n } catch (err) {\n console.warn('Error while processing template', err, _template);\n }\n },\n interpolate: function interpolate(rawTemplate, data, _options) {\n // Ensure reverse compatability.\n var options = _lodash[\"default\"].isObject(_options) ? _options : {\n noeval: _options\n };\n if (typeof rawTemplate === 'function') {\n try {\n return rawTemplate(data);\n } catch (err) {\n console.warn('Error interpolating template', err, data);\n return err.message;\n }\n }\n rawTemplate = String(rawTemplate);\n var template;\n if (Evaluator.noeval || options.noeval) {\n // No cached template methods available. Use poor-mans interpolate without eval.\n return rawTemplate.replace(/({{\\s*(.*?)\\s*}})/g, function (match, $1, $2) {\n // Allow for conditional values.\n var parts = $2.split('||').map(function (item) {\n return item.trim();\n });\n var value = '';\n var path = '';\n for (var i = 0; i < parts.length; i++) {\n path = parts[i];\n value = _lodash[\"default\"].get(data, path);\n if (value) {\n break;\n }\n }\n if (options.data) {\n _lodash[\"default\"].set(options.data, path, value);\n }\n return value;\n });\n } else {\n template = Evaluator.template(rawTemplate);\n }\n if (typeof template === 'function') {\n try {\n return template(data);\n } catch (err) {\n console.warn('Error interpolating template', err, rawTemplate, data);\n return err.message;\n }\n }\n return template;\n },\n evaluate: function evaluate(func, args) {\n return Array.isArray(args) ? func.apply(void 0, _toConsumableArray(args)) : func(args);\n }\n};\nEvaluator.registerEvaluator = function (evaluator) {\n Object.keys(evaluator).forEach(function (key) {\n Evaluator[key] = evaluator[key];\n });\n};\nvar _default = Evaluator;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/utils/Evaluator.js?"); +eval("\n\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.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.reflect.construct.js */ \"./node_modules/core-js/modules/es.reflect.construct.js\");\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.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.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.array.map.js */ \"./node_modules/core-js/modules/es.array.map.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.filter.js */ \"./node_modules/core-js/modules/es.array.filter.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/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.keys.js */ \"./node_modules/core-js/modules/es.object.keys.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.string.iterator.js */ \"./node_modules/core-js/modules/es.string.iterator.js\");\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nvar _stringHash = _interopRequireDefault(__webpack_require__(/*! string-hash */ \"./node_modules/string-hash/index.js\"));\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 _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 _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\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 _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 Evaluator = {\n noeval: false,\n protectedEval: false,\n // This property can be customized only by plugins\n cache: {},\n templateSettings: {\n evaluate: /\\{%([\\s\\S]+?)%\\}/g,\n interpolate: /\\{\\{([\\s\\S]+?)\\}\\}/g,\n escape: /\\{\\{\\{([\\s\\S]+?)\\}\\}\\}/g\n },\n evaluator: function evaluator(func) {\n for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n params[_key - 1] = arguments[_key];\n }\n if (Evaluator.noeval) {\n console.warn('No evaluations allowed for this renderer.');\n return _lodash[\"default\"].noop;\n }\n if (_typeof(params[0]) === 'object') {\n params = _lodash[\"default\"].keys(params[0]);\n }\n return _construct(Function, _toConsumableArray(params).concat([func]));\n },\n template: function template(_template, hash) {\n hash = hash || (0, _stringHash[\"default\"])(_template);\n if (Evaluator.cache[hash]) {\n return Evaluator.cache[hash];\n }\n try {\n // Ensure we handle copied templates from the ejs files.\n _template = _template.replace(/ctx\\./g, '');\n return Evaluator.cache[hash] = _lodash[\"default\"].template(_template, Evaluator.templateSettings);\n } catch (err) {\n console.warn('Error while processing template', err, _template);\n }\n },\n interpolate: function interpolate(rawTemplate, data, _options) {\n // Ensure reverse compatability.\n var options = _lodash[\"default\"].isObject(_options) ? _options : {\n noeval: _options\n };\n if (typeof rawTemplate === 'function') {\n try {\n return rawTemplate(data);\n } catch (err) {\n console.warn('Error interpolating template', err, data);\n return err.message;\n }\n }\n rawTemplate = String(rawTemplate);\n var template;\n if (Evaluator.noeval || options.noeval) {\n // No cached template methods available. Use poor-mans interpolate without eval.\n return rawTemplate.replace(/({{\\s*(.*?)\\s*}})/g, function (match, $1, $2) {\n // Allow for conditional values.\n var parts = $2.split('||').map(function (item) {\n return item.trim();\n });\n var value = '';\n var path = '';\n for (var i = 0; i < parts.length; i++) {\n path = parts[i];\n value = _lodash[\"default\"].get(data, path);\n if (value) {\n break;\n }\n }\n if (options.data) {\n _lodash[\"default\"].set(options.data, path, value);\n }\n return value;\n });\n } else {\n template = Evaluator.template(rawTemplate);\n }\n if (typeof template === 'function') {\n try {\n if (data.component && data.component.filter === rawTemplate && !data.options.building) {\n data.data = _lodash[\"default\"].mapValues(data.data, function (val) {\n return _lodash[\"default\"].isString(val) ? encodeURIComponent(val) : val;\n });\n }\n return template(data);\n } catch (err) {\n console.warn('Error interpolating template', err, rawTemplate, data);\n return err.message;\n }\n }\n return template;\n },\n evaluate: function evaluate(func, args) {\n return Array.isArray(args) ? func.apply(void 0, _toConsumableArray(args)) : func(args);\n }\n};\nEvaluator.registerEvaluator = function (evaluator) {\n Object.keys(evaluator).forEach(function (key) {\n Evaluator[key] = evaluator[key];\n });\n};\nvar _default = Evaluator;\nexports[\"default\"] = _default;\n\n//# sourceURL=webpack://Formio/./lib/utils/Evaluator.js?"); /***/ }), @@ -5124,7 +5135,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.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.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.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.date.now.js */ \"./node_modules/core-js/modules/es.date.now.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.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/web.timers.js */ \"./node_modules/core-js/modules/web.timers.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.string.match.js */ \"./node_modules/core-js/modules/es.string.match.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.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.find.js */ \"./node_modules/core-js/modules/es.array.find.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.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.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.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 _Formio = __webpack_require__(/*! ../Formio */ \"./lib/Formio.js\");\nvar _InputWidget2 = _interopRequireDefault(__webpack_require__(/*! ./InputWidget */ \"./lib/widgets/InputWidget.js\"));\nvar _utils = __webpack_require__(/*! ../utils/utils */ \"./lib/utils/utils.js\");\nvar _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.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 DEFAULT_FORMAT = 'yyyy-MM-dd hh:mm a';\nvar ISO_8601_FORMAT = 'yyyy-MM-ddTHH:mm:ssZ';\nvar isIEBrowser = (0, _utils.getBrowserInfo)().ie;\nvar CalendarWidget = /*#__PURE__*/function (_InputWidget) {\n _inherits(CalendarWidget, _InputWidget);\n var _super = _createSuper(CalendarWidget);\n /* eslint-enable camelcase */\n\n function CalendarWidget(settings, component, instance, index) {\n var _this;\n _classCallCheck(this, CalendarWidget);\n _this = _super.call(this, settings, component, instance, index);\n // Change the format to map to the settings.\n if (_this.settings.noCalendar) {\n _this.settings.format = _this.settings.format.replace(/yyyy-MM-dd /g, '');\n }\n if (!_this.settings.enableTime) {\n _this.settings.format = _this.settings.format.replace(/ hh:mm a$/g, '');\n } else if (_this.settings.time_24hr) {\n _this.settings.format = _this.settings.format.replace(/hh:mm a$/g, 'HH:mm');\n }\n _this.zoneLoading = false;\n _this.timezonesUrl = \"\".concat(_Formio.GlobalFormio.cdn['moment-timezone'], \"/data/packed/latest.json\");\n return _this;\n }\n\n /**\n * Load the timezones.\n *\n * @return {boolean} TRUE if the zones are loading, FALSE otherwise.\n */\n _createClass(CalendarWidget, [{\n key: \"loadZones\",\n value: function loadZones() {\n var _this2 = this;\n var timezone = this.timezone;\n if (this.zoneLoading) {\n return true;\n }\n if (!(0, _utils.zonesLoaded)() && (0, _utils.shouldLoadZones)(timezone)) {\n this.zoneLoading = true;\n (0, _utils.loadZones)(this.timezonesUrl, timezone).then(function () {\n _this2.zoneLoading = false;\n _this2.emit('redraw');\n });\n\n // Return zones are loading.\n return true;\n }\n\n // Zones are already loaded.\n return false;\n }\n }, {\n key: \"attach\",\n value: function attach(input) {\n var _this3 = this,\n _this$component$short;\n var superAttach = _get(_getPrototypeOf(CalendarWidget.prototype), \"attach\", this).call(this, input);\n var dateFormatInfo = (0, _utils.getLocaleDateFormatInfo)(this.settings.language);\n this.defaultFormat = {\n date: dateFormatInfo.dayFirst ? 'd/m/Y ' : 'm/d/Y ',\n time: 'G:i K'\n };\n this.closedOn = 0;\n this.valueFormat = this.settings.saveAs === 'date' ? ISO_8601_FORMAT : this.settings.dateFormat || ISO_8601_FORMAT;\n this.valueMomentFormat = (0, _utils.convertFormatToMoment)(this.valueFormat);\n var isReadOnly = this.settings.readOnly;\n this.settings.minDate = isReadOnly ? null : (0, _utils.getDateSetting)(this.settings.minDate);\n this.settings.maxDate = isReadOnly ? null : (0, _utils.getDateSetting)(this.settings.maxDate);\n this.settings.disable = this.disabledDates;\n this.settings.disableWeekends ? this.settings.disable.push(this.disableWeekends) : '';\n this.settings.disableWeekdays ? this.settings.disable.push(this.disableWeekdays) : '';\n this.settings.disableFunction ? this.settings.disable.push(this.disableFunction) : '';\n this.settings.wasDefaultValueChanged = false;\n this.settings.defaultValue = '';\n this.settings.manualInputValue = '';\n this.settings.isManuallyOverriddenValue = false;\n this.settings.currentValue = '';\n this.settings.altFormat = (0, _utils.convertFormatToFlatpickr)(this.settings.format);\n this.settings.dateFormat = (0, _utils.convertFormatToFlatpickr)(this.settings.dateFormat);\n this.settings.position = 'auto center';\n this.settings.onChange = function () {\n if (_this3.settings.allowInput) {\n if (_this3.settings.isManuallyOverriddenValue && _this3.settings.enableTime) {\n _this3.calendar._input.value = _this3.settings.manualInputValue;\n } else {\n _this3.settings.manualInputValue = '';\n }\n _this3.settings.isManuallyOverriddenValue = false;\n }\n _this3.emit('update');\n };\n this.settings.onOpen = function () {\n return _this3.hook('onCalendarOpen');\n };\n this.settings.onClose = function () {\n _this3.hook('onCalendarClose');\n _this3.closedOn = Date.now();\n if (_this3.settings.allowInput && _this3.settings.enableTime) {\n _this3.calendar._input.value = _this3.settings.manualInputValue || _this3.calendar._input.value;\n _this3.settings.isManuallyOverriddenValue = false;\n _this3.emit('update');\n }\n if (_this3.settings.wasDefaultValueChanged) {\n _this3.calendar._input.value = _this3.settings.defaultValue;\n _this3.settings.wasDefaultValueChanged = false;\n }\n if (_this3.calendar) {\n _this3.emit('blur');\n }\n };\n _Formio.GlobalFormio.requireLibrary('flatpickr-css', 'flatpickr', [{\n type: 'styles',\n src: \"\".concat(_Formio.GlobalFormio.cdn['flatpickr-formio'], \"/flatpickr.min.css\")\n }], true);\n if (this.component.shortcutButtons) {\n this.component.shortcutButtons = this.component.shortcutButtons.filter(function (btn) {\n return btn.label && btn.onClick;\n });\n }\n if ((_this$component$short = this.component.shortcutButtons) !== null && _this$component$short !== void 0 && _this$component$short.length) {\n _Formio.GlobalFormio.requireLibrary('shortcut-buttons-flatpickr-css', 'ShortcutButtonsPlugin', [{\n type: 'styles',\n src: \"\".concat(_Formio.GlobalFormio.cdn['shortcut-buttons-flatpickr'], \"/themes/light.min.css\")\n }], true);\n }\n return superAttach.then(function () {\n var _this3$component$shor;\n if ((_this3$component$shor = _this3.component.shortcutButtons) !== null && _this3$component$shor !== void 0 && _this3$component$shor.length) {\n return _Formio.GlobalFormio.requireLibrary('shortcut-buttons-flatpickr', 'ShortcutButtonsPlugin', \"\".concat(_Formio.GlobalFormio.cdn['shortcut-buttons-flatpickr'], \"/shortcut-buttons-flatpickr.min.js\"), true);\n }\n }).then(function (ShortcutButtonsPlugin) {\n return _Formio.GlobalFormio.requireLibrary('flatpickr', 'flatpickr', \"\".concat(_Formio.GlobalFormio.cdn['flatpickr-formio'], \"/flatpickr.min.js\"), true).then(function (Flatpickr) {\n var _this3$component$shor2;\n if ((_this3$component$shor2 = _this3.component.shortcutButtons) !== null && _this3$component$shor2 !== void 0 && _this3$component$shor2.length && ShortcutButtonsPlugin) {\n _this3.initShortcutButtonsPlugin(ShortcutButtonsPlugin);\n }\n _this3.settings.formatDate = _this3.getFlatpickrFormatDate(Flatpickr);\n if (_this3._input) {\n var locale = _this3.settings.locale;\n if (locale && locale.length >= 2 && locale !== 'en') {\n return _Formio.GlobalFormio.requireLibrary(\"flatpickr-\".concat(locale), \"flatpickr-\".concat(locale), \"\".concat(_Formio.GlobalFormio.cdn['flatpickr-formio'], \"/l10n/flatpickr-\").concat(locale, \".js\"), false, function () {\n return _this3.initFlatpickr(Flatpickr);\n });\n } else {\n _this3.initFlatpickr(Flatpickr);\n }\n }\n });\n })[\"catch\"](function (err) {\n console.warn(err);\n });\n }\n }, {\n key: \"disableWeekends\",\n get: function get() {\n return function (date) {\n return date.getDay() === 0 || date.getDay() === 6;\n };\n }\n }, {\n key: \"disableWeekdays\",\n get: function get() {\n var _this4 = this;\n return function (date) {\n return !_this4.disableWeekends(date);\n };\n }\n }, {\n key: \"disableFunction\",\n get: function get() {\n var _this5 = this;\n return function (date) {\n return _this5.evaluate(\"return \".concat(_this5.settings.disableFunction), {\n date: date\n });\n };\n }\n }, {\n key: \"timezone\",\n get: function get() {\n return this.componentInstance.getTimezone(this.settings);\n }\n }, {\n key: \"defaultSettings\",\n get: function get() {\n return CalendarWidget.defaultSettings;\n }\n }, {\n key: \"addSuffix\",\n value: function addSuffix(suffix) {\n var _this6 = this;\n this.addEventListener(suffix, 'click', function () {\n setTimeout(function () {\n if (_this6.calendar) {\n if (!_this6.calendar.isOpen && Date.now() - _this6.closedOn > 200) {\n _this6.calendar.open();\n } else if (_this6.calendar.isOpen) {\n _this6.calendar.close();\n }\n }\n }, 0);\n });\n return suffix;\n }\n }, {\n key: \"disabled\",\n set: function set(disabled) {\n _set(_getPrototypeOf(CalendarWidget.prototype), \"disabled\", disabled, this, true);\n if (this.calendar) {\n if (disabled) {\n this.calendar._input.setAttribute('disabled', 'disabled');\n } else {\n this.calendar._input.removeAttribute('disabled');\n }\n this.calendar.close();\n this.calendar.redraw();\n }\n }\n }, {\n key: \"input\",\n get: function get() {\n return this.calendar ? this.calendar.altInput : null;\n }\n }, {\n key: \"disabledDates\",\n get: function get() {\n if (this.settings.disabledDates) {\n var disabledDates = this.settings.disabledDates.split(',');\n return disabledDates.map(function (item) {\n var dateMask = /\\d{4}-\\d{2}-\\d{2}/g;\n var dates = item.match(dateMask);\n if (dates && dates.length) {\n return dates.length === 1 ? item.match(dateMask)[0] : {\n from: item.match(dateMask)[0],\n to: item.match(dateMask)[1]\n };\n }\n });\n }\n return [];\n }\n }, {\n key: \"localeFormat\",\n get: function get() {\n var format = '';\n if (this.settings.enableDate) {\n format += this.defaultFormat.date;\n }\n if (this.settings.enableTime) {\n format += this.defaultFormat.time;\n }\n return format;\n }\n }, {\n key: \"dateTimeFormat\",\n get: function get() {\n return this.settings.useLocaleSettings ? this.localeFormat : (0, _utils.convertFormatToFlatpickr)(this.dateFormat);\n }\n }, {\n key: \"dateFormat\",\n get: function get() {\n return _lodash[\"default\"].get(this.settings, 'format', DEFAULT_FORMAT);\n }\n\n /**\n * Return the date value.\n *\n * @param date\n * @param format\n * @return {string}\n */\n }, {\n key: \"getDateValue\",\n value: function getDateValue(date, format, useTimezone) {\n if (useTimezone) {\n return (0, _utils.momentDate)(date, this.valueFormat, this.timezone).format((0, _utils.convertFormatToMoment)(format));\n }\n return (0, _moment[\"default\"])(date).format((0, _utils.convertFormatToMoment)(format));\n }\n\n /**\n * Return the value of the selected date.\n *\n * @return {*}\n */\n }, {\n key: \"getValue\",\n value: function getValue() {\n // Standard output format.\n if (!this.calendar) {\n return _get(_getPrototypeOf(CalendarWidget.prototype), \"getValue\", this).call(this);\n }\n\n // Get the selected dates from the calendar widget.\n var dates = this.calendar.selectedDates;\n if (!dates || !dates.length) {\n return _get(_getPrototypeOf(CalendarWidget.prototype), \"getValue\", this).call(this);\n }\n if (!(dates[0] instanceof Date)) {\n return 'Invalid Date';\n }\n return this.getDateValue(dates[0], this.valueFormat, this.settings.saveAs === 'date');\n }\n }, {\n key: \"isValueISO8601\",\n value: function isValueISO8601(value) {\n return value && typeof value === 'string' && value.match(/-[0-9]{2}T[0-9]{2}:/);\n }\n\n /**\n * Set the selected date value.\n *\n * @param value\n */\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var saveAsText = this.settings.saveAs === 'text';\n if (!this.calendar) {\n value = value ? (0, _utils.formatDate)(this.timezonesUrl, value, (0, _utils.convertFormatToMoment)(this.settings.format), this.timezone, (0, _utils.convertFormatToMoment)(this.valueMomentFormat)) : value;\n return _get(_getPrototypeOf(CalendarWidget.prototype), \"setValue\", this).call(this, value);\n }\n var zonesLoading = this.loadZones();\n if (value) {\n if (!saveAsText && this.settings.readOnly && !zonesLoading) {\n this.calendar.setDate((0, _utils.momentDate)(value, this.valueFormat, this.timezone).format(), false);\n } else if (this.isValueISO8601(value)) {\n this.calendar.setDate(value, false);\n } else {\n this.calendar.setDate((0, _moment[\"default\"])(value, this.valueMomentFormat).toDate(), false);\n }\n } else {\n this.calendar.clear(false);\n }\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, format) {\n var inputFormat = format || this.dateFormat;\n var valueFormat = this.calendar ? this.valueFormat : this.settings.dateFormat;\n if (this.settings.saveAs === 'text' && this.componentInstance.parent && !this.settings.readOnly) {\n return (0, _moment[\"default\"])(value, (0, _utils.convertFormatToMoment)(valueFormat)).format((0, _utils.convertFormatToMoment)(valueFormat));\n }\n return (0, _utils.formatDate)(this.timezonesUrl, value, inputFormat, this.timezone, (0, _utils.convertFormatToMoment)(valueFormat));\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(hasErrors) {\n if (!this.input) {\n return;\n }\n if (hasErrors) {\n this.addClass(this.input, 'is-invalid');\n this.input.setAttribute('aria-invalid', 'true');\n } else {\n this.removeClass(this.input, 'is-invalid');\n this.input.setAttribute('aria-invalid', 'false');\n }\n }\n }, {\n key: \"validationValue\",\n value: function validationValue(value) {\n if (typeof value === 'string') {\n return new Date(value);\n }\n return value.map(function (val) {\n return new Date(val);\n });\n }\n }, {\n key: \"isCalendarElement\",\n value: function isCalendarElement(element) {\n var _this$calendar, _this$calendar$config, _this$calendar$config2, _this$calendar2, _this$calendar2$calen;\n if (!element) {\n return true;\n }\n if ((_this$calendar = this.calendar) !== null && _this$calendar !== void 0 && (_this$calendar$config = _this$calendar.config) !== null && _this$calendar$config !== void 0 && (_this$calendar$config2 = _this$calendar$config.appendTo) !== null && _this$calendar$config2 !== void 0 && _this$calendar$config2.contains(element)) {\n return true;\n }\n return (_this$calendar2 = this.calendar) === null || _this$calendar2 === void 0 ? void 0 : (_this$calendar2$calen = _this$calendar2.calendarContainer) === null || _this$calendar2$calen === void 0 ? void 0 : _this$calendar2$calen.contains(element);\n }\n }, {\n key: \"initFlatpickr\",\n value: function initFlatpickr(Flatpickr) {\n var _this7 = this;\n // Create a new flatpickr.\n this.calendar = new Flatpickr(this._input, _objectSpread(_objectSpread({}, this.settings), {}, {\n disableMobile: true\n }));\n this.calendar.altInput.addEventListener('input', function (event) {\n if (_this7.settings.allowInput && _this7.settings.currentValue !== event.target.value) {\n _this7.settings.manualInputValue = event.target.value;\n _this7.settings.isManuallyOverriddenValue = true;\n _this7.settings.currentValue = event.target.value;\n }\n if (event.target.value === '' && _this7.calendar.selectedDates.length > 0) {\n _this7.settings.wasDefaultValueChanged = true;\n _this7.settings.defaultValue = event.target.value;\n _this7.calendar.clear();\n } else {\n _this7.settings.wasDefaultValueChanged = false;\n }\n });\n var excludedFromMaskFormats = ['MMMM'];\n if (!this.settings.readOnly && !_lodash[\"default\"].some(excludedFromMaskFormats, function (format) {\n return _lodash[\"default\"].includes(_this7.settings.format, format);\n })) {\n // Enforce the input mask of the format.\n this.setInputMask(this.calendar._input, (0, _utils.convertFormatToMask)(this.settings.format));\n }\n\n // Fixes an issue with IE11 where value is set only after the second click\n // TODO: Remove when the issue is solved in the flatpickr library\n if (isIEBrowser) {\n // Remove the original blur listener, because value will be set to empty since relatedTarget is null in IE11\n var originalBlurListener = this.calendar._handlers.find(function (_ref) {\n var event = _ref.event,\n element = _ref.element;\n return event === 'blur' && element === _this7.calendar._input;\n });\n this.calendar._input.removeEventListener('blur', originalBlurListener.handler);\n // Add the same event listener as in the original library, but with workaround for IE11 issue\n this.addEventListener(this.calendar._input, 'blur', function (event) {\n var activeElement = _this7.settings.shadowRoot ? _this7.settings.shadowRoot.activeElement : document.activeElement;\n var relatedTarget = event.relatedTarget ? event.relatedTarget : activeElement;\n var isInput = event.target === _this7.calendar._input;\n if (isInput && !_this7.isCalendarElement(relatedTarget)) {\n _this7.calendar.setDate(_this7.calendar._input.value, true, event.target === _this7.calendar.altInput ? _this7.calendar.config.altFormat : _this7.calendar.config.dateFormat);\n }\n });\n }\n // Make sure we commit the value after a blur event occurs.\n this.addEventListener(this.calendar._input, 'blur', function (event) {\n var activeElement = _this7.settings.shadowRoot ? _this7.settings.shadowRoot.activeElement : document.activeElement;\n var relatedTarget = event.relatedTarget ? event.relatedTarget : activeElement;\n if (!(isIEBrowser && !relatedTarget) && !_this7.isCalendarElement(relatedTarget)) {\n var inputValue = _this7.calendar.input.value;\n var dateValue = inputValue ? (0, _moment[\"default\"])(_this7.calendar.input.value, (0, _utils.convertFormatToMoment)(_this7.valueFormat)).toDate() : inputValue;\n _this7.calendar.setDate(dateValue, true, _this7.settings.altFormat);\n } else if (!_this7.calendar.input.value && _this7.calendar.config.noCalendar) {\n var _this7$calendar, _this7$calendar$confi, _this7$calendar2, _this7$calendar2$conf;\n var value = (0, _moment[\"default\"])({\n hour: (_this7$calendar = _this7.calendar) === null || _this7$calendar === void 0 ? void 0 : (_this7$calendar$confi = _this7$calendar.config) === null || _this7$calendar$confi === void 0 ? void 0 : _this7$calendar$confi.defaultHour,\n minute: (_this7$calendar2 = _this7.calendar) === null || _this7$calendar2 === void 0 ? void 0 : (_this7$calendar2$conf = _this7$calendar2.config) === null || _this7$calendar2$conf === void 0 ? void 0 : _this7$calendar2$conf.defaultMinute\n }).toDate();\n _this7.calendar.setDate(value, true, _this7.settings.format);\n }\n });\n\n // FJS-1103: When hit the enter button, the field not saving the year correctly\n this.addEventListener(this.calendar.altInput, 'keydown', function (event) {\n if (event.keyCode === 13) {\n if (_this7.calendar.isOpen) {\n _this7.calendar.close();\n event.stopPropagation();\n }\n }\n });\n\n // Restore the calendar value from the component value.\n this.setValue(this.componentValue);\n }\n }, {\n key: \"initShortcutButtonsPlugin\",\n value: function initShortcutButtonsPlugin(ShortcutButtonsPlugin) {\n var _this8 = this;\n this.settings.plugins = [\n // eslint-disable-next-line new-cap\n ShortcutButtonsPlugin({\n button: this.component.shortcutButtons.map(function (btn) {\n return {\n label: btn.label,\n attributes: btn.attribute\n };\n }),\n onClick: function onClick(index) {\n var getValue = _this8.component.shortcutButtons[index].onClick;\n var date = _this8.evaluate(getValue, {\n date: new Date()\n }, 'date');\n _this8.calendar.setDate(date, true);\n }\n })];\n }\n }, {\n key: \"componentValue\",\n get: function get() {\n var compValue = this.componentInstance.dataValue;\n if (Array.isArray(compValue)) {\n compValue = compValue[this.valueIndex];\n }\n return compValue;\n }\n }, {\n key: \"getFlatpickrFormatDate\",\n value: function getFlatpickrFormatDate(Flatpickr) {\n var _this9 = this;\n return function (date, format) {\n // Only format this if this is the altFormat and the form is readOnly.\n if (_this9.settings.readOnly && format === _this9.settings.altFormat) {\n if (_this9.loadZones()) {\n return Flatpickr.formatDate(date, format);\n }\n var currentValue = new Date(_this9.getValue());\n if (currentValue.toString() === date.toString()) {\n return (0, _utils.formatOffset)(_this9.timezonesUrl, Flatpickr.formatDate.bind(Flatpickr), new Date(_this9.componentValue), format, _this9.timezone);\n }\n return (0, _utils.formatOffset)(_this9.timezonesUrl, Flatpickr.formatDate.bind(Flatpickr), date, format, _this9.timezone);\n }\n return Flatpickr.formatDate(date, format);\n };\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(CalendarWidget.prototype), \"destroy\", this).call(this);\n if (this.calendar) {\n this.calendar.destroy();\n }\n }\n }], [{\n key: \"defaultSettings\",\n get: /* eslint-disable camelcase */\n function get() {\n return {\n type: 'calendar',\n altInput: true,\n allowInput: true,\n clickOpens: true,\n enableDate: true,\n enableTime: true,\n mode: 'single',\n noCalendar: false,\n format: DEFAULT_FORMAT,\n dateFormat: ISO_8601_FORMAT,\n useLocaleSettings: false,\n language: 'us-en',\n hourIncrement: 1,\n minuteIncrement: 5,\n time_24hr: false,\n saveAs: 'date',\n displayInTimezone: '',\n timezone: '',\n disable: [],\n minDate: '',\n maxDate: ''\n };\n }\n }]);\n return CalendarWidget;\n}(_InputWidget2[\"default\"]);\nexports[\"default\"] = CalendarWidget;\n\n//# sourceURL=webpack://Formio/./lib/widgets/CalendarWidget.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.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.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.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.date.now.js */ \"./node_modules/core-js/modules/es.date.now.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.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/web.timers.js */ \"./node_modules/core-js/modules/web.timers.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.string.match.js */ \"./node_modules/core-js/modules/es.string.match.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.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.find.js */ \"./node_modules/core-js/modules/es.array.find.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.to-string.js */ \"./node_modules/core-js/modules/es.regexp.to-string.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.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 _Formio = __webpack_require__(/*! ../Formio */ \"./lib/Formio.js\");\nvar _InputWidget2 = _interopRequireDefault(__webpack_require__(/*! ./InputWidget */ \"./lib/widgets/InputWidget.js\"));\nvar _utils = __webpack_require__(/*! ../utils/utils */ \"./lib/utils/utils.js\");\nvar _moment = _interopRequireDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nvar _lodash = _interopRequireDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.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 DEFAULT_FORMAT = 'yyyy-MM-dd hh:mm a';\nvar ISO_8601_FORMAT = 'yyyy-MM-ddTHH:mm:ssZ';\nvar isIEBrowser = (0, _utils.getBrowserInfo)().ie;\nvar CalendarWidget = /*#__PURE__*/function (_InputWidget) {\n _inherits(CalendarWidget, _InputWidget);\n var _super = _createSuper(CalendarWidget);\n /* eslint-enable camelcase */\n\n function CalendarWidget(settings, component, instance, index) {\n var _this;\n _classCallCheck(this, CalendarWidget);\n _this = _super.call(this, settings, component, instance, index);\n // Change the format to map to the settings.\n if (_this.settings.noCalendar) {\n _this.settings.format = _this.settings.format.replace(/yyyy-MM-dd /g, '');\n }\n if (!_this.settings.enableTime) {\n _this.settings.format = _this.settings.format.replace(/ hh:mm a$/g, '');\n } else if (_this.settings.time_24hr) {\n _this.settings.format = _this.settings.format.replace(/hh:mm a$/g, 'HH:mm');\n }\n _this.zoneLoading = false;\n _this.timezonesUrl = \"\".concat(_Formio.GlobalFormio.cdn['moment-timezone'], \"/data/packed/latest.json\");\n return _this;\n }\n\n /**\n * Load the timezones.\n *\n * @return {boolean} TRUE if the zones are loading, FALSE otherwise.\n */\n _createClass(CalendarWidget, [{\n key: \"loadZones\",\n value: function loadZones() {\n var _this2 = this;\n var timezone = this.timezone;\n if (this.zoneLoading) {\n return true;\n }\n if (!(0, _utils.zonesLoaded)() && (0, _utils.shouldLoadZones)(timezone)) {\n this.zoneLoading = true;\n (0, _utils.loadZones)(this.timezonesUrl, timezone).then(function () {\n _this2.zoneLoading = false;\n _this2.emit('redraw');\n });\n\n // Return zones are loading.\n return true;\n }\n\n // Zones are already loaded.\n return false;\n }\n }, {\n key: \"attach\",\n value: function attach(input) {\n var _this3 = this,\n _this$component$short;\n var superAttach = _get(_getPrototypeOf(CalendarWidget.prototype), \"attach\", this).call(this, input);\n var dateFormatInfo = (0, _utils.getLocaleDateFormatInfo)(this.settings.language);\n this.defaultFormat = {\n date: dateFormatInfo.dayFirst ? 'd/m/Y ' : 'm/d/Y ',\n time: 'G:i K'\n };\n this.closedOn = 0;\n this.valueFormat = this.settings.saveAs === 'date' ? ISO_8601_FORMAT : this.settings.dateFormat || ISO_8601_FORMAT;\n this.valueMomentFormat = (0, _utils.convertFormatToMoment)(this.valueFormat);\n var isReadOnly = this.settings.readOnly;\n this.settings.minDate = isReadOnly ? null : (0, _utils.getDateSetting)(this.settings.minDate);\n this.settings.maxDate = isReadOnly ? null : (0, _utils.getDateSetting)(this.settings.maxDate);\n this.settings.disable = this.disabledDates;\n this.settings.disableWeekends ? this.settings.disable.push(this.disableWeekends) : '';\n this.settings.disableWeekdays ? this.settings.disable.push(this.disableWeekdays) : '';\n this.settings.disableFunction ? this.settings.disable.push(this.disableFunction) : '';\n this.settings.wasDefaultValueChanged = false;\n this.settings.defaultValue = '';\n this.settings.manualInputValue = '';\n this.settings.isManuallyOverriddenValue = false;\n this.settings.currentValue = '';\n this.settings.altFormat = (0, _utils.convertFormatToFlatpickr)(this.settings.format);\n this.settings.dateFormat = (0, _utils.convertFormatToFlatpickr)(this.settings.dateFormat);\n this.settings.position = 'auto center';\n this.settings.onChange = function () {\n if (_this3.settings.allowInput) {\n if (_this3.settings.isManuallyOverriddenValue && _this3.settings.enableTime) {\n _this3.calendar._input.value = _this3.settings.manualInputValue;\n } else {\n _this3.settings.manualInputValue = '';\n }\n _this3.settings.isManuallyOverriddenValue = false;\n }\n _this3.emit('update');\n };\n this.settings.onOpen = function () {\n return _this3.hook('onCalendarOpen');\n };\n this.settings.onClose = function () {\n _this3.hook('onCalendarClose');\n _this3.closedOn = Date.now();\n if (_this3.settings.allowInput && _this3.settings.enableTime) {\n _this3.calendar._input.value = _this3.settings.manualInputValue || _this3.calendar._input.value;\n _this3.settings.isManuallyOverriddenValue = false;\n _this3.emit('update');\n }\n if (_this3.settings.wasDefaultValueChanged) {\n _this3.calendar._input.value = _this3.settings.defaultValue;\n _this3.settings.wasDefaultValueChanged = false;\n }\n if (_this3.calendar) {\n _this3.emit('blur');\n }\n };\n _Formio.GlobalFormio.requireLibrary('flatpickr-css', 'flatpickr', [{\n type: 'styles',\n src: \"\".concat(_Formio.GlobalFormio.cdn['flatpickr-formio'], \"/flatpickr.min.css\")\n }], true);\n if (this.component.shortcutButtons) {\n this.component.shortcutButtons = this.component.shortcutButtons.filter(function (btn) {\n return btn.label && btn.onClick;\n });\n }\n if ((_this$component$short = this.component.shortcutButtons) !== null && _this$component$short !== void 0 && _this$component$short.length) {\n _Formio.GlobalFormio.requireLibrary('shortcut-buttons-flatpickr-css', 'ShortcutButtonsPlugin', [{\n type: 'styles',\n src: \"\".concat(_Formio.GlobalFormio.cdn['shortcut-buttons-flatpickr'], \"/themes/light.min.css\")\n }], true);\n }\n return superAttach.then(function () {\n var _this3$component$shor;\n if ((_this3$component$shor = _this3.component.shortcutButtons) !== null && _this3$component$shor !== void 0 && _this3$component$shor.length) {\n return _Formio.GlobalFormio.requireLibrary('shortcut-buttons-flatpickr', 'ShortcutButtonsPlugin', \"\".concat(_Formio.GlobalFormio.cdn['shortcut-buttons-flatpickr'], \"/shortcut-buttons-flatpickr.min.js\"), true);\n }\n }).then(function (ShortcutButtonsPlugin) {\n return _Formio.GlobalFormio.requireLibrary('flatpickr', 'flatpickr', \"\".concat(_Formio.GlobalFormio.cdn['flatpickr-formio'], \"/flatpickr.min.js\"), true).then(function (Flatpickr) {\n var _this3$component$shor2;\n if ((_this3$component$shor2 = _this3.component.shortcutButtons) !== null && _this3$component$shor2 !== void 0 && _this3$component$shor2.length && ShortcutButtonsPlugin) {\n _this3.initShortcutButtonsPlugin(ShortcutButtonsPlugin);\n }\n _this3.settings.formatDate = _this3.getFlatpickrFormatDate(Flatpickr);\n if (_this3._input) {\n var locale = _this3.settings.locale;\n if (locale && locale.length >= 2 && locale !== 'en') {\n return _Formio.GlobalFormio.requireLibrary(\"flatpickr-\".concat(locale), \"flatpickr-\".concat(locale), \"\".concat(_Formio.GlobalFormio.cdn['flatpickr-formio'], \"/l10n/flatpickr-\").concat(locale, \".js\"), true).then(function () {\n return _this3.initFlatpickr(Flatpickr);\n });\n } else {\n _this3.initFlatpickr(Flatpickr);\n }\n }\n });\n })[\"catch\"](function (err) {\n console.warn(err);\n });\n }\n }, {\n key: \"disableWeekends\",\n get: function get() {\n return function (date) {\n return date.getDay() === 0 || date.getDay() === 6;\n };\n }\n }, {\n key: \"disableWeekdays\",\n get: function get() {\n var _this4 = this;\n return function (date) {\n return !_this4.disableWeekends(date);\n };\n }\n }, {\n key: \"disableFunction\",\n get: function get() {\n var _this5 = this;\n return function (date) {\n return _this5.evaluate(\"return \".concat(_this5.settings.disableFunction), {\n date: date\n });\n };\n }\n }, {\n key: \"timezone\",\n get: function get() {\n return this.componentInstance.getTimezone(this.settings);\n }\n }, {\n key: \"defaultSettings\",\n get: function get() {\n return CalendarWidget.defaultSettings;\n }\n }, {\n key: \"addSuffix\",\n value: function addSuffix(suffix) {\n var _this6 = this;\n this.addEventListener(suffix, 'click', function () {\n setTimeout(function () {\n if (_this6.calendar) {\n if (!_this6.calendar.isOpen && Date.now() - _this6.closedOn > 200) {\n _this6.calendar.open();\n } else if (_this6.calendar.isOpen) {\n _this6.calendar.close();\n }\n }\n }, 0);\n });\n return suffix;\n }\n }, {\n key: \"disabled\",\n set: function set(disabled) {\n _set(_getPrototypeOf(CalendarWidget.prototype), \"disabled\", disabled, this, true);\n if (this.calendar) {\n if (disabled) {\n this.calendar._input.setAttribute('disabled', 'disabled');\n } else {\n this.calendar._input.removeAttribute('disabled');\n }\n this.calendar.close();\n this.calendar.redraw();\n }\n }\n }, {\n key: \"input\",\n get: function get() {\n return this.calendar ? this.calendar.altInput : null;\n }\n }, {\n key: \"disabledDates\",\n get: function get() {\n if (this.settings.disabledDates) {\n var disabledDates = this.settings.disabledDates.split(',');\n return disabledDates.map(function (item) {\n var dateMask = /\\d{4}-\\d{2}-\\d{2}/g;\n var dates = item.match(dateMask);\n if (dates && dates.length) {\n return dates.length === 1 ? item.match(dateMask)[0] : {\n from: item.match(dateMask)[0],\n to: item.match(dateMask)[1]\n };\n }\n });\n }\n return [];\n }\n }, {\n key: \"localeFormat\",\n get: function get() {\n var format = '';\n if (this.settings.enableDate) {\n format += this.defaultFormat.date;\n }\n if (this.settings.enableTime) {\n format += this.defaultFormat.time;\n }\n return format;\n }\n }, {\n key: \"dateTimeFormat\",\n get: function get() {\n return this.settings.useLocaleSettings ? this.localeFormat : (0, _utils.convertFormatToFlatpickr)(this.dateFormat);\n }\n }, {\n key: \"dateFormat\",\n get: function get() {\n return _lodash[\"default\"].get(this.settings, 'format', DEFAULT_FORMAT);\n }\n\n /**\n * Return the date value.\n *\n * @param date\n * @param format\n * @return {string}\n */\n }, {\n key: \"getDateValue\",\n value: function getDateValue(date, format, useTimezone) {\n if (useTimezone) {\n return (0, _utils.momentDate)(date, this.valueFormat, this.timezone).format((0, _utils.convertFormatToMoment)(format));\n }\n return (0, _moment[\"default\"])(date).format((0, _utils.convertFormatToMoment)(format));\n }\n\n /**\n * Return the value of the selected date.\n *\n * @return {*}\n */\n }, {\n key: \"getValue\",\n value: function getValue() {\n // Standard output format.\n if (!this.calendar) {\n return _get(_getPrototypeOf(CalendarWidget.prototype), \"getValue\", this).call(this);\n }\n\n // Get the selected dates from the calendar widget.\n var dates = this.calendar.selectedDates;\n if (!dates || !dates.length) {\n return _get(_getPrototypeOf(CalendarWidget.prototype), \"getValue\", this).call(this);\n }\n if (!(dates[0] instanceof Date)) {\n return 'Invalid Date';\n }\n return this.getDateValue(dates[0], this.valueFormat, this.settings.saveAs === 'date');\n }\n }, {\n key: \"isValueISO8601\",\n value: function isValueISO8601(value) {\n return value && typeof value === 'string' && value.match(/-[0-9]{2}T[0-9]{2}:/);\n }\n\n /**\n * Set the selected date value.\n *\n * @param value\n */\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n var saveAsText = this.settings.saveAs === 'text';\n if (!this.calendar) {\n value = value ? (0, _utils.formatDate)(this.timezonesUrl, value, (0, _utils.convertFormatToMoment)(this.settings.format), this.timezone, (0, _utils.convertFormatToMoment)(this.valueMomentFormat)) : value;\n return _get(_getPrototypeOf(CalendarWidget.prototype), \"setValue\", this).call(this, value);\n }\n var zonesLoading = this.loadZones();\n if (value) {\n if (!saveAsText && this.settings.readOnly && !zonesLoading) {\n this.calendar.setDate((0, _utils.momentDate)(value, this.valueFormat, this.timezone).format(), false);\n } else if (this.isValueISO8601(value)) {\n this.calendar.setDate(value, false);\n } else {\n this.calendar.setDate((0, _moment[\"default\"])(value, this.valueMomentFormat).toDate(), false);\n }\n } else {\n this.calendar.clear(false);\n }\n }\n }, {\n key: \"getValueAsString\",\n value: function getValueAsString(value, format) {\n var inputFormat = format || this.dateFormat;\n var valueFormat = this.calendar ? this.valueFormat : this.settings.dateFormat;\n if (this.settings.saveAs === 'text' && this.componentInstance.parent && !this.settings.readOnly) {\n return (0, _moment[\"default\"])(value, (0, _utils.convertFormatToMoment)(valueFormat)).format((0, _utils.convertFormatToMoment)(valueFormat));\n }\n return (0, _utils.formatDate)(this.timezonesUrl, value, inputFormat, this.timezone, (0, _utils.convertFormatToMoment)(valueFormat));\n }\n }, {\n key: \"setErrorClasses\",\n value: function setErrorClasses(hasErrors) {\n if (!this.input) {\n return;\n }\n if (hasErrors) {\n this.addClass(this.input, 'is-invalid');\n this.input.setAttribute('aria-invalid', 'true');\n } else {\n this.removeClass(this.input, 'is-invalid');\n this.input.setAttribute('aria-invalid', 'false');\n }\n }\n }, {\n key: \"validationValue\",\n value: function validationValue(value) {\n if (typeof value === 'string') {\n return new Date(value);\n }\n return value.map(function (val) {\n return new Date(val);\n });\n }\n }, {\n key: \"isCalendarElement\",\n value: function isCalendarElement(element) {\n var _this$calendar, _this$calendar$config, _this$calendar$config2, _this$calendar2, _this$calendar2$calen;\n if (!element) {\n return true;\n }\n if ((_this$calendar = this.calendar) !== null && _this$calendar !== void 0 && (_this$calendar$config = _this$calendar.config) !== null && _this$calendar$config !== void 0 && (_this$calendar$config2 = _this$calendar$config.appendTo) !== null && _this$calendar$config2 !== void 0 && _this$calendar$config2.contains(element)) {\n return true;\n }\n return (_this$calendar2 = this.calendar) === null || _this$calendar2 === void 0 ? void 0 : (_this$calendar2$calen = _this$calendar2.calendarContainer) === null || _this$calendar2$calen === void 0 ? void 0 : _this$calendar2$calen.contains(element);\n }\n }, {\n key: \"initFlatpickr\",\n value: function initFlatpickr(Flatpickr) {\n var _this7 = this;\n // Create a new flatpickr.\n this.calendar = new Flatpickr(this._input, _objectSpread(_objectSpread({}, this.settings), {}, {\n disableMobile: true\n }));\n this.calendar.altInput.addEventListener('input', function (event) {\n if (_this7.settings.allowInput && _this7.settings.currentValue !== event.target.value) {\n _this7.settings.manualInputValue = event.target.value;\n _this7.settings.isManuallyOverriddenValue = true;\n _this7.settings.currentValue = event.target.value;\n }\n if (event.target.value === '' && _this7.calendar.selectedDates.length > 0) {\n _this7.settings.wasDefaultValueChanged = true;\n _this7.settings.defaultValue = event.target.value;\n _this7.calendar.clear();\n } else {\n _this7.settings.wasDefaultValueChanged = false;\n }\n });\n var excludedFromMaskFormats = ['MMMM'];\n if (!this.settings.readOnly && !_lodash[\"default\"].some(excludedFromMaskFormats, function (format) {\n return _lodash[\"default\"].includes(_this7.settings.format, format);\n })) {\n // Enforce the input mask of the format.\n this.setInputMask(this.calendar._input, (0, _utils.convertFormatToMask)(this.settings.format));\n }\n\n // Fixes an issue with IE11 where value is set only after the second click\n // TODO: Remove when the issue is solved in the flatpickr library\n if (isIEBrowser) {\n // Remove the original blur listener, because value will be set to empty since relatedTarget is null in IE11\n var originalBlurListener = this.calendar._handlers.find(function (_ref) {\n var event = _ref.event,\n element = _ref.element;\n return event === 'blur' && element === _this7.calendar._input;\n });\n this.calendar._input.removeEventListener('blur', originalBlurListener.handler);\n // Add the same event listener as in the original library, but with workaround for IE11 issue\n this.addEventListener(this.calendar._input, 'blur', function (event) {\n var activeElement = _this7.settings.shadowRoot ? _this7.settings.shadowRoot.activeElement : document.activeElement;\n var relatedTarget = event.relatedTarget ? event.relatedTarget : activeElement;\n var isInput = event.target === _this7.calendar._input;\n if (isInput && !_this7.isCalendarElement(relatedTarget)) {\n _this7.calendar.setDate(_this7.calendar._input.value, true, event.target === _this7.calendar.altInput ? _this7.calendar.config.altFormat : _this7.calendar.config.dateFormat);\n }\n });\n }\n // Make sure we commit the value after a blur event occurs.\n this.addEventListener(this.calendar._input, 'blur', function (event) {\n var activeElement = _this7.settings.shadowRoot ? _this7.settings.shadowRoot.activeElement : document.activeElement;\n var relatedTarget = event.relatedTarget ? event.relatedTarget : activeElement;\n if (!(isIEBrowser && !relatedTarget) && !_this7.isCalendarElement(relatedTarget)) {\n var inputValue = _this7.calendar.input.value;\n var dateValue = inputValue ? (0, _moment[\"default\"])(_this7.calendar.input.value, (0, _utils.convertFormatToMoment)(_this7.valueFormat)).toDate() : inputValue;\n _this7.calendar.setDate(dateValue, true, _this7.settings.altFormat);\n } else if (!_this7.calendar.input.value && _this7.calendar.config.noCalendar) {\n var _this7$calendar, _this7$calendar$confi, _this7$calendar2, _this7$calendar2$conf;\n var value = (0, _moment[\"default\"])({\n hour: (_this7$calendar = _this7.calendar) === null || _this7$calendar === void 0 ? void 0 : (_this7$calendar$confi = _this7$calendar.config) === null || _this7$calendar$confi === void 0 ? void 0 : _this7$calendar$confi.defaultHour,\n minute: (_this7$calendar2 = _this7.calendar) === null || _this7$calendar2 === void 0 ? void 0 : (_this7$calendar2$conf = _this7$calendar2.config) === null || _this7$calendar2$conf === void 0 ? void 0 : _this7$calendar2$conf.defaultMinute\n }).toDate();\n _this7.calendar.setDate(value, true, _this7.settings.format);\n }\n });\n\n // FJS-1103: When hit the enter button, the field not saving the year correctly\n this.addEventListener(this.calendar.altInput, 'keydown', function (event) {\n if (event.keyCode === 13) {\n if (_this7.calendar.isOpen) {\n _this7.calendar.close();\n event.stopPropagation();\n }\n }\n });\n\n // Restore the calendar value from the component value.\n this.setValue(this.componentValue);\n }\n }, {\n key: \"initShortcutButtonsPlugin\",\n value: function initShortcutButtonsPlugin(ShortcutButtonsPlugin) {\n var _this8 = this;\n this.settings.plugins = [\n // eslint-disable-next-line new-cap\n ShortcutButtonsPlugin({\n button: this.component.shortcutButtons.map(function (btn) {\n return {\n label: btn.label,\n attributes: btn.attribute\n };\n }),\n onClick: function onClick(index) {\n var getValue = _this8.component.shortcutButtons[index].onClick;\n var date = _this8.evaluate(getValue, {\n date: new Date()\n }, 'date');\n _this8.calendar.setDate(date, true);\n }\n })];\n }\n }, {\n key: \"componentValue\",\n get: function get() {\n var compValue = this.componentInstance.dataValue;\n if (Array.isArray(compValue)) {\n compValue = compValue[this.valueIndex];\n }\n return compValue;\n }\n }, {\n key: \"getFlatpickrFormatDate\",\n value: function getFlatpickrFormatDate(Flatpickr) {\n var _this9 = this;\n return function (date, format) {\n // Only format this if this is the altFormat and the form is readOnly.\n if (_this9.settings.readOnly && format === _this9.settings.altFormat) {\n if (_this9.loadZones()) {\n return Flatpickr.formatDate(date, format);\n }\n var currentValue = new Date(_this9.getValue());\n if (currentValue.toString() === date.toString()) {\n return (0, _utils.formatOffset)(_this9.timezonesUrl, Flatpickr.formatDate.bind(Flatpickr), new Date(_this9.componentValue), format, _this9.timezone);\n }\n return (0, _utils.formatOffset)(_this9.timezonesUrl, Flatpickr.formatDate.bind(Flatpickr), date, format, _this9.timezone);\n }\n return Flatpickr.formatDate(date, format);\n };\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(CalendarWidget.prototype), \"destroy\", this).call(this);\n if (this.calendar) {\n this.calendar.destroy();\n }\n }\n }], [{\n key: \"defaultSettings\",\n get: /* eslint-disable camelcase */\n function get() {\n return {\n type: 'calendar',\n altInput: true,\n allowInput: true,\n clickOpens: true,\n enableDate: true,\n enableTime: true,\n mode: 'single',\n noCalendar: false,\n format: DEFAULT_FORMAT,\n dateFormat: ISO_8601_FORMAT,\n useLocaleSettings: false,\n language: 'us-en',\n hourIncrement: 1,\n minuteIncrement: 5,\n time_24hr: false,\n saveAs: 'date',\n displayInTimezone: '',\n timezone: '',\n disable: [],\n minDate: '',\n maxDate: ''\n };\n }\n }]);\n return CalendarWidget;\n}(_InputWidget2[\"default\"]);\nexports[\"default\"] = CalendarWidget;\n\n//# sourceURL=webpack://Formio/./lib/widgets/CalendarWidget.js?"); /***/ }), @@ -5367,7 +5378,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo \***************************************************************************************/ /***/ (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((__t = ( col.hideLabel ? '' : ctx.t(col.label || col.title, { _userInput: true }) )) == null ? '' : __t) +\n'\\n ';\n if (col.tooltip) { ;\n__p += ' ';\n } ;\n__p += '\\n \\n ';\n }) ;\n__p += '\\n ';\n if (ctx.hasExtraColumn) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n \\n \\n ';\n } ;\n__p += '\\n \\n ';\n ctx.rows.forEach(function(row, index) { ;\n__p += '\\n ';\n if (ctx.hasGroups && ctx.groups[index]) { ;\n__p += '\\n \\n ' +\n((__t = (ctx.groups[index].label)) == null ? '' : __t) +\n'\\n \\n ';\n } ;\n__p += '\\n \\n ';\n if (ctx.component.reorder) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n ';\n ctx.columns.forEach(function(col) { ;\n__p += '\\n \\n ';\n }) ;\n__p += '\\n ';\n if (ctx.hasExtraColumn) { ;\n__p += '\\n ';\n if (ctx.hasRemoveButtons) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n ';\n if (ctx.canAddColumn) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n ';\n } ;\n__p += '\\n \\n ';\n }) ;\n__p += '\\n \\n ';\n if (ctx.hasAddButton && ctx.hasBottomSubmit) { ;\n__p += '\\n \\n \\n \\n \\n \\n ';\n } ;\n__p += '\\n
\\n ';\n if (!ctx.builder && ctx.hasAddButton && ctx.hasTopSubmit) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n
\\n \\n \\n ' +\n((__t = (row[col.key])) == null ? '' : __t) +\n'\\n \\n \\n \\n ' +\n((__t = (ctx.placeholder)) == null ? '' : __t) +\n'\\n
\\n \\n
\\n';\nreturn __p\n}\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/bootstrap3/lib/templates/bootstrap3/datagrid/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((__t = ( col.hideLabel ? '' : ctx.t(col.label || col.title, { _userInput: true }) )) == null ? '' : __t) +\n'\\n ';\n if (col.tooltip) { ;\n__p += ' ';\n } ;\n__p += '\\n \\n ';\n }) ;\n__p += '\\n ';\n if (ctx.hasExtraColumn) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n \\n \\n ';\n } ;\n__p += '\\n \\n ';\n ctx.rows.forEach(function(row, index) { ;\n__p += '\\n ';\n if (ctx.hasGroups && ctx.groups[index]) { ;\n__p += '\\n \\n ' +\n((__t = (ctx.groups[index].label)) == null ? '' : __t) +\n'\\n \\n ';\n } ;\n__p += '\\n \\n ';\n if (ctx.component.reorder) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n ';\n ctx.columns.forEach(function(col) { ;\n__p += '\\n \\n ';\n }) ;\n__p += '\\n ';\n if (ctx.hasExtraColumn) { ;\n__p += '\\n ';\n if (ctx.hasRemoveButtons) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n ';\n if (ctx.canAddColumn) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n ';\n } ;\n__p += '\\n \\n ';\n }) ;\n__p += '\\n \\n ';\n if (ctx.hasAddButton && ctx.hasBottomSubmit) { ;\n__p += '\\n \\n \\n \\n \\n \\n ';\n } ;\n__p += '\\n
\\n ';\n if (!ctx.builder && ctx.hasAddButton && ctx.hasTopSubmit) { ;\n__p += '\\n \\n ';\n } ;\n__p += '\\n
\\n \\n \\n ' +\n((__t = (row[col.key])) == null ? '' : __t) +\n'\\n \\n \\n \\n ' +\n((__t = (ctx.placeholder)) == null ? '' : __t) +\n'\\n
\\n \\n
\\n';\nreturn __p\n}\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/bootstrap3/lib/templates/bootstrap3/datagrid/form.ejs.js?"); /***/ }), @@ -11550,7 +11561,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\n \***********************************************/ /***/ (function(module) { -eval("/*! @license DOMPurify 2.4.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.1/LICENSE */\n\n(function (global, factory) {\n true ? module.exports = factory() :\n 0;\n})(this, (function () { 'use strict';\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n\n function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n }\n\n function _construct(Parent, args, Class) {\n if (_isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) _setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n }\n\n function _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n }\n\n function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n }\n\n function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n }\n\n function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n }\n\n function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n\n function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n var hasOwnProperty = Object.hasOwnProperty,\n setPrototypeOf = Object.setPrototypeOf,\n isFrozen = Object.isFrozen,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n var freeze = Object.freeze,\n seal = Object.seal,\n create = Object.create; // eslint-disable-line import/no-mutable-exports\n\n var _ref = typeof Reflect !== 'undefined' && Reflect,\n apply = _ref.apply,\n construct = _ref.construct;\n\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n\n if (!construct) {\n construct = function construct(Func, args) {\n return _construct(Func, _toConsumableArray(args));\n };\n }\n\n var arrayForEach = unapply(Array.prototype.forEach);\n var arrayPop = unapply(Array.prototype.pop);\n var arrayPush = unapply(Array.prototype.push);\n var stringToLowerCase = unapply(String.prototype.toLowerCase);\n var stringToString = unapply(String.prototype.toString);\n var stringMatch = unapply(String.prototype.match);\n var stringReplace = unapply(String.prototype.replace);\n var stringIndexOf = unapply(String.prototype.indexOf);\n var stringTrim = unapply(String.prototype.trim);\n var regExpTest = unapply(RegExp.prototype.test);\n var typeErrorCreate = unconstruct(TypeError);\n function unapply(func) {\n return function (thisArg) {\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\n return apply(func, thisArg, args);\n };\n }\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return construct(func, args);\n };\n }\n /* Add properties to a lookup table */\n\n function addToSet(set, array, transformCaseFunc) {\n transformCaseFunc = transformCaseFunc ? transformCaseFunc : stringToLowerCase;\n\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n\n var l = array.length;\n\n while (l--) {\n var element = array[l];\n\n if (typeof element === 'string') {\n var lcElement = transformCaseFunc(element);\n\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n\n element = lcElement;\n }\n }\n\n set[element] = true;\n }\n\n return set;\n }\n /* Shallow clone an object */\n\n function clone(object) {\n var newObject = create(null);\n var property;\n\n for (property in object) {\n if (apply(hasOwnProperty, object, [property])) {\n newObject[property] = object[property];\n }\n }\n\n return newObject;\n }\n /* IE10 doesn't support __lookupGetter__ so lets'\n * simulate it. It also automatically checks\n * if the prop is function or getter and behaves\n * accordingly. */\n\n function lookupGetter(object, prop) {\n while (object !== null) {\n var desc = getOwnPropertyDescriptor(object, prop);\n\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n\n object = getPrototypeOf(object);\n }\n\n function fallbackValue(element) {\n console.warn('fallback value for', element);\n return null;\n }\n\n return fallbackValue;\n }\n\n var html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); // SVG\n\n var svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n\n var svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'fedropshadow', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n var mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover']); // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n\n var mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n var text = freeze(['#text']);\n\n var html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);\n var svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n var mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n var MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n\n var ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\n var TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\n var DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n\n var ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n\n var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n var IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n var ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n var DOCTYPE_NAME = seal(/^html$/i);\n\n var getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n };\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {Document} document The document object (to determine policy name suffix)\n * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported).\n */\n\n\n var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {\n if (_typeof(trustedTypes) !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n } // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n\n\n var suffix = null;\n var ATTR_NAME = 'data-tt-policy-suffix';\n\n if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {\n suffix = document.currentScript.getAttribute(ATTR_NAME);\n }\n\n var policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML: function createHTML(html) {\n return html;\n },\n createScriptURL: function createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n\n function createDOMPurify() {\n var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n\n var DOMPurify = function DOMPurify(root) {\n return createDOMPurify(root);\n };\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n\n\n DOMPurify.version = '2.4.1';\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n\n DOMPurify.removed = [];\n\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n\n var originalDocument = window.document;\n var document = window.document;\n var DocumentFragment = window.DocumentFragment,\n HTMLTemplateElement = window.HTMLTemplateElement,\n Node = window.Node,\n Element = window.Element,\n NodeFilter = window.NodeFilter,\n _window$NamedNodeMap = window.NamedNodeMap,\n NamedNodeMap = _window$NamedNodeMap === void 0 ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,\n HTMLFormElement = window.HTMLFormElement,\n DOMParser = window.DOMParser,\n trustedTypes = window.trustedTypes;\n var ElementPrototype = Element.prototype;\n var cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n var getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n var getParentNode = lookupGetter(ElementPrototype, 'parentNode'); // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n\n if (typeof HTMLTemplateElement === 'function') {\n var template = document.createElement('template');\n\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);\n\n var emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML('') : '';\n var _document = document,\n implementation = _document.implementation,\n createNodeIterator = _document.createNodeIterator,\n createDocumentFragment = _document.createDocumentFragment,\n getElementsByTagName = _document.getElementsByTagName;\n var importNode = originalDocument.importNode;\n var documentMode = {};\n\n try {\n documentMode = clone(document).documentMode ? document.documentMode : {};\n } catch (_) {}\n\n var hooks = {};\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n\n DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined' && documentMode !== 9;\n var MUSTACHE_EXPR$1 = MUSTACHE_EXPR,\n ERB_EXPR$1 = ERB_EXPR,\n TMPLIT_EXPR$1 = TMPLIT_EXPR,\n DATA_ATTR$1 = DATA_ATTR,\n ARIA_ATTR$1 = ARIA_ATTR,\n IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE$1 = ATTR_WHITESPACE;\n var IS_ALLOWED_URI$1 = IS_ALLOWED_URI;\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n\n var ALLOWED_TAGS = null;\n var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray(html$1), _toConsumableArray(svg$1), _toConsumableArray(svgFilters), _toConsumableArray(mathMl$1), _toConsumableArray(text)));\n /* Allowed attribute names */\n\n var ALLOWED_ATTR = null;\n var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray(html), _toConsumableArray(svg), _toConsumableArray(mathMl), _toConsumableArray(xml)));\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n\n var CUSTOM_ELEMENT_HANDLING = Object.seal(Object.create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n\n var FORBID_TAGS = null;\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n\n var FORBID_ATTR = null;\n /* Decide if ARIA attributes are okay */\n\n var ALLOW_ARIA_ATTR = true;\n /* Decide if custom data attributes are okay */\n\n var ALLOW_DATA_ATTR = true;\n /* Decide if unknown protocols are okay */\n\n var ALLOW_UNKNOWN_PROTOCOLS = false;\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n\n var SAFE_FOR_TEMPLATES = false;\n /* Decide if document with ... should be returned */\n\n var WHOLE_DOCUMENT = false;\n /* Track whether config is already set on this instance of DOMPurify. */\n\n var SET_CONFIG = false;\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n\n var FORCE_BODY = false;\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n\n var RETURN_DOM = false;\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n\n var RETURN_DOM_FRAGMENT = false;\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n\n var RETURN_TRUSTED_TYPE = false;\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n\n var SANITIZE_DOM = true;\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n\n var SANITIZE_NAMED_PROPS = false;\n var SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n /* Keep element content when removing element? */\n\n var KEEP_CONTENT = true;\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n\n var IN_PLACE = false;\n /* Allow usage of profiles like html, svg and mathMl */\n\n var USE_PROFILES = {};\n /* Tags to ignore content of when KEEP_CONTENT is true */\n\n var FORBID_CONTENTS = null;\n var DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n /* Tags that are safe for data: URIs */\n\n var DATA_URI_TAGS = null;\n var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n /* Attributes safe for values like \"javascript:\" */\n\n var URI_SAFE_ATTRIBUTES = null;\n var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n\n var NAMESPACE = HTML_NAMESPACE;\n var IS_EMPTY_INPUT = false;\n /* Allowed XHTML+XML namespaces */\n\n var ALLOWED_NAMESPACES = null;\n var DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n /* Parsing of strict XHTML documents */\n\n var PARSER_MEDIA_TYPE;\n var SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n var DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n var transformCaseFunc;\n /* Keep a reference to config to pass to hooks */\n\n var CONFIG = null;\n /* Ideally, do not touch anything below this line */\n\n /* ______________________________________________ */\n\n var formElement = document.createElement('form');\n\n var isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n\n\n var _parseConfig = function _parseConfig(cfg) {\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n /* Shield configuration object from tampering */\n\n\n if (!cfg || _typeof(cfg) !== 'object') {\n cfg = {};\n }\n /* Shield configuration object from prototype pollution */\n\n\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE; // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n /* Set configuration parameters */\n\n ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = 'ALLOWED_NAMESPACES' in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS, // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$1;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n /* Parse profile info */\n\n\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, _toConsumableArray(text));\n ALLOWED_ATTR = [];\n\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n /* Merge configuration parameters */\n\n\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n /* Add #text in case KEEP_CONTENT is set to true */\n\n\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n\n\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n\n\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n } // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n\n\n if (freeze) {\n freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']); // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n\n var COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n\n var ALL_SVG_TAGS = addToSet({}, svg$1);\n addToSet(ALL_SVG_TAGS, svgFilters);\n addToSet(ALL_SVG_TAGS, svgDisallowed);\n var ALL_MATHML_TAGS = addToSet({}, mathMl$1);\n addToSet(ALL_MATHML_TAGS, mathMlDisallowed);\n /**\n *\n *\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n\n var _checkValidNamespace = function _checkValidNamespace(element) {\n var parent = getParentNode(element); // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n\n var tagName = stringToLowerCase(element.tagName);\n var parentTagName = stringToLowerCase(parent.tagName);\n\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n } // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n\n\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n } // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n\n\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n } // The only way to switch from SVG to MathML is via\n // and HTML integration points\n\n\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n } // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n\n\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n } // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n\n\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n } // For XHTML and XML documents that support custom namespaces\n\n\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n } // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n\n\n return false;\n };\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n\n\n var _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n try {\n node.outerHTML = emptyHTML;\n } catch (_) {\n node.remove();\n }\n }\n };\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n\n\n var _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n\n node.removeAttribute(name); // We void attribute values for unremovable \"is\"\" attributes\n\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n\n\n var _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n var doc;\n var leadingWhitespace;\n\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n var matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '' + dirty + '';\n }\n\n var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n /* Use createHTMLDocument in case DOMParser is not available */\n\n\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? '' : dirtyPayload;\n } catch (_) {// Syntax error if dirtyPayload is invalid xml\n }\n }\n\n var body = doc.body || doc.documentElement;\n\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n /* Work on whole document or just its body */\n\n\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n /**\n * _createIterator\n *\n * @param {Document} root document/fragment to create iterator for\n * @return {Iterator} iterator instance\n */\n\n\n var _createIterator = function _createIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root, // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false);\n };\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n\n\n var _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n /**\n * _isNode\n *\n * @param {Node} obj object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n\n\n var _isNode = function _isNode(object) {\n return _typeof(Node) === 'object' ? object instanceof Node : object && _typeof(object) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';\n };\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n\n\n var _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n\n arrayForEach(hooks[entryPoint], function (hook) {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n\n\n var _sanitizeElements = function _sanitizeElements(currentNode) {\n var content;\n /* Execute a hook if present */\n\n _executeHook('beforeSanitizeElements', currentNode, null);\n /* Check if element is clobbered or can clobber */\n\n\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n\n return true;\n }\n /* Check if tagname contains Unicode */\n\n\n if (regExpTest(/[\\u0080-\\uFFFF]/, currentNode.nodeName)) {\n _forceRemove(currentNode);\n\n return true;\n }\n /* Now let's check the element's type and name */\n\n\n var tagName = transformCaseFunc(currentNode.nodeName);\n /* Execute a hook if present */\n\n _executeHook('uponSanitizeElement', currentNode, {\n tagName: tagName,\n allowedTags: ALLOWED_TAGS\n });\n /* Detect mXSS attempts abusing namespace confusion */\n\n\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n\n return true;\n }\n /* Mitigate a problem with templates inside select */\n\n\n if (tagName === 'select' && regExpTest(/