reactaform 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +499 -0
- package/dist/common-BD9zx3GT.js +1 -0
- package/dist/common-BQcVe8MY.mjs +87 -0
- package/dist/common-BnnwzTl2.mjs +87 -0
- package/dist/common-BxyjIoe1.js +1 -0
- package/dist/common-Bzz0clAC.mjs +87 -0
- package/dist/common-COyDhNL-.js +1 -0
- package/dist/common-DLqVHgfX.mjs +87 -0
- package/dist/common-hRFTL4KF.js +1 -0
- package/dist/components/LayoutComponents.d.ts +74 -0
- package/dist/components/PopupOptionMenu.d.ts +15 -0
- package/dist/components/ReactaForm.d.ts +4 -0
- package/dist/components/ReactaFormProvider.d.ts +3 -0
- package/dist/components/ReactaFormRenderer.d.ts +13 -0
- package/dist/components/Tooltip.d.ts +8 -0
- package/dist/components/VirtualizedFieldList.d.ts +36 -0
- package/dist/components/fields/CheckboxInput.d.ts +9 -0
- package/dist/components/fields/ColorInput.d.ts +17 -0
- package/dist/components/fields/DateInput.d.ts +11 -0
- package/dist/components/fields/DropdownInput.d.ts +13 -0
- package/dist/components/fields/EmailInput.d.ts +5 -0
- package/dist/components/fields/FileInput.d.ts +5 -0
- package/dist/components/fields/FloatArrayInput.d.ts +5 -0
- package/dist/components/fields/FloatInput.d.ts +24 -0
- package/dist/components/fields/ImageDisplay.d.ts +17 -0
- package/dist/components/fields/IntegerArrayInput.d.ts +23 -0
- package/dist/components/fields/IntegerInput.d.ts +28 -0
- package/dist/components/fields/MultiSelection.d.ts +9 -0
- package/dist/components/fields/MultilineTextInput.d.ts +6 -0
- package/dist/components/fields/NumericStepperInput.d.ts +6 -0
- package/dist/components/fields/PhoneInput.d.ts +6 -0
- package/dist/components/fields/RadioInput.d.ts +13 -0
- package/dist/components/fields/RatingInput.d.ts +6 -0
- package/dist/components/fields/Separator.d.ts +20 -0
- package/dist/components/fields/SliderInput.d.ts +22 -0
- package/dist/components/fields/SpinInput.d.ts +6 -0
- package/dist/components/fields/SwitchInput.d.ts +13 -0
- package/dist/components/fields/TextInput.d.ts +6 -0
- package/dist/components/fields/TimeInput.d.ts +6 -0
- package/dist/components/fields/UnitValueInput.d.ts +5 -0
- package/dist/components/fields/UrlInput.d.ts +21 -0
- package/dist/components/renderFields.d.ts +4 -0
- package/dist/core/fieldVisibility.d.ts +25 -0
- package/dist/core/index.d.ts +19 -0
- package/dist/core/reactaFormModel.d.ts +38 -0
- package/dist/core/reactaFormTypes.d.ts +137 -0
- package/dist/core/registries/baseRegistry.d.ts +15 -0
- package/dist/core/registries/componentRegistry.d.ts +9 -0
- package/dist/core/registries/index.d.ts +7 -0
- package/dist/core/registries/submissionHandlerRegistry.d.ts +6 -0
- package/dist/core/registries/validationHandlerRegistry.d.ts +16 -0
- package/dist/core/submitForm.d.ts +12 -0
- package/dist/core/validation.d.ts +10 -0
- package/dist/hooks/useDebouncedCallback.d.ts +25 -0
- package/dist/hooks/useReactaFormContext.d.ts +4 -0
- package/dist/index.d.ts +15 -0
- package/dist/reactaform.cjs.js +289 -0
- package/dist/reactaform.css +1 -0
- package/dist/reactaform.es.js +5085 -0
- package/dist/templates/conditionalAddress.d.ts +3 -0
- package/dist/templates/contactForm.d.ts +3 -0
- package/dist/templates/optionsAndParents.d.ts +3 -0
- package/dist/templates/surveyForm.d.ts +3 -0
- package/dist/utils/cssClasses.d.ts +14 -0
- package/dist/utils/definitionSerializers.d.ts +62 -0
- package/dist/utils/groupingHelpers.d.ts +24 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/translationCache.d.ts +43 -0
- package/dist/utils/unitValueMapper.d.ts +8 -0
- package/package.json +54 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),Ae=require("react-dom"),Nt=`/* ReactaForm CSS Custom Properties (CSS Variables) */\r
|
|
2
|
+
\r
|
|
3
|
+
/* Default Light Theme */\r
|
|
4
|
+
:root {\r
|
|
5
|
+
/* Colors */\r
|
|
6
|
+
--reactaform-primary-bg: #f9f9f9;\r
|
|
7
|
+
--reactaform-secondary-bg: #fff;\r
|
|
8
|
+
--reactaform-text-color: #000;\r
|
|
9
|
+
--reactaform-text-muted: #666;\r
|
|
10
|
+
--reactaform-border-color: #ccc;\r
|
|
11
|
+
--reactaform-border-hover: #999;\r
|
|
12
|
+
--reactaform-border-focus: #4CAF50;\r
|
|
13
|
+
--reactaform-error-color: #e11d48;\r
|
|
14
|
+
--reactaform-success-color: #4CAF50;\r
|
|
15
|
+
\r
|
|
16
|
+
/* Spacing */\r
|
|
17
|
+
--reactaform-space: 8px;\r
|
|
18
|
+
--reactaform-space-lg: 12px;\r
|
|
19
|
+
/* Hover background for light theme */\r
|
|
20
|
+
--reactaform-hover-bg: #f5f5f5;\r
|
|
21
|
+
\r
|
|
22
|
+
/* Typography */\r
|
|
23
|
+
--reactaform-font-size: 14px;\r
|
|
24
|
+
--reactaform-font-weight: 500;\r
|
|
25
|
+
\r
|
|
26
|
+
/* Layout */\r
|
|
27
|
+
--reactaform-border-radius: 0px;\r
|
|
28
|
+
\r
|
|
29
|
+
/* Shadows */\r
|
|
30
|
+
--reactaform-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\r
|
|
31
|
+
\r
|
|
32
|
+
/* Button Variables */\r
|
|
33
|
+
--reactaform-button-bg: var(--reactaform-success-color);\r
|
|
34
|
+
--reactaform-button-text: #ffffff;\r
|
|
35
|
+
--reactaform-button-padding: var(--reactaform-space) 12px;\r
|
|
36
|
+
--reactaform-button-border-radius: var(--reactaform-border-radius);\r
|
|
37
|
+
--reactaform-button-font-size: 14px;\r
|
|
38
|
+
--reactaform-button-font-weight: var(--reactaform-font-weight);\r
|
|
39
|
+
--reactaform-button-hover-opacity: 0.9;\r
|
|
40
|
+
--reactaform-button-disabled-opacity: 0.6;\r
|
|
41
|
+
--reactaform-button-disabled-bg: #cccccc;\r
|
|
42
|
+
--reactaform-button-disabled-cursor: not-allowed;\r
|
|
43
|
+
--reactaform-button-margin-top: 0.5em;\r
|
|
44
|
+
--reactaform-button-shadow: none;\r
|
|
45
|
+
\r
|
|
46
|
+
/* Form specific */\r
|
|
47
|
+
--reactaform-input-padding: var(--reactaform-space);\r
|
|
48
|
+
--reactaform-container-padding: var(--reactaform-space-lg);\r
|
|
49
|
+
--reactaform-field-gap: var(--reactaform-space);\r
|
|
50
|
+
\r
|
|
51
|
+
/* Input background (can be overridden per theme) */\r
|
|
52
|
+
--reactaform-input-bg: var(--reactaform-secondary-bg);\r
|
|
53
|
+
\r
|
|
54
|
+
--reactaform-field-text-color: #0000ff;\r
|
|
55
|
+
\r
|
|
56
|
+
/* Tooltip defaults */\r
|
|
57
|
+
--reactaform-tooltip-color-bg: rgba(60,60,60,0.92);\r
|
|
58
|
+
--reactaform-tooltip-color: #ffffff;\r
|
|
59
|
+
\r
|
|
60
|
+
}\r
|
|
61
|
+
\r
|
|
62
|
+
/* Dark Theme */\r
|
|
63
|
+
[data-reactaform-theme="dark"] {\r
|
|
64
|
+
\r
|
|
65
|
+
/* Layered Background System */\r
|
|
66
|
+
--reactaform-primary-bg: #121212; /* App background */\r
|
|
67
|
+
--reactaform-secondary-bg: #1A1A1A; /* Card / container surface */\r
|
|
68
|
+
--reactaform-input-bg: #262626; /* Component surface */\r
|
|
69
|
+
\r
|
|
70
|
+
/* Text */\r
|
|
71
|
+
--reactaform-text-color: #EDEDED; /* Primary text */\r
|
|
72
|
+
--reactaform-text-muted: #A5A5A5; /* Secondary text */\r
|
|
73
|
+
--reactaform-field-text-color: #C8C8E5; /* Optional tint for labels */\r
|
|
74
|
+
\r
|
|
75
|
+
/* Borders */\r
|
|
76
|
+
--reactaform-border-color: #3A3A3A; /* Default border */\r
|
|
77
|
+
--reactaform-border-hover: #4A4A4A; /* Hover */\r
|
|
78
|
+
--reactaform-border-focus: #4DA6FF; /* Accent blue focus */\r
|
|
79
|
+
\r
|
|
80
|
+
/* Status colors */\r
|
|
81
|
+
--reactaform-error-color: #FF6B6B;\r
|
|
82
|
+
--reactaform-success-color: #4CAF6A;\r
|
|
83
|
+
\r
|
|
84
|
+
/* Interactive / Hover */\r
|
|
85
|
+
--reactaform-hover-bg: rgba(255, 255, 255, 0.06);\r
|
|
86
|
+
\r
|
|
87
|
+
/* Shadows (subtle for dark mode) */\r
|
|
88
|
+
--reactaform-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);\r
|
|
89
|
+
\r
|
|
90
|
+
/* Tooltip */\r
|
|
91
|
+
--reactaform-tooltip-color-bg: rgba(40, 40, 40, 0.95);\r
|
|
92
|
+
--reactaform-tooltip-color: #F5F5F5;\r
|
|
93
|
+
}\r
|
|
94
|
+
\r
|
|
95
|
+
/* Base ReactaForm Container */\r
|
|
96
|
+
.reactaform-container {\r
|
|
97
|
+
background-color: var(--reactaform-primary-bg);\r
|
|
98
|
+
color: var(--reactaform-text-color);\r
|
|
99
|
+
padding: var(--reactaform-container-padding);\r
|
|
100
|
+
border-radius: var(--reactaform-border-radius);\r
|
|
101
|
+
box-shadow: var(--reactaform-shadow);\r
|
|
102
|
+
gap: var(--reactaform-space-lg);\r
|
|
103
|
+
max-width: 100%;\r
|
|
104
|
+
margin: 0 auto;\r
|
|
105
|
+
/* Removed internal scrolling - let parent container handle it */\r
|
|
106
|
+
}\r
|
|
107
|
+
\r
|
|
108
|
+
/* Field Container */\r
|
|
109
|
+
.reactaform-field {\r
|
|
110
|
+
display: grid;\r
|
|
111
|
+
grid-template-columns: 1fr 2fr;\r
|
|
112
|
+
align-items: start;\r
|
|
113
|
+
padding: 0;\r
|
|
114
|
+
gap: var(--reactaform-field-gap);\r
|
|
115
|
+
margin-bottom: var(--reactaform-space);\r
|
|
116
|
+
}\r
|
|
117
|
+
\r
|
|
118
|
+
/* Labels */\r
|
|
119
|
+
.reactaform-label {\r
|
|
120
|
+
justify-self: start;\r
|
|
121
|
+
align-self: center;\r
|
|
122
|
+
white-space: normal;\r
|
|
123
|
+
line-height: 1.4;\r
|
|
124
|
+
min-width: 100px;\r
|
|
125
|
+
color: var(--reactaform-text-color);\r
|
|
126
|
+
font-weight: var(--reactaform-font-weight);\r
|
|
127
|
+
font-size: var(--reactaform-font-size);\r
|
|
128
|
+
user-select: none;\r
|
|
129
|
+
}\r
|
|
130
|
+
\r
|
|
131
|
+
/* Ensure row layout labels are left-aligned */\r
|
|
132
|
+
\r
|
|
133
|
+
\r
|
|
134
|
+
/* Input Base */\r
|
|
135
|
+
.reactaform-input {\r
|
|
136
|
+
width: 100%;\r
|
|
137
|
+
color: var(--reactaform-text-color);\r
|
|
138
|
+
border: 1px solid var(--reactaform-border-color);\r
|
|
139
|
+
border-radius: var(--reactaform-border-radius);\r
|
|
140
|
+
padding: var(--reactaform-input-padding);\r
|
|
141
|
+
box-sizing: border-box;\r
|
|
142
|
+
background-color: var(--reactaform-input-bg);\r
|
|
143
|
+
font-size: var(--reactaform-font-size);\r
|
|
144
|
+
transition: border-color 0.2s ease;\r
|
|
145
|
+
box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);\r
|
|
146
|
+
}\r
|
|
147
|
+
\r
|
|
148
|
+
.reactaform-input:hover {\r
|
|
149
|
+
border-color: var(--reactaform-border-hover);\r
|
|
150
|
+
}\r
|
|
151
|
+
\r
|
|
152
|
+
.reactaform-input:focus {\r
|
|
153
|
+
outline: none;\r
|
|
154
|
+
border-color: var(--reactaform-border-focus);\r
|
|
155
|
+
/* Bright, prominent focus ring with cyan glow for maximum visibility on dark backgrounds */\r
|
|
156
|
+
box-shadow: 0 0 0 3px rgba(34,211,238,0.4),\r
|
|
157
|
+
0 0 16px rgba(34,211,238,0.25),\r
|
|
158
|
+
inset 0 1px 0 rgba(255,255,255,0.05);\r
|
|
159
|
+
}\r
|
|
160
|
+
\r
|
|
161
|
+
/* Input Variants */\r
|
|
162
|
+
.reactaform-input--text {\r
|
|
163
|
+
text-align: left;\r
|
|
164
|
+
}\r
|
|
165
|
+
\r
|
|
166
|
+
.reactaform-input--number {\r
|
|
167
|
+
text-align: right;\r
|
|
168
|
+
}\r
|
|
169
|
+
\r
|
|
170
|
+
.reactaform-input--select {\r
|
|
171
|
+
text-align: left;\r
|
|
172
|
+
appearance: none;\r
|
|
173
|
+
background-image: url("data:image/svg+xml;utf8,<svg fill='%23666' height='8' viewBox='0 0 24 24' width='8' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");\r
|
|
174
|
+
background-repeat: no-repeat;\r
|
|
175
|
+
background-position: right var(--reactaform-space) center;\r
|
|
176
|
+
background-size: 20px;\r
|
|
177
|
+
padding-right: 32px;\r
|
|
178
|
+
}\r
|
|
179
|
+
\r
|
|
180
|
+
/* Select component (multiselection, dropdown) */\r
|
|
181
|
+
.reactaform-select {\r
|
|
182
|
+
text-align: left;\r
|
|
183
|
+
appearance: none;\r
|
|
184
|
+
background-image: url("data:image/svg+xml;utf8,<svg fill='%23666' height='8' viewBox='0 0 24 24' width='8' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");\r
|
|
185
|
+
background-repeat: no-repeat;\r
|
|
186
|
+
background-position: right var(--reactaform-space) center;\r
|
|
187
|
+
background-size: 2.5em;\r
|
|
188
|
+
padding-right: 32px;\r
|
|
189
|
+
background-color: var(--reactaform-input-bg);\r
|
|
190
|
+
}\r
|
|
191
|
+
\r
|
|
192
|
+
.reactaform-textarea {\r
|
|
193
|
+
width: 100%;\r
|
|
194
|
+
background-color: var(--reactaform-input-bg);\r
|
|
195
|
+
color: var(--reactaform-text-color);\r
|
|
196
|
+
border: 1px solid var(--reactaform-border-color);\r
|
|
197
|
+
border-radius: var(--reactaform-border-radius);\r
|
|
198
|
+
padding: var(--reactaform-input-padding);\r
|
|
199
|
+
box-sizing: border-box;\r
|
|
200
|
+
}\r
|
|
201
|
+
\r
|
|
202
|
+
\r
|
|
203
|
+
\r
|
|
204
|
+
/* Responsive Design */\r
|
|
205
|
+
@media (max-width: 1024px) {\r
|
|
206
|
+
.reactaform-container {\r
|
|
207
|
+
padding: calc(var(--reactaform-space) * 0.8);\r
|
|
208
|
+
}\r
|
|
209
|
+
\r
|
|
210
|
+
.reactaform-field {\r
|
|
211
|
+
gap: calc(var(--reactaform-gap) * 0.8);\r
|
|
212
|
+
}\r
|
|
213
|
+
}\r
|
|
214
|
+
\r
|
|
215
|
+
@media (max-width: 768px) {\r
|
|
216
|
+
.reactaform-field {\r
|
|
217
|
+
grid-template-columns: 1fr;\r
|
|
218
|
+
gap: 6px;\r
|
|
219
|
+
}\r
|
|
220
|
+
\r
|
|
221
|
+
.reactaform-label {\r
|
|
222
|
+
justify-self: start;\r
|
|
223
|
+
margin-bottom: 4px;\r
|
|
224
|
+
font-size: 0.9rem;\r
|
|
225
|
+
}\r
|
|
226
|
+
\r
|
|
227
|
+
.reactaform-container {\r
|
|
228
|
+
padding: var(--reactaform-space);\r
|
|
229
|
+
}\r
|
|
230
|
+
\r
|
|
231
|
+
.reactaform-input,\r
|
|
232
|
+
.reactaform-textarea,\r
|
|
233
|
+
.reactaform-select {\r
|
|
234
|
+
font-size: 16px; /* Prevent zoom on iOS */\r
|
|
235
|
+
padding: 12px;\r
|
|
236
|
+
}\r
|
|
237
|
+
\r
|
|
238
|
+
.reactaform-checkbox-wrapper,\r
|
|
239
|
+
.reactaform-radio-wrapper {\r
|
|
240
|
+
padding: 8px 0;\r
|
|
241
|
+
min-height: 44px;\r
|
|
242
|
+
align-items: center;\r
|
|
243
|
+
}\r
|
|
244
|
+
\r
|
|
245
|
+
.reactaform-group {\r
|
|
246
|
+
margin-bottom: calc(var(--reactaform-space) * 1.5);\r
|
|
247
|
+
}\r
|
|
248
|
+
}\r
|
|
249
|
+
\r
|
|
250
|
+
@media (max-width: 480px) {\r
|
|
251
|
+
.reactaform-container {\r
|
|
252
|
+
padding: calc(var(--reactaform-space) * 0.7);\r
|
|
253
|
+
}\r
|
|
254
|
+
\r
|
|
255
|
+
.reactaform-field {\r
|
|
256
|
+
gap: 8px;\r
|
|
257
|
+
}\r
|
|
258
|
+
\r
|
|
259
|
+
.reactaform-label {\r
|
|
260
|
+
font-size: 0.85rem;\r
|
|
261
|
+
line-height: 1.3;\r
|
|
262
|
+
}\r
|
|
263
|
+
\r
|
|
264
|
+
.reactaform-input,\r
|
|
265
|
+
.reactaform-textarea,\r
|
|
266
|
+
.reactaform-select {\r
|
|
267
|
+
padding: 14px;\r
|
|
268
|
+
}\r
|
|
269
|
+
\r
|
|
270
|
+
\r
|
|
271
|
+
}\r
|
|
272
|
+
`;var ye={exports:{}},me={};var qe;function Ot(){if(qe)return me;qe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(o,n,a){var i=null;if(a!==void 0&&(i=""+a),n.key!==void 0&&(i=""+n.key),"key"in n){a={};for(var c in n)c!=="key"&&(a[c]=n[c])}else a=n;return n=a.ref,{$$typeof:e,type:o,key:i,ref:n!==void 0?n:null,props:a}}return me.Fragment=t,me.jsx=r,me.jsxs=r,me}var de={};var Be;function Mt(){return Be||(Be=1,process.env.NODE_ENV!=="production"&&(function(){function e(y){if(y==null)return null;if(typeof y=="function")return y.$$typeof===M?null:y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case x:return"Fragment";case k:return"Profiler";case v:return"StrictMode";case w:return"Suspense";case R:return"SuspenseList";case I:return"Activity"}if(typeof y=="object")switch(typeof y.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),y.$$typeof){case d:return"Portal";case S:return y.displayName||"Context";case O:return(y._context.displayName||"Context")+".Consumer";case C:var j=y.render;return y=y.displayName,y||(y=j.displayName||j.name||"",y=y!==""?"ForwardRef("+y+")":"ForwardRef"),y;case E:return j=y.displayName||null,j!==null?j:e(y.type)||"Memo";case N:j=y._payload,y=y._init;try{return e(y(j))}catch{}}return null}function t(y){return""+y}function r(y){try{t(y);var j=!1}catch{j=!0}if(j){j=console;var T=j.error,q=typeof Symbol=="function"&&Symbol.toStringTag&&y[Symbol.toStringTag]||y.constructor.name||"Object";return T.call(j,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",q),t(y)}}function o(y){if(y===x)return"<>";if(typeof y=="object"&&y!==null&&y.$$typeof===N)return"<...>";try{var j=e(y);return j?"<"+j+">":"<...>"}catch{return"<...>"}}function n(){var y=$.A;return y===null?null:y.getOwner()}function a(){return Error("react-stack-top-frame")}function i(y){if(V.call(y,"key")){var j=Object.getOwnPropertyDescriptor(y,"key").get;if(j&&j.isReactWarning)return!1}return y.key!==void 0}function c(y,j){function T(){te||(te=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",j))}T.isReactWarning=!0,Object.defineProperty(y,"key",{get:T,configurable:!0})}function l(){var y=e(this.type);return K[y]||(K[y]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),y=this.props.ref,y!==void 0?y:null}function u(y,j,T,q,Z,ee){var H=T.ref;return y={$$typeof:h,type:y,key:j,props:T,_owner:q},(H!==void 0?H:null)!==null?Object.defineProperty(y,"ref",{enumerable:!1,get:l}):Object.defineProperty(y,"ref",{enumerable:!1,value:null}),y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(y,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(y,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(y,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y}function m(y,j,T,q,Z,ee){var H=j.children;if(H!==void 0)if(q)if(L(H)){for(q=0;q<H.length;q++)g(H[q]);Object.freeze&&Object.freeze(H)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(H);if(V.call(j,"key")){H=e(y);var Q=Object.keys(j).filter(function(ie){return ie!=="key"});q=0<Q.length?"{key: someKey, "+Q.join(": ..., ")+": ...}":"{key: someKey}",F[H+q]||(Q=0<Q.length?"{"+Q.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
273
|
+
let props = %s;
|
|
274
|
+
<%s {...props} />
|
|
275
|
+
React keys must be passed directly to JSX without using spread:
|
|
276
|
+
let props = %s;
|
|
277
|
+
<%s key={someKey} {...props} />`,q,H,Q,H),F[H+q]=!0)}if(H=null,T!==void 0&&(r(T),H=""+T),i(j)&&(r(j.key),H=""+j.key),"key"in j){T={};for(var le in j)le!=="key"&&(T[le]=j[le])}else T=j;return H&&c(T,typeof y=="function"?y.displayName||y.name||"Unknown":y),u(y,H,T,n(),Z,ee)}function g(y){f(y)?y._store&&(y._store.validated=1):typeof y=="object"&&y!==null&&y.$$typeof===N&&(y._payload.status==="fulfilled"?f(y._payload.value)&&y._payload.value._store&&(y._payload.value._store.validated=1):y._store&&(y._store.validated=1))}function f(y){return typeof y=="object"&&y!==null&&y.$$typeof===h}var p=s,h=Symbol.for("react.transitional.element"),d=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),S=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),M=Symbol.for("react.client.reference"),$=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,L=Array.isArray,U=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(y){return y()}};var te,K={},se=p.react_stack_bottom_frame.bind(p,a)(),D=U(o(a)),F={};de.Fragment=x,de.jsx=function(y,j,T){var q=1e4>$.recentlyCreatedOwnerStacks++;return m(y,j,T,!1,q?Error("react-stack-top-frame"):se,q?U(o(y)):D)},de.jsxs=function(y,j,T){var q=1e4>$.recentlyCreatedOwnerStacks++;return m(y,j,T,!0,q?Error("react-stack-top-frame"):se,q?U(o(y)):D)}})()),de}var He;function At(){return He||(He=1,process.env.NODE_ENV==="production"?ye.exports=Ot():ye.exports=Mt()),ye.exports}var b=At();const et=s.createContext(void 0),P=()=>{const e=s.useContext(et);if(!e)throw new Error("❌ useReactaFormContext must be used within a <ReactaFormProvider>");return e};class we{map={};register(t,r){this.map[t]=r}get(t){return this.map[t]}has(t){return t in this.map}list(){return Object.keys(this.map)}entries(){return Object.entries(this.map)}values(){return Object.values(this.map)}size(){return Object.keys(this.map).length}unregister(t){return t in this.map?(delete this.map[t],!0):!1}clear(){this.map={}}registerAll(t){Array.isArray(t)?t.forEach(([r,o])=>this.register(r,o)):Object.entries(t).forEach(([r,o])=>this.register(r,o))}getOrDefault(t,r){return this.get(t)??r}}function tt(e,t=300,r){const o=s.useRef(void 0),n=s.useRef(e),a=s.useRef(null),i=s.useRef(!1);s.useEffect(()=>{n.current=e},[e]),s.useEffect(()=>()=>{o.current!==void 0&&(window.clearTimeout(o.current),o.current=void 0)},[]);const c=s.useCallback(()=>{o.current!==void 0&&(window.clearTimeout(o.current),o.current=void 0),a.current=null,i.current=!1},[]),l=s.useCallback(()=>{if(o.current!==void 0&&(window.clearTimeout(o.current),o.current=void 0),a.current)try{n.current(...a.current)}finally{a.current=null,i.current=!1}},[]);return{callback:s.useCallback((...m)=>{if(r?.leading===!0&&!i.current){i.current=!0,n.current(...m),window.clearTimeout(o.current),o.current=window.setTimeout(()=>{i.current=!1,o.current=void 0},t);return}a.current=m,window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=void 0,a.current&&(n.current(...a.current),a.current=null,i.current=!1)},t)},[t,r?.leading]),cancel:c,flush:l}}const A={field:"reactaform-field",label:"reactaform-label",input:"reactaform-input",textInput:"reactaform-input--text",inputNumber:"reactaform-input--number",inputSelect:"reactaform-select",rangeInput:"reactaform-input--range",button:"reactaform-button"},G=(...e)=>{const t=[];for(const r of e)r&&(typeof r=="string"?t.push(r):typeof r=="object"&&Object.entries(r).forEach(([o,n])=>{n&&t.push(o)}));return t.join(" ")},rt=({content:e,size:t="medium",animation:r=!0})=>{const{t:o,darkMode:n,formStyle:a,fieldStyle:i}=P(),[c,l]=s.useState(!1),[u,m]=s.useState({x:0,y:0}),[g,f]=s.useState(!1),p=s.useRef(null),h=s.useRef(null),d=s.useRef(null),x=s.useMemo(()=>{const S={icon:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1.2em",height:"1.2em",fontSize:"0.9em",fontWeight:"bold",borderRadius:"50%",backgroundColor:n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)",color:n?"#f0f0f0":"#333",border:`1px solid ${n?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.1)"}`,cursor:"pointer",transition:r?"all 0.2s ease":void 0,marginLeft:"0.3em"},text:{...{small:{padding:"4px 8px",fontSize:"11px",maxWidth:"200px"},medium:{padding:"6px 10px",fontSize:"12px",maxWidth:"240px"},large:{padding:"8px 12px",fontSize:"13px",maxWidth:"280px"}}[t],position:"absolute",backgroundColor:`var(--reactaform-tooltip-color-bg, ${n?"rgba(45,45,45,0.95)":"rgba(60,60,60,0.92)"})`,color:`var(--reactaform-tooltip-color, ${n?"#f0f0f0":"#fff"})`,borderRadius:"6px",border:`1px solid ${n?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"}`,boxShadow:n?"0 8px 16px rgba(0,0,0,0.4)":"0 6px 18px rgba(0,0,0,0.12)",zIndex:2147483647,opacity:0,visibility:"hidden",transition:r?"opacity 0.2s ease, visibility 0.2s ease":void 0,pointerEvents:"none",whiteSpace:"normal",wordBreak:"break-word",boxSizing:"border-box"},textVisible:{opacity:1,visibility:"visible"}},C=(R,E,N)=>{const M=R?.[E];return(N&&M?M[N]:void 0)??{}};return{icon:{...S.icon,...C(a,"tooltip","icon"),...C(i,"tooltip","icon")},text:{...S.text,...C(a,"tooltip","text"),...C(i,"tooltip","text")},textVisible:S.textVisible}},[n,t,r,a,i]);s.useEffect(()=>{if(c){const O=requestAnimationFrame(()=>f(!1)),S=requestAnimationFrame(()=>{if(p.current){const C=p.current.getBoundingClientRect(),w=8;d.current=C;const R=C.right+w,E=C.top;m({x:R,y:E}),f(!0)}});return()=>{cancelAnimationFrame(S),cancelAnimationFrame(O)}}else requestAnimationFrame(()=>f(!1))},[c]),s.useEffect(()=>{if(!g)return;const O=requestAnimationFrame(()=>{if(!h.current)return;const S=h.current.getBoundingClientRect(),C=8,w=typeof window<"u"?window.innerWidth:1024,R=typeof window<"u"?window.innerHeight:768;let E=u.x,N=u.y;const I=d.current;I&&(E=I.right+C,N=I.top+I.height/2-S.height/2+-4,E+S.width>w-C&&(E=I.left-C-S.width)),E+S.width>w-C&&(E=Math.max(C,w-S.width-C)),E<C&&(E=C),N+S.height>R-C&&(N=Math.max(C,R-S.height-C)),N<C&&(N=C),(E!==u.x||N!==u.y)&&m({x:E,y:N})});return()=>cancelAnimationFrame(O)},[g,u.x,u.y]);const v=typeof document<"u"?document.getElementById("popup-root"):null,k=b.jsx("div",{ref:h,style:{...x.text,transform:g?"translateY(0) scale(1)":"translateY(-4px) scale(0.98)",transition:"opacity 120ms ease, transform 120ms ease, visibility 120ms ease",width:240,...g?x.textVisible:{},top:u.y,left:u.x},"data-reactaform-theme":n?"dark":"light",children:o(e)});return b.jsxs(b.Fragment,{children:[b.jsx("span",{"data-testid":"tooltip-icon",ref:p,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{...x.icon},children:"?"}),c&&(v?Ae.createPortal(k,v):k)]})},nt=s.memo(({field:e,error:t,children:r})=>{const{t:o}=P(),n=e?.labelLayout==="column-center"?"center":"left";return b.jsxs("div",{className:`${A.field} column-layout`,style:{display:"flex",flexDirection:"column",gap:"var(--reactaform-field-gap, 8px)","--label-align":n},children:[b.jsx("div",{style:{textAlign:n,width:"100%"},children:b.jsx("label",{className:A.label,htmlFor:e.name,style:{textAlign:n,width:"100%",minWidth:"unset",display:"block"},children:o(e.displayName)})}),b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--reactaform-field-gap, 8px)",width:"100%"},children:[b.jsx("div",{style:{flex:1,minWidth:0,maxWidth:"100%"},children:b.jsx("div",{style:{width:"100%"},children:r})}),e.tooltip&&b.jsx(rt,{content:e.tooltip})]}),t&&b.jsx(Fe,{children:t})]})});nt.displayName="ColumnFieldLayout";const ot=s.memo(({field:e,error:t,children:r,rightAlign:o=!1})=>{const{t:n}=P(),a=s.useMemo(()=>({display:"flex",flexDirection:"column",gap:0}),[]),i=s.useMemo(()=>({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px"}),[]);return b.jsxs("div",{className:`${A.field} row-layout`,children:[b.jsx("label",{className:A.label,htmlFor:e.name,style:{textAlign:"left",justifyContent:"flex-start"},children:n(e.displayName)}),b.jsxs("div",{style:a,children:[b.jsxs("div",{style:i,children:[o?b.jsx("div",{style:{display:"flex",flex:1,justifyContent:"flex-end",alignItems:"center",gap:"var(--reactaform-field-gap, 8px)"},children:r}):r,e.tooltip&&b.jsx(rt,{content:e.tooltip})]}),t&&b.jsx(Fe,{children:t})]})]})});ot.displayName="RowFieldLayout";const W=({field:e,error:t,children:r,rightAlign:o=!1})=>e?.labelLayout==="column-left"||e?.labelLayout==="column-center"?b.jsx(nt,{field:e,error:t,children:r}):b.jsx(ot,{field:e,error:t,rightAlign:o,children:r}),Fe=s.memo(({children:e})=>{const t=s.useMemo(()=>({color:"var(--reactaform-error-color)",fontSize:"13px",marginTop:"4px",fontWeight:"var(--reactaform-font-weight)",display:"flex",flex:1,justifyContent:"flex-start",alignItems:"flex-start"}),[]);return b.jsx("div",{style:t,children:e})});Fe.displayName="ErrorDiv";const at=s.memo(({name:e,onChange:t})=>{const{t:r}=P();return b.jsxs("div",{style:{marginBottom:16},children:[b.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 2fr",gap:12,alignItems:"center"},children:[b.jsx("label",{htmlFor:"instance-name-input",style:{margin:0,fontSize:"0.95em",fontWeight:500,color:"var(--reactaform-text-color, #333)"},children:r("Instance Name")}),b.jsx("input",{id:"instance-name-input",type:"text",value:e,onChange:o=>t(o.target.value),style:{width:"100%",padding:"var(--reactaform-input-padding, 8px 12px)",fontSize:"var(--reactaform-input-font-size, 14px)",border:"1px solid var(--reactaform-input-border, #ddd)",borderRadius:"var(--reactaform-border-radius, 4px)",backgroundColor:"var(--reactaform-input-bg, #fff)",color:"var(--reactaform-text-color, #333)",boxSizing:"border-box"},placeholder:r("Enter instance name")})]}),b.jsx("div",{style:{height:"1px",backgroundColor:"var(--reactaform-separator, #e6e6e6)",marginTop:12,marginBottom:12}})]})});at.displayName="InstanceName";const Ft=({field:e,value:t,onChange:r})=>{const o=i=>{const c=i.target.checked;r?.(c,null)},n=i=>{(i.key===" "||i.key==="Spacebar"||i.key==="Space"||i.key==="Enter")&&(i.preventDefault(),r?.(!t,null))},a=e.name;return b.jsx(W,{field:e,rightAlign:!0,children:b.jsx("input",{id:a,"data-testid":"boolean-checkbox",type:"checkbox",checked:!!t,onChange:o,onKeyDown:n,"aria-checked":!!t,style:{cursor:"pointer",margin:"8px 0 8px 0",width:"1.2em",height:"1.2em",verticalAlign:"middle",color:"#FFFFFF",accentColor:"#0000FF",opacity:void 0}})})};class zt extends we{registerInCategory(t,r,o){this.get(t)||this.register(t,{});const n=this.get(t);n[r]=o}getFromCategory(t,r){return this.get(t)?.[r]}listFromCategory(t){return Object.keys(this.get(t)||{})}listCategories(){return this.list()}}const st=new we,it=new zt;function Vt(e,t){st.register(e,t)}function $t(e,t,r){it.registerInCategory(e,t,r)}function Tt(e,t){return it.getFromCategory(e,t)||null}function Pt(e){return st.get(e)||null}const Ce=new Map,Re=new Map;function Y(e,t,r,o){if(t&&typeof t.validationHandlerName=="string"){const n=`${e}:${t.validationHandlerName}`;if(!Ce.has(n)){const i=Tt(e,t.validationHandlerName);Ce.set(n,i)}const a=Ce.get(n);if(a)return a(r,o)||null}return null}function ct(e,t,r){if(e&&typeof e.validationHandlerName=="string"){const o=e.validationHandlerName;if(!Re.has(o)){const a=Pt(o);Re.set(o,a)}const n=Re.get(o);if(n)return n(t,r)||null}return null}const Dt=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,formStyle:a,fieldStyle:i,definitionName:c}=P(),l=a,u=i,m=(S,C,w)=>{if(!C)return{};const R=S?.[C];return(w&&R?R[w]:void 0)??{}},g=s.useMemo(()=>({display:"inline-block",position:"relative",width:44,height:24,...m(l,"switch","label"),...m(u,void 0,"label")}),[l,u]),f=s.useMemo(()=>({position:"absolute",opacity:0,top:0,left:0,width:"100%",height:"100%",margin:0,cursor:"pointer",pointerEvents:"none",...m(l,"switch","hiddenInput"),...m(u,void 0,"hiddenInput")}),[l,u]),p=s.useMemo(()=>({position:"absolute",cursor:"pointer",top:0,left:0,right:0,bottom:0,backgroundColor:"var(--reactaform-switch-off-bg, #ccc)",transition:"0.3s",borderRadius:24,borderWidth:2,borderStyle:"solid",borderColor:"transparent",...m(l,"switch","slider"),...m(u,void 0,"slider")}),[l,u]),h=s.useMemo(()=>({position:"absolute",height:16,width:16,left:2,bottom:2,backgroundColor:"white",transition:"0.3s",borderRadius:"50%",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.3)",...m(l,"switch","knob"),...m(u,void 0,"knob")}),[l,u]),d=!!t,x=s.useRef(null),v=s.useRef(o),k=s.useCallback(S=>S?Y(c,e,S,n)??null:e.required?n("Value required"):null,[e,n,c]),O=()=>{const S=!d,C=k(S);r?.(S,C)};return s.useEffect(()=>{v.current=o},[o]),s.useEffect(()=>{const S=k(d);S!==x.current&&(x.current=S,v.current?.(S??null))},[d,e,k]),b.jsx(W,{field:e,error:k(d),rightAlign:!0,children:b.jsxs("label",{style:g,children:[b.jsx("input",{id:e.name,type:"checkbox",checked:d,readOnly:!0,"aria-label":n(e.displayName),style:f,tabIndex:-1}),b.jsx("span",{role:"switch","data-testid":"switch",tabIndex:0,"aria-checked":d,onClick:O,onKeyDown:S=>{(S.key===" "||S.key==="Spacebar"||S.key==="Space"||S.key==="Enter")&&(S.preventDefault(),O())},className:`reactaform-switch ${d?"active checked on":""} `,style:d?{...p,backgroundColor:"var(--reactaform-switch-on-bg, #22c55e)",borderColor:"var(--reactaform-switch-on-border, #16a34a)"}:p,children:b.jsx("span",{style:{...h,transform:d?"translateX(20px)":void 0}})})]})})},We=[{label:"Black",value:"#000000"},{label:"White",value:"#ffffff"},{label:"Red",value:"#ff0000"},{label:"Green",value:"#008000"},{label:"Blue",value:"#0000ff"},{label:"Yellow",value:"#ffff00"},{label:"Cyan",value:"#00ffff"},{label:"Magenta",value:"#ff00ff"},{label:"Orange",value:"#ffa500"},{label:"Purple",value:"#800080"},{label:"Brown",value:"#a52a2a"},{label:"Gray",value:"#808080"},{label:"Light Gray",value:"#d3d3d3"},{label:"Pink",value:"#ffc0cb"}];function lt(e){return/^#([0-9A-F]{3}){1,2}$/i.test(e)}function Lt(e){if(!lt(e))return null;const t=ut(e),r=parseInt(t.slice(1),16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function ut(e){return e?(e=e.toLowerCase(),/^#([a-f0-9]){3}$/i.test(e)?"#"+e.slice(1).split("").map(t=>t+t).join(""):e):"#000000"}const _t=({field:e,value:t,onChange:r})=>{const{t:o}=P(),[n,a]=s.useState("#000000"),i=s.useRef(null),c=s.useRef(null);s.useEffect(()=>{const h=t&<(t)?t:"#000000",d=ut(h);a(d)},[t]);const l=h=>{const d=h.target.value;a(d),r?.(d,null)},u=h=>{const d=h.target.value;a(d),r?.(d,null)},m=We.find(h=>h.value===n),{r:g,g:f,b:p}=Lt(n)||{r:0,g:0,b:0};return b.jsx(W,{field:e,error:null,children:b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",width:"100%"},children:[b.jsxs("select",{ref:i,id:e.name,value:n,onChange:l,style:{minWidth:"120px",flex:1},className:G(A.input,A.inputSelect),children:[We.map(h=>b.jsx("option",{value:h.value,children:o(h.label)},h.value)),m?null:b.jsxs("option",{value:n,children:["(",g,", ",f,", ",p,")"]},n)]}),b.jsx("label",{style:{width:"2.5em",height:"1.8em",display:"inline-block",border:"1px solid #ccc",borderRadius:"4px",backgroundColor:n,cursor:"pointer",overflow:"hidden",flexShrink:0},children:b.jsx("input",{ref:c,type:"color",value:n,onChange:u,style:{opacity:0,width:"100%",height:"100%",border:"none",padding:0,cursor:"pointer"}})})]})})},pe=e=>{if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t},qt=e=>{if(!e)return"";if(/^\d{4}-\d{2}-\d{2}$/.test(e))return pe(e)?e:"";const r=pe(e);if(r){const o=r.getFullYear(),n=String(r.getMonth()+1).padStart(2,"0"),a=String(r.getDate()).padStart(2,"0");return`${o}-${n}-${a}`}return""},Bt=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,definitionName:a}=P(),{name:i,required:c}=e,l=s.useRef(null),u=s.useRef(o);s.useEffect(()=>{u.current=o},[o]);const m=s.useCallback(f=>{if(!f||f.trim()==="")return c?n("Value required"):null;if(f){const h=pe(f);if(!h)return n("Invalid date format");if(e.minDate){const d=pe(e.minDate);if(d&&h.getTime()<d.getTime())return n("Date must be on or after {{1}}",e.minDate)}if(e.maxDate){const d=pe(e.maxDate);if(d&&h.getTime()>d.getTime())return n("Date must be on or before {{1}}",e.maxDate)}}return Y(a,e,f,n)??null},[e,a,n,c]),g=f=>{const p=f.target.value,h=m(p);r?.(p,h)};return s.useEffect(()=>{const f=m(t);f!==l.current&&(l.current=f,u.current?.(f??null))},[t,m]),b.jsx(W,{field:e,error:m(t),children:b.jsx("input",{id:i,type:"date",value:qt(t),onChange:g,className:G(A.input,A.textInput),...e.minDate?{min:e.minDate}:{},...e.maxDate?{max:e.maxDate}:{},"aria-invalid":!!m(t),"aria-describedby":m(t)?`${i}-error`:void 0})})};function Ht(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}const Wt=({field:e,value:t,onChange:r,onError:o})=>{const{definitionName:n,t:a}=P(),i=s.useRef(null),c=s.useCallback(g=>{const f=g.trim();return f===""?e.required?a("Value required"):null:Ht(f)?e.pattern&&!new RegExp(e.pattern).test(f)?a("Email does not match pattern: {{%1}}",{"%1":`${e.pattern}`}):Y(n,e,g,a)??null:a("Must be valid email format")},[e,n,a]),l=g=>{const f=g.target.value,p=c(f);r?.(f,p)},u=s.useRef(null),m=s.useRef(o);return s.useEffect(()=>{m.current=o},[o]),s.useEffect(()=>{const g=t??"",f=c(g);i.current&&i.current.value!==String(g)&&(i.current.value=String(g)),f!==u.current&&(u.current=f,m.current?.(f??null))},[t,c]),b.jsx(W,{field:e,error:c(String(t??"")),children:b.jsx("input",{id:e.name,type:"email",defaultValue:String(t??""),ref:i,onChange:l,className:G(A.input,A.textInput)})})},Ut=/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/,Yt=e=>{const t=Number.parseFloat(e);return Number.isNaN(t)?null:t},Jt=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,definitionName:a}=P(),i=s.useRef(null),c=s.useCallback(g=>{if(g.trim()==="")return e.required?n("Value required"):null;if(!Ut.test(g))return n("Must be a valid float");const f=Yt(g);return f===null?n("Must be a valid float"):e.min!==void 0&&(e.minInclusive?f<e.min:f<=e.min)?n("Must be {{1}} {{2}}",e.minInclusive?"≥":">",e.min):e.max!==void 0&&(e.maxInclusive?f>e.max:f>=e.max)?n("Must be {{1}} {{2}}",e.maxInclusive?"≤":"<",e.max):Y(a,e,f,n)??null},[e,a,n]),l=s.useRef(null),u=s.useRef(o);s.useEffect(()=>{u.current=o},[o]),s.useEffect(()=>{const g=String(t??""),f=c(g);f!==l.current&&(l.current=f,u.current?.(f??null)),i.current&&document.activeElement!==i.current&&(i.current.value=g)},[t,e,c,n]);const m=g=>{const f=g.target.value,p=c(f);r?.(f,p)};return b.jsx(W,{field:e,error:c(String(t??"")),children:b.jsx("input",{id:e.name,type:"text",defaultValue:String(t??""),ref:i,onChange:m,className:G(A.input,A.inputNumber)})})},Gt=/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/;function Kt(e){return e.split(",").map(t=>t.trim()).every(t=>Gt.test(t))}const Xt=e=>!e||e.trim()===""?[]:e.split(",").map(t=>t.trim()).filter(Boolean).map(Number),Zt=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,definitionName:a}=P(),[i,c]=s.useState(Array.isArray(t)?t.join(", "):String(t??"")),l=s.useCallback(f=>{if(f.trim()==="")return e.required?n("Value required"):null;if(!Kt(f))return n("Each value must be a valid float");const p=Xt(f);if(e.minCount!==void 0&&p.length<e.minCount)return n("Minimum number of values: {{1}}",e.minCount);if(e.maxCount!==void 0&&p.length>e.maxCount)return n("Maximum number of values: {{1}}",e.maxCount);for(const d of p){if(e.min!==void 0&&(e.minInclusive?d<e.min:d<=e.min))return n("Each value must be {{1}} {{2}}",e.minInclusive?"≥":">",e.min);if(e.max!==void 0&&(e.maxInclusive?d>e.max:d>=e.max))return n("Each value must be {{1}} {{2}}",e.maxInclusive?"≤":"<",e.max)}return Y(a,e,p,n)??null},[a,e,n]),u=f=>{const p=f.target.value,h=l(p);c(p),r?.(p,h)},m=s.useRef(null),g=s.useRef(o);return s.useEffect(()=>{g.current=o},[o]),s.useEffect(()=>{const f=Array.isArray(t)?t.join(", "):String(t??""),p=l(f);p!==m.current&&(m.current=p,g.current?.(p??null))},[t,e.required,l,n]),b.jsx(W,{field:e,error:l(i),children:b.jsx("input",{type:"text",value:i,onChange:u,className:G(A.input,A.textInput),style:{flex:1}})})},Qt=({field:e})=>{const{darkMode:t}=P(),{color:r=t?"#444444":"#CCCCCC",thickness:o=1,margin:n="8px 0"}=e;return b.jsx("div",{style:{width:"auto",height:"0",borderTop:`${o}px solid ${r}`,margin:n}})};function er(){try{return"/"}catch{}try{if(typeof process<"u"&&process?.env?.PUBLIC_URL)return process.env.PUBLIC_URL}catch{}return"/"}const tr=({field:e,value:t})=>{const{language:r,t:o}=P(),n=e.alignment||"center",a={left:"flex-start",center:"center",right:"flex-end"},i=typeof t=="string"?t:"";let c=i&&i.trim()!==""?i:typeof e.defaultValue=="string"?e.defaultValue:"";c&&!c.startsWith("/")&&(c=`${er()}${c}`);const l=e.localized?.split(";").map(x=>x.trim()),[u,m]=s.useState(c||""),g=s.useRef(c||null);if(s.useEffect(()=>{if(!c)return;const x=c.split("/"),v=x.pop(),k=v.lastIndexOf(".");if(k===-1)return;const O=v.substring(0,k),S=v.substring(k);let C=null;l?.includes(r)&&(C=`${O}_${r}${S}`);const w=new AbortController;if(C){const R=[...x,C].join("/");fetch(R,{method:"HEAD",signal:w.signal}).then(E=>{const N=E.ok?R:c;N!==g.current&&(g.current=N,m(N))}).catch(()=>{c!==g.current&&(g.current=c,m(c))})}else{const R=c;R!==g.current&&(g.current=R,requestAnimationFrame(()=>m(R)))}return()=>{w.abort()}},[c,r,l]),!u)return null;const{width:f,height:p}=e,h={},d={borderRadius:"8px",objectFit:"contain",boxShadow:"0 2px 6px rgba(0,0,0,0.1)",margin:"0 0 8px 0"};return f&&p?(h.width=f,h.height=p,d.width=`${f}px`,d.height=`${p}px`):f&&!p?(h.width=f,d.width=`${f}px`,d.height="auto"):!f&&p&&(h.height=p,d.width="auto",d.height=`${p}px`),b.jsx(W,{field:e,children:b.jsx("div",{"data-testid":"image-wrapper",style:{display:"flex",justifyContent:a[n]||"center",margin:"0 0"},children:b.jsx("img",{src:u,alt:o?.(e.displayName||"Image")||e.displayName||"Image",...h,style:d})})})};function rr(e){return/^[-+]?\d*$/.test(e)}const nr=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,definitionName:a}=P(),i=s.useRef(null),c=s.useCallback(f=>{const p=parseInt(f,10);return Number.isNaN(p)?null:p},[]),l=s.useCallback(f=>{if(f.trim()==="")return e.required?n("Value required"):null;if(!rr(f))return n("Must be a valid integer");const p=c(f);if(p===null)return n("Must be a valid integer");if(e.min!==void 0&&(e.minInclusive?p<e.min:p<=e.min))return n("Must be {{1}} {{2}}",e.minInclusive?"≥":">",e.min);if(e.max!==void 0&&(e.maxInclusive?p>e.max:p>=e.max))return n("Must be {{1}} {{2}}",e.maxInclusive?"≤":"<",e.max);if(e.step!==void 0){const d=Number(e.step);if(!Number.isInteger(d))return n("Invalid step value");if(p%d!==0)return n("Must be a multiple of {{1}}",d)}return Y(a,e,p,n)??null},[e,a,n,c]),u=s.useRef(null),m=s.useRef(o);s.useEffect(()=>{m.current=o},[o]),s.useEffect(()=>{const f=String(t??""),p=l(f);p!==u.current&&(u.current=p,m.current?.(p??null)),i.current&&document.activeElement!==i.current&&(i.current.value=f)},[t,e,l,n]);const g=f=>{const p=f.target.value,h=l(p);r?.(p,h)};return b.jsx(W,{field:e,error:l(String(t??"")),children:b.jsx("input",{id:e.name,type:"text",defaultValue:String(t??""),ref:i,onChange:g,className:G(A.input,A.inputNumber)})})};function or(e){const t=/^-?\d+$/;return e.split(",").map(r=>r.trim()).every(r=>t.test(r))}const ar=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,definitionName:a}=P(),i=",",[c,l]=s.useState(Array.isArray(t)?t.join(i+" "):String(t??"")),u=h=>!h||h.trim()===""?[]:h.split(i).map(d=>d.trim()).filter(Boolean).map(d=>Number(d)),m=s.useCallback(h=>{if(h.trim()==="")return e.required?n("Value required"):null;if(!or(h))return n("Each value must be a valid integer");const d=u(h);if(e.minCount!==void 0&&d.length<e.minCount)return n("Minimum number of values: {{1}}",`${e.minCount}`);if(e.maxCount!==void 0&&d.length>e.maxCount)return n("Maximum number of values: {{1}}",`${e.maxCount}`);for(const v of d){if(e.min!==void 0&&(e.minInclusive?v<e.min:v<=e.min))return n("Each value must be {{1}} {{2}}",e.minInclusive?"≥":">",e.min);if(e.max!==void 0&&(e.maxInclusive?v>e.max:v>=e.max))return n("Each value must be {{1}} {{2}}",e.maxInclusive?"≤":"<",e.max)}return Y(a,e,d,n)??null},[a,e,n]),g=h=>{const d=h.target.value,x=m(d);l(d),r?.(d,x)},f=s.useRef(null),p=s.useRef(o);return s.useEffect(()=>{p.current=o},[o]),s.useEffect(()=>{const h=Array.isArray(t)?t.join(i+" "):String(t??""),d=m(h);d!==f.current&&(f.current=d,p.current?.(d??null))},[t,e.required,m,n]),b.jsx(W,{field:e,error:m(c),children:b.jsx("input",{type:"text",value:c,onChange:g,className:G(A.input,A.textInput),style:{flex:1}})})},sr=({field:e,value:t,onChange:r})=>{const{t:o,darkMode:n,formStyle:a,fieldStyle:i,definitionName:c}=P(),l=(w,R,E)=>{if(!R)return{};const I=w?.[R];return(E&&I?I[E]:void 0)??{}},u=s.useRef(null),[m,g]=s.useState(!1),[f,p]=s.useState(null),h=s.useMemo(()=>e.options.map(w=>({value:w.value,label:o(w.label)})),[e.options,o]),d=s.useMemo(()=>{const w=Array.isArray(t)?t:[],R=new Set(h.map(E=>E.value));return w.filter(E=>R.has(E))},[t,h]),x=w=>{const R=Array.isArray(w)?w:[];return e.required&&R.length===0?o("Value required"):Y(c,e,R,o)??null},v=()=>{if(!u.current)return;const w=u.current.getBoundingClientRect();p({x:w.left,y:w.bottom}),g(R=>!R)},k=w=>{const R=d.includes(w)?d.filter(N=>N!==w):[...d,w],E=x(R);r?.(R,E)},O=s.useMemo(()=>({height:"var(--reactaform-input-height, 2.5rem)",padding:"var(--reactaform-input-padding, 8px)",display:"flex",alignItems:"center",boxSizing:"border-box",cursor:"pointer",position:"relative",borderRadius:"var(--reactaform-border-radius, 4px)",border:"1px solid var(--reactaform-border-color, #ccc)",background:"var(--reactaform-secondary-bg, #fff)",color:"var(--reactaform-text-color, #000)",...l(a,"multiSelect","control"),...l(i,void 0,"control")}),[a,i]),S=s.useMemo(()=>({position:"absolute",right:"1.5em",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",fontSize:"0.8em",color:"var(--reactaform-text-muted, #999)",padding:0,...l(a,"multiSelect","clearButton"),...l(i,void 0,"clearButton")}),[a,i]),C=s.useMemo(()=>({position:"absolute",right:"0.7em",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",fontSize:"0.8em",color:"var(--reactaform-text-muted, #999)",...l(a,"multiSelect","arrow"),...l(i,void 0,"arrow")}),[a,i]);return b.jsxs("div",{children:[b.jsx(W,{field:e,error:null,children:b.jsx("div",{style:{width:"100%"},children:b.jsxs("div",{ref:u,className:"reactaform-multiselection-control",style:O,onClick:v,tabIndex:0,role:"button","aria-haspopup":"listbox","aria-expanded":m,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),v())},children:[b.jsxs("span",{style:{flex:1,color:"var(--reactaform-text-muted, #888)"},children:[d.length," / ",h.length," selected"]}),d.length>0&&b.jsx("button",{type:"button","aria-label":"Clear selections",onClick:w=>{w.stopPropagation(),r?.([],null)},style:S,children:b.jsx("span",{style:S,"aria-hidden":!0,children:"✖"})}),b.jsx("span",{style:C,"aria-hidden":!0,children:"▼"})]})})}),m&&f&&b.jsx(ir,{position:f,options:h,selectedValues:d,onToggleOption:k,onClose:()=>g(!1),controlRef:u,darkMode:n})]})},ir=({position:e,options:t,selectedValues:r,onToggleOption:o,onClose:n,controlRef:a,darkMode:i})=>{const c=s.useRef(null),[l,u]=s.useState(-1),{formStyle:m,fieldStyle:g}=P(),f=(w,R,E)=>{if(!R)return{};const I=w?.[R];return(E&&I?I[E]:void 0)??{}},p=s.useMemo(()=>({maxHeight:200,overflowY:"auto",background:"var(--reactaform-secondary-bg, #fff)",border:"1px solid var(--reactaform-border-color, #ccc)",borderRadius:4,zIndex:2e3,boxShadow:"var(--reactaform-shadow, 0 2px 8px rgba(0,0,0,0.15))",pointerEvents:"auto",color:"var(--reactaform-text-color, #000)",fontSize:"var(--reactaform-popup-font-size, 0.875rem)",...f(m,"multiSelect","popup"),...f(g,void 0,"popup")}),[m,g]),h=s.useMemo(()=>({padding:"6px 8px",cursor:"pointer",display:"flex",alignItems:"center",background:"transparent",color:"var(--reactaform-text-color, #000)",...f(m,"multiSelect","option"),...f(g,void 0,"option")}),[m,g]);s.useEffect(()=>{const w=R=>{const E=R.target;!c.current?.contains(E)&&!a.current?.contains(E)&&n()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[n,a]),s.useEffect(()=>{c.current&&t.length>0&&requestAnimationFrame(()=>u(w=>w===-1?0:w))},[t.length]),s.useEffect(()=>{if(!c.current||l<0)return;const w=c.current.querySelector(`#multi-opt-${l}`);w&&requestAnimationFrame(()=>w.focus())},[l]);const d=250,x=200,[v,k]=s.useState(null),[O,S]=s.useState(null);if(s.useEffect(()=>{if(typeof window>"u")return;const w=()=>{let N=e.x,I=e.y,M=d;const $=a?.current;if($){const V=$.getBoundingClientRect();N=V.left,I=V.bottom,M=Math.max(80,Math.round(V.width))}N=Math.min(N,window.innerWidth-M),I=Math.min(I,window.innerHeight-x),k({left:N,top:I}),S(M)};w(),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w);let R=null;const E=a?.current;return typeof ResizeObserver<"u"&&E&&(R=new ResizeObserver(()=>w()),R.observe(E)),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w),R&&E&&R.unobserve(E)}},[a,e.x,e.y]),typeof window>"u")return null;let C=document.getElementById("popup-root");return C||(C=document.createElement("div"),C.id="popup-root",document.body.appendChild(C)),Ae.createPortal(b.jsx("div",{ref:c,role:"listbox","aria-activedescendant":l>=0?`multi-opt-${l}`:void 0,style:{position:"absolute",top:v?v.top:e.y,left:v?v.left:e.x,width:O??d,...p},"data-reactaform-theme":i?"dark":"light",children:t.map((w,R)=>{const E=r.includes(w.value),N=i?"var(--reactaform-hover-bg, rgba(255,255,255,0.01))":"var(--reactaform-hover-bg, #eee)",I={...h,background:R===l?N:h.background};return b.jsxs("div",{id:`multi-opt-${R}`,onMouseDown:M=>{M.stopPropagation(),o(w.value)},onKeyDown:M=>{const $=t.length;switch(M.key){case"ArrowDown":M.preventDefault(),u(V=>(V+1)%$);break;case"ArrowUp":M.preventDefault(),u(V=>(V-1+$)%$);break;case"Home":M.preventDefault(),u(0);break;case"End":M.preventDefault(),u($-1);break;case"Enter":case" ":M.preventDefault(),M.stopPropagation(),o(w.value);break;case"Escape":M.preventDefault(),n(),a?.current?.focus();break}},tabIndex:R===l?0:-1,role:"option","aria-selected":E,style:I,onMouseEnter:M=>{M.currentTarget.style.background=N,u(R)},onMouseLeave:M=>{M.currentTarget.style.background="transparent",u($=>$===R?-1:$)},children:[b.jsx("input",{type:"checkbox",checked:E,readOnly:!0,style:{marginRight:8,width:"1.125em",height:"1.125em",verticalAlign:"middle",accentColor:i?"#10b981":"#22c55e",cursor:"pointer"}}),w.label]},w.value)})}),C)},cr=({field:e,value:t,onChange:r})=>{const{t:o,definitionName:n}=P(),a=e.layout?.toLowerCase()==="horizontal"?"row":"column",i=s.useRef(null),c=s.useCallback(u=>u===""||u===null||u===void 0?o("Value required"):!e.options||e.options.length===0?null:e.options.some(g=>g.value===u)?Y(n,e,u,o)??null:o("Invalid option selected"),[e,o,n]);s.useEffect(()=>{const u=t!=null?String(t):"",m=c(u);if(i.current){const g=Array.from(i.current.querySelectorAll("input[type=radio]"));if(m&&e.options&&e.options.length>0){const f=String(e.options[0].value);g.forEach(p=>p.checked=p.value===f),r?.(f,null)}else g.forEach(f=>f.checked=f.value===u)}},[t,c,r,e.options]);const l=u=>{const m=u.target.value,g=c(m);r?.(m,g)};return b.jsx(W,{field:e,error:c(String(t??"")),children:b.jsx("div",{style:{display:"flex",flexDirection:a,flexWrap:a==="row"?"wrap":"nowrap",gap:a==="row"?"12px":"4px",alignItems:a==="row"?"center":"flex-start",width:"100%"},ref:i,children:(e.options??[]).map(u=>b.jsxs("label",{style:{display:"flex",gap:"6px",alignItems:"center",whiteSpace:"nowrap"},children:[b.jsx("input",{type:"radio",name:e.name,value:String(u.value),defaultChecked:String(t??"")===String(u.value),onChange:l}),o(u.label)]},String(u.value)))})})},lr=({field:e,value:t,onChange:r})=>{const{t:o,definitionName:n}=P(),a=s.useRef(null),i=s.useCallback(l=>l===""||l===null||l===void 0?o("Value required"):!e.options||e.options.length===0?null:e.options.some(m=>m.value===l)?Y(n,e,l,o)??null:o("Invalid option selected"),[e,o,n]);s.useEffect(()=>{const l=t!=null?String(t):"";if(i(l)&&e.options&&e.options.length>0){const m=String(e.options[0].value);a.current&&(a.current.value=m),r?.(m,null)}else a.current&&(a.current.value=l)},[t,i,r,e.options]);const c=l=>{const u=l.target.value,m=i(u);r?.(u,m)};return b.jsx(W,{field:e,error:i(String(t??"")),children:b.jsx("select",{defaultValue:String(t??""),ref:a,onChange:c,className:G(A.input,A.inputSelect),children:(e.options??[]).map(l=>b.jsx("option",{value:String(l.value),children:o(l.label)},String(l.value)))})})},ur=({field:e,value:t,onChange:r,onError:o})=>{const{t:n}=P(),a=s.useRef(null),{definitionName:i}=P(),c=s.useCallback(g=>{const f=String(g??"").trim();if(f==="")return e.required?n("Value required"):null;if(e.pattern)try{if(!new RegExp(e.pattern).test(f))return n("Phone number does not match pattern: {{1}}",`${e.pattern}`)}catch{}return Y(i,e,f,n)},[i,e,n]),l=s.useRef(null),u=s.useRef(o);s.useEffect(()=>{u.current=o},[o]),s.useEffect(()=>{const g=String(t??""),f=c(g);a.current&&a.current.value!==String(g)&&(a.current.value=String(g)),f!==l.current&&(l.current=f,u.current?.(f??null))},[t,c]);const m=g=>{const f=g.target.value,p=f.trim();let h=null;if(p===""){h=e.required?n("Value required"):null,r?.(f,h);return}!h&&e.pattern&&!new RegExp(e.pattern).test(p)&&(h=n("Phone number does not match pattern: {{1}}",`${e.pattern}`)),r?.(f,h)};return b.jsx(W,{field:e,error:c(String(t??"")),children:b.jsx("input",{type:"tel",defaultValue:String(t??""),ref:a,onChange:m,className:G(A.input,A.textInput)})})},fr=/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/;function mr(e){return fr.test(e)}const dr=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,definitionName:a}=P(),i=s.useRef(null),c=s.useRef(null),l=s.useCallback(h=>{let d=null;if(h.trim()==="")return n("Value required");if(!mr(h))return n("Invalid number");const x=Number(h);return typeof e.min=="number"&&x<e.min?n("Value should be at least {{1}}",e.min):typeof e.max=="number"&&x>e.max?n("Value should be at most {{1}}",e.max):(d||(d=Y(a,e,x,n)),d)},[a,e,n]),u=s.useRef(null),m=s.useRef(o);s.useEffect(()=>{m.current=o},[o]),s.useEffect(()=>{const h=String(t),d=l(h);c.current&&document.activeElement!==c.current&&(c.current.value=isNaN(Number(h))?String(e.min??0):String(Number(h))),i.current&&document.activeElement!==i.current&&(i.current.value=h),d!==u.current&&(u.current=d,m.current?.(d??null))},[t,l,e.min]);const g=e.min??0,f=e.max??100,p=h=>{const d=h.target.value,x=l(d);r?.(d,x)};return b.jsx(W,{field:e,error:l(String(t??"")),children:b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",width:"100%"},children:[b.jsx("input",{ref:c,type:"range",defaultValue:isNaN(Number(t))?String(g):String(Number(t)),onChange:p,min:g,max:f,style:{padding:"0px, 0px",flex:1},className:A.rangeInput}),b.jsx("input",{ref:i,type:"text",defaultValue:String(t??""),onChange:p,required:!0,style:{width:"40px",minWidth:"40px",height:"2.3em",textAlign:"center",flexShrink:0},className:G(A.input,A.textInput)})]})})},Ue=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,definitionName:a}=P(),i=s.useRef(null),c=s.useRef(null),l=s.useRef(o);s.useEffect(()=>{l.current=o},[o]);const u=s.useMemo(()=>e.pattern?new RegExp(e.pattern):null,[e.pattern]),m=s.useCallback(f=>f.trim()===""?e.required?n("Value required"):null:e.minLength!==void 0&&f.length<e.minLength?n("Must be at least {{1}} characters",e.minLength):e.maxLength!==void 0&&f.length>e.maxLength?n("Must be at most {{1}} characters",e.maxLength):u&&!u.test(f)?n("Input does not match pattern: {{1}}",e.pattern):Y(a,e,f,n),[e,a,n,u]),g=f=>{const p=f.target.value,h=m(p);r?.(p,h)};return s.useEffect(()=>{const f=m(t);i.current&&i.current.value!==String(t??"")&&(i.current.value=String(t??"")),f!==c.current&&(c.current=f,l.current?.(f??null))},[t,m]),b.jsx(W,{field:e,error:m(String(t??"")),children:b.jsx("input",{id:e.name,type:"text",defaultValue:String(t??""),ref:i,onChange:g,className:G(A.input,A.textInput)})})},pr=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,definitionName:a}=P(),i=s.useRef(null),c=s.useRef(o),l=e.includeSeconds??!0;s.useEffect(()=>{c.current=o},[o]);const u=s.useCallback(g=>{if(!g||g.trim()==="")return e.required||e.min||e.max?n("Value required"):null;const f=d=>{const x=d.split(":").map(k=>parseInt(k,10));if(x.some(k=>Number.isNaN(k)))return NaN;let v=0;if(x.length===3)v=x[0]*3600+x[1]*60+x[2];else if(x.length===2)v=x[0]*3600+x[1]*60;else if(x.length===1)v=x[0]*3600;else return NaN;return v},p=f(g);if(Number.isNaN(p))return n("Invalid time format");if(e.min&&typeof e.min=="string"){const d=f(e.min);if(!Number.isNaN(d)&&p<d)return n("Time must be on or after {{1}}",e.min)}if(e.max&&typeof e.max=="string"){const d=f(e.max);if(!Number.isNaN(d)&&p>d)return n("Time must be on or before {{1}}",e.max)}return Y(a,e,g,n)??null},[e,a,n]),m=g=>{const f=g.target.value,p=u(f);r?.(f,p)};return s.useEffect(()=>{const g=u(t);g!==i.current&&(i.current=g,c.current?.(g??null))},[t,u]),b.jsx(W,{field:e,error:u(t),children:b.jsx("input",{id:e.name,type:"time",value:t,step:l?1:60,onChange:m,min:typeof e.min=="string"?e.min:void 0,max:typeof e.max=="string"?e.max:void 0,className:G(A.input,A.textInput)})})};function ft({pos:e,options:t,onClose:r,onClickOption:o}){const n=s.useRef(null),a=s.useRef(!1),i=typeof window<"u"?document.getElementById("popup-root")||document.body:null;if(s.useEffect(()=>{function p(h){a.current||h.target.dataset?.popupMenu==="item"||n.current&&h.target instanceof Node&&!n.current.contains(h.target)&&r()}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[r]),!i||t===void 0||t.length===0||!e||e.x==null||e.y==null)return null;const c=e.x,l=e.y,u=typeof window<"u"?window.innerWidth:1024,m=Math.max(0,u-160),g=Math.max(0,Math.min(c,m)),f=Math.max(0,l);return Ae.createPortal(b.jsx("div",{ref:n,onMouseDown:p=>{p.stopPropagation()},style:{position:"fixed",top:f,left:g,backgroundColor:"var(--reactaform-primary-bg, #fff)",border:"1px solid var(--reactaform-border-color, #ccc)",borderRadius:"var(--reactaform-border-radius, 4px)",boxShadow:"var(--reactaform-shadow, 0 2px 10px rgba(0,0,0,0.2))",zIndex:9999,minWidth:"var(--reactaform-menu-min-width, 150px)",pointerEvents:"auto"},children:t.map((p,h)=>b.jsx("div",{"data-popup-menu":"item",onMouseDown:d=>{d.stopPropagation(),a.current=!0},onClick:d=>{d.stopPropagation(),d.preventDefault(),o(p),r(),setTimeout(()=>{a.current=!1},100)},style:{padding:"var(--reactaform-menu-item-padding, 8px 12px)",cursor:"pointer",fontSize:"var(--reactaform-menu-item-font-size, 0.8em)",borderBottom:h<t.length-1?"1px solid var(--reactaform-border-light, #eee)":void 0,transition:"background-color 0.15s ease"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--reactaform-hover-bg, #e0e0e0)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:p.label},p.label??h))}),i)}const ze={length:["m","cm","mm","km","in","ft","yd","mi"],area:["m^2","cm^2","mm^2","in^2","ft^2","yd^2"],volume:["L","m^3","cm^3","mL","in^3","ft^3","yd^3"],weight:["kg","g","mg","t","lb","oz"],time:["min","s","h","ms","d"],temperature:["C","F","K"],angle:["deg","rad","rev"]},Ve={length:{m:"Meter (m)",mm:"Millimeter (mm)",cm:"Centimeter (cm)",km:"Kilometer (km)",in:"Inch (in)",ft:"Foot (ft)",yd:"Yard (yd)",mi:"Mile (mi)"},area:{"m^2":"Square meter (m^2)","mm^2":"Square millimeter (mm^2)","cm^2":"Square centimeter (cm^2)","in^2":"Square inch (in^2)","ft^2":"Square foot (ft^2)","yd^2":"Square yard (yd^2)"},volume:{L:"Liter (L)","cm^3":"Cubic centimeter (cm^3)","m^3":"Cubic meter (m^3)",mL:"Milliliter (mL)","in^3":"Cubic inch (in^3)","ft^3":"Cubic foot (ft^3)","yd^3":"Cubic yard (yd^3)"},weight:{kg:"Kilogram (kg)",g:"Gram (g)",mg:"Milligram (mg)",t:"Tonne (t)",lb:"Pound (lb)",oz:"Ounce (oz)"},time:{s:"Second (s)",min:"Minute (min)",h:"Hour (h)",ms:"Millisecond (ms)",d:"Day (d)",wk:"Week (wk)"},temperature:{C:"Celsius (C)",F:"Fahrenheit (F)",K:"Kelvin (K)"},angle:{deg:"Degree (deg)",rad:"Radian (rad)",rev:"Revolution (rev)"}},$e={length:{mm:1e3,cm:100,m:1,km:.001,in:100/2.54,ft:100/(2.54*12),yd:100/(2.54*36),mi:1/1609.344},area:{"m^2":1,"mm^2":1e6,"cm^2":1e4,"km^2":1/1e6,"in^2":(100/2.54)**2,"ft^2":(100/(2.54*12))**2,"yd^2":(100/(2.54*36))**2},volume:{"cm^3":1e6,"m^3":1,L:1,mL:1e6,"in^3":(100/2.54)**3,"ft^3":(100/(2.54*12))**3,"yd^3":(100/(2.54*36))**3},weight:{mg:1e6,g:1e3,kg:1,t:.001,lb:1/.45359237,oz:1/.028349523125},time:{ms:1e3,s:1,min:1/60,h:1/3600,d:1/86400,wk:1/604800},temperature:{C:1,F:33.8,K:274.15},angle:{deg:1,rad:Math.PI/180,rev:1/360}},Te={},gr=new Set([...Object.keys(ze),...Object.keys(Ve),...Object.keys($e)]);for(const e of gr){const t={},r=ze[e]??[],o=Ve[e]??{},n=$e[e]??{};for(const a of r){const i=o[a];t[a]={name:typeof i=="string"?i:String(a),shortName:a,factor:Object.prototype.hasOwnProperty.call(n,a)?n[a]:void 0}}for(const[a,i]of Object.entries(o))if(!t[a]){const c=typeof i=="string"?i:String(a);t[a]={name:c,shortName:a,factor:Object.prototype.hasOwnProperty.call(n,a)?n[a]:void 0}}for(const[a,i]of Object.entries(n))t[a]||(t[a]={name:String(a),shortName:String(a),factor:i});Te[e]=t}const hr=Object.freeze(Object.defineProperty({__proto__:null,dimensionUnitDisplayMap:Ve,dimensionUnitsMap:ze,dimensonUnitFactorsMap:$e,unitsByDimension:Te},Symbol.toStringTag,{value:"Module"})),he={};function br(e,t){if(e in he)return;const r=Te[e]??{},o={},n={},a={};for(const[c,l]of Object.entries(r))typeof l.factor=="number"&&(o[c]=l.factor),n[c]=t(c),a[t(c)]=c;const i=Object.keys(r)[0]??"";he[e]={default:i,factors:o,labels:n,reverseLabels:a}}function yr(e,t,r){if(e==="C"){if(t==="F")return r*(9/5)+32;if(t==="K")return r+273.15}else if(e==="F"){if(t==="C")return(r-32)*5/9;if(t==="K")return(r-32)*5/9+273.15}else if(e==="K"){if(t==="C")return r-273.15;if(t==="F")return(r-273.15)*9/5+32}return r}function xr(e,t,r){if(!Number.isFinite(e))return[];if(r===he.temperature)return Object.keys(r.labels).map(a=>{const i=yr(t,a,e);return Number.isFinite(i)?{label:`${i.toFixed(6)} ${a}`,value:i.toString(),unit:a}:{label:`${String(i)} ${a}`,value:String(i),unit:a}});const n=r.factors[t];return n===void 0?[]:Object.entries(r.factors).map(([a,i])=>{const c=e/n*i;return Number.isFinite(c)?{label:`${c.toFixed(6)} ${a}`,value:c.toString(),unit:a}:{label:`${String(c)} ${a}`,value:String(c),unit:a}})}function xe(e,t){return e in t.labels?e:t.reverseLabels&&t.reverseLabels[e]?t.reverseLabels[e]:null}const vr=/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/,wr=({unitFactors:e,field:t,value:r,onChange:o,onError:n})=>{const{t:a,definitionName:i}=P(),c=s.useRef(null),l=s.useRef(null),u=s.useRef(null),[m,g]=s.useState(null),[f,p]=s.useState(null),[h,d]=s.useState(!1),[x,v]=s.useState(null),[k,O]=s.useState([]),S=s.useCallback((D,F)=>{if(!D||D.trim()==="")return t.required?a("Value required"):null;if(!vr.test(D))return a("Must be a valid number");const y=Y(i,t,[D,F],a);return y||null},[i,t,a]),C=e.reverseLabels!==void 0?e.reverseLabels:Object.fromEntries(Object.entries(e.labels).map(([D,F])=>[F,D]));s.useEffect(()=>{const D=String(r[0]);let F=r[1]??e.default;F=xe(F,e)||F;const y=document.activeElement;y===c.current||y===l.current||(c.current&&(c.current.value=D),l.current&&(l.current.value=F),u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),u.current=requestAnimationFrame(()=>{u.current=null,g(null),p(null)}))},[r,e]),s.useEffect(()=>()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)},[]);const w=s.useRef(null),R=s.useRef(n);s.useEffect(()=>{R.current=n},[n]),s.useEffect(()=>{const D=String(r[0]);let F=r[1]??e.default;F=xe(F,e)||F;const y=S(D,F);y!==w.current&&(w.current=y,R.current?.(y??null))},[r,e,S]);const E=(D,F,y)=>{const j=C[F]||F;o?.([D,j],y)},N=D=>{const F=D.target.value,y=l.current?l.current.value:e.default,j=S(F,y);g(F),E(F,y,j)},I=D=>{const F=D.target.value,y=c.current?c.current.value:String(r[0]??""),j=S(y,F);p(F),l.current&&(l.current.value=F),E(y,F,j)},M=D=>{const F=c.current?c.current.value:String(r[0]??""),y=parseFloat(F),j=l.current?l.current.value:e.default;if(S(F,j)||!F.trim()||!Number.isFinite(y))return;const q=D.currentTarget.getBoundingClientRect(),Z=q.left,ee=q.bottom;v({x:Z,y:ee});const H=xr(y,j,e);if(H.length===0){O([]),d(!1);return}O(H),d(Q=>!Q)},$=D=>{const{value:F,unit:y}=D;d(!1),v(null),c.current&&(c.current.value=F),l.current&&(l.current.value=y),g(F),p(y);const j=S(F,y);E(F,y,j)},V=String(r[0]??""),L=xe(r[1]??e.default,e)||(r[1]??e.default),U=m??V,K=!!S(U,f??L)||!U.trim(),se={width:"var(--reactaform-unit-btn-width, 2.5em)",height:"var(--reactaform-unit-btn-height, 2.5em)",padding:"var(--reactaform-unit-btn-padding, 0)",border:"none",borderRadius:"var(--reactaform-button-border-radius, var(--reactaform-border-radius, 0.25em))",backgroundColor:K?"var(--reactaform-button-disabled-bg, #cccccc)":"var(--reactaform-button-bg, var(--reactaform-success-color))",color:"var(--reactaform-button-text, #ffffff)",cursor:K?"var(--reactaform-button-disabled-cursor, not-allowed)":"pointer",opacity:K?+"var(--reactaform-button-disabled-opacity, 0.6)":1,display:"flex",alignItems:"center",justifyContent:"center"};return b.jsx(W,{field:t,error:S(V,L),children:b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--reactaform-unit-gap, 8px)",width:"100%"},children:[b.jsx("input",{type:"text",ref:c,defaultValue:String(r[0]??""),onChange:N,style:{width:"var(--reactaform-unit-input-width, 100px)"},className:G(A.input,A.textInput)}),b.jsx("select",{ref:l,defaultValue:xe(r[1]??e.default,e)||(r[1]??e.default),onChange:I,className:G(A.input,A.inputSelect),children:Object.keys(e.labels).map(D=>b.jsx("option",{value:D,children:e.labels[D]??D},D))}),b.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[b.jsx("button",{onClick:M,"aria-disabled":K,disabled:K,style:se,className:A.button,children:b.jsx("span",{style:{fontSize:"var(--reactaform-unit-btn-icon-size, 1em)",lineHeight:"1",transform:"translateY(-1px)",pointerEvents:"none"},children:"⟷"})}),h&&k&&b.jsx(ft,{pos:x,options:k,onClose:()=>{v(null),d(!1)},onClickOption:$})]})]})})};function Sr({field:e,value:t,onChange:r}){const{t:o}=P(),n=e.dimension;if(!n)return null;he[n]||br(n,o);const a=he[n];return a?b.jsx(wr,{unitFactors:a,field:e,value:t,onChange:r}):null}const Cr={display:"flex",gap:4},Rr={cursor:"pointer",fontSize:"1.5rem",lineHeight:1,display:"inline-block",marginRight:"0.25rem",userSelect:"none",transition:"color 0.12s ease"},Er=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,definitionName:a}=P(),[i,c]=s.useState(null),l=e.max||5,u=s.useCallback(h=>e.required&&h===0?n("Value required"):Y(a,e,h,n)??null,[e,n,a]),m=s.useRef(null),g=s.useRef(o);s.useEffect(()=>{g.current=o},[o]),s.useEffect(()=>{let h=t||0;t<0&&(h=0),t>l&&(h=l);const d=u(h);d!==m.current&&(m.current=d,g.current?.(d??null))},[t,u,l]);const f=h=>{const d=u(h);r?.(h,d)},p=(()=>{let h=t||0;return h<0&&(h=0),h>l&&(h=l),h})();return b.jsx(W,{field:e,error:u(p),children:b.jsx("div",{style:Cr,children:(()=>{const h=e.icon,d=h&&String(h).trim()?String(h):"★";return[...Array(l)].map((x,v)=>{const k=v<p,S=i!==null&&v<=i||k?"gold":"lightgray";return b.jsx("span",{onClick:()=>f(v+1),onMouseEnter:()=>c(v),onMouseLeave:()=>c(null),style:{...Rr,color:S},"aria-label":`Rating ${v+1}`,title:n(`${e.displayName} ${v+1}`),children:d},v)})})()})})},jr=({field:e,value:t,onChange:r})=>{const{t:o,definitionName:n}=P(),[a,i]=s.useState(!1),[c,l]=s.useState(null),[u,m]=s.useState([]),g=s.useRef(null),f=s.useCallback(x=>e.required&&(!x||Array.isArray(x)&&x.length===0)?o("Value required"):Y(n,e,x,o)??null,[e,n,o]),p=s.useMemo(()=>f(t),[t,f]);s.useEffect(()=>{const x=f(t);r?.(t,x)},[t,f]);const h=x=>{const v=x.target.files;let k=null;v&&v.length>0&&(k=e.multiple?Array.from(v):v[0]);const O=f(k);r?.(k,O)},d=x=>{if(p)return;let v=null;try{v=x.currentTarget.getBoundingClientRect()}catch{v=null}const k=v&&typeof v.left=="number"?v.left:10,O=v&&typeof v.bottom=="number"?v.bottom:20;l({x:k,y:O});let S=[];Array.isArray(t)?S=t?t.map(C=>({label:C.name})):[]:S=t?[{label:t.name}]:[],S.length===0&&(S=[{label:o("No file selected")}]),m(S),i(C=>!C)};return b.jsx(W,{field:e,error:p,children:b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--reactaform-field-gap, 8px)",width:"100%"},children:[b.jsx("input",{id:e.name,ref:g,type:"file",accept:e.accept,multiple:e.multiple,style:{width:0,height:0,opacity:0,position:"absolute",zIndex:-1},onChange:h}),b.jsx("label",{htmlFor:e.name,className:A.button,style:{width:"100%",height:"inherit",textAlign:"center"},children:e.multiple?o("Choose Files..."):o("Choose File...")}),b.jsx("button",{onClick:d,"aria-haspopup":!0,"aria-expanded":a,"aria-label":o("Show selected files"),className:A.button,style:{height:"inherit",display:"inline-block"},children:b.jsx("span",{children:"⋮"})}),a&&c&&u&&u.length>0&&b.jsx(ft,{pos:c,options:u,onClose:()=>{l(null),i(!1)},onClickOption:()=>{}})]})})},kr=/^(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]$/i,Ir=e=>{try{return new URL(e),!0}catch{return!1}},Nr=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,definitionName:a}=P(),i=s.useRef(null),c=s.useCallback(g=>{const f=g.trim();return f===""?e.required?n("Value required"):null:!kr.test(f)&&!Ir(f)?n("Must be a valid URL"):Y(a,e,f,n)??null},[a,e,n]),l=g=>{const f=g.target.value,p=c(f);r?.(f.trim(),p)},u=s.useRef(null),m=s.useRef(o);return s.useEffect(()=>{m.current=o},[o]),s.useEffect(()=>{const g=t??"",f=c(g);i.current&&i.current.value!==String(g)&&(i.current.value=String(g)),f!==u.current&&(u.current=f,m.current?.(f??null))},[t,c]),b.jsx(W,{field:e,error:c(String(t??"")),children:b.jsx("input",{id:e.name,type:"url",defaultValue:String(t??""),ref:i,onChange:l,style:{alignItems:"left"},className:G(A.input,A.textInput),placeholder:"https://example.com"})})},Or=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,definitionName:a}=P(),i=s.useRef(null),c=e.min??void 0,l=e.max??void 0,u=Math.max(1,Math.round(e.step??1)),m=s.useCallback(d=>isNaN(d)?n("Must be a valid integer"):Number.isInteger(d)?c!==void 0&&d<c?n("Must be �?{{1}}",c):l!==void 0&&d>l?n("Must be �?{{1}}",l):Y(a,e,d,n)??null:n("Must be an integer"),[a,e,n,c,l]),g=s.useRef(null),f=s.useRef(o);s.useEffect(()=>{f.current=o},[o]),s.useEffect(()=>{if(document.activeElement===i.current)return;const x=String(t),v=m(t);i.current&&(i.current.value=x),v!==g.current&&(g.current=v,f.current?.(v??null))},[t,m]);const p=d=>{if(d.trim()==="")return e.required?n("Value required"):null;const v=Number(d);return m(v)},h=d=>{const x=d.target.value,v=d.target.valueAsNumber,k=p(x);r?.(v,k)};return b.jsx(W,{field:e,error:p(String(t??"")),children:b.jsx("input",{ref:i,id:e.name,type:"number",defaultValue:String(t??""),min:c,max:l,step:u,onChange:h,style:{width:"100%",height:"100%"},className:A.input})})},Mr=({field:e,value:t,onChange:r,onError:o})=>{const{t:n,definitionName:a}=P(),i=e.minHeight??"80px",c=s.useRef(null),l=s.useRef(null),u=s.useRef(o);s.useEffect(()=>{u.current=o},[o]);const m=s.useCallback(p=>p.trim()===""?e.required?n("Value required"):null:e.minLength!==void 0&&p.length<e.minLength?n("Must be at least {{1}} characters",e.minLength):e.maxLength!==void 0&&p.length>e.maxLength?n("Must be at most {{1}} characters",e.maxLength):Y(a,e,p,n),[e,a,n]),g=p=>{const h=p.target.value,d=m(h);r?.(h,d)};s.useEffect(()=>{const p=m(t);p!==l.current&&(l.current=p,u.current?.(p??null)),c.current&&c.current.value!==String(t??"")&&(c.current.value=String(t??""))},[t,m]);const f={defaultValue:String(t??""),ref:c,onChange:g,style:{resize:"vertical",minHeight:i,width:"100%",boxSizing:"border-box"},className:G(A.input,A.textInput)};return b.jsx(W,{field:e,error:m(t),children:b.jsx("textarea",{...f})})},ke=new we,Ar=new Set(["checkbox","switch","dropdown","radio","multi-selection","slider","stepper","color","rating"]);function mt(e,t){if(Ar.has(e)){ke.register(e,t);return}const r=o=>{const{callback:a,cancel:i}=tt((...c)=>{const l=o.onChange;typeof l=="function"&&l(...c)},200);return s.useEffect(()=>()=>{i()},[i]),s.createElement(t,{...o,onChange:a})};ke.register(e,r)}function Pe(e){return ke.get(e)}let Ye=!1;function dt(){if(Ye)return;Object.entries({checkbox:Ft,color:_t,date:Bt,dropdown:lr,email:Wt,file:jr,float:Jt,"float-array":Zt,image:tr,int:nr,"int-array":ar,"multi-selection":sr,multiline:Mr,phone:ur,radio:cr,rating:Er,separator:Qt,slider:dr,string:Ue,stepper:Or,switch:Dt,text:Ue,time:pr,unit:Sr,url:Nr}).forEach(([t,r])=>{mt(t,r)}),Ye=!0}const pt=new we;function gt(e,t){pt.register(e,t)}function Fr(e){return pt.get(e)}gt("Preset_AlertSubmitHandler",(e,t,r)=>{const o={name:t||"Unnamed Instance",version:e.version,definition:e.name,values:r},n=JSON.stringify(o,null,2);alert(n)});const zr=(e,t)=>{const r=new Map;let o=null,n=null,a=0;for(const i of e){const c=i.group;if(!c){o=null,n=null;continue}if(c===o)t[i.name].group=n??c;else{if(!r.has(c))r.set(c,1),n=null,t[i.name].group=c;else{const l=r.get(c),u=`${c}(${l})`;r.set(c,l+1),n=u,t[i.name].group=u,a++}o=c}}return a},ht=(e,t={})=>{const{includeEmpty:r=!0}=t,o=[];let n=null,a=[],i=0;for(const l of e){const u=l.group||null;u!==n?((a.length>0||r)&&(a.length===0&&i++,o.push({name:n,fields:a})),n=u,a=[l]):a.push(l)}(a.length>0||r)&&(a.length===0&&i++,o.push({name:n,fields:a}));const c=Math.max(0,...o.map(l=>l.fields.length));return{groups:o,metadata:{totalGroups:o.length,emptyGroups:i,largestGroup:c}}},bt=s.memo(({field:e,value:t,handleChange:r,handleError:o})=>{const n=Pe(e.type),a=s.useCallback((c,l)=>r(e.name,c,l),[r,e.name]),i=s.useCallback(c=>o?.(e.name,c),[o,e.name]);return n?b.jsx(n,{field:e,value:t,onChange:a,onError:i}):null},(e,t)=>e.field===t.field&&e.value===t.value&&e.handleChange===t.handleChange&&e.handleError===t.handleError);bt.displayName="FieldWrapper";const yt=(e,t,r,o)=>b.jsx(bt,{field:e,value:t[e.name],handleChange:r,handleError:o},e.name),xt=s.memo(({groupName:e,isOpen:t,fields:r,valuesMap:o,handleChange:n,handleError:a,toggleGroup:i,t:c})=>{const l=s.useCallback(()=>i(e),[i,e]),{formStyle:u,fieldStyle:m}=P(),g=s.useMemo(()=>({border:"1px solid var(--reactaform-border-color, #bbb)",padding:"var(--reactaform-fieldset-padding, 0.5em)",borderRadius:"var(--reactaform-border-radius, 4px)",marginBottom:"var(--reactaform-space, 8px)",...u?.fieldset||{},...m?.fieldset||{}}),[u,m]),f=s.useMemo(()=>({fontWeight:"bold",cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0 var(--reactaform-space, 8px)",color:"var(--reactaform-text-color, inherit)",...u?.legend||{},...m?.legend||{}}),[u,m]);return b.jsxs("fieldset",{style:g,children:[b.jsxs("legend",{onClick:l,style:f,children:[b.jsx("span",{children:c(e)}),b.jsx("span",{children:t?"▼":"▶"})]}),t&&r.map(p=>b.jsx("div",{children:yt(p,o,n,a)},p.name))]})});xt.displayName="FieldGroup";const Vr=(e,t,r,o,n,a,i,c,l)=>{const u=t.slice(0,c).filter(p=>i[p.name]),g=ht(u).groups,f=[];return g.forEach(p=>{if(p.name){const h=e[p.name]??!0;f.push(b.jsx(xt,{groupName:p.name,isOpen:h,fields:p.fields,valuesMap:r,handleChange:n,handleError:a,toggleGroup:l,t:o},p.name))}else p.fields.forEach(h=>f.push(b.jsx("div",{children:yt(h,r,n,a)},h.name)))}),f},be=typeof window<"u"?s.useLayoutEffect:s.useEffect;function Je(e){if(e!==void 0)switch(typeof e){case"number":return e;case"string":{if(e.endsWith("px"))return parseFloat(e);break}}}function $r({box:e,defaultHeight:t,defaultWidth:r,disabled:o,element:n,mode:a,style:i}){const{styleHeight:c,styleWidth:l}=s.useMemo(()=>({styleHeight:Je(i?.height),styleWidth:Je(i?.width)}),[i?.height,i?.width]),[u,m]=s.useState({height:t,width:r}),g=o||c!==void 0||a==="only-width"||c!==void 0&&l!==void 0;return be(()=>{if(n===null||g)return;const f=new ResizeObserver(p=>{for(const h of p){const{contentRect:d,target:x}=h;n===x&&m(v=>v.height===d.height&&v.width===d.width?v:{height:d.height,width:d.width})}});return f.observe(n,{box:e}),()=>{f?.unobserve(n)}},[e,g,n,c,l]),s.useMemo(()=>({height:c??u.height,width:l??u.width}),[u,c,l])}function Tr(e){const t=s.useRef(()=>{throw new Error("Cannot call during render.")});return be(()=>{t.current=e},[e]),s.useCallback(r=>t.current?.(r),[t])}function Ee({containerElement:e,direction:t,isRtl:r,scrollOffset:o}){return o}function ne(e,t="Assertion error"){if(!e)throw console.error(t),Error(t)}function ge(e,t){if(e===t)return!0;if(!!e!=!!t||(ne(e!==void 0),ne(t!==void 0),Object.keys(e).length!==Object.keys(t).length))return!1;for(const r in e)if(!Object.is(t[r],e[r]))return!1;return!0}function vt({cachedBounds:e,itemCount:t,itemSize:r}){if(t===0)return 0;if(typeof r=="number")return t*r;{const o=e.get(e.size===0?0:e.size-1);ne(o!==void 0,"Unexpected bounds cache miss");const n=(o.scrollOffset+o.size)/e.size;return t*n}}function Pr({align:e,cachedBounds:t,index:r,itemCount:o,itemSize:n,containerScrollOffset:a,containerSize:i}){if(r<0||r>=o)throw RangeError(`Invalid index specified: ${r}`,{cause:`Index ${r} is not within the range of 0 - ${o-1}`});const c=vt({cachedBounds:t,itemCount:o,itemSize:n}),l=t.get(r),u=Math.max(0,Math.min(c-i,l.scrollOffset)),m=Math.max(0,l.scrollOffset-i+l.size);switch(e==="smart"&&(a>=m&&a<=u?e="auto":e="center"),e){case"start":return u;case"end":return m;case"center":return l.scrollOffset<=i/2?0:l.scrollOffset+l.size/2>=c-i/2?c-i:l.scrollOffset+l.size/2-i/2;case"auto":default:return a>=m&&a<=u?a:a<m?m:u}}function Ge({cachedBounds:e,containerScrollOffset:t,containerSize:r,itemCount:o,overscanCount:n}){const a=o-1;let i=0,c=-1,l=0,u=-1,m=0;for(;m<a;){const g=e.get(m);if(g.scrollOffset+g.size>t)break;m++}for(i=m,l=Math.max(0,i-n);m<a;){const g=e.get(m);if(g.scrollOffset+g.size>=t+r)break;m++}return c=Math.min(a,m),u=Math.min(o-1,c+n),i<0&&(i=0,c=-1,l=0,u=-1),{startIndexVisible:i,stopIndexVisible:c,startIndexOverscan:l,stopIndexOverscan:u}}function Dr({itemCount:e,itemProps:t,itemSize:r}){const o=new Map;return{get(n){for(ne(n<e,`Invalid index ${n}`);o.size-1<n;){const i=o.size;let c;switch(typeof r){case"function":{c=r(i,t);break}case"number":{c=r;break}}if(i===0)o.set(i,{size:c,scrollOffset:0});else{const l=o.get(i-1);ne(l!==void 0,`Unexpected bounds cache miss for index ${n}`),o.set(i,{scrollOffset:l.scrollOffset+l.size,size:c})}}const a=o.get(n);return ne(a!==void 0,`Unexpected bounds cache miss for index ${n}`),a},set(n,a){o.set(n,a)},get size(){return o.size}}}function Lr({itemCount:e,itemProps:t,itemSize:r}){return s.useMemo(()=>Dr({itemCount:e,itemProps:t,itemSize:r}),[e,t,r])}function _r({containerSize:e,itemSize:t}){let r;switch(typeof t){case"string":{ne(t.endsWith("%"),`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`),ne(e!==void 0,"Container size must be defined if a percentage item size is specified"),r=e*parseInt(t)/100;break}default:{r=t;break}}return r}function qr({containerElement:e,containerStyle:t,defaultContainerSize:r=0,direction:o,isRtl:n=!1,itemCount:a,itemProps:i,itemSize:c,onResize:l,overscanCount:u}){const[m,g]=s.useState({startIndexVisible:0,startIndexOverscan:0,stopIndexVisible:-1,stopIndexOverscan:-1}),{startIndexVisible:f,startIndexOverscan:p,stopIndexVisible:h,stopIndexOverscan:d}={startIndexVisible:Math.min(a-1,m.startIndexVisible),startIndexOverscan:Math.min(a-1,m.startIndexOverscan),stopIndexVisible:Math.min(a-1,m.stopIndexVisible),stopIndexOverscan:Math.min(a-1,m.stopIndexOverscan)},{height:x=r,width:v=r}=$r({defaultHeight:r,defaultWidth:void 0,element:e,mode:"only-height",style:t}),k=s.useRef({height:0,width:0}),O=x,S=_r({containerSize:O,itemSize:c});s.useLayoutEffect(()=>{if(typeof l=="function"){const I=k.current;(I.height!==x||I.width!==v)&&(l({height:x,width:v},{...I}),I.height=x,I.width=v)}},[x,l,v]);const C=Lr({itemCount:a,itemProps:i,itemSize:S}),w=s.useCallback(I=>C.get(I),[C]),R=s.useCallback(()=>vt({cachedBounds:C,itemCount:a,itemSize:S}),[C,a,S]),E=s.useCallback(I=>{const M=Ee({containerElement:e,direction:o,isRtl:n,scrollOffset:I});return Ge({cachedBounds:C,containerScrollOffset:M,containerSize:O,itemCount:a,overscanCount:u})},[C,e,O,o,n,a,u]);be(()=>{const I=e?.scrollTop??0;g(E(I))},[e,o,E]),be(()=>{if(!e)return;const I=()=>{g(M=>{const{scrollLeft:$,scrollTop:V}=e,L=Ee({containerElement:e,direction:o,isRtl:n,scrollOffset:V}),U=Ge({cachedBounds:C,containerScrollOffset:L,containerSize:O,itemCount:a,overscanCount:u});return ge(U,M)?M:U})};return e.addEventListener("scroll",I),()=>{e.removeEventListener("scroll",I)}},[C,e,O,o,a,u]);const N=Tr(({align:I="auto",containerScrollOffset:M,index:$})=>{let V=Pr({align:I,cachedBounds:C,containerScrollOffset:M,containerSize:O,index:$,itemCount:a,itemSize:S});if(e){if(V=Ee({containerElement:e,direction:o,isRtl:n,scrollOffset:V}),typeof e.scrollTo!="function"){const L=E(V);ge(m,L)||g(L)}return V}});return{getCellBounds:w,getEstimatedSize:R,scrollToIndex:N,startIndexOverscan:p,startIndexVisible:f,stopIndexOverscan:d,stopIndexVisible:h}}function Br(e){return s.useMemo(()=>e,Object.values(e))}function Hr(e,t){const{ariaAttributes:r,style:o,...n}=e,{ariaAttributes:a,style:i,...c}=t;return ge(r,a)&&ge(o,i)&&ge(n,c)}function Wr(e){return e!=null&&typeof e=="object"&&"getAverageRowHeight"in e&&typeof e.getAverageRowHeight=="function"}const Ur="data-react-window-index";function Yr({children:e,className:t,defaultHeight:r=0,listRef:o,onResize:n,onRowsRendered:a,overscanCount:i=3,rowComponent:c,rowCount:l,rowHeight:u,rowProps:m,tagName:g="div",style:f,...p}){const h=Br(m),d=s.useMemo(()=>s.memo(c,Hr),[c]),[x,v]=s.useState(null),k=Wr(u),O=s.useMemo(()=>k?V=>u.getRowHeight(V)??u.getAverageRowHeight():u,[k,u]),{getCellBounds:S,getEstimatedSize:C,scrollToIndex:w,startIndexOverscan:R,startIndexVisible:E,stopIndexOverscan:N,stopIndexVisible:I}=qr({containerElement:x,containerStyle:f,defaultContainerSize:r,direction:"vertical",itemCount:l,itemProps:h,itemSize:O,onResize:n,overscanCount:i});s.useImperativeHandle(o,()=>({get element(){return x},scrollToRow({align:V="auto",behavior:L="auto",index:U}){const te=w({align:V,containerScrollOffset:x?.scrollTop??0,index:U});typeof x?.scrollTo=="function"&&x.scrollTo({behavior:L,top:te})}}),[x,w]),be(()=>{if(!x)return;const V=Array.from(x.children).filter((L,U)=>{if(L.hasAttribute("aria-hidden"))return!1;const te=`${R+U}`;return L.setAttribute(Ur,te),!0});if(k)return u.observeRowElements(V)},[x,k,u,R,N]),s.useEffect(()=>{R>=0&&N>=0&&a&&a({startIndex:E,stopIndex:I},{startIndex:R,stopIndex:N})},[a,R,E,N,I]);const M=s.useMemo(()=>{const V=[];if(l>0)for(let L=R;L<=N;L++){const U=S(L);V.push(s.createElement(d,{...h,ariaAttributes:{"aria-posinset":L+1,"aria-setsize":l,role:"listitem"},key:L,index:L,style:{position:"absolute",left:0,transform:`translateY(${U.scrollOffset}px)`,height:k?void 0:U.size,width:"100%"}}))}return V},[d,S,k,l,h,R,N]),$=b.jsx("div",{"aria-hidden":!0,style:{height:C(),width:"100%",zIndex:-1}});return s.createElement(g,{role:"list",...p,className:t,ref:v,style:{position:"relative",maxHeight:"100%",flexGrow:1,overflowY:"auto",...f}},M,e,$)}const Jr=({fields:e,visibility:t,groupState:r,toggleGroup:o,t:n,renderField:a,containerHeight:i=600,estimatedFieldHeight:c=60})=>{const l=s.useRef(null),u=s.useMemo(()=>{const f=e.filter(d=>t[d.name]),p=ht(f),h=[];return p.groups.forEach(d=>{if(d.name){const x=r[d.name]??!0;h.push({type:"group-header",groupName:d.name,isOpen:x}),x&&d.fields.forEach(v=>{h.push({type:"field",field:v})})}else d.fields.forEach(x=>{h.push({type:"field",field:x})})}),h},[e,t,r]),m=f=>{const p=u[f];if(!p)return c;if(p.type==="group-header")return 50;const h=p.field?.type;return h==="multiline"?120:h==="separator"?30:h==="image"?200:c},g=s.useCallback(({index:f,style:p})=>{const h=u[f];return h?h.type==="group-header"&&h.groupName?b.jsx("div",{style:p,children:b.jsx("fieldset",{style:{border:"1px solid var(--reactaform-border-color, #bbb)",padding:"0",borderRadius:"var(--reactaform-border-radius, 4px)",marginBottom:"var(--reactaform-space, 8px)"},children:b.jsxs("legend",{onClick:()=>o(h.groupName),style:{fontWeight:"bold",cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0 var(--reactaform-space, 8px)",color:"var(--reactaform-text-color, inherit)"},children:[b.jsx("span",{children:n(h.groupName)}),b.jsx("span",{children:h.isOpen?"▼":"▶"})]})})}):h.type==="field"&&h.field?b.jsx("div",{style:p,children:a(h.field)},h.field.name):b.jsx("div",{style:p}):b.jsx("div",{style:p})},[u,o,a,n]);return u.length===0?b.jsx("div",{style:{padding:"var(--reactaform-space, 8px)",color:"var(--reactaform-text-muted, #666)"},children:n("No fields to display")}):b.jsx("div",{ref:l,children:b.jsx(Yr,{defaultHeight:i,rowCount:u.length,rowHeight:m,rowComponent:g,rowProps:{}})})},Gr=e=>{const t={};return e.forEach(r=>{t[r.name]=!1}),t},De=(e,t,r,o)=>{const n=t[e];if(!n?.children)return;const a=r[e],i=a!=null?String(a):"";(n.children[i]||[]).forEach(l=>{o[l]=!0,De(l,t,r,o)})},wt=(e,t,r)=>{const o=t[e];o?.children&&Object.values(o.children).flat().forEach(n=>{r[n]=!1,wt(n,t,r)})},Kr=(e,t,r,o)=>{const n={...r};return e.forEach(a=>{(!a.parents||Object.keys(a.parents).length===0)&&(n[a.name]=!0,De(a.name,o,t,n))}),n},Xr=(e,t,r,o,n)=>{const a={...e};if(wt(o,t,a),n!=null){const i=t[o];if(i?.children){const c=String(n);(i.children[c]||[]).forEach(u=>{a[u]=!0,De(u,t,r,a)})}}return a};function Zr(e,t,r,o,n){const a=Object.values(n).filter(Boolean);if(a.length>0)return{success:!1,message:o("Please fix validation errors before submitting."),errors:a};const i={...r},c=[];if(e&&Array.isArray(e.properties))for(const u of e.properties){const m=u.name,g=i[m];if(g==null)continue;const f=u.type;try{if((f==="int"||f==="number"||f==="float")&&typeof g=="string"){const p=Number(String(g).trim());isNaN(p)?c.push(o(`Invalid number format for field ${u.displayName||m}`)):i[m]=p}else if((f==="int-array"||f==="float-array")&&typeof g=="string"){const h=String(g).split(",").map(d=>d.trim()).filter(Boolean).map(d=>{const x=Number(d);return isNaN(x)?(c.push(o(`Invalid number "${d}" in array for field ${u.displayName||m}`)),0):x});c.length===0&&(i[m]=h)}}catch(p){c.push(o(`Error processing field ${u.displayName||m}: ${p}`))}}if(c.length>0)return{success:!1,message:o("Data transformation errors occurred."),errors:c};const l=ct(e,i,o);if(l&&l.length>0)return{success:!1,message:l.join(`
|
|
278
|
+
`),errors:l};if(e&&typeof e.submitHandlerName=="string"){const u=Fr(e.submitHandlerName);if(u)try{const m=u(e,t?.name??null,i,o);if(m&&m.length>0)return{success:!1,message:o("Submission failed."),errors:Array.isArray(m)?m:[m]}}catch(m){return{success:!1,message:o("Submission handler error occurred."),errors:[String(m)]}}}return{success:!0,message:o("Form submitted successfully."),data:i}}const St=({definition:e,instance:t,chunkSize:r=50,chunkDelay:o=50,enableVirtualization:n=!1,virtualizationThreshold:a=50,virtualContainerHeight:i=600,estimatedFieldHeight:c=60})=>{const{properties:l,displayName:u}=e,{t:m,formStyle:g,language:f}=P(),[p,h]=s.useState("en"),[d,x]=s.useState([]),[v,k]=s.useState({}),[O,S]=s.useState({}),[C,w]=s.useState({}),[R,E]=s.useState({}),[N,I]=s.useState({}),[M,$]=s.useState(null),[V,L]=s.useState(null),[U,te]=s.useState(0),[K,se]=s.useState(!1),[D,F]=s.useState(!1),[y,j]=s.useState(t.name||""),T=s.useRef(t),q=s.useRef(!1);s.useEffect(()=>{const z=Object.fromEntries(l.map(B=>[B.name,{...B,children:{}}]));l.forEach(B=>{B.parents&&Object.entries(B.parents).forEach(([ue,Se])=>{const fe=z[ue];fe&&Se.forEach(It=>{fe.children||(fe.children={});const _e=String(It);fe.children[_e]=[...fe.children[_e]||[],B.name]})})}),zr(l,z);const _=Object.values(z),J={};_.forEach(B=>{if(B.type==="unit"){const ue=typeof B.defaultValue=="number"?String(B.defaultValue):"",Se=typeof B.defaultUnit=="string"?B.defaultUnit:String(B.defaultUnit??"m");J[B.name]=[ue,Se]}else J[B.name]=B.defaultValue}),T.current=t,Object.keys(t.values).forEach(B=>{z[B]!==void 0&&(J[B]=t.values[B])});const X=Gr(_),re={};_.forEach(B=>{B.group&&!(B.group in re)&&(re[B.group]=!0)});const ce=requestAnimationFrame(()=>{x(_),k(z),S(J),w(Kr(_,J,X,z)),E(re),se(!0),j(t.name)});return()=>cancelAnimationFrame(ce)},[l,t,e]),s.useEffect(()=>{if(!K||U>=d.length)return;const z=setTimeout(()=>{te(_=>Math.min(_+r,d.length))},o);return()=>clearTimeout(z)},[K,U,d.length,r,o]);const Z=s.useCallback((z,_,J)=>{$(null),L(null),S(X=>{const re={...X,[z]:_},ce=v[z];return ce&&["checkbox","dropdown","multi-select","radio","switch"].includes(ce.type)&&w(ue=>Xr(ue,v,re,z,String(_))),re}),I(X=>J?{...X,[z]:J}:Object.fromEntries(Object.entries(X).filter(([ce])=>ce!==z)))},[v,$,L]);s.useEffect(()=>{let z=0;return z=requestAnimationFrame(()=>{f!==p&&(h(f||"en"),$(null),L(null))}),()=>cancelAnimationFrame(z)},[f,p]),s.useEffect(()=>{let z=0;return z=requestAnimationFrame(()=>{if(q.current){q.current=!1,T.current=t,j(t.name||"");return}T.current=t,$(null),L(null),j(t.name||"")}),()=>cancelAnimationFrame(z)},[t,t.name]);const ee=s.useCallback((z,_)=>{I(J=>_?{...J,[z]:String(_)}:Object.fromEntries(Object.entries(J).filter(([re])=>re!==z)))},[]),H=()=>{q.current=!0;const z=T.current?.name;T.current.name=y;const _=Zr(e,T.current,O,m,N),J=typeof _.message=="string"?_.message:String(_.message),X=Object.values(_.errors??{}).join(`
|
|
279
|
+
`);$(X?J+`
|
|
280
|
+
`+X:J),L(_.success),_.success||(T.current.name=z??T.current.name,j(z??""))},Q=z=>{E(_=>({..._,[z]:!_[z]}))},le=s.useCallback(z=>{const _=Pe(z.type);return _?b.jsx("div",{children:b.jsx(_,{field:z,value:O[z.name],onChange:(J,X)=>Z(z.name,J,X),onError:J=>ee(z.name,J)})},z.name):null},[O,Z,ee]),ie=s.useMemo(()=>Object.values(N).some(Boolean),[N]),kt=s.useMemo(()=>n?d.filter(_=>C[_.name]).length>=a:!1,[n,d,C,a]);return K?b.jsxs("div",{style:g.container,children:[u&&b.jsx("h2",{style:g.titleStyle,children:m(u)}),M&&b.jsxs("div",{role:"status",style:{marginBottom:12,padding:12,borderRadius:6,backgroundColor:V?"rgba(76, 175, 80, 0.12)":"rgba(225, 29, 72, 0.06)",border:`1px solid ${V?"rgba(76,175,80,0.3)":"rgba(225,29,72,0.12)"}`,color:V?"var(--reactaform-success-color, #4CAF50)":"var(--reactaform-error-color, #e11d48)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[b.jsx("div",{style:{whiteSpace:"pre-wrap",flex:1},children:M}),b.jsx("button",{onClick:()=>{$(null),L(null)},"aria-label":m("Dismiss"),style:{marginLeft:12,background:"transparent",border:"none",cursor:"pointer",color:"inherit",fontSize:16,lineHeight:1},children:"×"})]}),t&&b.jsx(at,{name:y,onChange:z=>{j(z),$(null),L(null)}}),kt?b.jsx(Jr,{fields:d,valuesMap:O,visibility:C,groupState:R,handleChange:Z,handleError:ee,toggleGroup:Q,t:m,renderField:le,containerHeight:i,estimatedFieldHeight:c}):b.jsxs(b.Fragment,{children:[Vr(R,d,O,m,Z,ee,C,U,Q),U<d.length&&b.jsx("div",{style:{fontSize:"0.9em",color:"var(--reactaform-text-muted, #666)"}})]}),b.jsx("button",{onClick:H,disabled:ie,onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),style:{padding:"var(--reactaform-button-padding, var(--reactaform-space) 12px)",backgroundColor:ie?"var(--reactaform-button-disabled-bg, #cccccc)":"var(--reactaform-button-bg, var(--reactaform-success-color))",color:"var(--reactaform-button-text, #ffffff)",border:"none",borderRadius:"4px",cursor:ie?"var(--reactaform-button-disabled-cursor, not-allowed)":"pointer",fontSize:"var(--reactaform-button-font-size, 14px)",fontWeight:"var(--reactaform-button-font-weight, 500)",boxShadow:"var(--reactaform-button-shadow, none)",marginTop:"var(--reactaform-button-margin-top, 0.5em)",transition:"opacity 0.2s ease",opacity:ie?"var(--reactaform-button-disabled-opacity, 0.6)":D?"var(--reactaform-button-hover-opacity, 0.9)":"1"},children:m("Submit")})]}):b.jsx("div",{children:"Initializing form..."})},je=new Map,ve=new Map,oe=new Set,Ie=new Map,Qr=async e=>{try{let t;switch(e.toLowerCase()){case"fr":t=(await Promise.resolve().then(()=>require("./common-BxyjIoe1.js"))).default;break;case"de":t=(await Promise.resolve().then(()=>require("./common-BD9zx3GT.js"))).default;break;case"es":t=(await Promise.resolve().then(()=>require("./common-hRFTL4KF.js"))).default;break;case"zh-cn":t=(await Promise.resolve().then(()=>require("./common-COyDhNL-.js"))).default;break;case"en":t={};break;default:t={}}return{success:!0,translations:t,fromCache:!1}}catch(t){return{success:!1,translations:{},error:`Failed to load common translations for ${e}: ${t}`}}},en=async e=>{if(!e)return{success:!1,translations:{},error:"Language is required"};const t=e.toLowerCase();if(t==="en")return{success:!0,translations:{},fromCache:!1};if(je.has(t))return{success:!0,translations:je.get(t)||{},fromCache:!0};const r=await Qr(t);return r.success&&(je.set(t,r.translations),Ie.set(t,{loadedAt:new Date,size:Object.keys(r.translations).length,source:"common"})),r},tn=async(e,t)=>{if(!e||!t)return{success:!1,translations:{},error:"Both language and localizeName are required"};const r=`${e.toLowerCase()}/${t}`;if(oe.has(r))return{success:!1,translations:{},error:"Previously failed to load",fromCache:!0};if(ve.has(r))return{success:!0,translations:ve.get(r)||{},fromCache:!0};try{let o=t;!t.includes("/")&&!t.includes(".")&&(o=`/locales/${e}/${t}.json`);const n=await fetch(o);if(!n.ok){const u=`HTTP ${n.status}: ${n.statusText}`;return n.status===404?(ve.set(r,{}),Ie.set(r,{loadedAt:new Date,size:0,source:"user"}),{success:!0,translations:{},fromCache:!1}):(oe.add(r),{success:!1,translations:{},error:u})}const a=n.headers.get("content-type")||"";!a.includes("application/json")&&!a.includes("text/json")&&Ct()&&console.warn(`Translation file at ${o} has unexpected content-type: ${a}`);const i=await n.text();if(!i){const u="Empty translation file";return oe.add(r),{success:!1,translations:{},error:u}}let c;try{c=JSON.parse(i)}catch(u){const m=`Invalid JSON in translation file: ${u instanceof Error?u.message:String(u)}`;return oe.add(r),{success:!1,translations:{},error:m}}if(!c||typeof c!="object"){const u="Invalid translation file format";return oe.add(r),{success:!1,translations:{},error:u}}const l=Object.fromEntries(Object.entries(c).map(([u,m])=>[u,typeof m=="string"?m:String(m)]));if(!l||typeof l!="object"){const u="Invalid translation file format";return oe.add(r),{success:!1,translations:{},error:u}}return ve.set(r,l),Ie.set(r,{loadedAt:new Date,size:Object.keys(l).length,source:"user"}),{success:!0,translations:l,fromCache:!1}}catch(o){const n=`Failed to load user translations: ${o instanceof Error?o.message:"Unknown error"}`;return oe.add(r),{success:!1,translations:{},error:n}}};function Ct(){try{if(typeof process<"u"&&process?.env?.NODE_ENV==="development")return!0}catch{}return!1}function rn(e,t){return t.length===0?e:e.replace(/\{\{(\d+)\}\}/g,(r,o)=>{const n=parseInt(o,10)-1,a=t[n];if(a==null)return r;try{return String(a)}catch{return r}})}const nn=(e,t,r)=>(o,...n)=>{let a=o,i=!1;return!o||typeof o!="string"?String(o||""):(e.toLowerCase()==="en"?(a=o,i=!0):Object.prototype.hasOwnProperty.call(r,o)?(a=r[o],i=!0):Object.prototype.hasOwnProperty.call(t,o)?(a=t[o],i=!0):a=o,a=rn(a,n),!i&&Ct()&&console.debug(`Missing translation for "${o}" in language "${e}"`),a)};dt();const on=(e,t=!1)=>({container:{padding:"var(--reactaform-space-sm, 8px)",margin:"0 auto",backgroundColor:"transparent",borderRadius:0,color:"var(--reactaform-color-text)",fontFamily:e?.fontFamily||"var(--reactaform-font-family, system-ui, -apple-system, sans-serif)",boxSizing:"border-box",minHeight:e?.minHeight??"0",...e?.width?{width:e.width,overflowX:"auto"}:{maxWidth:"100%"},...e?.height?{height:e.height,overflowY:"auto"}:{}},buttonStyle:{padding:"var(--reactaform-space-sm, 8px) var(--reactaform-space-md, 16px)",backgroundColor:"var(--reactaform-color-primary)",color:"var(--reactaform-color-background)",border:"1px solid var(--reactaform-color-primary)",borderRadius:"var(--reactaform-border-radius, 6px)",cursor:"pointer",fontSize:e?.fontSize||"1rem",fontWeight:"600",transition:"all 0.2s ease",boxShadow:"var(--reactaform-shadow-small, 0 1px 3px rgba(0, 0, 0, 0.12))"},titleStyle:{marginBottom:"var(--reactaform-space-lg, 24px)",color:"var(--reactaform-color-text)",fontSize:typeof e?.fontSize=="number"?`${e.fontSize*1.5}px`:"1.5rem",fontWeight:"700",lineHeight:"1.2",textAlign:"left"}}),an=(e,t=!1)=>{const r={color:"var(--reactaform-color-text)",fontFamily:e?.fontFamily||"var(--reactaform-font-family, inherit)",transition:"all 0.2s ease",outline:"none",width:"100%",boxSizing:"border-box"};return{container:{fontFamily:e?.fontFamily||"var(--reactaform-font-family, inherit)",fontSize:e?.fontSize||"var(--reactaform-font-size, 1rem)",width:"100%",maxWidth:e?.width||"100%",marginBottom:"var(--reactaform-space-md, 16px)"},label:{display:"block",marginBottom:"var(--reactaform-space-xs, 4px)",fontWeight:"500",color:"var(--reactaform-color-text)",fontSize:"var(--reactaform-font-size, 1rem)",fontFamily:e?.fontFamily||"var(--reactaform-font-family, inherit)"},input:r,textInput:r,optionInput:r,select:{...r,cursor:"pointer",backgroundRepeat:"no-repeat",backgroundPosition:"right 8px center",backgroundSize:"16px",paddingRight:"32px",backgroundImage:`url("data:image/svg+xml;utf8,<svg
|
|
281
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
282
|
+
viewBox='0 0 24 24'
|
|
283
|
+
fill='none'
|
|
284
|
+
stroke='currentColor'
|
|
285
|
+
stroke-width='2'
|
|
286
|
+
stroke-linecap='round'
|
|
287
|
+
stroke-linejoin='round'>
|
|
288
|
+
<polyline points='6,9 12,15 18,9'/>
|
|
289
|
+
</svg>")`},textarea:{...r,minHeight:"80px",resize:"vertical",paddingTop:"var(--reactaform-space-sm, 8px)"},error:{color:"var(--reactaform-color-error)",fontSize:"0.875rem",marginTop:"var(--reactaform-space-xs, 4px)",display:"block"}}},Rt=({children:e,defaultDefinitionName:t="",defaultStyle:r,defaultLanguage:o="en",defaultDarkMode:n=!1,defaultLocalizeName:a="",className:i="reactaform-container"})=>{const c=t,l=a,u=n,m=o,g=s.useMemo(()=>r??{},[r]),[f,p]=s.useState({}),[h,d]=s.useState({}),[x,v]=s.useState({}),[k,O]=s.useState({});s.useEffect(()=>{let E=!0;return(async()=>{if(m==="en"){E&&(p({}),d({}));return}try{const I=await en(m),M=I.success?I.translations:{};E&&p(M);const $=await tn(m,l),V=$.success?$.translations:{};E&&d(V)}catch{E&&(p({}),d({}))}})(),()=>{E=!1}},[m,l]),s.useEffect(()=>{O(on(g,u)),v(an(g,u))},[g,u]);const S=s.useMemo(()=>nn(m,f,h),[m,f,h]),C=s.useCallback((E,...N)=>S(E,...N),[S]),w=s.useMemo(()=>({definitionName:c,language:m,darkMode:u,formStyle:k,fieldStyle:x,t:C}),[c,m,u,x,k,C]),R=g?.height?{height:"100%"}:void 0;return b.jsx(et.Provider,{value:w,children:b.jsx("div",{"data-reactaform-theme":u?"dark":"light",className:i,style:R,children:e})})};function sn(e){if(!e||typeof e!="object")return"Definition must be an object";const t=e;if(!t.name||typeof t.name!="string")return"Definition must include a 'name' string";if(!t.version||typeof t.version!="string")return"Definition must include a 'version' string";if(t.properties!==void 0&&!Array.isArray(t.properties))return"'properties' must be an array if provided";if(Array.isArray(t.properties))for(let r=0;r<t.properties.length;r++){const o=t.properties[r];if(!o||typeof o!="object")return`Property at index ${r} must be an object`;if(!o.name||typeof o.name!="string")return`Property at index ${r} must have a string 'name'`;if(!o.type||typeof o.type!="string")return`Property '${o.name}' must have a string 'type'`}return null}async function cn(e,t={}){const{validateSchema:r=!0}=t;try{if(!e||typeof e!="string")return{success:!1,error:"jsonData must be a non-empty JSON string"};const o=e.trim();if(!o)return{success:!1,error:"jsonData is empty"};let n;try{n=JSON.parse(o)}catch(a){return{success:!1,error:`Invalid JSON format: ${a instanceof Error?a.message:"Unknown parsing error"}`}}if(r){const a=sn(n);if(a)return{success:!1,error:`Schema validation failed: ${a}`}}return{success:!0,definition:n}}catch(o){return{success:!1,error:`Unexpected error loading definition: ${o instanceof Error?o.message:"Unknown error"}`}}}function Et(e,t){try{if(!e)return{success:!1,error:"Definition is required"};if(!t||typeof t!="string")return{success:!1,error:"Instance name is required"};const r={name:t,definition:e.name??"unknown",version:e.version??"1.0.0",values:{}},o=e.properties||[];return Array.isArray(o)&&o.forEach(n=>{const a=n;a.defaultValue!==void 0&&(r.values[a.name]=a.defaultValue)}),{success:!0,instance:r}}catch(r){return{success:!1,error:`Error creating instance: ${r instanceof Error?r.message:"Unknown error"}`}}}function ln(e){try{if(!e)return{success:!1,error:"Instance data is required"};let t;if(typeof e=="string")try{t=JSON.parse(e)}catch(r){return{success:!1,error:`Invalid JSON format: ${r instanceof Error?r.message:"Unknown parsing error"}`}}else t=e;return typeof t!="object"||t===null?{success:!1,error:"Instance must be a valid object"}:{success:!0,instance:t}}catch(t){return{success:!1,error:`Error loading instance: ${t instanceof Error?t.message:"Unknown error"}`}}}dt();function un(e){const[t,r]=s.useState(null);return s.useEffect(()=>{const o=document.querySelector("[data-reactaform-theme]");if(!o)return;const n=o.closest("[data-reactaform-theme]");if(!n)return;const a=()=>r(n.getAttribute("data-reactaform-theme"));a();const i=new MutationObserver(c=>{for(const l of c)l.type==="attributes"&&l.attributeName==="data-reactaform-theme"&&a()});return i.observe(n,{attributes:!0,attributeFilter:["data-reactaform-theme"]}),()=>i.disconnect()},[e]),t}const fn=({definitionData:e,instance:t,language:r,className:o,darkMode:n,style:a})=>{const i=s.useMemo(()=>{try{return typeof e=="string"?JSON.parse(e):e??null}catch{return null}},[e]),c={fontSize:"inherit",fontFamily:"inherit",...a},l=un(),u=n??l==="dark",m=r??"en";if(s.useEffect(()=>{let f=document.getElementById("popup-root");f||(f=document.createElement("div"),f.id="popup-root",document.body.appendChild(f))},[]),!i)return b.jsx("div",{style:{color:"red"},children:"Error: No form definition provided."});let g=t;if(!g){const f=Et(i,i.name);if(!f.success||!f.instance)return b.jsx("div",{style:{color:"red"},children:"Error: Failed to create instance from definition."});g=f.instance}return b.jsx(Rt,{defaultDefinitionName:i.name,defaultStyle:c,defaultLanguage:m,defaultDarkMode:u,defaultLocalizeName:i.localization||"",className:o,children:b.jsx(St,{definition:i,instance:g})})};function ae(e){return typeof e=="object"&&e!==null}function Le(e){if(!ae(e))return!1;const t=e;return typeof t.name=="string"&&typeof t.displayName=="string"}function jt(e){if(!ae(e))return!1;const t=e;return typeof t.name!="string"||typeof t.version!="string"||!Array.isArray(t.properties)?!1:t.properties.every(r=>Le(r))}function Ne(e){try{return typeof File<"u"&&e instanceof File}catch{const t=ae(e)?e:void 0;return!!t&&typeof t.name=="string"&&typeof t.size=="number"}}function mn(e,t,r={}){try{const{includeMetadata:o=!1,dateFormat:n="iso",fileHandling:a="metadata",prettify:i=!1,excludeFields:c=[],includeOnlyFields:l=[]}=r;if(!e||typeof e!="object")return{success:!1,error:"Instance must be a valid object"};const u=[],m=[],g={},p=(jt(t)||ae(t)&&Array.isArray(t.properties)?t.properties:[]).filter(Le),h=new Map(p.map(x=>[x.name,x]));for(const[x,v]of Object.entries(e)){if(c.includes(x)){m.push(x);continue}if(l.length>0&&!l.includes(x)){m.push(x);continue}if(v===void 0)continue;const k=h.get(x);try{g[x]=dn(v,k,{dateFormat:n,fileHandling:a})}catch(O){u.push(`Error serializing field '${x}': ${String(O)}`),g[x]=null}}return o&&(g._metadata={serializedAt:new Date().toISOString(),version:(ae(t)?t.version:void 0)||"1.0.0",fieldCount:Object.keys(g).length-1}),{success:!0,data:i?JSON.stringify(g,null,2):JSON.stringify(g),metadata:{fieldCount:Object.keys(g).length,excludedFields:m,warnings:u}}}catch(o){return{success:!1,error:`Serialization failed: ${o instanceof Error?o.message:"Unknown error"}`}}}function dn(e,t,r={}){const{dateFormat:o="iso",fileHandling:n="metadata"}=r;if(e==null)return null;if(t)switch(t.type){case"date":case"datetime":case"date-time":return Ke(e,o);case"file":return Xe(e,n);case"int":case"integer":return typeof e=="string"?parseInt(e,10):e;case"float":case"number":return typeof e=="string"?parseFloat(e):e;case"boolean":return typeof e=="string"?e==="true":!!e;case"int-array":case"float-array":return Array.isArray(e)?e.map(a=>typeof a=="string"?Number(a):a):e;default:return e}return e instanceof Date?Ke(e,o):Ne(e)||Array.isArray(e)&&Ne(e[0])?Xe(e,n):e}function Ke(e,t){let r=null;if(e instanceof Date)r=e;else if(typeof e=="string"){const o=new Date(e);if(!isNaN(o.getTime()))r=o;else return e}else return e;switch(t){case"timestamp":return r.getTime();case"locale":return r.toLocaleString();case"iso":default:return r.toISOString()}}function Xe(e,t){return t==="skip"?null:Array.isArray(e)?e.map(r=>Ze(r,t)):Ze(e,t)}function Ze(e,t){if(!Ne(e))return e;const r=e;return t==="metadata"?{name:r.name,size:r.size,type:r.type,lastModified:r.lastModified}:{name:r.name,size:r.size,type:r.type,lastModified:r.lastModified,_note:"Base64 encoding requires async implementation"}}function pn(e,t,r={}){try{const{strict:o=!1,validateTypes:n=!0,preserveUnknownFields:a=!0,dateFormat:i="auto"}=r;if(!e||typeof e!="string")return{success:!1,error:"Serialized data must be a non-empty string"};let c;try{c=JSON.parse(e)}catch(d){return{success:!1,error:`Invalid JSON: ${d instanceof Error?d.message:"Unknown parsing error"}`}}if(!c||typeof c!="object")return{success:!1,error:"Parsed data must be an object"};const l=[],u=[],m={},f=(jt(t)||ae(t)&&Array.isArray(t.properties)?t.properties:[]).filter(Le),p=new Map(f.map(d=>[d.name,d]));for(const d of f){const x=d.name,v=c[x];if(v===void 0){o&&d.required&&u.push(`Required field '${x}' is missing`);continue}try{m[x]=gn(v,d,{validateTypes:n,dateFormat:i})}catch(k){const O=`Error deserializing field '${x}': ${String(k)}`;o?u.push(O):(l.push(O),m[x]=v)}}if(a)for(const[d,x]of Object.entries(c))!p.has(d)&&d!=="_metadata"&&(o&&l.push(`Unknown field '${d}' preserved`),m[d]=x);const h=u.length>0;return{success:!h,data:m,warnings:l.length>0?l:void 0,validationErrors:h?u:void 0}}catch(o){return{success:!1,error:`Deserialization failed: ${o instanceof Error?o.message:"Unknown error"}`}}}function gn(e,t,r={}){const{validateTypes:o=!0,dateFormat:n="auto"}=r;if(e==null)return e;try{switch(t.type){case"date":case"datetime":case"date-time":return yn(e,n,o);case"int":case"integer":return Oe(e,o);case"float":case"number":return Me(e,o);case"boolean":return xn(e,o);case"int-array":return Qe(e,"integer",o);case"float-array":return Qe(e,"number",o);case"string":case"text":case"email":case"url":case"phone":return o?String(e):e;default:return e}}catch(a){if(o)throw new Error(`Type conversion failed: ${String(a)}`);return e}}function hn(e,t={}){try{const{prettify:r=!0,includeMetadata:o=!0}=t;if(!e||typeof e!="object")return{success:!1,error:"Definition must be a valid object"};const n={...e};return o&&(n._metadata={serializedAt:new Date().toISOString(),version:n.version||"1.0.0",propertyCount:(Array.isArray(n.properties)?n.properties.length:0)||0}),{success:!0,data:r?JSON.stringify(n,null,2):JSON.stringify(n),metadata:{fieldCount:(Array.isArray(n.properties)?n.properties.length:0)||0,excludedFields:[],warnings:[]}}}catch(r){return{success:!1,error:`Definition serialization failed: ${r instanceof Error?r.message:"Unknown error"}`}}}function bn(e,t={}){try{const{strict:r=!1,validateTypes:o=!0}=t;let n;if(typeof e=="string")try{n=JSON.parse(e)}catch(m){return{success:!1,error:`Invalid JSON for definition: ${m instanceof Error?m.message:"Unknown parsing error"}`}}else if(e&&typeof e=="object")n={...e};else return{success:!1,error:"Input must be a string or object"};const a=[],i=[],c=["name","version","displayName"];for(const m of c)if(!n[m])if(r)i.push(`Required field '${m}' is missing`);else switch(a.push(`Missing field '${m}', using default`),m){case"name":n.name="unnamed-definition";break;case"version":n.version="1.0.0";break;case"displayName":n.displayName=n.name||"Unnamed Definition";break}const l=Array.isArray(n.properties)?n.properties:null;l?n.properties=l.map((m,g)=>{const f=ae(m)?m:{},p={...f};if(!f.name){const h=`Property at index ${g} missing 'name'`;r?i.push(h):(a.push(`${h}, using 'field_${g}'`),p.name=`field_${g}`)}return f.displayName||(p.displayName=f.name||`Field ${g}`),f.type||(r&&o?i.push(`Property '${f.name||g}' missing 'type'`):(a.push(`Property '${f.name||g}' missing 'type', using 'string'`),p.type="string")),f.defaultValue===void 0&&(p.defaultValue=null),f.required===void 0&&(p.required=!1),p}):r?i.push("Properties must be an array"):(a.push("Properties not found or invalid, using empty array"),n.properties=[]);const u=i.length>0;return{success:!u,data:n,warnings:a.length>0?a:void 0,validationErrors:u?i:void 0}}catch(r){return{success:!1,error:`Definition deserialization failed: ${r instanceof Error?r.message:"Unknown error"}`}}}function yn(e,t,r){if(e instanceof Date)return e;if(typeof e=="number"){const o=new Date(e);if(r&&isNaN(o.getTime()))throw new Error(`Invalid timestamp: ${e}`);return o}if(typeof e=="string"){const o=new Date(e);if(r&&isNaN(o.getTime()))throw new Error(`Invalid date string: ${e}`);return o}if(r)throw new Error(`Cannot convert ${typeof e} to Date`);return e}function Oe(e,t){if(typeof e=="number"&&Number.isInteger(e))return e;if(typeof e=="string"&&e.trim()!==""){const r=parseInt(e,10);if(t&&isNaN(r))throw new Error(`Cannot convert "${e}" to integer`);return r}if(t)throw new Error(`Cannot convert ${typeof e} to integer`);return e}function Me(e,t){if(typeof e=="number")return e;if(typeof e=="string"&&e.trim()!==""){const r=parseFloat(e);if(t&&isNaN(r))throw new Error(`Cannot convert "${e}" to number`);return r}if(t)throw new Error(`Cannot convert ${typeof e} to number`);return e}function xn(e,t){if(typeof e=="boolean")return e;if(typeof e=="string"){const r=e.toLowerCase();if(r==="true"||r==="1")return!0;if(r==="false"||r==="0")return!1;if(t)throw new Error(`Cannot convert "${e}" to boolean`)}if(typeof e=="number")return!!e;if(t)throw new Error(`Cannot convert ${typeof e} to boolean`);return e}function Qe(e,t,r){if(!Array.isArray(e)){if(typeof e=="string")return e.split(",").map(n=>n.trim()).filter(Boolean).map(n=>t==="integer"?Oe(n,r):Me(n,r));if(r)throw new Error(`Expected array, got ${typeof e}`);return e}return e.map((o,n)=>{try{return t==="integer"?Oe(o,r):Me(o,r)}catch(a){if(r)throw new Error(`Array element ${n}: ${a}`);return o}})}function vn(){if(!(typeof document>"u")&&!document.getElementById("reactaform-styles"))try{const e=document.createElement("style");e.id="reactaform-styles",e.textContent=Nt,document.head.appendChild(e)}catch{}}vn();exports.ReactaForm=fn;exports.ReactaFormProvider=Rt;exports.ReactaFormRenderer=St;exports.Units=hr;exports.createInstanceFromDefinition=Et;exports.deserializeDefinition=bn;exports.deserializeInstance=pn;exports.getComponent=Pe;exports.loadInstance=ln;exports.loadJsonDefinition=cn;exports.registerComponent=mt;exports.registerFieldValidationHandler=$t;exports.registerFormValidationHandler=Vt;exports.registerSubmissionHandler=gt;exports.serializeDefinition=hn;exports.serializeInstance=mn;exports.useDebouncedCallback=tt;exports.useReactaFormContext=P;exports.validateFieldValue=Y;exports.validateFormValues=ct;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--reactaform-primary-bg: #f9f9f9;--reactaform-secondary-bg: #fff;--reactaform-text-color: #000;--reactaform-text-muted: #666;--reactaform-border-color: #ccc;--reactaform-border-hover: #999;--reactaform-border-focus: #4CAF50;--reactaform-error-color: #e11d48;--reactaform-success-color: #4CAF50;--reactaform-space: 8px;--reactaform-space-lg: 12px;--reactaform-hover-bg: #f5f5f5;--reactaform-font-size: 14px;--reactaform-font-weight: 500;--reactaform-border-radius: 0px;--reactaform-shadow: 0 2px 4px rgba(0, 0, 0, .1);--reactaform-button-bg: var(--reactaform-success-color);--reactaform-button-text: #ffffff;--reactaform-button-padding: var(--reactaform-space) 12px;--reactaform-button-border-radius: var(--reactaform-border-radius);--reactaform-button-font-size: 14px;--reactaform-button-font-weight: var(--reactaform-font-weight);--reactaform-button-hover-opacity: .9;--reactaform-button-disabled-opacity: .6;--reactaform-button-disabled-bg: #cccccc;--reactaform-button-disabled-cursor: not-allowed;--reactaform-button-margin-top: .5em;--reactaform-button-shadow: none;--reactaform-input-padding: var(--reactaform-space);--reactaform-container-padding: var(--reactaform-space-lg);--reactaform-field-gap: var(--reactaform-space);--reactaform-input-bg: var(--reactaform-secondary-bg);--reactaform-field-text-color: #0000ff;--reactaform-tooltip-color-bg: rgba(60,60,60,.92);--reactaform-tooltip-color: #ffffff}[data-reactaform-theme=dark]{--reactaform-primary-bg: #121212;--reactaform-secondary-bg: #1A1A1A;--reactaform-input-bg: #262626;--reactaform-text-color: #EDEDED;--reactaform-text-muted: #A5A5A5;--reactaform-field-text-color: #C8C8E5;--reactaform-border-color: #3A3A3A;--reactaform-border-hover: #4A4A4A;--reactaform-border-focus: #4DA6FF;--reactaform-error-color: #FF6B6B;--reactaform-success-color: #4CAF6A;--reactaform-hover-bg: rgba(255, 255, 255, .06);--reactaform-shadow: 0 2px 8px rgba(0, 0, 0, .45);--reactaform-tooltip-color-bg: rgba(40, 40, 40, .95);--reactaform-tooltip-color: #F5F5F5}.reactaform-container{background-color:var(--reactaform-primary-bg);color:var(--reactaform-text-color);padding:var(--reactaform-container-padding);border-radius:var(--reactaform-border-radius);box-shadow:var(--reactaform-shadow);gap:var(--reactaform-space-lg);max-width:100%;margin:0 auto}.reactaform-field{display:grid;grid-template-columns:1fr 2fr;align-items:start;padding:0;gap:var(--reactaform-field-gap);margin-bottom:var(--reactaform-space)}.reactaform-label{justify-self:start;align-self:center;white-space:normal;line-height:1.4;min-width:100px;color:var(--reactaform-text-color);font-weight:var(--reactaform-font-weight);font-size:var(--reactaform-font-size);-webkit-user-select:none;user-select:none}.reactaform-input{width:100%;color:var(--reactaform-text-color);border:1px solid var(--reactaform-border-color);border-radius:var(--reactaform-border-radius);padding:var(--reactaform-input-padding);box-sizing:border-box;background-color:var(--reactaform-input-bg);font-size:var(--reactaform-font-size);transition:border-color .2s ease;box-shadow:inset 0 1px #ffffff08}.reactaform-input:hover{border-color:var(--reactaform-border-hover)}.reactaform-input:focus{outline:none;border-color:var(--reactaform-border-focus);box-shadow:0 0 0 3px #22d3ee66,0 0 16px #22d3ee40,inset 0 1px #ffffff0d}.reactaform-input--text{text-align:left}.reactaform-input--number{text-align:right}.reactaform-input--select{text-align:left;appearance:none;background-image:url("data:image/svg+xml;utf8,<svg fill='%23666' height='8' viewBox='0 0 24 24' width='8' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");background-repeat:no-repeat;background-position:right var(--reactaform-space) center;background-size:20px;padding-right:32px}.reactaform-select{text-align:left;appearance:none;background-image:url("data:image/svg+xml;utf8,<svg fill='%23666' height='8' viewBox='0 0 24 24' width='8' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");background-repeat:no-repeat;background-position:right var(--reactaform-space) center;background-size:2.5em;padding-right:32px;background-color:var(--reactaform-input-bg)}.reactaform-textarea{width:100%;background-color:var(--reactaform-input-bg);color:var(--reactaform-text-color);border:1px solid var(--reactaform-border-color);border-radius:var(--reactaform-border-radius);padding:var(--reactaform-input-padding);box-sizing:border-box}@media(max-width:1024px){.reactaform-container{padding:calc(var(--reactaform-space) * .8)}.reactaform-field{gap:calc(var(--reactaform-gap) * .8)}}@media(max-width:768px){.reactaform-field{grid-template-columns:1fr;gap:6px}.reactaform-label{justify-self:start;margin-bottom:4px;font-size:.9rem}.reactaform-container{padding:var(--reactaform-space)}.reactaform-input,.reactaform-textarea,.reactaform-select{font-size:16px;padding:12px}.reactaform-checkbox-wrapper,.reactaform-radio-wrapper{padding:8px 0;min-height:44px;align-items:center}.reactaform-group{margin-bottom:calc(var(--reactaform-space) * 1.5)}}@media(max-width:480px){.reactaform-container{padding:calc(var(--reactaform-space) * .7)}.reactaform-field{gap:8px}.reactaform-label{font-size:.85rem;line-height:1.3}.reactaform-input,.reactaform-textarea,.reactaform-select{padding:14px}}
|