@bigbinary/neeto-form-frontend 4.4.8 → 4.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/app/javascript/src/translations/ar.json +10 -1
  2. package/app/javascript/src/translations/bg.json +10 -1
  3. package/app/javascript/src/translations/ca.json +10 -1
  4. package/app/javascript/src/translations/cs.json +10 -1
  5. package/app/javascript/src/translations/da.json +10 -1
  6. package/app/javascript/src/translations/de.json +10 -1
  7. package/app/javascript/src/translations/es-MX.json +10 -1
  8. package/app/javascript/src/translations/es.json +10 -1
  9. package/app/javascript/src/translations/et.json +10 -1
  10. package/app/javascript/src/translations/fi.json +10 -1
  11. package/app/javascript/src/translations/fil.json +10 -1
  12. package/app/javascript/src/translations/fr.json +10 -1
  13. package/app/javascript/src/translations/he.json +10 -1
  14. package/app/javascript/src/translations/hi.json +10 -1
  15. package/app/javascript/src/translations/hr.json +10 -1
  16. package/app/javascript/src/translations/hu.json +10 -1
  17. package/app/javascript/src/translations/id.json +10 -1
  18. package/app/javascript/src/translations/it.json +10 -1
  19. package/app/javascript/src/translations/ja.json +10 -1
  20. package/app/javascript/src/translations/ko.json +10 -1
  21. package/app/javascript/src/translations/nl.json +10 -1
  22. package/app/javascript/src/translations/pl.json +10 -1
  23. package/app/javascript/src/translations/pt-BR.json +10 -1
  24. package/app/javascript/src/translations/pt.json +10 -1
  25. package/app/javascript/src/translations/ro.json +10 -1
  26. package/app/javascript/src/translations/ru.json +10 -1
  27. package/app/javascript/src/translations/sk.json +10 -1
  28. package/app/javascript/src/translations/sl.json +10 -1
  29. package/app/javascript/src/translations/sv.json +10 -1
  30. package/app/javascript/src/translations/th.json +10 -1
  31. package/app/javascript/src/translations/tr.json +10 -1
  32. package/app/javascript/src/translations/uk.json +10 -1
  33. package/app/javascript/src/translations/vi.json +10 -1
  34. package/app/javascript/src/translations/zh-CN.json +10 -1
  35. package/app/javascript/src/translations/zh-TW.json +10 -1
  36. package/package.json +1 -1
  37. package/dist/BuildForm.js +0 -3077
  38. package/dist/BuildForm.js.map +0 -1
  39. package/dist/ExternalForm.js +0 -647
  40. package/dist/ExternalForm.js.map +0 -1
  41. package/dist/NeetoFormProvider.js +0 -11
  42. package/dist/NeetoFormProvider.js.map +0 -1
  43. package/dist/Submission.js +0 -2832
  44. package/dist/Submission.js.map +0 -1
  45. package/dist/UrlBuilder.js +0 -317
  46. package/dist/UrlBuilder.js.map +0 -1
  47. package/dist/buildForm-CrOWLvLE.js +0 -35
  48. package/dist/buildForm-CrOWLvLE.js.map +0 -1
  49. package/dist/buildForm-DfMpfuSp.js +0 -38
  50. package/dist/buildForm-DfMpfuSp.js.map +0 -1
  51. package/dist/cjs/BuildForm.js +0 -3098
  52. package/dist/cjs/BuildForm.js.map +0 -1
  53. package/dist/cjs/ExternalForm.js +0 -649
  54. package/dist/cjs/ExternalForm.js.map +0 -1
  55. package/dist/cjs/NeetoFormProvider.js +0 -13
  56. package/dist/cjs/NeetoFormProvider.js.map +0 -1
  57. package/dist/cjs/Submission.js +0 -2834
  58. package/dist/cjs/Submission.js.map +0 -1
  59. package/dist/cjs/UrlBuilder.js +0 -319
  60. package/dist/cjs/UrlBuilder.js.map +0 -1
  61. package/dist/cjs/hooks.js +0 -33
  62. package/dist/cjs/hooks.js.map +0 -1
  63. package/dist/cjs/index.js +0 -113
  64. package/dist/cjs/index.js.map +0 -1
  65. package/dist/constants-Cj0XxE8a.js +0 -494
  66. package/dist/constants-Cj0XxE8a.js.map +0 -1
  67. package/dist/constants-D5JlvWws.js +0 -513
  68. package/dist/constants-D5JlvWws.js.map +0 -1
  69. package/dist/hooks.js +0 -20
  70. package/dist/hooks.js.map +0 -1
  71. package/dist/index-Beo6ztaM.js +0 -51
  72. package/dist/index-Beo6ztaM.js.map +0 -1
  73. package/dist/index-DhtQJpD_.js +0 -43
  74. package/dist/index-DhtQJpD_.js.map +0 -1
  75. package/dist/index.js +0 -95
  76. package/dist/index.js.map +0 -1
  77. package/dist/main.css +0 -2
  78. package/dist/main.css.map +0 -1
  79. package/dist/useFormSubmission-D3O7sDHp.js +0 -24
  80. package/dist/useFormSubmission-D3O7sDHp.js.map +0 -1
  81. package/dist/useFormSubmission-PLRMfzJ3.js +0 -22
  82. package/dist/useFormSubmission-PLRMfzJ3.js.map +0 -1
  83. package/dist/utils-CI844li1.js +0 -2718
  84. package/dist/utils-CI844li1.js.map +0 -1
  85. package/dist/utils-baAzU7l8.js +0 -2749
  86. package/dist/utils-baAzU7l8.js.map +0 -1
  87. package/dist/yup-CSYHMEsr.js +0 -1014
  88. package/dist/yup-CSYHMEsr.js.map +0 -1
  89. package/dist/yup-DMlViLLB.js +0 -1097
  90. package/dist/yup-DMlViLLB.js.map +0 -1
