@mieweb/forms-renderer 0.1.3 → 0.1.6

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/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import A from "react";
2
- import { useUIApi as ne, useFormStore as Ce, useFieldsArray as De, isVisible as Ie, getFieldComponent as gr } from "@mieweb/forms-engine";
3
- var K = { exports: {} }, N = {};
1
+ import I from "react";
2
+ import { useUIApi as Ce, useFormStore as ke, getFieldComponent as br, isVisible as yr, useVisibleFields as gr, useFieldsArray as hr } from "@mieweb/forms-engine";
3
+ var q = { exports: {} }, Y = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.min.js
@@ -10,21 +10,21 @@ var K = { exports: {} }, N = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var je;
14
- function hr() {
15
- if (je) return N;
16
- je = 1;
17
- var o = A, l = Symbol.for("react.element"), g = Symbol.for("react.fragment"), p = Object.prototype.hasOwnProperty, d = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function O(S, y, P) {
19
- var m, x = {}, C = null, _ = null;
20
- P !== void 0 && (C = "" + P), y.key !== void 0 && (C = "" + y.key), y.ref !== void 0 && (_ = y.ref);
21
- for (m in y) p.call(y, m) && !h.hasOwnProperty(m) && (x[m] = y[m]);
22
- if (S && S.defaultProps) for (m in y = S.defaultProps, y) x[m] === void 0 && (x[m] = y[m]);
23
- return { $$typeof: l, type: S, key: C, ref: _, props: x, _owner: d.current };
13
+ var xe;
14
+ function mr() {
15
+ if (xe) return Y;
16
+ xe = 1;
17
+ var a = I, c = Symbol.for("react.element"), f = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, p = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function T(S, b, O) {
19
+ var m, E = {}, x = null, k = null;
20
+ O !== void 0 && (x = "" + O), b.key !== void 0 && (x = "" + b.key), b.ref !== void 0 && (k = b.ref);
21
+ for (m in b) s.call(b, m) && !y.hasOwnProperty(m) && (E[m] = b[m]);
22
+ if (S && S.defaultProps) for (m in b = S.defaultProps, b) E[m] === void 0 && (E[m] = b[m]);
23
+ return { $$typeof: c, type: S, key: x, ref: k, props: E, _owner: p.current };
24
24
  }
25
- return N.Fragment = g, N.jsx = O, N.jsxs = O, N;
25
+ return Y.Fragment = f, Y.jsx = T, Y.jsxs = T, Y;
26
26
  }
27
- var L = {};
27
+ var V = {};
28
28
  /**
29
29
  * @license React
30
30
  * react-jsx-runtime.development.js
@@ -34,70 +34,70 @@ var L = {};
34
34
  * This source code is licensed under the MIT license found in the
35
35
  * LICENSE file in the root directory of this source tree.
36
36
  */
37
- var ke;
38
- function mr() {
39
- return ke || (ke = 1, process.env.NODE_ENV !== "production" && (function() {
40
- var o = A, l = Symbol.for("react.element"), g = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), d = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), O = Symbol.for("react.provider"), S = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), v = Symbol.iterator, b = "@@iterator";
41
- function I(e) {
37
+ var Oe;
38
+ function Rr() {
39
+ return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && (function() {
40
+ var a = I, c = Symbol.for("react.element"), f = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), S = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), ee = Symbol.iterator, Ae = "@@iterator";
41
+ function Fe(e) {
42
42
  if (e === null || typeof e != "object")
43
43
  return null;
44
- var r = v && e[v] || e[b];
44
+ var r = ee && e[ee] || e[Ae];
45
45
  return typeof r == "function" ? r : null;
46
46
  }
47
- var $ = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
- function E(e) {
47
+ var A = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
+ function g(e) {
49
49
  {
50
50
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
51
51
  t[n - 1] = arguments[n];
52
- $e("error", e, t);
52
+ De("error", e, t);
53
53
  }
54
54
  }
55
- function $e(e, r, t) {
55
+ function De(e, r, t) {
56
56
  {
57
- var n = $.ReactDebugCurrentFrame, s = n.getStackAddendum();
58
- s !== "" && (r += "%s", t = t.concat([s]));
59
- var u = t.map(function(i) {
60
- return String(i);
57
+ var n = A.ReactDebugCurrentFrame, u = n.getStackAddendum();
58
+ u !== "" && (r += "%s", t = t.concat([u]));
59
+ var l = t.map(function(o) {
60
+ return String(o);
61
61
  });
62
- u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
62
+ l.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, l);
63
63
  }
64
64
  }
65
- var We = !1, Ye = !1, Ve = !1, Me = !1, Ne = !1, ae;
66
- ae = Symbol.for("react.module.reference");
67
- function Le(e) {
68
- return !!(typeof e == "string" || typeof e == "function" || e === p || e === h || Ne || e === d || e === P || e === m || Me || e === _ || We || Ye || Ve || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === x || e.$$typeof === O || e.$$typeof === S || e.$$typeof === y || // This needs to include all possible module reference object
65
+ var Ie = !1, $e = !1, We = !1, Ye = !1, Ve = !1, re;
66
+ re = Symbol.for("react.module.reference");
67
+ function Ne(e) {
68
+ return !!(typeof e == "string" || typeof e == "function" || e === s || e === y || Ve || e === p || e === O || e === m || Ye || e === k || Ie || $e || We || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === E || e.$$typeof === T || e.$$typeof === S || e.$$typeof === b || // This needs to include all possible module reference object
69
69
  // types supported by any Flight configuration anywhere since
70
70
  // we don't know which Flight build this will end up being used
71
71
  // with.
72
- e.$$typeof === ae || e.getModuleId !== void 0));
72
+ e.$$typeof === re || e.getModuleId !== void 0));
73
73
  }
74
- function Ue(e, r, t) {
74
+ function Le(e, r, t) {
75
75
  var n = e.displayName;
76
76
  if (n)
77
77
  return n;
78
- var s = r.displayName || r.name || "";
79
- return s !== "" ? t + "(" + s + ")" : t;
78
+ var u = r.displayName || r.name || "";
79
+ return u !== "" ? t + "(" + u + ")" : t;
80
80
  }
81
- function ie(e) {
81
+ function te(e) {
82
82
  return e.displayName || "Context";
83
83
  }
84
- function k(e) {
84
+ function P(e) {
85
85
  if (e == null)
86
86
  return null;
87
- if (typeof e.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
87
+ if (typeof e.tag == "number" && g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
88
  return e.displayName || e.name || null;
89
89
  if (typeof e == "string")
90
90
  return e;
91
91
  switch (e) {
92
- case p:
92
+ case s:
93
93
  return "Fragment";
94
- case g:
94
+ case f:
95
95
  return "Portal";
96
- case h:
96
+ case y:
97
97
  return "Profiler";
98
- case d:
98
+ case p:
99
99
  return "StrictMode";
100
- case P:
100
+ case O:
101
101
  return "Suspense";
102
102
  case m:
103
103
  return "SuspenseList";
@@ -106,19 +106,19 @@ function mr() {
106
106
  switch (e.$$typeof) {
107
107
  case S:
108
108
  var r = e;
109
- return ie(r) + ".Consumer";
110
- case O:
109
+ return te(r) + ".Consumer";
110
+ case T:
111
111
  var t = e;
112
- return ie(t._context) + ".Provider";
113
- case y:
114
- return Ue(e, e.render, "ForwardRef");
115
- case x:
112
+ return te(t._context) + ".Provider";
113
+ case b:
114
+ return Le(e, e.render, "ForwardRef");
115
+ case E:
116
116
  var n = e.displayName || null;
117
- return n !== null ? n : k(e.type) || "Memo";
118
- case C: {
119
- var s = e, u = s._payload, i = s._init;
117
+ return n !== null ? n : P(e.type) || "Memo";
118
+ case x: {
119
+ var u = e, l = u._payload, o = u._init;
120
120
  try {
121
- return k(i(u));
121
+ return P(o(l));
122
122
  } catch {
123
123
  return null;
124
124
  }
@@ -126,18 +126,18 @@ function mr() {
126
126
  }
127
127
  return null;
128
128
  }
129
- var F = Object.assign, V = 0, oe, se, ue, le, ce, fe, de;
130
- function ve() {
129
+ var j = Object.assign, $ = 0, ne, ae, ie, oe, ue, se, le;
130
+ function ce() {
131
131
  }
132
- ve.__reactDisabledLog = !0;
133
- function qe() {
132
+ ce.__reactDisabledLog = !0;
133
+ function Ue() {
134
134
  {
135
- if (V === 0) {
136
- oe = console.log, se = console.info, ue = console.warn, le = console.error, ce = console.group, fe = console.groupCollapsed, de = console.groupEnd;
135
+ if ($ === 0) {
136
+ ne = console.log, ae = console.info, ie = console.warn, oe = console.error, ue = console.group, se = console.groupCollapsed, le = console.groupEnd;
137
137
  var e = {
138
138
  configurable: !0,
139
139
  enumerable: !0,
140
- value: ve,
140
+ value: ce,
141
141
  writable: !0
142
142
  };
143
143
  Object.defineProperties(console, {
@@ -150,202 +150,202 @@ function mr() {
150
150
  groupEnd: e
151
151
  });
152
152
  }
153
- V++;
153
+ $++;
154
154
  }
155
155
  }
156
- function Be() {
156
+ function Me() {
157
157
  {
158
- if (V--, V === 0) {
158
+ if ($--, $ === 0) {
159
159
  var e = {
160
160
  configurable: !0,
161
161
  enumerable: !0,
162
162
  writable: !0
163
163
  };
164
164
  Object.defineProperties(console, {
165
- log: F({}, e, {
166
- value: oe
165
+ log: j({}, e, {
166
+ value: ne
167
167
  }),
168
- info: F({}, e, {
169
- value: se
168
+ info: j({}, e, {
169
+ value: ae
170
170
  }),
171
- warn: F({}, e, {
172
- value: ue
171
+ warn: j({}, e, {
172
+ value: ie
173
173
  }),
174
- error: F({}, e, {
175
- value: le
174
+ error: j({}, e, {
175
+ value: oe
176
176
  }),
177
- group: F({}, e, {
178
- value: ce
177
+ group: j({}, e, {
178
+ value: ue
179
179
  }),
180
- groupCollapsed: F({}, e, {
181
- value: fe
180
+ groupCollapsed: j({}, e, {
181
+ value: se
182
182
  }),
183
- groupEnd: F({}, e, {
184
- value: de
183
+ groupEnd: j({}, e, {
184
+ value: le
185
185
  })
186
186
  });
187
187
  }
188
- V < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
188
+ $ < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
189
  }
190
190
  }
191
- var z = $.ReactCurrentDispatcher, G;
192
- function U(e, r, t) {
191
+ var B = A.ReactCurrentDispatcher, J;
192
+ function N(e, r, t) {
193
193
  {
194
- if (G === void 0)
194
+ if (J === void 0)
195
195
  try {
196
196
  throw Error();
197
- } catch (s) {
198
- var n = s.stack.trim().match(/\n( *(at )?)/);
199
- G = n && n[1] || "";
197
+ } catch (u) {
198
+ var n = u.stack.trim().match(/\n( *(at )?)/);
199
+ J = n && n[1] || "";
200
200
  }
201
201
  return `
202
- ` + G + e;
202
+ ` + J + e;
203
203
  }
204
204
  }
205
- var X = !1, q;
205
+ var K = !1, L;
206
206
  {
207
- var Je = typeof WeakMap == "function" ? WeakMap : Map;
208
- q = new Je();
207
+ var qe = typeof WeakMap == "function" ? WeakMap : Map;
208
+ L = new qe();
209
209
  }
210
- function pe(e, r) {
211
- if (!e || X)
210
+ function fe(e, r) {
211
+ if (!e || K)
212
212
  return "";
213
213
  {
214
- var t = q.get(e);
214
+ var t = L.get(e);
215
215
  if (t !== void 0)
216
216
  return t;
217
217
  }
218
218
  var n;
219
- X = !0;
220
- var s = Error.prepareStackTrace;
219
+ K = !0;
220
+ var u = Error.prepareStackTrace;
221
221
  Error.prepareStackTrace = void 0;
222
- var u;
223
- u = z.current, z.current = null, qe();
222
+ var l;
223
+ l = B.current, B.current = null, Ue();
224
224
  try {
225
225
  if (r) {
226
- var i = function() {
226
+ var o = function() {
227
227
  throw Error();
228
228
  };
229
- if (Object.defineProperty(i.prototype, "props", {
229
+ if (Object.defineProperty(o.prototype, "props", {
230
230
  set: function() {
231
231
  throw Error();
232
232
  }
233
233
  }), typeof Reflect == "object" && Reflect.construct) {
234
234
  try {
235
- Reflect.construct(i, []);
236
- } catch (T) {
237
- n = T;
235
+ Reflect.construct(o, []);
236
+ } catch (R) {
237
+ n = R;
238
238
  }
239
- Reflect.construct(e, [], i);
239
+ Reflect.construct(e, [], o);
240
240
  } else {
241
241
  try {
242
- i.call();
243
- } catch (T) {
244
- n = T;
242
+ o.call();
243
+ } catch (R) {
244
+ n = R;
245
245
  }
246
- e.call(i.prototype);
246
+ e.call(o.prototype);
247
247
  }
248
248
  } else {
249
249
  try {
250
250
  throw Error();
251
- } catch (T) {
252
- n = T;
251
+ } catch (R) {
252
+ n = R;
253
253
  }
254
254
  e();
255
255
  }
256
- } catch (T) {
257
- if (T && n && typeof T.stack == "string") {
258
- for (var a = T.stack.split(`
259
- `), R = n.stack.split(`
260
- `), c = a.length - 1, f = R.length - 1; c >= 1 && f >= 0 && a[c] !== R[f]; )
261
- f--;
262
- for (; c >= 1 && f >= 0; c--, f--)
263
- if (a[c] !== R[f]) {
264
- if (c !== 1 || f !== 1)
256
+ } catch (R) {
257
+ if (R && n && typeof R.stack == "string") {
258
+ for (var i = R.stack.split(`
259
+ `), h = n.stack.split(`
260
+ `), d = i.length - 1, v = h.length - 1; d >= 1 && v >= 0 && i[d] !== h[v]; )
261
+ v--;
262
+ for (; d >= 1 && v >= 0; d--, v--)
263
+ if (i[d] !== h[v]) {
264
+ if (d !== 1 || v !== 1)
265
265
  do
266
- if (c--, f--, f < 0 || a[c] !== R[f]) {
267
- var w = `
268
- ` + a[c].replace(" at new ", " at ");
269
- return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && q.set(e, w), w;
266
+ if (d--, v--, v < 0 || i[d] !== h[v]) {
267
+ var _ = `
268
+ ` + i[d].replace(" at new ", " at ");
269
+ return e.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, _), _;
270
270
  }
271
- while (c >= 1 && f >= 0);
271
+ while (d >= 1 && v >= 0);
272
272
  break;
273
273
  }
274
274
  }
275
275
  } finally {
276
- X = !1, z.current = u, Be(), Error.prepareStackTrace = s;
276
+ K = !1, B.current = l, Me(), Error.prepareStackTrace = u;
277
277
  }
278
- var Y = e ? e.displayName || e.name : "", D = Y ? U(Y) : "";
279
- return typeof e == "function" && q.set(e, D), D;
278
+ var D = e ? e.displayName || e.name : "", C = D ? N(D) : "";
279
+ return typeof e == "function" && L.set(e, C), C;
280
280
  }
281
- function Ke(e, r, t) {
282
- return pe(e, !1);
281
+ function Be(e, r, t) {
282
+ return fe(e, !1);
283
283
  }
284
- function ze(e) {
284
+ function Je(e) {
285
285
  var r = e.prototype;
286
286
  return !!(r && r.isReactComponent);
287
287
  }
288
- function B(e, r, t) {
288
+ function U(e, r, t) {
289
289
  if (e == null)
290
290
  return "";
291
291
  if (typeof e == "function")
292
- return pe(e, ze(e));
292
+ return fe(e, Je(e));
293
293
  if (typeof e == "string")
294
- return U(e);
294
+ return N(e);
295
295
  switch (e) {
296
- case P:
297
- return U("Suspense");
296
+ case O:
297
+ return N("Suspense");
298
298
  case m:
299
- return U("SuspenseList");
299
+ return N("SuspenseList");
300
300
  }
301
301
  if (typeof e == "object")
302
302
  switch (e.$$typeof) {
303
- case y:
304
- return Ke(e.render);
305
- case x:
306
- return B(e.type, r, t);
307
- case C: {
308
- var n = e, s = n._payload, u = n._init;
303
+ case b:
304
+ return Be(e.render);
305
+ case E:
306
+ return U(e.type, r, t);
307
+ case x: {
308
+ var n = e, u = n._payload, l = n._init;
309
309
  try {
310
- return B(u(s), r, t);
310
+ return U(l(u), r, t);
311
311
  } catch {
312
312
  }
313
313
  }
314
314
  }
315
315
  return "";
316
316
  }
317
- var M = Object.prototype.hasOwnProperty, ye = {}, be = $.ReactDebugCurrentFrame;
318
- function J(e) {
317
+ var W = Object.prototype.hasOwnProperty, de = {}, ve = A.ReactDebugCurrentFrame;
318
+ function M(e) {
319
319
  if (e) {
320
- var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
321
- be.setExtraStackFrame(t);
320
+ var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
321
+ ve.setExtraStackFrame(t);
322
322
  } else
323
- be.setExtraStackFrame(null);
323
+ ve.setExtraStackFrame(null);
324
324
  }
325
- function Ge(e, r, t, n, s) {
325
+ function Ke(e, r, t, n, u) {
326
326
  {
327
- var u = Function.call.bind(M);
328
- for (var i in e)
329
- if (u(e, i)) {
330
- var a = void 0;
327
+ var l = Function.call.bind(W);
328
+ for (var o in e)
329
+ if (l(e, o)) {
330
+ var i = void 0;
331
331
  try {
332
- if (typeof e[i] != "function") {
333
- var R = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
- throw R.name = "Invariant Violation", R;
332
+ if (typeof e[o] != "function") {
333
+ var h = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
+ throw h.name = "Invariant Violation", h;
335
335
  }
336
- a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
- } catch (c) {
338
- a = c;
336
+ i = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
+ } catch (d) {
338
+ i = d;
339
339
  }
340
- a && !(a instanceof Error) && (J(s), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), J(null)), a instanceof Error && !(a.message in ye) && (ye[a.message] = !0, J(s), E("Failed %s type: %s", t, a.message), J(null));
340
+ i && !(i instanceof Error) && (M(u), g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof i), M(null)), i instanceof Error && !(i.message in de) && (de[i.message] = !0, M(u), g("Failed %s type: %s", t, i.message), M(null));
341
341
  }
342
342
  }
343
343
  }
344
- var Xe = Array.isArray;
345
- function H(e) {
346
- return Xe(e);
344
+ var ze = Array.isArray;
345
+ function z(e) {
346
+ return ze(e);
347
347
  }
348
- function He(e) {
348
+ function Ge(e) {
349
349
  {
350
350
  var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
351
  return t;
@@ -353,47 +353,47 @@ function mr() {
353
353
  }
354
354
  function Qe(e) {
355
355
  try {
356
- return ge(e), !1;
356
+ return pe(e), !1;
357
357
  } catch {
358
358
  return !0;
359
359
  }
360
360
  }
361
- function ge(e) {
361
+ function pe(e) {
362
362
  return "" + e;
363
363
  }
364
- function he(e) {
364
+ function be(e) {
365
365
  if (Qe(e))
366
- return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), ge(e);
366
+ return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ge(e)), pe(e);
367
367
  }
368
- var me = $.ReactCurrentOwner, Ze = {
368
+ var ye = A.ReactCurrentOwner, Xe = {
369
369
  key: !0,
370
370
  ref: !0,
371
371
  __self: !0,
372
372
  __source: !0
373
- }, Ee, Re;
374
- function er(e) {
375
- if (M.call(e, "ref")) {
373
+ }, ge, he;
374
+ function He(e) {
375
+ if (W.call(e, "ref")) {
376
376
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
377
377
  if (r && r.isReactWarning)
378
378
  return !1;
379
379
  }
380
380
  return e.ref !== void 0;
381
381
  }
382
- function rr(e) {
383
- if (M.call(e, "key")) {
382
+ function Ze(e) {
383
+ if (W.call(e, "key")) {
384
384
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
385
385
  if (r && r.isReactWarning)
386
386
  return !1;
387
387
  }
388
388
  return e.key !== void 0;
389
389
  }
390
- function tr(e, r) {
391
- typeof e.ref == "string" && me.current;
390
+ function er(e, r) {
391
+ typeof e.ref == "string" && ye.current;
392
392
  }
393
- function nr(e, r) {
393
+ function rr(e, r) {
394
394
  {
395
395
  var t = function() {
396
- Ee || (Ee = !0, E("%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://reactjs.org/link/special-props)", r));
396
+ ge || (ge = !0, g("%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://reactjs.org/link/special-props)", r));
397
397
  };
398
398
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
399
399
  get: t,
@@ -401,10 +401,10 @@ function mr() {
401
401
  });
402
402
  }
403
403
  }
404
- function ar(e, r) {
404
+ function tr(e, r) {
405
405
  {
406
406
  var t = function() {
407
- Re || (Re = !0, E("%s: `ref` 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://reactjs.org/link/special-props)", r));
407
+ he || (he = !0, g("%s: `ref` 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://reactjs.org/link/special-props)", r));
408
408
  };
409
409
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
410
  get: t,
@@ -412,70 +412,70 @@ function mr() {
412
412
  });
413
413
  }
414
414
  }
415
- var ir = function(e, r, t, n, s, u, i) {
416
- var a = {
415
+ var nr = function(e, r, t, n, u, l, o) {
416
+ var i = {
417
417
  // This tag allows us to uniquely identify this as a React Element
418
- $$typeof: l,
418
+ $$typeof: c,
419
419
  // Built-in properties that belong on the element
420
420
  type: e,
421
421
  key: r,
422
422
  ref: t,
423
- props: i,
423
+ props: o,
424
424
  // Record the component responsible for creating this element.
425
- _owner: u
425
+ _owner: l
426
426
  };
427
- return a._store = {}, Object.defineProperty(a._store, "validated", {
427
+ return i._store = {}, Object.defineProperty(i._store, "validated", {
428
428
  configurable: !1,
429
429
  enumerable: !1,
430
430
  writable: !0,
431
431
  value: !1
432
- }), Object.defineProperty(a, "_self", {
432
+ }), Object.defineProperty(i, "_self", {
433
433
  configurable: !1,
434
434
  enumerable: !1,
435
435
  writable: !1,
436
436
  value: n
437
- }), Object.defineProperty(a, "_source", {
437
+ }), Object.defineProperty(i, "_source", {
438
438
  configurable: !1,
439
439
  enumerable: !1,
440
440
  writable: !1,
441
- value: s
442
- }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
441
+ value: u
442
+ }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
443
443
  };
444
- function or(e, r, t, n, s) {
444
+ function ar(e, r, t, n, u) {
445
445
  {
446
- var u, i = {}, a = null, R = null;
447
- t !== void 0 && (he(t), a = "" + t), rr(r) && (he(r.key), a = "" + r.key), er(r) && (R = r.ref, tr(r, s));
448
- for (u in r)
449
- M.call(r, u) && !Ze.hasOwnProperty(u) && (i[u] = r[u]);
446
+ var l, o = {}, i = null, h = null;
447
+ t !== void 0 && (be(t), i = "" + t), Ze(r) && (be(r.key), i = "" + r.key), He(r) && (h = r.ref, er(r, u));
448
+ for (l in r)
449
+ W.call(r, l) && !Xe.hasOwnProperty(l) && (o[l] = r[l]);
450
450
  if (e && e.defaultProps) {
451
- var c = e.defaultProps;
452
- for (u in c)
453
- i[u] === void 0 && (i[u] = c[u]);
451
+ var d = e.defaultProps;
452
+ for (l in d)
453
+ o[l] === void 0 && (o[l] = d[l]);
454
454
  }
455
- if (a || R) {
456
- var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
- a && nr(i, f), R && ar(i, f);
455
+ if (i || h) {
456
+ var v = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
+ i && rr(o, v), h && tr(o, v);
458
458
  }
459
- return ir(e, a, R, s, n, me.current, i);
459
+ return nr(e, i, h, u, n, ye.current, o);
460
460
  }
461
461
  }
462
- var Q = $.ReactCurrentOwner, _e = $.ReactDebugCurrentFrame;
463
- function W(e) {
462
+ var G = A.ReactCurrentOwner, me = A.ReactDebugCurrentFrame;
463
+ function F(e) {
464
464
  if (e) {
465
- var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
466
- _e.setExtraStackFrame(t);
465
+ var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
466
+ me.setExtraStackFrame(t);
467
467
  } else
468
- _e.setExtraStackFrame(null);
468
+ me.setExtraStackFrame(null);
469
469
  }
470
- var Z;
471
- Z = !1;
472
- function ee(e) {
473
- return typeof e == "object" && e !== null && e.$$typeof === l;
470
+ var Q;
471
+ Q = !1;
472
+ function X(e) {
473
+ return typeof e == "object" && e !== null && e.$$typeof === c;
474
474
  }
475
- function Te() {
475
+ function Re() {
476
476
  {
477
- if (Q.current) {
478
- var e = k(Q.current.type);
477
+ if (G.current) {
478
+ var e = P(G.current.type);
479
479
  if (e)
480
480
  return `
481
481
 
@@ -484,13 +484,13 @@ Check the render method of \`` + e + "`.";
484
484
  return "";
485
485
  }
486
486
  }
487
- function sr(e) {
487
+ function ir(e) {
488
488
  return "";
489
489
  }
490
- var we = {};
491
- function ur(e) {
490
+ var Ee = {};
491
+ function or(e) {
492
492
  {
493
- var r = Te();
493
+ var r = Re();
494
494
  if (!r) {
495
495
  var t = typeof e == "string" ? e : e.displayName || e.name;
496
496
  t && (r = `
@@ -500,39 +500,39 @@ Check the top-level render call using <` + t + ">.");
500
500
  return r;
501
501
  }
502
502
  }
503
- function xe(e, r) {
503
+ function _e(e, r) {
504
504
  {
505
505
  if (!e._store || e._store.validated || e.key != null)
506
506
  return;
507
507
  e._store.validated = !0;
508
- var t = ur(r);
509
- if (we[t])
508
+ var t = or(r);
509
+ if (Ee[t])
510
510
  return;
511
- we[t] = !0;
511
+ Ee[t] = !0;
512
512
  var n = "";
513
- e && e._owner && e._owner !== Q.current && (n = " It was passed a child from " + k(e._owner.type) + "."), W(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), W(null);
513
+ e && e._owner && e._owner !== G.current && (n = " It was passed a child from " + P(e._owner.type) + "."), F(e), g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), F(null);
514
514
  }
515
515
  }
516
- function Se(e, r) {
516
+ function Te(e, r) {
517
517
  {
518
518
  if (typeof e != "object")
519
519
  return;
520
- if (H(e))
520
+ if (z(e))
521
521
  for (var t = 0; t < e.length; t++) {
522
522
  var n = e[t];
523
- ee(n) && xe(n, r);
523
+ X(n) && _e(n, r);
524
524
  }
525
- else if (ee(e))
525
+ else if (X(e))
526
526
  e._store && (e._store.validated = !0);
527
527
  else if (e) {
528
- var s = I(e);
529
- if (typeof s == "function" && s !== e.entries)
530
- for (var u = s.call(e), i; !(i = u.next()).done; )
531
- ee(i.value) && xe(i.value, r);
528
+ var u = Fe(e);
529
+ if (typeof u == "function" && u !== e.entries)
530
+ for (var l = u.call(e), o; !(o = l.next()).done; )
531
+ X(o.value) && _e(o.value, r);
532
532
  }
533
533
  }
534
534
  }
535
- function lr(e) {
535
+ function ur(e) {
536
536
  {
537
537
  var r = e.type;
538
538
  if (r == null || typeof r == "string")
@@ -540,195 +540,209 @@ Check the top-level render call using <` + t + ">.");
540
540
  var t;
541
541
  if (typeof r == "function")
542
542
  t = r.propTypes;
543
- else if (typeof r == "object" && (r.$$typeof === y || // Note: Memo only checks outer props here.
543
+ else if (typeof r == "object" && (r.$$typeof === b || // Note: Memo only checks outer props here.
544
544
  // Inner props are checked in the reconciler.
545
- r.$$typeof === x))
545
+ r.$$typeof === E))
546
546
  t = r.propTypes;
547
547
  else
548
548
  return;
549
549
  if (t) {
550
- var n = k(r);
551
- Ge(t, e.props, "prop", n, e);
552
- } else if (r.PropTypes !== void 0 && !Z) {
553
- Z = !0;
554
- var s = k(r);
555
- E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
550
+ var n = P(r);
551
+ Ke(t, e.props, "prop", n, e);
552
+ } else if (r.PropTypes !== void 0 && !Q) {
553
+ Q = !0;
554
+ var u = P(r);
555
+ g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
556
556
  }
557
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
557
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
558
  }
559
559
  }
560
- function cr(e) {
560
+ function sr(e) {
561
561
  {
562
562
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
563
563
  var n = r[t];
564
564
  if (n !== "children" && n !== "key") {
565
- W(e), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), W(null);
565
+ F(e), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), F(null);
566
566
  break;
567
567
  }
568
568
  }
569
- e.ref !== null && (W(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
569
+ e.ref !== null && (F(e), g("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
570
570
  }
571
571
  }
572
- var Oe = {};
573
- function Pe(e, r, t, n, s, u) {
572
+ var we = {};
573
+ function Se(e, r, t, n, u, l) {
574
574
  {
575
- var i = Le(e);
576
- if (!i) {
577
- var a = "";
578
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
- var R = sr();
580
- R ? a += R : a += Te();
581
- var c;
582
- e === null ? c = "null" : H(e) ? c = "array" : e !== void 0 && e.$$typeof === l ? (c = "<" + (k(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : c = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, a);
575
+ var o = Ne(e);
576
+ if (!o) {
577
+ var i = "";
578
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
+ var h = ir();
580
+ h ? i += h : i += Re();
581
+ var d;
582
+ e === null ? d = "null" : z(e) ? d = "array" : e !== void 0 && e.$$typeof === c ? (d = "<" + (P(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, i);
583
583
  }
584
- var f = or(e, r, t, s, u);
585
- if (f == null)
586
- return f;
587
- if (i) {
588
- var w = r.children;
589
- if (w !== void 0)
584
+ var v = ar(e, r, t, u, l);
585
+ if (v == null)
586
+ return v;
587
+ if (o) {
588
+ var _ = r.children;
589
+ if (_ !== void 0)
590
590
  if (n)
591
- if (H(w)) {
592
- for (var Y = 0; Y < w.length; Y++)
593
- Se(w[Y], e);
594
- Object.freeze && Object.freeze(w);
591
+ if (z(_)) {
592
+ for (var D = 0; D < _.length; D++)
593
+ Te(_[D], e);
594
+ Object.freeze && Object.freeze(_);
595
595
  } else
596
- E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
596
+ g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
597
  else
598
- Se(w, e);
598
+ Te(_, e);
599
599
  }
600
- if (M.call(r, "key")) {
601
- var D = k(e), T = Object.keys(r).filter(function(br) {
602
- return br !== "key";
603
- }), re = T.length > 0 ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}";
604
- if (!Oe[D + re]) {
605
- var yr = T.length > 0 ? "{" + T.join(": ..., ") + ": ...}" : "{}";
606
- E(`A props object containing a "key" prop is being spread into JSX:
600
+ if (W.call(r, "key")) {
601
+ var C = P(e), R = Object.keys(r).filter(function(pr) {
602
+ return pr !== "key";
603
+ }), H = R.length > 0 ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}";
604
+ if (!we[C + H]) {
605
+ var vr = R.length > 0 ? "{" + R.join(": ..., ") + ": ...}" : "{}";
606
+ g(`A props object containing a "key" prop is being spread into JSX:
607
607
  let props = %s;
608
608
  <%s {...props} />
609
609
  React keys must be passed directly to JSX without using spread:
610
610
  let props = %s;
611
- <%s key={someKey} {...props} />`, re, D, yr, D), Oe[D + re] = !0;
611
+ <%s key={someKey} {...props} />`, H, C, vr, C), we[C + H] = !0;
612
612
  }
613
613
  }
614
- return e === p ? cr(f) : lr(f), f;
614
+ return e === s ? sr(v) : ur(v), v;
615
615
  }
616
616
  }
617
- function fr(e, r, t) {
618
- return Pe(e, r, t, !0);
617
+ function lr(e, r, t) {
618
+ return Se(e, r, t, !0);
619
619
  }
620
- function dr(e, r, t) {
621
- return Pe(e, r, t, !1);
620
+ function cr(e, r, t) {
621
+ return Se(e, r, t, !1);
622
622
  }
623
- var vr = dr, pr = fr;
624
- L.Fragment = p, L.jsx = vr, L.jsxs = pr;
625
- })()), L;
623
+ var fr = cr, dr = lr;
624
+ V.Fragment = s, V.jsx = fr, V.jsxs = dr;
625
+ })()), V;
626
626
  }
627
- var Ae;
627
+ var Pe;
628
628
  function Er() {
629
- return Ae || (Ae = 1, process.env.NODE_ENV === "production" ? K.exports = hr() : K.exports = mr()), K.exports;
629
+ return Pe || (Pe = 1, process.env.NODE_ENV === "production" ? q.exports = mr() : q.exports = Rr()), q.exports;
630
630
  }
631
- var j = Er();
632
- function xr({
633
- fields: o,
634
- onChange: l,
635
- onSubmit: g,
636
- questionnaireId: p = "questionnaire-1",
637
- subjectId: d,
638
- className: h = "",
639
- fullHeight: O = !1
640
- }) {
641
- const S = A.useRef(!1), y = ne();
642
- A.useEffect(() => {
643
- if (S.current || !Array.isArray(o)) return;
644
- const _ = /* @__PURE__ */ new Set();
645
- o.forEach((b) => {
646
- (b == null ? void 0 : b.fieldType) === "section" && Array.isArray(b.fields) && b.fields.forEach((I) => (I == null ? void 0 : I.id) && _.add(I.id));
647
- });
648
- const v = o.filter((b) => !_.has(b.id));
649
- Ce.getState().replaceAll(v), y.preview.set(!0), S.current = !0;
650
- }, [o, y.preview]), A.useEffect(() => l ? Ce.subscribe((v) => {
651
- const b = v.flatArray ? v.flatArray() : Object.values(v.byId);
652
- l(b);
653
- }) : void 0, [l]);
654
- const P = De(), m = A.useCallback(() => {
655
- const _ = [];
656
- return (P || []).forEach((v) => {
657
- if (v.fieldType === "section" && Array.isArray(v.fields)) {
658
- v.fields.forEach((b) => {
659
- b && _.push({
660
- linkId: b.id,
661
- text: b.question || b.title || "",
662
- answer: Fe(b)
663
- });
664
- });
665
- return;
666
- }
667
- v.fieldType !== "section" && _.push({
668
- linkId: v.id,
669
- text: v.question || v.title || "",
670
- answer: Fe(v)
671
- });
672
- }), {
673
- resourceType: "QuestionnaireResponse",
674
- questionnaire: p,
675
- status: "in-progress",
676
- subject: d ? { reference: `Patient/${d}` } : void 0,
677
- item: _
678
- };
679
- }, [P, p, d]), x = (_) => {
680
- _.preventDefault();
681
- const v = m();
682
- g == null || g(v);
683
- }, C = [
684
- "qb-render-root",
685
- "bg-gray-100",
686
- "font-titillium",
687
- O ? "min-h-screen" : "",
688
- h
689
- ].filter(Boolean).join(" ");
690
- return /* @__PURE__ */ j.jsx("div", { className: C, children: /* @__PURE__ */ j.jsxs("form", { onSubmit: x, className: "max-w-4xl mx-auto px-2 pb-8 pt-4", children: [
691
- /* @__PURE__ */ j.jsx(Rr, {}),
692
- /* @__PURE__ */ j.jsx("div", { className: "pt-2", children: /* @__PURE__ */ j.jsx("button", { type: "submit", className: "px-4 py-2 rounded bg-[#0076a8] text-white shadow hover:bg-[#00628a] transition-colors", children: "Submit" }) })
693
- ] }) });
631
+ var w = Er();
632
+ function _r(a) {
633
+ const c = I.useRef(!1), f = Ce();
634
+ I.useEffect(() => {
635
+ c.current || !Array.isArray(a) || (ke.getState().ingest(a), f.preview.set(!0), c.current = !0);
636
+ }, [a, f.preview]);
694
637
  }
695
- function Fe(o) {
696
- switch (o.fieldType) {
638
+ function je(a) {
639
+ switch (a.fieldType) {
697
640
  case "input":
698
- return o.answer ? [{ valueString: String(o.answer) }] : [];
641
+ return a.answer ? [{ valueString: String(a.answer) }] : [];
699
642
  case "radio":
700
- return o.selected ? [{ valueString: te(o, o.selected) }] : [];
643
+ return a.selected ? [{ valueString: Z(a, a.selected) }] : [];
701
644
  case "check":
702
- return (o.selected || []).map((l) => ({ valueString: te(o, l) }));
645
+ return (a.selected || []).map((c) => ({ valueString: Z(a, c) }));
703
646
  case "selection":
704
- return o.selected ? [{ valueString: te(o, o.selected) }] : [];
647
+ return a.selected ? [{ valueString: Z(a, a.selected) }] : [];
705
648
  default:
706
649
  return [];
707
650
  }
708
651
  }
709
- function te(o, l) {
710
- const g = (o.options || []).find((p) => p.id === l || p.value === l);
711
- return g ? g.value : "";
652
+ function Z(a, c) {
653
+ const f = (a.options || []).find((s) => s.id === c || s.value === c);
654
+ return f ? f.value : "";
712
655
  }
713
- function Rr() {
714
- const o = ne(), l = De() || [], g = A.useMemo(() => {
715
- const d = [];
716
- return l.forEach((h) => {
717
- d.push(h), (h == null ? void 0 : h.fieldType) === "section" && Array.isArray(h.fields) && d.push(...h.fields);
718
- }), d;
719
- }, [l]), p = A.useMemo(() => o.state.isPreview ? l.filter((d) => Ie(d, g)) : l, [l, g, o.state.isPreview]);
720
- return /* @__PURE__ */ j.jsx("div", { children: p.map((d) => /* @__PURE__ */ j.jsx(_r, { field: d, allFlat: g }, d.id)) });
656
+ function Tr(a, c, f) {
657
+ const s = [];
658
+ return (a || []).forEach((p) => {
659
+ if (p.fieldType === "section" && Array.isArray(p.fields)) {
660
+ p.fields.forEach((y) => {
661
+ y && s.push({
662
+ linkId: y.id,
663
+ text: y.question || y.title || "",
664
+ answer: je(y)
665
+ });
666
+ });
667
+ return;
668
+ }
669
+ p.fieldType !== "section" && s.push({
670
+ linkId: p.id,
671
+ text: p.question || p.title || "",
672
+ answer: je(p)
673
+ });
674
+ }), {
675
+ resourceType: "QuestionnaireResponse",
676
+ questionnaire: c,
677
+ status: "in-progress",
678
+ subject: f ? { reference: `Patient/${f}` } : void 0,
679
+ item: s
680
+ };
721
681
  }
722
- function _r({ field: o, allFlat: l }) {
723
- const g = ne(), p = gr(o.fieldType);
724
- if (!p) return null;
725
- if (o.fieldType === "section" && g.state.isPreview && Array.isArray(o.fields)) {
726
- const d = o.fields.filter((O) => Ie(O, l)), h = { ...o, fields: d };
727
- return /* @__PURE__ */ j.jsx(p, { field: h });
682
+ function wr(a, c, f, s) {
683
+ return I.useCallback((y) => {
684
+ y.preventDefault();
685
+ const T = Tr(a, c, f);
686
+ s == null || s(T);
687
+ }, [a, c, f, s]);
688
+ }
689
+ function Sr({ field: a, allFlat: c, isPreview: f }) {
690
+ const s = br(a.fieldType);
691
+ if (!s) return null;
692
+ if (a.fieldType === "section" && f && Array.isArray(a.fields)) {
693
+ const p = a.fields.filter((T) => yr(T, c)), y = { ...a, fields: p };
694
+ return /* @__PURE__ */ w.jsx(s, { field: y });
728
695
  }
729
- return /* @__PURE__ */ j.jsx(p, { field: o });
696
+ return /* @__PURE__ */ w.jsx(s, { field: a });
697
+ }
698
+ function xr() {
699
+ const a = Ce(), { fields: c, allFlat: f } = gr(a.state.isPreview);
700
+ return /* @__PURE__ */ w.jsx("div", { children: c.map((s) => /* @__PURE__ */ w.jsx(
701
+ Sr,
702
+ {
703
+ field: s,
704
+ allFlat: f,
705
+ isPreview: a.state.isPreview
706
+ },
707
+ s.id
708
+ )) });
709
+ }
710
+ function Or({ className: a = "" }) {
711
+ return /* @__PURE__ */ w.jsx("div", { className: `pt-2 ${a}`, children: /* @__PURE__ */ w.jsx(
712
+ "button",
713
+ {
714
+ type: "submit",
715
+ className: "px-4 py-2 rounded bg-[#0076a8] text-white shadow hover:bg-[#00628a] transition-colors",
716
+ children: "Submit"
717
+ }
718
+ ) });
719
+ }
720
+ function Cr({
721
+ fields: a,
722
+ onChange: c,
723
+ onSubmit: f,
724
+ questionnaireId: s = "questionnaire-1",
725
+ subjectId: p,
726
+ className: y = "",
727
+ fullHeight: T = !1
728
+ }) {
729
+ _r(a), I.useEffect(() => c ? ke.subscribe((E) => {
730
+ const x = E.order.map((k) => E.byId[k]);
731
+ c(x);
732
+ }) : void 0, [c]);
733
+ const S = hr(), b = wr(S, s, p, f), O = [
734
+ "qb-render-root",
735
+ "bg-gray-100",
736
+ "font-titillium",
737
+ T ? "min-h-screen" : "",
738
+ y
739
+ ].filter(Boolean).join(" ");
740
+ return /* @__PURE__ */ w.jsx("div", { className: O, children: /* @__PURE__ */ w.jsxs("form", { onSubmit: b, className: "max-w-4xl mx-auto px-2 pb-8 pt-4", children: [
741
+ /* @__PURE__ */ w.jsx(xr, {}),
742
+ /* @__PURE__ */ w.jsx(Or, {})
743
+ ] }) });
730
744
  }
731
745
  export {
732
- xr as QuestionnaireRenderer
746
+ Cr as QuestionnaireRenderer
733
747
  };
734
748
  //# sourceMappingURL=index.js.map