@@ -1,1014 +0,0 @@
1
- import { t } from 'i18next';
2
- import * as React from 'react';
3
- import { memo } from 'react';
4
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
5
- import { Q as QUESTION_TYPES, C as CAPTCHA_TYPES } from './constants-Cj0XxE8a.js';
6
- import { includes, __, equals, curry, assoc, prop, dissoc, mergeAll, reduce, range, reject, filter, values, pipe, toLower, map } from 'ramda';
7
- import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
8
- import { jsx, jsxs } from 'react/jsx-runtime';
9
- import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
10
- import { dynamicArray, findBy, toLabelAndValue } from '@bigbinary/neeto-cist';
11
- import DOMPurify from 'dompurify';
12
- import { f as fieldWithFallback } from './index-DhtQJpD_.js';
13
- import Plus from '@bigbinary/neeto-icons/Plus';
14
- import * as yup from 'yup';
15
-
16
- var _excluded$1 = ["size"],
17
- _excluded2$1 = ["size"],
18
- _excluded3$1 = ["size"],
19
- _excluded4$1 = ["size"],
20
- _excluded5 = ["size"];
21
- function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
- function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23
- var Star = function Star(props) {
24
- var _props$size = props.size,
25
- size = _props$size === void 0 ? 20 : _props$size,
26
- other = _objectWithoutProperties(props, _excluded$1);
27
- return /*#__PURE__*/jsx("svg", _objectSpread$3(_objectSpread$3({
28
- fill: "none",
29
- height: size,
30
- stroke: "currentColor",
31
- strokeLinecap: "round",
32
- strokeLinejoin: "round",
33
- strokeWidth: "2",
34
- viewBox: "0 0 24 24",
35
- width: size,
36
- xmlns: "http://www.w3.org/2000/svg"
37
- }, other), {}, {
38
- children: /*#__PURE__*/jsx("path", {
39
- d: "M12 2L15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2z"
40
- })
41
- }));
42
- };
43
- var Heart = function Heart(props) {
44
- var _props$size2 = props.size,
45
- size = _props$size2 === void 0 ? 20 : _props$size2,
46
- other = _objectWithoutProperties(props, _excluded2$1);
47
- return /*#__PURE__*/jsx("svg", _objectSpread$3(_objectSpread$3({
48
- fill: "none",
49
- height: size,
50
- stroke: "currentColor",
51
- strokeLinecap: "round",
52
- strokeLinejoin: "round",
53
- strokeWidth: "2",
54
- viewBox: "0 0 24 24",
55
- width: size,
56
- xmlns: "http://www.w3.org/2000/svg"
57
- }, other), {}, {
58
- children: /*#__PURE__*/jsx("path", {
59
- d: "M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"
60
- })
61
- }));
62
- };
63
- var Zap = function Zap(props) {
64
- var _props$size3 = props.size,
65
- size = _props$size3 === void 0 ? 20 : _props$size3,
66
- other = _objectWithoutProperties(props, _excluded3$1);
67
- return /*#__PURE__*/jsx("svg", _objectSpread$3(_objectSpread$3({
68
- fill: "none",
69
- height: size,
70
- stroke: "currentColor",
71
- strokeLinecap: "round",
72
- strokeLinejoin: "round",
73
- strokeWidth: "2",
74
- viewBox: "0 0 24 24",
75
- width: size,
76
- xmlns: "http://www.w3.org/2000/svg"
77
- }, other), {}, {
78
- children: /*#__PURE__*/jsx("path", {
79
- d: "M13 2L3 14 12 14 11 22 21 10 12 10 13 2z"
80
- })
81
- }));
82
- };
83
- var Crown = function Crown(_ref) {
84
- var _ref$size = _ref.size,
85
- size = _ref$size === void 0 ? 20 : _ref$size,
86
- otherProps = _objectWithoutProperties(_ref, _excluded4$1);
87
- return /*#__PURE__*/jsx("svg", _objectSpread$3(_objectSpread$3({
88
- fill: "none",
89
- height: size,
90
- stroke: "currentColor",
91
- strokeLinecap: "round",
92
- strokeLinejoin: "round",
93
- strokeWidth: "2",
94
- viewBox: "0 0 24 24",
95
- width: size,
96
- xmlns: "http://www.w3.org/2000/svg"
97
- }, otherProps), {}, {
98
- children: /*#__PURE__*/jsx("path", {
99
- d: "M22.3186 17.8652C22.3186 18.8915 21.4789 19.7311 20.4527 19.7311L20.4714 19.733H5.54466C4.49979 19.733 3.67882 18.912 3.67882 17.8858V8.61254H3.66016C3.66016 8.0901 4.07064 7.67962 4.59308 7.67962C4.761 7.67962 4.94759 7.71693 5.09686 7.82888L9.23902 10.5903L12.1871 6.14963V6.13097C12.4669 5.70182 13.0453 5.57122 13.4745 5.86975C13.5678 5.92573 13.6611 6.01902 13.717 6.11231L16.6651 10.5344L20.8072 7.75425C21.2177 7.45572 21.8129 7.56767 22.0928 7.99681C22.1861 8.14608 22.2421 8.314 22.2421 8.50059V17.7552",
100
- stroke: "currentColor",
101
- strokeLinecap: "round",
102
- strokeLinejoin: "round",
103
- strokeWidth: "1.5"
104
- })
105
- }));
106
- };
107
- var Trophy = function Trophy(_ref2) {
108
- var _ref2$size = _ref2.size,
109
- size = _ref2$size === void 0 ? 20 : _ref2$size,
110
- otherProps = _objectWithoutProperties(_ref2, _excluded5);
111
- return /*#__PURE__*/jsxs("svg", _objectSpread$3(_objectSpread$3({
112
- fill: "none",
113
- height: size,
114
- stroke: "currentColor",
115
- strokeLinecap: "round",
116
- strokeLinejoin: "round",
117
- strokeWidth: "2",
118
- viewBox: "0 0 24 24",
119
- width: size,
120
- xmlns: "http://www.w3.org/2000/svg"
121
- }, otherProps), {}, {
122
- children: [/*#__PURE__*/jsx("path", {
123
- d: "M17.6873 8.05176H20.0311V8.05176C20.894 8.05176 21.5936 8.75131 21.5936 9.61426V11.1768C21.5936 12.9026 20.1944 14.3018 18.4686 14.3018H17.5889",
124
- stroke: "currentColor",
125
- strokeLinecap: "round",
126
- strokeLinejoin: "round",
127
- strokeWidth: "1.5"
128
- }), /*#__PURE__*/jsx("path", {
129
- d: "M13 16.6455V21.333",
130
- stroke: "currentColor",
131
- strokeLinecap: "round",
132
- strokeLinejoin: "round",
133
- strokeWidth: "1.5"
134
- }), /*#__PURE__*/jsx("path", {
135
- d: "M16.125 21.333H9.875",
136
- stroke: "currentColor",
137
- strokeLinecap: "round",
138
- strokeLinejoin: "round",
139
- strokeWidth: "1.5"
140
- }), /*#__PURE__*/jsx("path", {
141
- d: "M9.875 5.70801H16.125V5.70801C16.9879 5.70801 17.6875 6.40756 17.6875 7.27051V13.5205C17.6875 15.2464 16.2884 16.6455 14.5625 16.6455H11.4375V16.6455C9.71161 16.6455 8.3125 15.2464 8.3125 13.5205V7.27051V7.27051C8.3125 6.40756 9.01205 5.70801 9.875 5.70801V5.70801Z",
142
- stroke: "currentColor",
143
- strokeLinecap: "round",
144
- strokeLinejoin: "round",
145
- strokeWidth: "1.5"
146
- }), /*#__PURE__*/jsx("path", {
147
- d: "M8.3125 8.05176H5.96875V8.05176C5.1058 8.05176 4.40625 8.75131 4.40625 9.61426V11.1768V11.1768C4.40625 12.9026 5.80536 14.3018 7.53125 14.3018H8.41094",
148
- stroke: "currentColor",
149
- strokeLinecap: "round",
150
- strokeLinejoin: "round",
151
- strokeWidth: "1.5"
152
- })]
153
- }));
154
- };
155
- var MemoizedStar = /*#__PURE__*/memo(Star);
156
- var MemoizedHeart = /*#__PURE__*/memo(Heart);
157
- var MemoizedZap = /*#__PURE__*/memo(Zap);
158
- var MemoizedCrown = /*#__PURE__*/memo(Crown);
159
- var MemoizedTrophy = /*#__PURE__*/memo(Trophy);
160
-
161
- var _path$2, _path2$2;
162
- function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
163
- const SvgConfusedFace = props => /*#__PURE__*/React.createElement("svg", _extends$2({
164
- xmlns: "http://www.w3.org/2000/svg",
165
- width: 32,
166
- height: 32,
167
- fill: "none"
168
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
169
- stroke: "#68737D",
170
- strokeLinecap: "round",
171
- strokeLinejoin: "round",
172
- strokeWidth: 2,
173
- d: "M16 4C9.383 4 4 9.383 4 16s5.383 12 12 12 12-5.384 12-12S22.616 4 16 4Z"
174
- })), _path2$2 || (_path2$2 = /*#__PURE__*/React.createElement("path", {
175
- stroke: "#68737D",
176
- strokeLinecap: "round",
177
- strokeLinejoin: "round",
178
- strokeWidth: 2,
179
- d: "M20.668 20.918S18.916 22.667 16 22.667c-2.918 0-4.667-1.75-4.667-1.75m9.104-8.25a.333.333 0 1 0 .003.666.333.333 0 0 0-.003-.666Zm-8.918 0a.333.333 0 1 0 .003.666.333.333 0 0 0-.004-.666Z"
180
- })));
181
-
182
- var _path$1, _path2$1, _path3;
183
- function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
184
- const SvgHappyFace = props => /*#__PURE__*/React.createElement("svg", _extends$1({
185
- xmlns: "http://www.w3.org/2000/svg",
186
- width: 32,
187
- height: 32,
188
- fill: "none"
189
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
190
- stroke: "#68737D",
191
- strokeLinecap: "round",
192
- strokeLinejoin: "round",
193
- strokeWidth: 2,
194
- d: "M9.332 13.334c.527-.647 1.247-1.014 2-1.014.753 0 1.453.367 2 1.014m5.333 0c.527-.647 1.247-1.014 2-1.014.754 0 1.454.367 2 1.014"
195
- })), _path2$1 || (_path2$1 = /*#__PURE__*/React.createElement("path", {
196
- stroke: "#68737D",
197
- strokeLinecap: "round",
198
- strokeLinejoin: "round",
199
- strokeWidth: 2,
200
- d: "M24.485 7.515c4.687 4.686 4.687 12.284 0 16.97-4.686 4.687-12.284 4.687-16.97 0-4.687-4.686-4.687-12.284 0-16.97 4.686-4.687 12.284-4.687 16.97 0"
201
- })), _path3 || (_path3 = /*#__PURE__*/React.createElement("path", {
202
- stroke: "#68737D",
203
- strokeLinecap: "round",
204
- strokeLinejoin: "round",
205
- strokeWidth: 2,
206
- d: "M20.665 19.584s-1.75 1.75-4.666 1.75c-2.918 0-4.667-1.75-4.667-1.75"
207
- })));
208
-
209
- var _path, _path2;
210
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
211
- const SvgSadFace = props => /*#__PURE__*/React.createElement("svg", _extends({
212
- xmlns: "http://www.w3.org/2000/svg",
213
- width: 32,
214
- height: 32,
215
- fill: "none"
216
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
217
- stroke: "#68737D",
218
- strokeLinecap: "round",
219
- strokeLinejoin: "round",
220
- strokeWidth: 2,
221
- d: "M20.667 12v1.333m3.818-5.818c4.687 4.686 4.687 12.284 0 16.97-4.686 4.687-12.284 4.687-16.97 0-4.687-4.686-4.687-12.284 0-16.97 4.686-4.687 12.284-4.687 16.97 0v0ZM11.333 12v1.333V12Z"
222
- })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
223
- stroke: "#68737D",
224
- strokeLinecap: "round",
225
- strokeLinejoin: "round",
226
- strokeWidth: 2,
227
- d: "M11.332 21.333s1.75-1.749 4.667-1.749 4.666 1.75 4.666 1.75"
228
- })));
229
-
230
- var QUESTION_KIND = {
231
- TEXT: {
232
- value: "text"
233
- },
234
- NAME: {
235
- value: "name"
236
- },
237
- EMAIL: {
238
- type: "email",
239
- value: "email"
240
- },
241
- PHONE: {
242
- value: "phone"
243
- },
244
- CHECKBOX: {
245
- value: "checkbox"
246
- },
247
- RADIO: {
248
- value: "radio"
249
- },
250
- DROPDOWN: {
251
- value: "dropdown"
252
- },
253
- PARAGRAPH: {
254
- value: "paragraph"
255
- },
256
- TEXTAREA: {
257
- value: "textarea"
258
- },
259
- QUESTION: {
260
- value: "question"
261
- },
262
- RATING: {
263
- value: "rating"
264
- },
265
- STAR_RATING: {
266
- value: "star_rating"
267
- },
268
- OPINION_SCALE: {
269
- value: "opinion_scale"
270
- },
271
- TERMS: {
272
- value: "termsandcondition",
273
- type: "checkbox"
274
- },
275
- CONDITION: {
276
- value: "condition",
277
- type: "checkbox"
278
- },
279
- DATE: {
280
- value: "date"
281
- },
282
- ADDITIONAL_GUESTS: {
283
- value: "additional_guests"
284
- },
285
- RICH_TEXT: {
286
- value: "rich_text"
287
- },
288
- INTEGER: {
289
- type: "number",
290
- value: "integer",
291
- onKeyDown: function onKeyDown(e) {
292
- if (e.key === "." || e.key === "e") e.preventDefault();
293
- }
294
- },
295
- DECIMAL: {
296
- type: "number",
297
- value: "decimal",
298
- onKeyDown: function onKeyDown(e) {
299
- if (e.key === "e") e.preventDefault();
300
- }
301
- },
302
- FILE_UPLOAD: {
303
- value: "file_upload"
304
- },
305
- CAPTCHA: {
306
- value: "captcha"
307
- },
308
- SMS_REMINDER: {
309
- value: "sms_reminder"
310
- },
311
- SPOT: {
312
- type: "number",
313
- value: "spot",
314
- onKeyDown: function onKeyDown(e) {
315
- if (e.key === "." || e.key === "e") e.preventDefault();
316
- }
317
- },
318
- ADDRESS: {
319
- value: "address"
320
- }
321
- };
322
- var RATING_VALUES = {
323
- GOOD: {
324
- label: t("neetoForm.common.good"),
325
- value: "good"
326
- },
327
- AVERAGE: {
328
- label: t("neetoForm.common.okay"),
329
- value: "okay"
330
- },
331
- BAD: {
332
- label: t("neetoForm.common.bad"),
333
- value: "bad"
334
- }
335
- };
336
- var SCHEMA_LESS_QUESTION_KINDS = [QUESTION_KIND.PARAGRAPH.value];
337
- var SPOT_QUESTION_DEFAULT_VALUE = 1;
338
- var RATING_OPTIONS$1 = [{
339
- icon: SvgHappyFace,
340
- modifier: "happy",
341
- value: RATING_VALUES.GOOD.value
342
- }, {
343
- icon: SvgConfusedFace,
344
- modifier: "confused",
345
- value: RATING_VALUES.AVERAGE.value
346
- }, {
347
- icon: SvgSadFace,
348
- modifier: "sad",
349
- value: RATING_VALUES.BAD.value
350
- }];
351
- var ICONS_MAP = {
352
- star: MemoizedStar,
353
- heart: MemoizedHeart,
354
- crown: MemoizedCrown,
355
- trophy: MemoizedTrophy,
356
- zap: MemoizedZap
357
- };
358
- var EMAIL_REGEX = new RegExp("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$", "i");
359
- var SIX_DIGIT_NUMBER_REGEX = /^\d{6}$/;
360
- var PARENTHESES_REGEX = /[()]/g;
361
- var LAST_ELEMENTS_THRESHOLD = 2;
362
- var RADIO_DESELECT_KEYS = [" ", "Enter", "Spacebar"];
363
-
364
- var PARAGRAPH$1 = QUESTION_TYPES.PARAGRAPH,
365
- TERMS_AND_CONDITION$1 = QUESTION_TYPES.TERMS_AND_CONDITION,
366
- CONDITION$1 = QUESTION_TYPES.CONDITION,
367
- CHECKBOX$1 = QUESTION_TYPES.CHECKBOX,
368
- RADIO$1 = QUESTION_TYPES.RADIO,
369
- DROPDOWN$1 = QUESTION_TYPES.DROPDOWN,
370
- FILE_UPLOAD$1 = QUESTION_TYPES.FILE_UPLOAD,
371
- CAPTCHA$1 = QUESTION_TYPES.CAPTCHA,
372
- SMS_REMINDER$1 = QUESTION_TYPES.SMS_REMINDER,
373
- SPOT$1 = QUESTION_TYPES.SPOT,
374
- RATING$1 = QUESTION_TYPES.RATING,
375
- STAR_RATING$1 = QUESTION_TYPES.STAR_RATING,
376
- OPINION_SCALE$1 = QUESTION_TYPES.OPINION_SCALE;
377
- var DEFAULT_AVAILABLE_LANGUAGES = [{
378
- code: "en",
379
- name: "English"
380
- }];
381
- var DEFAULT_LANGUAGE_CODE = "en";
382
- var MANDATORY_KINDS = [CAPTCHA$1];
383
- var IMMUTABLE_KINDS = [];
384
- var AUTO_GENERATED_KINDS = [SMS_REMINDER$1, SPOT$1];
385
- var QUESTIONS_WITHOUT_FIELD_CODE = [PARAGRAPH$1, TERMS_AND_CONDITION$1, CONDITION$1, FILE_UPLOAD$1, CAPTCHA$1];
386
- var NON_HIDEABLE_FIELDS = [].concat(QUESTIONS_WITHOUT_FIELD_CODE, [SMS_REMINDER$1, SPOT$1]);
387
- var NON_READ_ONLY_FIELDS = [].concat(QUESTIONS_WITHOUT_FIELD_CODE, [SMS_REMINDER$1, SPOT$1, RATING$1, STAR_RATING$1, OPINION_SCALE$1]);
388
- var QUESTIONS_INITIAL_VALUE = {
389
- enabled: false,
390
- questions: [{
391
- label: "",
392
- kind: "text",
393
- nodeId: "1"
394
- }, {
395
- label: "",
396
- kind: "email",
397
- nodeId: "2"
398
- }],
399
- title: "",
400
- isQuestionsLoading: true
401
- };
402
- var RESERVED_FIELD_CODES = ["month", "date", "time", "lang"];
403
- var SPOT_QUESTION_FIELD_CODE = "number_of_group_booking_spots";
404
- var SELECTABLE_KINDS = [RADIO$1, CHECKBOX$1, DROPDOWN$1];
405
- var RICH_TEXT_QUESTIONS = [PARAGRAPH$1, TERMS_AND_CONDITION$1];
406
- var QUESTION_ACTIONS = {
407
- ADD: "add",
408
- EDIT: "edit",
409
- DELETE: "delete",
410
- REORDER: "reorder",
411
- CLONE: "clone"
412
- };
413
- var MINIMUM_OPTIONS = 1;
414
-
415
- // eslint-disable-next-line no-control-regex
416
- var NON_BASIC_LATIN_CHARACTERS_REGEX = /[^\u0000-\u007f]/;
417
- var DEFAULT_ADVANCED_FEATURES = {
418
- fieldCode: false,
419
- markResponsesAsReadOnly: false,
420
- restrictResponseVisibilityToHost: false
421
- };
422
- var MINIMUM_ADDRESS_FIELDS = 2;
423
-
424
- var _excluded = ["size", "color"],
425
- _excluded2 = ["size", "color"],
426
- _excluded3 = ["size", "color"],
427
- _excluded4 = ["size", "color"];
428
- function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
429
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
430
- var BadSmiley = function BadSmiley(props) {
431
- var size = props.size,
432
- color = props.color,
433
- other = _objectWithoutProperties(props, _excluded);
434
- return /*#__PURE__*/jsxs("svg", _objectSpread$2(_objectSpread$2({
435
- fill: "none",
436
- height: size,
437
- viewBox: "0 0 48 48",
438
- width: size
439
- }, other), {}, {
440
- children: [/*#__PURE__*/jsx("path", {
441
- d: "M24 0C10.767 0 0 10.767 0 24s10.767 24 24 24c13.234 0 24-10.767 24-24S37.234 0 24 0zm0 45.913c-12.084 0-21.913-9.83-21.913-21.913 0-12.084 9.83-21.913 21.913-21.913 12.082 0 21.913 9.83 21.913 21.913 0 12.084-9.83 21.913-21.913 21.913z",
442
- fill: color
443
- }), /*#__PURE__*/jsx("path", {
444
- d: "M18.783 19.826a3.134 3.134 0 00-3.13-3.13 3.134 3.134 0 00-3.131 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13zm-4.174 0c0-.575.468-1.044 1.043-1.044s1.044.469 1.044 1.044c0 .575-.469 1.043-1.044 1.043a1.045 1.045 0 01-1.043-1.043zm17.739-3.13a3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13zm0 4.173a1.045 1.045 0 010-2.087 1.045 1.045 0 010 2.087zM24 29.218a13.677 13.677 0 00-10.168 4.52 1.043 1.043 0 101.553 1.394A11.587 11.587 0 0124 31.305c3.3 0 6.44 1.394 8.614 3.826a1.045 1.045 0 001.473.082 1.044 1.044 0 00.082-1.473c-2.57-2.874-6.277-4.523-10.169-4.523z",
445
- fill: color
446
- })]
447
- }));
448
- };
449
- BadSmiley.defaultProps = {
450
- color: "currentColor",
451
- size: 24,
452
- strokeWidth: "1.5"
453
- };
454
- var OkaySmiley = function OkaySmiley(props) {
455
- var size = props.size,
456
- color = props.color,
457
- other = _objectWithoutProperties(props, _excluded2);
458
- return /*#__PURE__*/jsxs("svg", _objectSpread$2(_objectSpread$2({
459
- fill: "none",
460
- height: size,
461
- viewBox: "0 0 48 48",
462
- width: size
463
- }, other), {}, {
464
- children: [/*#__PURE__*/jsx("path", {
465
- d: "M24 0C10.767 0 0 10.767 0 24s10.767 24 24 24 24-10.767 24-24S37.233 0 24 0zm0 45.913c-12.084 0-21.913-9.83-21.913-21.913 0-12.084 9.83-21.913 21.913-21.913 12.084 0 21.913 9.83 21.913 21.913 0 12.084-9.83 21.913-21.913 21.913z",
466
- fill: color
467
- }), /*#__PURE__*/jsx("path", {
468
- d: "M15.652 22.956a3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13 3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13zm0-4.174c.575 0 1.044.469 1.044 1.044 0 .575-.469 1.043-1.044 1.043a1.045 1.045 0 01-1.043-1.043c0-.575.468-1.044 1.043-1.044zm16.696-2.086a3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13zm0 4.173a1.045 1.045 0 01-1.044-1.043c0-.575.469-1.044 1.044-1.044a1.044 1.044 0 010 2.087zm2.087 8.349h-20.87a1.044 1.044 0 000 2.086h20.87a1.044 1.044 0 000-2.086z",
469
- fill: color
470
- })]
471
- }));
472
- };
473
- OkaySmiley.defaultProps = {
474
- color: "currentColor",
475
- size: 24,
476
- strokeWidth: "1.5"
477
- };
478
- var GoodSmiley = function GoodSmiley(props) {
479
- var size = props.size,
480
- color = props.color,
481
- other = _objectWithoutProperties(props, _excluded3);
482
- return /*#__PURE__*/jsxs("svg", _objectSpread$2(_objectSpread$2({
483
- fill: "none",
484
- height: size,
485
- viewBox: "0 0 48 48",
486
- width: size
487
- }, other), {}, {
488
- children: [/*#__PURE__*/jsx("path", {
489
- d: "M24 0C10.767 0 0 10.767 0 24s10.767 24 24 24 24-10.767 24-24S37.233 0 24 0zm0 45.913c-12.084 0-21.913-9.83-21.913-21.913 0-12.084 9.83-21.913 21.913-21.913 12.084 0 21.913 9.83 21.913 21.913 0 12.084-9.83 21.913-21.913 21.913z",
490
- fill: color
491
- }), /*#__PURE__*/jsx("path", {
492
- d: "M18.783 19.826a3.134 3.134 0 00-3.13-3.13 3.134 3.134 0 00-3.131 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13zm-4.174 0a1.044 1.044 0 012.087 0c0 .575-.469 1.044-1.044 1.044a1.045 1.045 0 01-1.043-1.044zm17.739-3.13a3.134 3.134 0 00-3.13 3.13 3.134 3.134 0 003.13 3.13 3.134 3.134 0 003.13-3.13 3.134 3.134 0 00-3.13-3.13zm0 4.174a1.045 1.045 0 01-1.044-1.044 1.044 1.044 0 111.044 1.044zm.265 8.695c-2.175 2.432-5.314 3.826-8.613 3.826a11.59 11.59 0 01-8.615-3.827 1.043 1.043 0 10-1.553 1.394A13.677 13.677 0 0024 35.478c3.892 0 7.599-1.648 10.17-4.521a1.043 1.043 0 10-1.557-1.392z",
493
- fill: color
494
- })]
495
- }));
496
- };
497
- GoodSmiley.defaultProps = {
498
- color: "currentColor",
499
- size: 24,
500
- strokeWidth: "1.5"
501
- };
502
- var Drag = function Drag(props) {
503
- var size = props.size,
504
- color = props.color,
505
- other = _objectWithoutProperties(props, _excluded4);
506
- return /*#__PURE__*/jsxs("svg", _objectSpread$2(_objectSpread$2({
507
- fill: "none",
508
- height: size,
509
- viewBox: "0 0 24 24",
510
- width: size
511
- }, other), {}, {
512
- children: [/*#__PURE__*/jsx("g", {
513
- clipPath: "url(#clip0_6290_43)",
514
- fill: color,
515
- stroke: color,
516
- strokeLinecap: "round",
517
- strokeLinejoin: "round",
518
- strokeWidth: "1.5",
519
- children: /*#__PURE__*/jsx("path", {
520
- d: "M8 12a1 1 0 102 0 1 1 0 00-2 0zM8 18a1 1 0 102 0 1 1 0 00-2 0zM8 6a1 1 0 102 0 1 1 0 00-2 0zM14 12a1 1 0 102 0 1 1 0 00-2 0zM14 18a1 1 0 102 0 1 1 0 00-2 0zM14 6a1 1 0 102 0 1 1 0 00-2 0z"
521
- })
522
- }), /*#__PURE__*/jsx("defs", {
523
- children: /*#__PURE__*/jsx("clipPath", {
524
- id: "clip0_6290_43",
525
- children: /*#__PURE__*/jsx("path", {
526
- d: "M0 0H24V24H0z",
527
- fill: color
528
- })
529
- })
530
- })]
531
- }));
532
- };
533
- Drag.defaultProps = {
534
- color: "currentColor",
535
- size: 24,
536
- strokeWidth: "1.5"
537
- };
538
-
539
- var CALLOUT_STYLES = {
540
- ERROR: "error",
541
- INFO: "info"
542
- };
543
- var CALLOUT_POSITIONS = {
544
- ABSOLUTE: "absolute",
545
- STATIC: "static"
546
- };
547
- var LABEL_FIELDS = {
548
- DEFAULT: "label",
549
- FULL_NAME: "fullNameLabel",
550
- FIRST_NAME: "firstNameLabel",
551
- LAST_NAME: "lastNameLabel"
552
- };
553
-
554
- function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
555
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
556
- var randomId = function randomId() {
557
- return Math.random().toString(36).substring(2, 13);
558
- };
559
- var validateEditorContent = function validateEditorContent(editorRef) {
560
- return function () {
561
- var _editorRef$current;
562
- return (_editorRef$current = editorRef.current) !== null && _editorRef$current !== void 0 && (_editorRef$current = _editorRef$current.editor) !== null && _editorRef$current !== void 0 && _editorRef$current.isEmpty ? t("neetoForm.common.thisFieldIsRequired") : "";
563
- };
564
- };
565
- var buildReorderPayload = function buildReorderPayload(questions) {
566
- return reduce(function (acc, _ref) {
567
- var id = _ref.id,
568
- displayOrder = _ref.displayOrder;
569
- return assoc(id, displayOrder, acc);
570
- }, {}, questions);
571
- };
572
- var isRichTextQuestion = includes(__, RICH_TEXT_QUESTIONS);
573
- var isAutoGeneratedQuestion = includes(__, AUTO_GENERATED_KINDS);
574
- var isImmutableField = function isImmutableField(_ref2) {
575
- var kind = _ref2.kind;
576
- return includes(kind, IMMUTABLE_KINDS);
577
- };
578
- var isMandatoryField = function isMandatoryField(_ref3) {
579
- var kind = _ref3.kind;
580
- return includes(kind, MANDATORY_KINDS);
581
- };
582
- var buildAddQuestionButtonProps = function buildAddQuestionButtonProps(onAdd, isDisabled, tooltipProps) {
583
- return _objectSpread$1({
584
- "data-testid": "neeto-form-engine-add-question-button",
585
- disabled: isDisabled,
586
- label: t("neetoForm.questions.common.primaryPanel.addQuestion"),
587
- icon: Plus,
588
- iconPosition: "left",
589
- style: "link",
590
- onClick: onAdd
591
- }, isDisabled && {
592
- tooltipProps: tooltipProps
593
- });
594
- };
595
- var buildDisabledAddButtonHelpPopoverProps = function buildDisabledAddButtonHelpPopoverProps() {
596
- var disabledAddButtonHelpPopoverProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
597
- return _objectSpread$1({
598
- description: t("neetoForm.questions.common.primaryPanel.noQuestionLeft")
599
- }, disabledAddButtonHelpPopoverProps);
600
- };
601
- var generateDefaultOptions = function generateDefaultOptions(count) {
602
- return dynamicArray(count, function (index) {
603
- return {
604
- id: "draft-".concat(randomId()),
605
- label: t("neetoForm.questions.common.questionFields.field.numberedOption", {
606
- number: index + 1
607
- }),
608
- position: index
609
- };
610
- });
611
- };
612
- var isDefaultLanguage = equals(__, DEFAULT_LANGUAGE_CODE);
613
- var generateDefaultAddressFields = function generateDefaultAddressFields() {
614
- return DEFAULT_ADDRESS_FIELDS.map(function (field, index) {
615
- return mergeAll([ADDRESS_FIELD_DEFAULT_VALUES, field, {
616
- id: "draft-".concat(randomId()),
617
- altId: "alt-".concat(randomId()),
618
- position: index
619
- }]);
620
- });
621
- };
622
- var renameKey = curry(function (oldKey, newKey, obj) {
623
- return assoc(newKey, prop(oldKey, obj), dissoc(oldKey, obj));
624
- });
625
-
626
- var getActiveQuestionKindDetails = function getActiveQuestionKindDetails(_ref) {
627
- var allQuestionKinds = _ref.allQuestionKinds,
628
- item = _ref.item;
629
- var kind = item.kind,
630
- label = item.label;
631
- var _findBy = findBy({
632
- type: kind
633
- }, allQuestionKinds),
634
- isSingular = _findBy.isSingular;
635
- return {
636
- kind: kind,
637
- label: label,
638
- isSingular: isSingular
639
- };
640
- };
641
- var generateArray = function generateArray(start, end) {
642
- return range(start, end + 1);
643
- };
644
- var isElementOverflowing = function isElementOverflowing(_ref2) {
645
- var clientWidth = _ref2.clientWidth,
646
- clientHeight = _ref2.clientHeight,
647
- scrollWidth = _ref2.scrollWidth,
648
- scrollHeight = _ref2.scrollHeight;
649
- return scrollHeight > clientHeight || scrollWidth > clientWidth;
650
- };
651
- var htmlToPlainText = function htmlToPlainText(htmlContent) {
652
- var formattedContent = htmlContent.replaceAll(EMPTY_PARAGRAPH_REGEX, "\n");
653
- var node = document.createElement("div");
654
- node.innerHTML = DOMPurify.sanitize(formattedContent);
655
- return node.textContent || node.innerText || "";
656
- };
657
- var buildDisplayLabel = function buildDisplayLabel(question) {
658
- var label = fieldWithFallback(question, LABEL_FIELDS.DEFAULT);
659
- var kind = question.kind;
660
- if (isRichTextQuestion(kind)) return htmlToPlainText(label);
661
- if (kind !== QUESTION_TYPES.NAME) return label;
662
- if (!question.isSplitMode) {
663
- return fieldWithFallback(question, LABEL_FIELDS.FULL_NAME);
664
- }
665
- var firstNameLabel = fieldWithFallback(question, LABEL_FIELDS.FIRST_NAME);
666
- var lastNameLabel = fieldWithFallback(question, LABEL_FIELDS.LAST_NAME);
667
- return "".concat(firstNameLabel, ", ").concat(lastNameLabel);
668
- };
669
-
670
- var generateRangeOptions = function generateRangeOptions(range) {
671
- return generateArray.apply(void 0, _toConsumableArray(range)).map(toLabelAndValue);
672
- };
673
- var getActiveRecords = reject(prop("deleted"));
674
- var getDeletedRecords = filter(prop("deleted"));
675
-
676
- var FILE_TYPES = {
677
- DOCUMENTS: "documents",
678
- IMAGES: "images",
679
- AUDIO_VIDEO: "audio/video"
680
- };
681
- var STAR_RATING_ICONS_MAP = {
682
- star: MemoizedStar,
683
- heart: MemoizedHeart,
684
- crown: MemoizedCrown,
685
- trophy: MemoizedTrophy,
686
- zap: MemoizedZap
687
- };
688
- var STAR_RATING_MAX_VALUE_OPTIONS = generateRangeOptions([3, 10]);
689
- var STAR_RATING_MIN_VALUE_OPTIONS = generateRangeOptions([0, 1]);
690
- var OPINION_SCALE_MAX_VALUE_OPTIONS = generateRangeOptions([3, 10]);
691
- var OPINION_SCALE_MIN_VALUE_OPTIONS = generateRangeOptions([0, 1]);
692
- var OPINION_LABEL_MAX_LENGTH = 30;
693
- var OPINION_SCALE_DEFAULT_VALUES = {
694
- leftOpinionLabel: t("neetoForm.questions.opinionScale.worst"),
695
- rightOpinionLabel: t("neetoForm.questions.opinionScale.best"),
696
- minValue: 1,
697
- maxValue: 10,
698
- hasOpinionLabels: true
699
- };
700
- var FILE_TYPES_MAP = _defineProperty(_defineProperty(_defineProperty({}, FILE_TYPES.DOCUMENTS, ["pdf", "doc", "docx", "xls", "xlsx", "csv", "txt", "rtf", "html", "zip", "md"]), FILE_TYPES.IMAGES, ["jpg", "jpeg", "png", "gif"]), FILE_TYPES.AUDIO_VIDEO, ["mp3", "wma", "mpg", "flv", "avi", "mp4", "webm"]);
701
- var DEFAULT_ALLOWED_FILE_TYPES = values(FILE_TYPES_MAP).flat().join(", ");
702
- var IMAGE_HEIGHT_SLIDER_DEFAULTS = {
703
- max: 200,
704
- min: 50
705
- };
706
- var FILE_GROUPS = [{
707
- label: t("neetoForm.fileTypes.documents"),
708
- name: FILE_TYPES.DOCUMENTS
709
- }, {
710
- label: t("neetoForm.fileTypes.images"),
711
- name: FILE_TYPES.IMAGES
712
- }, {
713
- label: t("neetoForm.fileTypes.audioVideo"),
714
- name: FILE_TYPES.AUDIO_VIDEO
715
- }];
716
- var RATING_OPTIONS = [{
717
- icon: GoodSmiley,
718
- name: "highestRatingLabel",
719
- color: "#00ba88"
720
- }, {
721
- icon: OkaySmiley,
722
- name: "averageRatingLabel",
723
- color: "#f3cd82"
724
- }, {
725
- icon: BadSmiley,
726
- name: "lowestRatingLabel",
727
- color: "#f56a58"
728
- }];
729
- var ADDRESS_FIELD_WIDTHS = {
730
- FULL: "full",
731
- HALF: "half",
732
- ONE_FOURTH: "one_fourth",
733
- THREE_FOURTH: "three_fourth"
734
- };
735
- var ADDRESS_FIELD_TYPES = {
736
- INPUT: "text_input",
737
- SELECT: "select_input"
738
- };
739
- var ADDRESS_FIELD_DEFAULT_VALUES = {
740
- isRequired: true,
741
- width: ADDRESS_FIELD_WIDTHS.FULL,
742
- fieldType: ADDRESS_FIELD_TYPES.INPUT,
743
- placeholder: t("neetoForm.questions.address.fieldLabelPlaceholder")
744
- };
745
- var DEFAULT_ADDRESS_FIELDS = [{
746
- label: t("neetoForm.questions.address.defaultFields.streetAddress")
747
- }, {
748
- label: t("neetoForm.questions.address.defaultFields.streetAddressLine2"),
749
- isRequired: false
750
- }, {
751
- label: t("neetoForm.questions.address.defaultFields.city"),
752
- width: ADDRESS_FIELD_WIDTHS.ONE_FOURTH
753
- }, {
754
- label: t("neetoForm.questions.address.defaultFields.stateProvince"),
755
- width: ADDRESS_FIELD_WIDTHS.THREE_FOURTH
756
- }, {
757
- label: t("neetoForm.questions.address.defaultFields.postalZipCode")
758
- }];
759
-
760
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
761
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
762
- var NAME = QUESTION_TYPES.NAME,
763
- PHONE = QUESTION_TYPES.PHONE,
764
- EMAIL = QUESTION_TYPES.EMAIL,
765
- ADDITIONAL_GUESTS = QUESTION_TYPES.ADDITIONAL_GUESTS,
766
- TEXT = QUESTION_TYPES.TEXT,
767
- TEXTAREA = QUESTION_TYPES.TEXTAREA,
768
- RICH_TEXT = QUESTION_TYPES.RICH_TEXT,
769
- INTEGER = QUESTION_TYPES.INTEGER,
770
- DECIMAL = QUESTION_TYPES.DECIMAL,
771
- PARAGRAPH = QUESTION_TYPES.PARAGRAPH,
772
- TERMS_AND_CONDITION = QUESTION_TYPES.TERMS_AND_CONDITION,
773
- CONDITION = QUESTION_TYPES.CONDITION,
774
- CHECKBOX = QUESTION_TYPES.CHECKBOX,
775
- RADIO = QUESTION_TYPES.RADIO,
776
- DROPDOWN = QUESTION_TYPES.DROPDOWN,
777
- STAR_RATING = QUESTION_TYPES.STAR_RATING,
778
- OPINION_SCALE = QUESTION_TYPES.OPINION_SCALE,
779
- RATING = QUESTION_TYPES.RATING,
780
- DATE = QUESTION_TYPES.DATE,
781
- FILE_UPLOAD = QUESTION_TYPES.FILE_UPLOAD,
782
- CAPTCHA = QUESTION_TYPES.CAPTCHA,
783
- SMS_REMINDER = QUESTION_TYPES.SMS_REMINDER,
784
- SPOT = QUESTION_TYPES.SPOT,
785
- ADDRESS = QUESTION_TYPES.ADDRESS;
786
- var DEFAULT_CHOICE_QUESTION_ATTRIBUTES = {
787
- label: "",
788
- isRequired: false,
789
- isPictureChoice: false,
790
- imageHeight: 150,
791
- shouldFitImages: false,
792
- optionsAttributes: generateDefaultOptions(MINIMUM_OPTIONS)
793
- };
794
- var QUESTION_KINDS = [{
795
- type: EMAIL,
796
- label: t("neetoForm.fields.eif"),
797
- isSingular: true,
798
- defaults: {
799
- label: ""
800
- }
801
- }, {
802
- type: ADDITIONAL_GUESTS,
803
- label: t("neetoForm.fields.agif"),
804
- isSingular: true,
805
- defaults: {
806
- label: t("neetoForm.common.addAdditionalGuests")
807
- }
808
- }, {
809
- type: PHONE,
810
- label: t("neetoForm.fields.pif"),
811
- isSingular: true,
812
- defaults: {
813
- label: ""
814
- }
815
- }, {
816
- type: NAME,
817
- label: t("neetoForm.fields.nif"),
818
- isSingular: true,
819
- defaults: {
820
- label: ""
821
- }
822
- }, {
823
- type: ADDRESS,
824
- label: t("neetoForm.fields.address"),
825
- isSingular: false,
826
- defaults: {
827
- label: "",
828
- isRequired: true,
829
- fields: generateDefaultAddressFields()
830
- }
831
- }, {
832
- type: TEXT,
833
- label: t("neetoForm.fields.tif"),
834
- isSingular: false,
835
- defaults: {
836
- label: ""
837
- }
838
- }, {
839
- type: TEXTAREA,
840
- label: t("neetoForm.fields.qif"),
841
- isSingular: false,
842
- defaults: {
843
- label: ""
844
- }
845
- }, {
846
- type: INTEGER,
847
- label: t("neetoForm.fields.iif"),
848
- isSingular: false,
849
- defaults: {
850
- label: ""
851
- }
852
- }, {
853
- type: DECIMAL,
854
- label: t("neetoForm.fields.dif"),
855
- isSingular: false,
856
- defaults: {
857
- label: ""
858
- }
859
- }, {
860
- type: RICH_TEXT,
861
- label: t("neetoForm.fields.rtf"),
862
- isSingular: false,
863
- defaults: {
864
- label: ""
865
- }
866
- }, {
867
- type: PARAGRAPH,
868
- label: t("neetoForm.fields.def"),
869
- isSingular: false,
870
- defaults: {
871
- label: ""
872
- }
873
- }, {
874
- type: CHECKBOX,
875
- label: t("neetoForm.fields.mcf"),
876
- isSingular: false,
877
- defaults: DEFAULT_CHOICE_QUESTION_ATTRIBUTES
878
- }, {
879
- type: RADIO,
880
- label: t("neetoForm.fields.scf"),
881
- isSingular: false,
882
- defaults: DEFAULT_CHOICE_QUESTION_ATTRIBUTES
883
- }, {
884
- type: DROPDOWN,
885
- label: t("neetoForm.fields.drf"),
886
- isSingular: false,
887
- defaults: DEFAULT_CHOICE_QUESTION_ATTRIBUTES
888
- }, {
889
- type: STAR_RATING,
890
- label: t("neetoForm.fields.starRating"),
891
- isSingular: false,
892
- defaults: {
893
- label: "",
894
- isRequired: true,
895
- minValue: 1,
896
- maxValue: 5,
897
- iconType: "star"
898
- }
899
- }, {
900
- type: OPINION_SCALE,
901
- label: t("neetoForm.fields.opinionScale"),
902
- isSingular: false,
903
- defaults: _objectSpread({
904
- label: "",
905
- isRequired: true
906
- }, OPINION_SCALE_DEFAULT_VALUES)
907
- }, {
908
- type: RATING,
909
- label: t("neetoForm.fields.fbf"),
910
- isSingular: false,
911
- defaults: {
912
- label: "",
913
- isRequired: true,
914
- highestRatingLabel: "",
915
- averageRatingLabel: "",
916
- lowestRatingLabel: ""
917
- }
918
- }, {
919
- type: TERMS_AND_CONDITION,
920
- label: t("neetoForm.fields.tcf"),
921
- isSingular: true,
922
- defaults: {
923
- termsLink: "",
924
- privacyPolicyLink: "",
925
- isRequired: true,
926
- label: t("neetoForm.common.agreeTermsAndConditions")
927
- }
928
- }, {
929
- type: CONDITION,
930
- label: t("neetoForm.fields.cf"),
931
- defaults: {
932
- isRequired: true,
933
- label: t("neetoForm.common.agreeCondition")
934
- }
935
- }, {
936
- type: DATE,
937
- label: t("neetoForm.fields.date"),
938
- isSingular: false,
939
- defaults: {
940
- label: "",
941
- isRequired: true
942
- }
943
- }, {
944
- type: FILE_UPLOAD,
945
- label: t("neetoForm.fields.fileUpload"),
946
- isSingular: false,
947
- defaults: {
948
- label: "",
949
- multipleFilesAllowed: true,
950
- allowedFileTypes: DEFAULT_ALLOWED_FILE_TYPES
951
- }
952
- }, {
953
- type: CAPTCHA,
954
- label: t("neetoForm.fields.captcha"),
955
- isSingular: true,
956
- defaults: {
957
- label: t("neetoForm.questions.common.questionFields.field.verifyHuman"),
958
- isRequired: true,
959
- variant: CAPTCHA_TYPES.RECAPTCHA_V2
960
- }
961
- }, {
962
- type: SMS_REMINDER,
963
- label: t("neetoForm.fields.smsReminder"),
964
- isSingular: true,
965
- defaults: {
966
- label: ""
967
- }
968
- }, {
969
- type: SPOT,
970
- label: t("neetoForm.fields.spot"),
971
- isSingular: true,
972
- defaults: {
973
- label: t("neetoForm.questions.spot.defaultLabel"),
974
- isRequired: true
975
- }
976
- }];
977
-
978
- // To show the question type as label in accordion
979
- var INDEPENDENT_LABELS_MAP = {
980
- paragraph: t("neetoForm.fields.def"),
981
- termsandcondition: t("neetoForm.fields.tcf")
982
- };
983
- var EMPTY_PARAGRAPH_REGEX = new RegExp(/<p[^>]*?>\s*<\/p>/gi);
984
- var FIELD_CODES_REJECT_CHARS_REGEX = new RegExp("[^a-z0-9_]");
985
-
986
- yup.addMethod(yup.array, "unique", function () {
987
- var field, message;
988
- if (arguments.length > 1) {
989
- field = arguments[0];
990
- message = arguments[1];
991
- } else {
992
- message = arguments[0];
993
- }
994
- var getValue = function getValue(item) {
995
- return field ? item[field] : item;
996
- };
997
- var valueInLowerCase = pipe(getValue, toLower);
998
- return this.test("unique", message, function () {
999
- var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1000
- // ignore destroyed items in the array
1001
- var validItems = reject(prop("_destroy"), array);
1002
- var uniqueItems = new Set(map(valueInLowerCase, validItems));
1003
-
1004
- // all items are unique
1005
- if (validItems.length === uniqueItems.size) return true;
1006
- return this.createError({
1007
- path: this.path,
1008
- message: message
1009
- });
1010
- });
1011
- });
1012
-
1013
- export { STAR_RATING_MAX_VALUE_OPTIONS as $, ADDRESS_FIELD_TYPES as A, RICH_TEXT_QUESTIONS as B, CALLOUT_POSITIONS as C, DEFAULT_CHOICE_QUESTION_ATTRIBUTES as D, EMAIL_REGEX as E, FIELD_CODES_REJECT_CHARS_REGEX as F, generateDefaultOptions as G, getDeletedRecords as H, ICONS_MAP as I, randomId as J, getActiveRecords as K, LAST_ELEMENTS_THRESHOLD as L, MINIMUM_ADDRESS_FIELDS as M, NON_BASIC_LATIN_CHARACTERS_REGEX as N, OPINION_LABEL_MAX_LENGTH as O, PARENTHESES_REGEX as P, QUESTIONS_WITHOUT_FIELD_CODE as Q, RATING_VALUES as R, SPOT_QUESTION_DEFAULT_VALUE as S, FILE_TYPES_MAP as T, FILE_GROUPS as U, OPINION_SCALE_MIN_VALUE_OPTIONS as V, OPINION_SCALE_MAX_VALUE_OPTIONS as W, MINIMUM_OPTIONS as X, IMAGE_HEIGHT_SLIDER_DEFAULTS as Y, RATING_OPTIONS as Z, STAR_RATING_MIN_VALUE_OPTIONS as _, QUESTION_KIND as a, STAR_RATING_ICONS_MAP as a0, buildDisabledAddButtonHelpPopoverProps as a1, buildReorderPayload as a2, QUESTIONS_INITIAL_VALUE as a3, isMandatoryField as a4, QUESTION_KINDS as a5, getActiveQuestionKindDetails as a6, DEFAULT_AVAILABLE_LANGUAGES as a7, DEFAULT_ADVANCED_FEATURES as a8, CALLOUT_STYLES as b, SCHEMA_LESS_QUESTION_KINDS as c, SIX_DIGIT_NUMBER_REGEX as d, ADDRESS_FIELD_WIDTHS as e, LABEL_FIELDS as f, generateArray as g, RADIO_DESELECT_KEYS as h, RATING_OPTIONS$1 as i, QUESTION_ACTIONS as j, INDEPENDENT_LABELS_MAP as k, buildDisplayLabel as l, isElementOverflowing as m, Drag as n, SELECTABLE_KINDS as o, isAutoGeneratedQuestion as p, isRichTextQuestion as q, SPOT_QUESTION_FIELD_CODE as r, RESERVED_FIELD_CODES as s, renameKey as t, isDefaultLanguage as u, buildAddQuestionButtonProps as v, validateEditorContent as w, isImmutableField as x, NON_HIDEABLE_FIELDS as y, NON_READ_ONLY_FIELDS as z };
1014
- //# sourceMappingURL=yup-CSYHMEsr.js.map