treege 3.0.0-beta.8 → 3.0.0-beta.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/LICENSE +18 -12
  2. package/README.md +474 -79
  3. package/dist/DefaultSubmitButton-Dg9GPvh-.js +1853 -0
  4. package/dist/ThemeContext-BgTIhoK6.js +985 -0
  5. package/dist/editor/components/input/ComboboxWithCreate.d.ts +2 -1
  6. package/dist/editor/components/styles/EditorStyles.d.ts +2 -0
  7. package/dist/editor/constants/defaultNode.d.ts +1 -1
  8. package/dist/editor/constants/edgeTypes.d.ts +3 -2
  9. package/dist/editor/constants/inputTypeIcons.d.ts +3 -0
  10. package/dist/editor/constants/nodeSpacing.d.ts +25 -0
  11. package/dist/editor/constants/nodeTypes.d.ts +4 -5
  12. package/dist/editor/context/OpenApiContext.d.ts +79 -0
  13. package/dist/editor/context/TreegeEditorRuntimeProvider.d.ts +78 -0
  14. package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
  15. package/dist/editor/features/TreegeEditor/controls/MiniMapControl.d.ts +6 -0
  16. package/dist/editor/features/TreegeEditor/dialogs/AuthorizeDialog.d.ts +20 -0
  17. package/dist/editor/features/TreegeEditor/dialogs/ChangeNodeTypeDialog.d.ts +2 -0
  18. package/dist/editor/features/TreegeEditor/dialogs/DeleteNodeDialog.d.ts +2 -0
  19. package/dist/editor/features/TreegeEditor/dialogs/HeadersDialog.d.ts +19 -0
  20. package/dist/editor/features/TreegeEditor/dialogs/OpenApiDialog.d.ts +6 -0
  21. package/dist/editor/features/TreegeEditor/edges/ConditionalEdge.d.ts +2 -2
  22. package/dist/editor/features/TreegeEditor/edges/DefaultEdge.d.ts +3 -0
  23. package/dist/editor/features/TreegeEditor/forms/HttpConfigForm.d.ts +4 -1
  24. package/dist/editor/features/TreegeEditor/forms/JsonTemplateEditor.d.ts +13 -0
  25. package/dist/editor/features/TreegeEditor/forms/OptionsMappingFields.d.ts +34 -0
  26. package/dist/editor/features/TreegeEditor/forms/OptionsSourceForm.d.ts +7 -0
  27. package/dist/editor/features/TreegeEditor/forms/SensitiveHeaderWarning.d.ts +13 -0
  28. package/dist/editor/features/TreegeEditor/forms/SubmitConfigForm.d.ts +7 -0
  29. package/dist/editor/features/TreegeEditor/inputs/ApiUrlCombobox.d.ts +20 -0
  30. package/dist/editor/features/TreegeEditor/inputs/ComboboxPattern.d.ts +2 -1
  31. package/dist/editor/features/TreegeEditor/inputs/DefaultFileValueField.d.ts +14 -0
  32. package/dist/editor/features/TreegeEditor/inputs/OptionImageField.d.ts +6 -0
  33. package/dist/editor/features/TreegeEditor/inputs/SelectNodeGroup.d.ts +22 -1
  34. package/dist/editor/features/TreegeEditor/layout/AutoLayout.d.ts +15 -0
  35. package/dist/editor/features/TreegeEditor/listeners/FlowChangeEmitter.d.ts +19 -0
  36. package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +5 -0
  37. package/dist/editor/features/TreegeEditor/nodes/components/BottomHandleDropdown.d.ts +25 -0
  38. package/dist/editor/features/TreegeEditor/nodes/components/NodeGroupBadge.d.ts +6 -0
  39. package/dist/editor/features/TreegeEditor/nodes/components/NodeImage.d.ts +5 -0
  40. package/dist/editor/features/TreegeEditor/nodes/components/NodeImageButton.d.ts +6 -0
  41. package/dist/editor/features/TreegeEditor/nodes/components/NodeInputPreview.d.ts +12 -0
  42. package/dist/editor/features/TreegeEditor/nodes/components/NodeLabelInput.d.ts +10 -0
  43. package/dist/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.d.ts +6 -0
  44. package/dist/editor/features/TreegeEditor/nodes/components/NodeRequiredButton.d.ts +6 -0
  45. package/dist/editor/features/TreegeEditor/nodes/components/NodeStackOrderButtons.d.ts +6 -0
  46. package/dist/editor/features/TreegeEditor/nodes/components/NodeTypeBadge.d.ts +7 -0
  47. package/dist/editor/features/TreegeEditor/nodes/components/NodeTypePickerMenuContent.d.ts +12 -0
  48. package/dist/editor/features/TreegeEditor/nodes/layout/NodeWrapper.d.ts +4 -2
  49. package/dist/editor/features/TreegeEditor/panel/AIGeneratorDialog.d.ts +16 -0
  50. package/dist/editor/features/TreegeEditor/panel/ActionsPanel.d.ts +7 -2
  51. package/dist/editor/features/TreegeEditor/panel/MultiSelectionPanel.d.ts +7 -0
  52. package/dist/editor/hooks/useAvailableParentFields.d.ts +13 -0
  53. package/dist/editor/hooks/useFlowActions.d.ts +6 -2
  54. package/dist/editor/hooks/useFlowConnections.d.ts +14 -0
  55. package/dist/editor/hooks/useFlowContent.d.ts +16 -0
  56. package/dist/editor/hooks/useHistoryStore.d.ts +26 -0
  57. package/dist/editor/hooks/useIsStackedEdge.d.ts +8 -0
  58. package/dist/editor/hooks/useKeyValueRows.d.ts +15 -0
  59. package/dist/editor/hooks/useNodesSelection.d.ts +5 -5
  60. package/dist/editor/hooks/useStackPosition.d.ts +14 -0
  61. package/dist/editor/hooks/useTranslate.d.ts +1 -1
  62. package/dist/editor/hooks/useUndoRedo.d.ts +31 -0
  63. package/dist/editor/types/ai.d.ts +65 -0
  64. package/dist/editor/types/editor.d.ts +106 -10
  65. package/dist/editor/types/openapi.d.ts +106 -0
  66. package/dist/editor/utils/aiFlowGenerator.d.ts +5 -0
  67. package/dist/editor/utils/cleanEmptyData.d.ts +18 -0
  68. package/dist/editor/utils/cleanNodeConfig.d.ts +5 -0
  69. package/dist/editor/utils/dagreLayout.d.ts +8 -0
  70. package/dist/editor/utils/edge.d.ts +50 -0
  71. package/dist/editor/utils/groupColor.d.ts +14 -0
  72. package/dist/editor/utils/image.d.ts +7 -0
  73. package/dist/editor/utils/inputTypeIcon.d.ts +6 -0
  74. package/dist/editor/utils/jsonBindTarget.d.ts +15 -0
  75. package/dist/editor/utils/openApiPayload.d.ts +12 -0
  76. package/dist/editor/utils/openapi.d.ts +35 -0
  77. package/dist/editor/utils/sensitiveHeaders.d.ts +20 -0
  78. package/dist/editor/utils/stackPositionIndex.d.ts +9 -0
  79. package/dist/editor-h20-TVM8.js +6575 -0
  80. package/dist/editor.js +3 -7
  81. package/dist/main.js +6 -52
  82. package/dist/renderer/context/TreegeRenderRuntimeProvider.d.ts +135 -0
  83. package/dist/renderer/context/TreegeRendererProvider.d.ts +15 -0
  84. package/dist/renderer/features/TreegeRenderer/native/TreegeRenderer.d.ts +19 -11
  85. package/dist/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.d.ts +7 -7
  86. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputLabel.d.ts +10 -0
  87. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputWrapper.d.ts +9 -0
  88. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +20 -15
  89. package/dist/renderer/features/TreegeRenderer/native/components/DefaultLoadingSkeleton.d.ts +8 -0
  90. package/dist/renderer/features/TreegeRenderer/native/components/DefaultStep.d.ts +3 -0
  91. package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButton.d.ts +9 -7
  92. package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButtonWrapper.d.ts +11 -0
  93. package/dist/renderer/features/TreegeRenderer/native/components/DefaultUI.d.ts +8 -7
  94. package/dist/renderer/features/TreegeRenderer/native/components/DependencyHint.d.ts +15 -0
  95. package/dist/renderer/features/TreegeRenderer/native/components/OptionItemContent.d.ts +17 -0
  96. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts +3 -0
  97. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts +3 -0
  98. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultCheckboxInput.d.ts +3 -0
  99. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateInput.d.ts +3 -0
  100. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateRangeInput.d.ts +3 -0
  101. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultFileInput.d.ts +3 -0
  102. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHiddenInput.d.ts +3 -0
  103. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHttpInput.d.ts +3 -0
  104. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts +3 -0
  105. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts +3 -0
  106. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultRadioInput.d.ts +3 -0
  107. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts +3 -0
  108. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSubmitInput.d.ts +11 -0
  109. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSwitchInput.d.ts +3 -0
  110. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextInput.d.ts +3 -0
  111. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts +3 -0
  112. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeInput.d.ts +3 -0
  113. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeRangeInput.d.ts +3 -0
  114. package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +97 -24
  115. package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
  116. package/dist/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.d.ts +3 -2
  117. package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputLabel.d.ts +9 -0
  118. package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputWrapper.d.ts +9 -0
  119. package/dist/renderer/features/TreegeRenderer/web/components/DefaultLoadingSkeleton.d.ts +7 -0
  120. package/dist/renderer/features/TreegeRenderer/web/components/DefaultStep.d.ts +3 -0
  121. package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButton.d.ts +5 -1
  122. package/dist/renderer/features/TreegeRenderer/web/components/DependencyHint.d.ts +22 -0
  123. package/dist/renderer/features/TreegeRenderer/web/components/OptionItemContent.d.ts +17 -0
  124. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +1 -1
  125. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +1 -1
  126. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +1 -1
  127. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +1 -1
  128. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +1 -1
  129. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +1 -1
  130. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +1 -1
  131. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +1 -1
  132. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +1 -1
  133. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +1 -1
  134. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +1 -1
  135. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +1 -1
  136. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSubmitInput.d.ts +11 -0
  137. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +1 -1
  138. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +1 -1
  139. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +1 -1
  140. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +1 -1
  141. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +1 -1
  142. package/dist/renderer/features/TreegeRenderer/web/components/styles/RendererStyles.d.ts +2 -0
  143. package/dist/renderer/hooks/useInputOptions.d.ts +28 -0
  144. package/dist/renderer/hooks/useRenderNode.d.ts +62 -0
  145. package/dist/renderer/hooks/useSubmitHandler.d.ts +36 -0
  146. package/dist/renderer/hooks/useTranslate.d.ts +7 -5
  147. package/dist/renderer/index.d.ts +5 -2
  148. package/dist/renderer/index.native.d.ts +20 -0
  149. package/dist/renderer/types/renderer.d.ts +316 -42
  150. package/dist/renderer/utils/file.d.ts +11 -10
  151. package/dist/renderer/utils/flow.d.ts +1 -18
  152. package/dist/renderer/utils/form.d.ts +54 -2
  153. package/dist/renderer/utils/http.d.ts +177 -0
  154. package/dist/renderer/utils/jsonTemplate.d.ts +30 -0
  155. package/dist/renderer/utils/node.d.ts +29 -1
  156. package/dist/renderer/utils/sanitize.d.ts +85 -0
  157. package/dist/renderer/utils/sanitize.native.d.ts +69 -0
  158. package/dist/renderer/utils/step.d.ts +27 -0
  159. package/dist/renderer/utils/submit.d.ts +49 -0
  160. package/dist/renderer/utils/templateDependencies.d.ts +17 -0
  161. package/dist/renderer-DI6nF4St.js +256 -0
  162. package/dist/renderer-native.d.ts +2 -0
  163. package/dist/renderer-native.js +3704 -0
  164. package/dist/renderer.js +5 -45
  165. package/dist/shared/components/ui/badge.d.ts +2 -2
  166. package/dist/shared/components/ui/button.d.ts +3 -3
  167. package/dist/shared/components/ui/collapsible.d.ts +1 -1
  168. package/dist/shared/components/ui/command.d.ts +1 -1
  169. package/dist/shared/components/ui/dropdown-menu.d.ts +1 -1
  170. package/dist/shared/components/ui/field.d.ts +24 -0
  171. package/dist/shared/components/ui/form.d.ts +1 -1
  172. package/dist/shared/components/ui/item.d.ts +23 -0
  173. package/dist/shared/components/ui/popover.d.ts +10 -2
  174. package/dist/shared/components/ui/select.d.ts +3 -1
  175. package/dist/shared/components/ui/sheet.d.ts +1 -1
  176. package/dist/shared/components/ui/skeleton.d.ts +3 -0
  177. package/dist/shared/components/ui/toggle-group.d.ts +7 -0
  178. package/dist/shared/components/ui/toggle.d.ts +9 -0
  179. package/dist/shared/components/ui/tooltip.d.ts +1 -1
  180. package/dist/shared/constants/colors.d.ts +45 -0
  181. package/dist/shared/constants/inputType.d.ts +6 -0
  182. package/dist/shared/constants/node.d.ts +0 -1
  183. package/dist/shared/context/PortalContainerContext.d.ts +5 -0
  184. package/dist/shared/context/ThemeContext.d.ts +2 -0
  185. package/dist/shared/context/ThemeContext.native.d.ts +22 -0
  186. package/dist/shared/hooks/useMediaQuery.d.ts +12 -0
  187. package/dist/shared/hooks/useThemeColors.d.ts +37 -0
  188. package/dist/shared/locales/ar.json.d.ts +259 -19
  189. package/dist/shared/locales/de.json.d.ts +260 -20
  190. package/dist/shared/locales/en.json.d.ts +261 -21
  191. package/dist/shared/locales/es.json.d.ts +260 -20
  192. package/dist/shared/locales/fr.json.d.ts +260 -20
  193. package/dist/shared/locales/it.json.d.ts +260 -20
  194. package/dist/shared/locales/pt.json.d.ts +260 -20
  195. package/dist/shared/types/edge.d.ts +6 -0
  196. package/dist/shared/types/file.d.ts +14 -0
  197. package/dist/shared/types/node.d.ts +155 -19
  198. package/dist/shared/utils/httpRecord.d.ts +20 -0
  199. package/dist/shared/utils/inputTypeGuards.d.ts +7 -0
  200. package/dist/shared/utils/nodeTypeGuards.d.ts +1 -6
  201. package/dist/shared/utils/normalizeLabel.d.ts +21 -0
  202. package/dist/useRenderNode-B1sfwbia.js +527 -0
  203. package/package.json +54 -22
  204. package/dist/ThemeContext-BIvs8Kw-.js +0 -758
  205. package/dist/TreegeEditor-Lv5Tn9_F.js +0 -2152
  206. package/dist/TreegeRenderer-D3EvsEfJ.js +0 -1413
  207. package/dist/editor/context/TreegeEditorContext.d.ts +0 -12
  208. package/dist/editor/features/TreegeEditor/forms/FlowNodeForm.d.ts +0 -2
  209. package/dist/editor/features/TreegeEditor/inputs/SelectInputType.d.ts +0 -7
  210. package/dist/editor/features/TreegeEditor/nodes/FlowNode.d.ts +0 -6
  211. package/dist/editor/features/TreegeEditor/nodes/GroupNode.d.ts +0 -6
  212. package/dist/editor/features/TreegeEditor/nodes/InputNode.d.ts +0 -6
  213. package/dist/editor/features/TreegeEditor/nodes/UINode.d.ts +0 -6
  214. package/dist/editor/hooks/useEdgesSelection.d.ts +0 -11
  215. package/dist/renderer/context/TreegeConfigContext.d.ts +0 -39
  216. package/dist/renderer/context/TreegeRendererContext.d.ts +0 -25
  217. package/dist/renderer/features/TreegeRenderer/native/components/DefaultGroup.d.ts +0 -7
  218. package/dist/renderer/features/TreegeRenderer/web/components/DefaultGroup.d.ts +0 -6
  219. /package/dist/editor/components/{data-display/logo.d.ts → branding/Logo.d.ts} +0 -0
@@ -0,0 +1,3704 @@
1
+ import { A as e, C as t, D as n, H as r, I as i, L as a, M as o, N as s, S as c, T as l, W as u, _ as d, a as f, c as p, g as m, h, i as g, j as _, l as v, m as y, n as b, o as x, r as S, s as C, t as w, v as T, y as E } from "./ThemeContext-BgTIhoK6.js";
2
+ import { a as D, c as O, i as k, l as A, n as ee, o as te, r as j, s as ne, t as re } from "./useRenderNode-B1sfwbia.js";
3
+ import { useCallback as ie, useEffect as ae, useMemo as oe, useRef as M, useState as N } from "react";
4
+ import { Fragment as se, jsx as P, jsxs as F } from "react/jsx-runtime";
5
+ import { ActivityIndicator as ce, Alert as I, Animated as L, FlatList as le, Image as R, Modal as ue, ScrollView as de, StyleSheet as z, Switch as fe, Text as B, TextInput as pe, TouchableOpacity as V, View as H } from "react-native";
6
+ //#region src/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.tsx
7
+ var me = ({ children: e }) => /* @__PURE__ */ P(H, {
8
+ style: he.container,
9
+ children: e
10
+ }), he = z.create({ container: { padding: 16 } }), ge = ({ label: e, required: t, style: n }) => {
11
+ let { colors: r } = b();
12
+ return e ? /* @__PURE__ */ F(B, {
13
+ style: [
14
+ _e.label,
15
+ { color: r.textSecondary },
16
+ n
17
+ ],
18
+ children: [e, t && /* @__PURE__ */ P(B, {
19
+ style: { color: r.error },
20
+ children: "*"
21
+ })]
22
+ }) : null;
23
+ }, _e = z.create({ label: {
24
+ fontSize: 14,
25
+ fontWeight: "500",
26
+ marginBottom: 8
27
+ } }), ve = async (e, t) => {
28
+ if (!e || e.trim().length < 3) return [];
29
+ try {
30
+ let n = await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&format=jsonv2&addressdetails=1&limit=5`, { headers: {
31
+ Accept: "application/json",
32
+ "User-Agent": "Treege Renderer",
33
+ ...t && { "Accept-Language": t }
34
+ } });
35
+ return n.ok ? (await n.json()).map((e) => ({
36
+ label: e.display_name,
37
+ value: e.display_name
38
+ })) : [];
39
+ } catch (e) {
40
+ return console.error("Nominatim fetch error:", e), [];
41
+ }
42
+ }, ye = async (e, t) => {
43
+ if (!e || e.trim().length < 3) return [];
44
+ try {
45
+ let n = await fetch(`https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${encodeURIComponent(e)}&key=${t}`);
46
+ if (!n.ok) return console.warn("Google Places API request failed:", n.status), [];
47
+ let r = await n.json();
48
+ return r.status !== "OK" && r.status !== "ZERO_RESULTS" ? (console.warn("Google Places API status:", r.status), []) : (r.predictions || []).map((e) => ({
49
+ label: e.description,
50
+ value: e.description
51
+ }));
52
+ } catch (e) {
53
+ return console.error("Google Places fetch error:", e), [];
54
+ }
55
+ }, be = ({ field: e, extra: t }) => {
56
+ let [n, r] = N(""), [i, o] = N([]), [c, l] = N(!1), [u, d] = N(!1), { value: f, placeholder: p, id: m, name: h } = e, { InputLabel: g, node: _, setValue: v, error: y, label: x, helperText: S } = t, { language: C, googleApiKey: w } = a(), T = s(), { colors: E } = b(), D = ie((e) => {
57
+ v(e.value), r(""), l(!1), o([]);
58
+ }, [v]), O = () => {
59
+ l(!1);
60
+ };
61
+ return ae(() => {
62
+ if (!n || n.trim().length < 3) {
63
+ o([]), d(!1);
64
+ return;
65
+ }
66
+ d(!0);
67
+ let e = setTimeout(async () => {
68
+ o(w ? await ye(n, w) : await ve(n, C)), d(!1);
69
+ }, 300);
70
+ return () => {
71
+ clearTimeout(e), d(!1);
72
+ };
73
+ }, [
74
+ n,
75
+ C,
76
+ w
77
+ ]), /* @__PURE__ */ F(H, {
78
+ style: U.container,
79
+ children: [
80
+ /* @__PURE__ */ P(g, {
81
+ label: x,
82
+ required: _.data.required
83
+ }),
84
+ /* @__PURE__ */ F(V, {
85
+ style: [
86
+ U.trigger,
87
+ {
88
+ backgroundColor: E.input,
89
+ borderColor: E.border
90
+ },
91
+ y && { borderColor: E.error }
92
+ ],
93
+ onPress: () => l(!0),
94
+ activeOpacity: .7,
95
+ children: [/* @__PURE__ */ P(B, {
96
+ style: [
97
+ U.triggerText,
98
+ { color: E.text },
99
+ !f && { color: E.textMuted }
100
+ ],
101
+ numberOfLines: 1,
102
+ children: f || p || T("renderer.defaultAddressInput.enterAddress")
103
+ }), /* @__PURE__ */ P(B, {
104
+ style: U.icon,
105
+ children: "📍"
106
+ })]
107
+ }),
108
+ /* @__PURE__ */ P(ue, {
109
+ visible: c,
110
+ transparent: !0,
111
+ animationType: "fade",
112
+ onRequestClose: O,
113
+ children: /* @__PURE__ */ P(V, {
114
+ style: U.modalOverlay,
115
+ activeOpacity: 1,
116
+ onPress: O,
117
+ children: /* @__PURE__ */ F(V, {
118
+ style: [U.modalContent, { backgroundColor: E.card }],
119
+ activeOpacity: 1,
120
+ onPress: () => {},
121
+ children: [
122
+ /* @__PURE__ */ F(H, {
123
+ style: [U.modalHeader, { borderBottomColor: E.separator }],
124
+ children: [/* @__PURE__ */ P(B, {
125
+ style: [U.modalTitle, { color: E.text }],
126
+ children: x || p || T("renderer.defaultAddressInput.enterAddress")
127
+ }), /* @__PURE__ */ P(V, {
128
+ onPress: O,
129
+ children: /* @__PURE__ */ P(B, {
130
+ style: [U.closeButton, { color: E.textMuted }],
131
+ children: "✕"
132
+ })
133
+ })]
134
+ }),
135
+ /* @__PURE__ */ F(H, {
136
+ style: U.searchContainer,
137
+ children: [/* @__PURE__ */ P(pe, {
138
+ style: [U.searchInput, {
139
+ backgroundColor: E.muted,
140
+ borderColor: E.border,
141
+ color: E.text
142
+ }],
143
+ placeholder: p || T("renderer.defaultAddressInput.enterAddress"),
144
+ placeholderTextColor: E.textMuted,
145
+ value: n,
146
+ onChangeText: r,
147
+ autoFocus: !0,
148
+ autoCapitalize: "none",
149
+ autoCorrect: !1
150
+ }), u && /* @__PURE__ */ P(ce, {
151
+ size: "small",
152
+ color: E.primary,
153
+ style: U.searchLoader
154
+ })]
155
+ }),
156
+ u ? /* @__PURE__ */ F(H, {
157
+ style: U.loadingContainer,
158
+ children: [/* @__PURE__ */ P(ce, {
159
+ size: "small",
160
+ color: E.primary
161
+ }), /* @__PURE__ */ P(B, {
162
+ style: [U.loadingText, { color: E.textMuted }],
163
+ children: T("renderer.defaultAddressInput.searching")
164
+ })]
165
+ }) : /* @__PURE__ */ P(le, {
166
+ data: i,
167
+ keyExtractor: (e, t) => t.toString(),
168
+ style: U.suggestionsList,
169
+ contentContainerStyle: U.suggestionsListContent,
170
+ keyboardShouldPersistTaps: "handled",
171
+ ListEmptyComponent: n.length >= 3 ? /* @__PURE__ */ P(H, {
172
+ style: U.emptyContainer,
173
+ children: /* @__PURE__ */ P(B, {
174
+ style: [U.emptyText, { color: E.textMuted }],
175
+ children: T("renderer.defaultAddressInput.noAddressesFound")
176
+ })
177
+ }) : /* @__PURE__ */ P(H, {
178
+ style: U.emptyContainer,
179
+ children: /* @__PURE__ */ P(B, {
180
+ style: [U.emptyText, { color: E.textMuted }],
181
+ children: T("renderer.defaultAddressInput.typeMinChars")
182
+ })
183
+ }),
184
+ renderItem: ({ item: e }) => /* @__PURE__ */ F(V, {
185
+ style: U.suggestionItem,
186
+ onPress: () => D(e),
187
+ activeOpacity: .7,
188
+ children: [/* @__PURE__ */ P(B, {
189
+ style: U.suggestionIcon,
190
+ children: "📍"
191
+ }), /* @__PURE__ */ P(B, {
192
+ style: [U.suggestionText, { color: E.text }],
193
+ numberOfLines: 2,
194
+ children: e.label
195
+ })]
196
+ })
197
+ })
198
+ ]
199
+ })
200
+ })
201
+ }),
202
+ y && /* @__PURE__ */ P(B, {
203
+ style: [U.error, { color: E.error }],
204
+ children: y
205
+ }),
206
+ S && !y && /* @__PURE__ */ P(B, {
207
+ style: [U.helperText, { color: E.textMuted }],
208
+ children: S
209
+ })
210
+ ]
211
+ });
212
+ }, U = z.create({
213
+ closeButton: {
214
+ fontSize: 24,
215
+ fontWeight: "300"
216
+ },
217
+ container: { marginBottom: 16 },
218
+ emptyContainer: {
219
+ alignItems: "center",
220
+ paddingVertical: 24
221
+ },
222
+ emptyText: { fontSize: 14 },
223
+ error: {
224
+ fontSize: 12,
225
+ marginTop: 4
226
+ },
227
+ helperText: {
228
+ fontSize: 12,
229
+ marginTop: 4
230
+ },
231
+ icon: { fontSize: 16 },
232
+ loadingContainer: {
233
+ alignItems: "center",
234
+ flexDirection: "row",
235
+ justifyContent: "center",
236
+ paddingVertical: 24
237
+ },
238
+ loadingText: {
239
+ fontSize: 14,
240
+ marginLeft: 8
241
+ },
242
+ modalContent: {
243
+ borderRadius: 12,
244
+ maxHeight: "80%",
245
+ padding: 16,
246
+ width: "90%"
247
+ },
248
+ modalHeader: {
249
+ alignItems: "center",
250
+ borderBottomWidth: 1,
251
+ flexDirection: "row",
252
+ justifyContent: "space-between",
253
+ marginBottom: 12,
254
+ paddingBottom: 12
255
+ },
256
+ modalOverlay: {
257
+ alignItems: "center",
258
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
259
+ flex: 1,
260
+ justifyContent: "center"
261
+ },
262
+ modalTitle: {
263
+ fontSize: 18,
264
+ fontWeight: "600"
265
+ },
266
+ searchContainer: {
267
+ marginBottom: 12,
268
+ position: "relative"
269
+ },
270
+ searchInput: {
271
+ borderRadius: 6,
272
+ borderWidth: 1,
273
+ fontSize: 14,
274
+ paddingHorizontal: 12,
275
+ paddingRight: 40,
276
+ paddingVertical: 10
277
+ },
278
+ searchLoader: {
279
+ position: "absolute",
280
+ right: 12,
281
+ top: "50%",
282
+ transform: [{ translateY: -10 }]
283
+ },
284
+ suggestionIcon: {
285
+ fontSize: 16,
286
+ marginRight: 8
287
+ },
288
+ suggestionItem: {
289
+ alignItems: "center",
290
+ borderRadius: 6,
291
+ flexDirection: "row",
292
+ paddingHorizontal: 12,
293
+ paddingVertical: 12
294
+ },
295
+ suggestionsList: {
296
+ flexGrow: 0,
297
+ flexShrink: 1
298
+ },
299
+ suggestionsListContent: { flexGrow: 0 },
300
+ suggestionText: {
301
+ flex: 1,
302
+ fontSize: 14
303
+ },
304
+ trigger: {
305
+ alignItems: "center",
306
+ borderRadius: 6,
307
+ borderWidth: 1,
308
+ flexDirection: "row",
309
+ justifyContent: "space-between",
310
+ paddingHorizontal: 12,
311
+ paddingVertical: 10
312
+ },
313
+ triggerText: {
314
+ flex: 1,
315
+ fontSize: 14
316
+ }
317
+ }), xe = ({ label: e, description: t, image: n, disabled: r }) => {
318
+ let { colors: i } = b();
319
+ return /* @__PURE__ */ F(H, {
320
+ style: Se.content,
321
+ children: [n ? /* @__PURE__ */ P(R, {
322
+ source: { uri: n },
323
+ style: Se.image
324
+ }) : null, /* @__PURE__ */ F(H, {
325
+ style: Se.textWrapper,
326
+ children: [/* @__PURE__ */ P(B, {
327
+ style: [Se.label, { color: r ? i.textMuted : i.text }],
328
+ children: e
329
+ }), t ? /* @__PURE__ */ P(B, {
330
+ style: [Se.description, { color: i.textMuted }],
331
+ children: t
332
+ }) : null]
333
+ })]
334
+ });
335
+ }, Se = z.create({
336
+ content: {
337
+ alignItems: "center",
338
+ flex: 1,
339
+ flexDirection: "row",
340
+ gap: 12
341
+ },
342
+ description: {
343
+ fontSize: 12,
344
+ marginTop: 2
345
+ },
346
+ image: {
347
+ borderRadius: 6,
348
+ height: 40,
349
+ width: 40
350
+ },
351
+ label: { fontSize: 14 },
352
+ textWrapper: { flex: 1 }
353
+ }), Ce = ({ field: e, extra: t }) => {
354
+ let [n, r] = N(!1), [i, a] = N(""), { value: o, placeholder: c } = e, { InputLabel: l, node: u, setValue: d, error: f, label: p, helperText: m } = t, h = s(), { colors: g } = b(), _ = u.data.options || [], v = _.find((e) => e.value === o), y = oe(() => {
355
+ if (!i.trim()) return _;
356
+ let e = i.toLowerCase();
357
+ return _.filter((t) => h(t.label).toLowerCase().includes(e) || t.value.toLowerCase().includes(e));
358
+ }, [
359
+ _,
360
+ i,
361
+ h
362
+ ]), x = (e) => {
363
+ d(e === o ? "" : e), r(!1), a("");
364
+ }, S = () => {
365
+ r(!1), a("");
366
+ };
367
+ return /* @__PURE__ */ F(H, {
368
+ style: W.container,
369
+ children: [
370
+ /* @__PURE__ */ P(l, {
371
+ label: p,
372
+ required: u.data.required
373
+ }),
374
+ /* @__PURE__ */ F(V, {
375
+ style: [
376
+ W.trigger,
377
+ {
378
+ backgroundColor: g.input,
379
+ borderColor: g.border
380
+ },
381
+ f && { borderColor: g.error }
382
+ ],
383
+ onPress: () => r(!0),
384
+ activeOpacity: .7,
385
+ children: [
386
+ /* @__PURE__ */ P(B, {
387
+ style: [
388
+ W.triggerText,
389
+ { color: g.text },
390
+ !o && { color: g.textMuted }
391
+ ],
392
+ numberOfLines: 1,
393
+ children: o && v ? h(v.label) : c || h("renderer.defaultAutocompleteInput.selectOption")
394
+ }),
395
+ o ? /* @__PURE__ */ P(V, {
396
+ onPress: () => d(""),
397
+ hitSlop: {
398
+ bottom: 8,
399
+ left: 8,
400
+ right: 8,
401
+ top: 8
402
+ },
403
+ style: W.clearButton,
404
+ children: /* @__PURE__ */ P(B, {
405
+ style: [W.clearIcon, { color: g.textMuted }],
406
+ children: "✕"
407
+ })
408
+ }) : null,
409
+ /* @__PURE__ */ P(B, {
410
+ style: [W.arrow, { color: g.textMuted }],
411
+ children: "▼"
412
+ })
413
+ ]
414
+ }),
415
+ /* @__PURE__ */ P(ue, {
416
+ visible: n,
417
+ transparent: !0,
418
+ animationType: "fade",
419
+ onRequestClose: S,
420
+ children: /* @__PURE__ */ P(V, {
421
+ style: W.modalOverlay,
422
+ activeOpacity: 1,
423
+ onPress: S,
424
+ children: /* @__PURE__ */ F(V, {
425
+ style: [W.modalContent, { backgroundColor: g.card }],
426
+ activeOpacity: 1,
427
+ onPress: () => {},
428
+ children: [
429
+ /* @__PURE__ */ F(H, {
430
+ style: [W.modalHeader, { borderBottomColor: g.separator }],
431
+ children: [/* @__PURE__ */ P(B, {
432
+ style: [W.modalTitle, { color: g.text }],
433
+ children: p || c || h("renderer.defaultAutocompleteInput.selectOption")
434
+ }), /* @__PURE__ */ P(V, {
435
+ onPress: S,
436
+ children: /* @__PURE__ */ P(B, {
437
+ style: [W.closeButton, { color: g.textMuted }],
438
+ children: "✕"
439
+ })
440
+ })]
441
+ }),
442
+ /* @__PURE__ */ P(H, {
443
+ style: W.searchContainer,
444
+ children: /* @__PURE__ */ P(pe, {
445
+ style: [W.searchInput, {
446
+ backgroundColor: g.muted,
447
+ borderColor: g.border,
448
+ color: g.text
449
+ }],
450
+ placeholder: c || h("renderer.defaultAutocompleteInput.search"),
451
+ placeholderTextColor: g.textMuted,
452
+ value: i,
453
+ onChangeText: a,
454
+ autoFocus: !0,
455
+ autoCapitalize: "none",
456
+ autoCorrect: !1
457
+ })
458
+ }),
459
+ /* @__PURE__ */ P(le, {
460
+ data: y,
461
+ keyExtractor: (e) => e.value,
462
+ style: W.optionsList,
463
+ contentContainerStyle: W.optionsListContent,
464
+ ListEmptyComponent: /* @__PURE__ */ P(H, {
465
+ style: W.emptyContainer,
466
+ children: /* @__PURE__ */ P(B, {
467
+ style: [W.emptyText, { color: g.textMuted }],
468
+ children: h("renderer.defaultAutocompleteInput.noResults")
469
+ })
470
+ }),
471
+ renderItem: ({ item: e }) => {
472
+ let t = e.value === o;
473
+ return /* @__PURE__ */ F(V, {
474
+ style: [W.option, t && { backgroundColor: g.primaryLight }],
475
+ onPress: () => x(e.value),
476
+ disabled: e.disabled,
477
+ activeOpacity: .7,
478
+ children: [/* @__PURE__ */ P(xe, {
479
+ label: h(e.label) || e.value,
480
+ description: h(e.description),
481
+ image: e.image,
482
+ disabled: e.disabled
483
+ }), t && /* @__PURE__ */ P(B, {
484
+ style: [W.checkmark, { color: g.primary }],
485
+ children: "✓"
486
+ })]
487
+ });
488
+ }
489
+ })
490
+ ]
491
+ })
492
+ })
493
+ }),
494
+ f && /* @__PURE__ */ P(B, {
495
+ style: [W.error, { color: g.error }],
496
+ children: f
497
+ }),
498
+ m && !f && /* @__PURE__ */ P(B, {
499
+ style: [W.helperText, { color: g.textMuted }],
500
+ children: m
501
+ })
502
+ ]
503
+ });
504
+ }, W = z.create({
505
+ arrow: { fontSize: 12 },
506
+ checkmark: {
507
+ fontSize: 18,
508
+ fontWeight: "700"
509
+ },
510
+ clearButton: {
511
+ marginRight: 8,
512
+ paddingHorizontal: 2
513
+ },
514
+ clearIcon: { fontSize: 14 },
515
+ closeButton: {
516
+ fontSize: 24,
517
+ fontWeight: "300"
518
+ },
519
+ container: { marginBottom: 16 },
520
+ emptyContainer: {
521
+ alignItems: "center",
522
+ paddingVertical: 24
523
+ },
524
+ emptyText: { fontSize: 14 },
525
+ error: {
526
+ fontSize: 12,
527
+ marginTop: 4
528
+ },
529
+ helperText: {
530
+ fontSize: 12,
531
+ marginTop: 4
532
+ },
533
+ modalContent: {
534
+ borderRadius: 12,
535
+ maxHeight: "80%",
536
+ padding: 16,
537
+ width: "90%"
538
+ },
539
+ modalHeader: {
540
+ alignItems: "center",
541
+ borderBottomWidth: 1,
542
+ flexDirection: "row",
543
+ justifyContent: "space-between",
544
+ marginBottom: 12,
545
+ paddingBottom: 12
546
+ },
547
+ modalOverlay: {
548
+ alignItems: "center",
549
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
550
+ flex: 1,
551
+ justifyContent: "center"
552
+ },
553
+ modalTitle: {
554
+ fontSize: 18,
555
+ fontWeight: "600"
556
+ },
557
+ option: {
558
+ alignItems: "center",
559
+ borderRadius: 6,
560
+ flexDirection: "row",
561
+ justifyContent: "space-between",
562
+ paddingHorizontal: 12,
563
+ paddingVertical: 12
564
+ },
565
+ optionsList: {
566
+ flexGrow: 0,
567
+ flexShrink: 1
568
+ },
569
+ optionsListContent: { flexGrow: 0 },
570
+ searchContainer: { marginBottom: 12 },
571
+ searchInput: {
572
+ borderRadius: 6,
573
+ borderWidth: 1,
574
+ fontSize: 14,
575
+ paddingHorizontal: 12,
576
+ paddingVertical: 10
577
+ },
578
+ trigger: {
579
+ alignItems: "center",
580
+ borderRadius: 6,
581
+ borderWidth: 1,
582
+ flexDirection: "row",
583
+ justifyContent: "space-between",
584
+ paddingHorizontal: 12,
585
+ paddingVertical: 10
586
+ },
587
+ triggerText: {
588
+ flex: 1,
589
+ fontSize: 14
590
+ }
591
+ }), we = ({ field: e, extra: t }) => {
592
+ let n = s(), { value: r } = e, { InputLabel: i, node: a, setValue: o, error: c, label: l, helperText: u } = t, { colors: d } = b(), f = a.data.options || [], p = f.length > 0, m = Array.isArray(r) ? r : [], h = typeof r == "boolean" ? r : !1, g = (e) => {
593
+ o(p ? m.includes(e) ? m.filter((t) => t !== e) : [...m, e] : !h);
594
+ }, _ = (e) => p ? m.includes(e) : h;
595
+ return /* @__PURE__ */ F(H, {
596
+ style: G.container,
597
+ children: [
598
+ /* @__PURE__ */ P(i, {
599
+ label: l,
600
+ required: a.data.required
601
+ }),
602
+ f.length > 0 ? f.map((e) => {
603
+ let t = n(e.description);
604
+ return /* @__PURE__ */ F(V, {
605
+ style: G.option,
606
+ onPress: () => g(e.value),
607
+ disabled: e.disabled,
608
+ activeOpacity: .7,
609
+ accessible: !0,
610
+ accessibilityRole: "checkbox",
611
+ accessibilityState: {
612
+ checked: _(e.value),
613
+ disabled: e.disabled
614
+ },
615
+ accessibilityLabel: n(e.label) || e.value,
616
+ children: [
617
+ /* @__PURE__ */ P(H, {
618
+ style: [
619
+ G.checkbox,
620
+ {
621
+ backgroundColor: d.input,
622
+ borderColor: d.border
623
+ },
624
+ _(e.value) && {
625
+ backgroundColor: d.primary,
626
+ borderColor: d.primary
627
+ }
628
+ ],
629
+ children: _(e.value) && /* @__PURE__ */ P(B, {
630
+ style: G.checkmark,
631
+ children: "✓"
632
+ })
633
+ }),
634
+ e.image ? /* @__PURE__ */ P(R, {
635
+ source: { uri: e.image },
636
+ style: G.image
637
+ }) : null,
638
+ /* @__PURE__ */ F(H, {
639
+ style: G.optionTextContainer,
640
+ children: [/* @__PURE__ */ P(B, {
641
+ style: [
642
+ G.optionLabel,
643
+ { color: d.textSecondary },
644
+ e.disabled && { color: d.textMuted }
645
+ ],
646
+ children: n(e.label) || e.value
647
+ }), t && /* @__PURE__ */ P(B, {
648
+ style: [G.optionDescription, { color: d.textMuted }],
649
+ children: t
650
+ })]
651
+ })
652
+ ]
653
+ }, e.value);
654
+ }) : /* @__PURE__ */ F(V, {
655
+ style: G.option,
656
+ onPress: () => g(""),
657
+ activeOpacity: .7,
658
+ accessible: !0,
659
+ accessibilityRole: "checkbox",
660
+ accessibilityState: { checked: h },
661
+ accessibilityLabel: l || a.data.name,
662
+ children: [/* @__PURE__ */ P(H, {
663
+ style: [
664
+ G.checkbox,
665
+ {
666
+ backgroundColor: d.input,
667
+ borderColor: d.border
668
+ },
669
+ h && {
670
+ backgroundColor: d.primary,
671
+ borderColor: d.primary
672
+ }
673
+ ],
674
+ children: h && /* @__PURE__ */ P(B, {
675
+ style: G.checkmark,
676
+ children: "✓"
677
+ })
678
+ }), l && /* @__PURE__ */ P(B, {
679
+ style: [G.optionLabel, { color: d.textSecondary }],
680
+ children: l
681
+ })]
682
+ }),
683
+ c && /* @__PURE__ */ P(B, {
684
+ style: [G.error, { color: d.error }],
685
+ children: c
686
+ }),
687
+ u && !c && /* @__PURE__ */ P(B, {
688
+ style: [G.helperText, { color: d.textMuted }],
689
+ children: u
690
+ })
691
+ ]
692
+ });
693
+ }, G = z.create({
694
+ checkbox: {
695
+ alignItems: "center",
696
+ borderRadius: 4,
697
+ borderWidth: 2,
698
+ height: 20,
699
+ justifyContent: "center",
700
+ marginRight: 12,
701
+ width: 20
702
+ },
703
+ checkmark: {
704
+ color: "#FFFFFF",
705
+ fontSize: 14,
706
+ fontWeight: "700"
707
+ },
708
+ container: { marginBottom: 16 },
709
+ error: {
710
+ fontSize: 12,
711
+ marginTop: 4
712
+ },
713
+ helperText: {
714
+ fontSize: 12,
715
+ marginTop: 4
716
+ },
717
+ image: {
718
+ borderRadius: 4,
719
+ height: 32,
720
+ marginRight: 8,
721
+ width: 32
722
+ },
723
+ option: {
724
+ alignItems: "flex-start",
725
+ flexDirection: "row",
726
+ marginBottom: 8
727
+ },
728
+ optionDescription: {
729
+ fontSize: 12,
730
+ marginTop: 2
731
+ },
732
+ optionLabel: { fontSize: 14 },
733
+ optionTextContainer: { flex: 1 }
734
+ }), Te = ({ field: e, extra: t }) => {
735
+ let [n, r] = N(!1), { value: i, placeholder: a } = e, { InputLabel: o, node: c, setValue: l, error: u, label: d, helperText: f } = t, { colors: p } = b(), m = s(), h = i ? new Date(i) : void 0, { year: g, month: _, today: v } = oe(() => {
736
+ let e = h || /* @__PURE__ */ new Date(), t = e.getFullYear(), n = e.getMonth(), r = /* @__PURE__ */ new Date();
737
+ return r.setHours(0, 0, 0, 0), {
738
+ month: n,
739
+ today: r,
740
+ year: t
741
+ };
742
+ }, [h]), [y, x] = N(g), [S, C] = N(_), w = [
743
+ "January",
744
+ "February",
745
+ "March",
746
+ "April",
747
+ "May",
748
+ "June",
749
+ "July",
750
+ "August",
751
+ "September",
752
+ "October",
753
+ "November",
754
+ "December"
755
+ ], T = oe(() => {
756
+ let e = new Date(y, S, 1).getDay(), t = new Date(y, S + 1, 0).getDate(), n = new Date(y, S, 0).getDate(), r = [];
757
+ for (let t = e - 1; t >= 0; t--) r.push({
758
+ date: new Date(y, S - 1, n - t),
759
+ day: n - t,
760
+ isCurrentMonth: !1
761
+ });
762
+ for (let e = 1; e <= t; e++) r.push({
763
+ date: new Date(y, S, e),
764
+ day: e,
765
+ isCurrentMonth: !0
766
+ });
767
+ let i = 42 - r.length;
768
+ for (let e = 1; e <= i; e++) r.push({
769
+ date: new Date(y, S + 1, e),
770
+ day: e,
771
+ isCurrentMonth: !1
772
+ });
773
+ return r;
774
+ }, [y, S]), E = ie((e) => {
775
+ c.data.disablePast && e < v || (l(e.toISOString()), r(!1));
776
+ }, [
777
+ c.data.disablePast,
778
+ v,
779
+ l
780
+ ]), D = () => {
781
+ S === 0 ? (C(11), x(y - 1)) : C(S - 1);
782
+ }, O = () => {
783
+ S === 11 ? (C(0), x(y + 1)) : C(S + 1);
784
+ }, k = () => h ? h.toLocaleDateString() : a || m("renderer.defaultInputs.selectDate"), A = (e) => c.data.disablePast ? e < v : !1, ee = (e) => h ? e.getDate() === h.getDate() && e.getMonth() === h.getMonth() && e.getFullYear() === h.getFullYear() : !1;
785
+ return /* @__PURE__ */ F(H, {
786
+ style: K.container,
787
+ children: [
788
+ /* @__PURE__ */ P(o, {
789
+ label: d,
790
+ required: c.data.required
791
+ }),
792
+ /* @__PURE__ */ F(V, {
793
+ style: [
794
+ K.trigger,
795
+ {
796
+ backgroundColor: p.input,
797
+ borderColor: p.border
798
+ },
799
+ u && { borderColor: p.error }
800
+ ],
801
+ onPress: () => r(!0),
802
+ activeOpacity: .7,
803
+ children: [/* @__PURE__ */ P(B, {
804
+ style: [
805
+ K.triggerText,
806
+ { color: p.text },
807
+ !i && { color: p.textMuted }
808
+ ],
809
+ numberOfLines: 1,
810
+ children: k()
811
+ }), /* @__PURE__ */ P(B, {
812
+ style: K.icon,
813
+ children: "📅"
814
+ })]
815
+ }),
816
+ /* @__PURE__ */ P(ue, {
817
+ visible: n,
818
+ transparent: !0,
819
+ animationType: "fade",
820
+ onRequestClose: () => r(!1),
821
+ children: /* @__PURE__ */ P(V, {
822
+ style: K.modalOverlay,
823
+ activeOpacity: 1,
824
+ onPress: () => r(!1),
825
+ children: /* @__PURE__ */ F(V, {
826
+ style: [K.modalContent, { backgroundColor: p.card }],
827
+ activeOpacity: 1,
828
+ onPress: () => {},
829
+ children: [
830
+ /* @__PURE__ */ F(H, {
831
+ style: [K.modalHeader, { borderBottomColor: p.separator }],
832
+ children: [/* @__PURE__ */ P(B, {
833
+ style: [K.modalTitle, { color: p.text }],
834
+ children: d || a || m("renderer.defaultInputs.selectDate")
835
+ }), /* @__PURE__ */ P(V, {
836
+ onPress: () => r(!1),
837
+ children: /* @__PURE__ */ P(B, {
838
+ style: [K.closeButton, { color: p.textMuted }],
839
+ children: "✕"
840
+ })
841
+ })]
842
+ }),
843
+ /* @__PURE__ */ F(H, {
844
+ style: K.calendarHeader,
845
+ children: [
846
+ /* @__PURE__ */ P(V, {
847
+ onPress: D,
848
+ style: K.navButton,
849
+ children: /* @__PURE__ */ P(B, {
850
+ style: [K.navButtonText, { color: p.primary }],
851
+ children: "‹"
852
+ })
853
+ }),
854
+ /* @__PURE__ */ F(B, {
855
+ style: [K.monthYear, { color: p.text }],
856
+ children: [
857
+ w[S],
858
+ " ",
859
+ y
860
+ ]
861
+ }),
862
+ /* @__PURE__ */ P(V, {
863
+ onPress: O,
864
+ style: K.navButton,
865
+ children: /* @__PURE__ */ P(B, {
866
+ style: [K.navButtonText, { color: p.primary }],
867
+ children: "›"
868
+ })
869
+ })
870
+ ]
871
+ }),
872
+ /* @__PURE__ */ P(H, {
873
+ style: K.weekDays,
874
+ children: [
875
+ "Sun",
876
+ "Mon",
877
+ "Tue",
878
+ "Wed",
879
+ "Thu",
880
+ "Fri",
881
+ "Sat"
882
+ ].map((e) => /* @__PURE__ */ P(B, {
883
+ style: [K.weekDay, { color: p.textMuted }],
884
+ children: e
885
+ }, e))
886
+ }),
887
+ /* @__PURE__ */ P(le, {
888
+ data: T,
889
+ keyExtractor: (e, t) => `${e.date.getTime()}-${t}`,
890
+ numColumns: 7,
891
+ scrollEnabled: !1,
892
+ style: K.calendar,
893
+ contentContainerStyle: K.calendarContent,
894
+ renderItem: ({ item: e }) => {
895
+ let t = A(e.date), n = ee(e.date);
896
+ return /* @__PURE__ */ P(V, {
897
+ style: [
898
+ K.dayCell,
899
+ !e.isCurrentMonth && K.dayCellOtherMonth,
900
+ n && {
901
+ backgroundColor: p.primary,
902
+ borderRadius: 20
903
+ },
904
+ t && K.dayCellDisabled
905
+ ],
906
+ onPress: () => E(e.date),
907
+ disabled: t,
908
+ activeOpacity: .7,
909
+ children: /* @__PURE__ */ P(B, {
910
+ style: [
911
+ K.dayText,
912
+ { color: p.text },
913
+ !e.isCurrentMonth && { color: p.textMuted },
914
+ n && {
915
+ color: p.background,
916
+ fontWeight: "600"
917
+ },
918
+ t && { color: p.textMuted }
919
+ ],
920
+ children: e.day
921
+ })
922
+ });
923
+ }
924
+ })
925
+ ]
926
+ })
927
+ })
928
+ }),
929
+ u && /* @__PURE__ */ P(B, {
930
+ style: [K.error, { color: p.error }],
931
+ children: u
932
+ }),
933
+ f && !u && /* @__PURE__ */ P(B, {
934
+ style: [K.helperText, { color: p.textMuted }],
935
+ children: f
936
+ })
937
+ ]
938
+ });
939
+ }, K = z.create({
940
+ calendar: {
941
+ flexGrow: 0,
942
+ flexShrink: 1
943
+ },
944
+ calendarContent: { flexGrow: 0 },
945
+ calendarHeader: {
946
+ alignItems: "center",
947
+ flexDirection: "row",
948
+ justifyContent: "space-between",
949
+ marginBottom: 16,
950
+ paddingHorizontal: 8
951
+ },
952
+ closeButton: {
953
+ fontSize: 24,
954
+ fontWeight: "300"
955
+ },
956
+ container: { marginBottom: 16 },
957
+ dayCell: {
958
+ alignItems: "center",
959
+ aspectRatio: 1,
960
+ flex: 1,
961
+ justifyContent: "center",
962
+ margin: 2,
963
+ maxWidth: "14.28%"
964
+ },
965
+ dayCellDisabled: { opacity: .3 },
966
+ dayCellOtherMonth: { opacity: .3 },
967
+ dayText: { fontSize: 14 },
968
+ error: {
969
+ fontSize: 12,
970
+ marginTop: 4
971
+ },
972
+ helperText: {
973
+ fontSize: 12,
974
+ marginTop: 4
975
+ },
976
+ icon: { fontSize: 16 },
977
+ modalContent: {
978
+ borderRadius: 12,
979
+ maxHeight: "80%",
980
+ padding: 16,
981
+ width: "90%"
982
+ },
983
+ modalHeader: {
984
+ alignItems: "center",
985
+ borderBottomWidth: 1,
986
+ flexDirection: "row",
987
+ justifyContent: "space-between",
988
+ marginBottom: 16,
989
+ paddingBottom: 12
990
+ },
991
+ modalOverlay: {
992
+ alignItems: "center",
993
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
994
+ flex: 1,
995
+ justifyContent: "center"
996
+ },
997
+ modalTitle: {
998
+ fontSize: 18,
999
+ fontWeight: "600"
1000
+ },
1001
+ monthYear: {
1002
+ fontSize: 16,
1003
+ fontWeight: "600"
1004
+ },
1005
+ navButton: { padding: 8 },
1006
+ navButtonText: {
1007
+ fontSize: 24,
1008
+ fontWeight: "600"
1009
+ },
1010
+ trigger: {
1011
+ alignItems: "center",
1012
+ borderRadius: 6,
1013
+ borderWidth: 1,
1014
+ flexDirection: "row",
1015
+ justifyContent: "space-between",
1016
+ paddingHorizontal: 12,
1017
+ paddingVertical: 10
1018
+ },
1019
+ triggerText: {
1020
+ flex: 1,
1021
+ fontSize: 14
1022
+ },
1023
+ weekDay: {
1024
+ flex: 1,
1025
+ fontSize: 12,
1026
+ fontWeight: "600",
1027
+ maxWidth: "14.28%",
1028
+ textAlign: "center"
1029
+ },
1030
+ weekDays: {
1031
+ flexDirection: "row",
1032
+ marginBottom: 8
1033
+ }
1034
+ }), Ee = ({ field: e, extra: t }) => {
1035
+ let [n, r] = N(!1), [i, a] = N(!0), { value: o } = e, { InputLabel: c, node: l, setValue: u, error: d, label: f, helperText: p } = t, m = s(), { colors: h } = b(), g = Array.isArray(o) ? o : [], _ = g[0] ? new Date(g[0]) : void 0, v = g[1] ? new Date(g[1]) : void 0, { year: y, month: x, today: S } = oe(() => {
1036
+ let e = _ || /* @__PURE__ */ new Date(), t = e.getFullYear(), n = e.getMonth(), r = /* @__PURE__ */ new Date();
1037
+ return r.setHours(0, 0, 0, 0), {
1038
+ month: n,
1039
+ today: r,
1040
+ year: t
1041
+ };
1042
+ }, [_]), [C, w] = N(y), [T, E] = N(x), D = [
1043
+ "January",
1044
+ "February",
1045
+ "March",
1046
+ "April",
1047
+ "May",
1048
+ "June",
1049
+ "July",
1050
+ "August",
1051
+ "September",
1052
+ "October",
1053
+ "November",
1054
+ "December"
1055
+ ], O = oe(() => {
1056
+ let e = new Date(C, T, 1).getDay(), t = new Date(C, T + 1, 0).getDate(), n = new Date(C, T, 0).getDate(), r = [];
1057
+ for (let t = e - 1; t >= 0; t--) r.push({
1058
+ date: new Date(C, T - 1, n - t),
1059
+ day: n - t,
1060
+ isCurrentMonth: !1
1061
+ });
1062
+ for (let e = 1; e <= t; e++) r.push({
1063
+ date: new Date(C, T, e),
1064
+ day: e,
1065
+ isCurrentMonth: !0
1066
+ });
1067
+ let i = 42 - r.length;
1068
+ for (let e = 1; e <= i; e++) r.push({
1069
+ date: new Date(C, T + 1, e),
1070
+ day: e,
1071
+ isCurrentMonth: !1
1072
+ });
1073
+ return r;
1074
+ }, [C, T]), k = ie((e) => {
1075
+ l.data.disablePast && e < S || (i ? (u([e.toISOString(), v?.toISOString()]), a(!1)) : (u(_ && e < _ ? [e.toISOString(), _.toISOString()] : [_?.toISOString(), e.toISOString()]), r(!1), a(!0)));
1076
+ }, [
1077
+ l.data.disablePast,
1078
+ S,
1079
+ i,
1080
+ _,
1081
+ v,
1082
+ u
1083
+ ]), A = () => {
1084
+ T === 0 ? (E(11), w(C - 1)) : E(T - 1);
1085
+ }, ee = () => {
1086
+ T === 11 ? (E(0), w(C + 1)) : E(T + 1);
1087
+ }, te = () => _ && v ? `${_.toLocaleDateString()} - ${v.toLocaleDateString()}` : _ ? _.toLocaleDateString() : m("renderer.defaultInputs.selectDateRange"), j = (e) => l.data.disablePast ? e < S : !1, ne = (e) => _ && v ? e >= _ && e <= v : !1, re = (e) => {
1088
+ if (!(_ || v)) return !1;
1089
+ let t = _ && e.getDate() === _.getDate() && e.getMonth() === _.getMonth() && e.getFullYear() === _.getFullYear(), n = v && e.getDate() === v.getDate() && e.getMonth() === v.getMonth() && e.getFullYear() === v.getFullYear();
1090
+ return t || n;
1091
+ };
1092
+ return /* @__PURE__ */ F(H, {
1093
+ style: q.container,
1094
+ children: [
1095
+ /* @__PURE__ */ P(c, {
1096
+ label: f,
1097
+ required: l.data.required
1098
+ }),
1099
+ /* @__PURE__ */ F(V, {
1100
+ style: [
1101
+ q.trigger,
1102
+ {
1103
+ backgroundColor: h.input,
1104
+ borderColor: h.border
1105
+ },
1106
+ d && { borderColor: h.error }
1107
+ ],
1108
+ onPress: () => r(!0),
1109
+ activeOpacity: .7,
1110
+ children: [/* @__PURE__ */ P(B, {
1111
+ style: [
1112
+ q.triggerText,
1113
+ { color: h.text },
1114
+ !_ && { color: h.textMuted }
1115
+ ],
1116
+ numberOfLines: 1,
1117
+ children: te()
1118
+ }), /* @__PURE__ */ P(B, {
1119
+ style: q.icon,
1120
+ children: "📅"
1121
+ })]
1122
+ }),
1123
+ /* @__PURE__ */ P(ue, {
1124
+ visible: n,
1125
+ transparent: !0,
1126
+ animationType: "fade",
1127
+ onRequestClose: () => r(!1),
1128
+ children: /* @__PURE__ */ P(V, {
1129
+ style: q.modalOverlay,
1130
+ activeOpacity: 1,
1131
+ onPress: () => r(!1),
1132
+ children: /* @__PURE__ */ F(V, {
1133
+ style: [q.modalContent, { backgroundColor: h.card }],
1134
+ activeOpacity: 1,
1135
+ onPress: () => {},
1136
+ children: [
1137
+ /* @__PURE__ */ F(H, {
1138
+ style: [q.modalHeader, { borderBottomColor: h.separator }],
1139
+ children: [/* @__PURE__ */ P(B, {
1140
+ style: [q.modalTitle, { color: h.text }],
1141
+ children: f || m("renderer.defaultInputs.selectDateRange")
1142
+ }), /* @__PURE__ */ P(V, {
1143
+ onPress: () => r(!1),
1144
+ children: /* @__PURE__ */ P(B, {
1145
+ style: [q.closeButton, { color: h.textMuted }],
1146
+ children: "✕"
1147
+ })
1148
+ })]
1149
+ }),
1150
+ /* @__PURE__ */ P(H, {
1151
+ style: [q.rangeIndicator, { backgroundColor: h.primaryLight }],
1152
+ children: /* @__PURE__ */ P(B, {
1153
+ style: [q.rangeIndicatorText, { color: h.primary }],
1154
+ children: m(i ? "renderer.defaultInputs.startDate" : "renderer.defaultInputs.endDate")
1155
+ })
1156
+ }),
1157
+ /* @__PURE__ */ F(H, {
1158
+ style: q.calendarHeader,
1159
+ children: [
1160
+ /* @__PURE__ */ P(V, {
1161
+ onPress: A,
1162
+ style: q.navButton,
1163
+ children: /* @__PURE__ */ P(B, {
1164
+ style: [q.navButtonText, { color: h.primary }],
1165
+ children: "‹"
1166
+ })
1167
+ }),
1168
+ /* @__PURE__ */ F(B, {
1169
+ style: [q.monthYear, { color: h.text }],
1170
+ children: [
1171
+ D[T],
1172
+ " ",
1173
+ C
1174
+ ]
1175
+ }),
1176
+ /* @__PURE__ */ P(V, {
1177
+ onPress: ee,
1178
+ style: q.navButton,
1179
+ children: /* @__PURE__ */ P(B, {
1180
+ style: [q.navButtonText, { color: h.primary }],
1181
+ children: "›"
1182
+ })
1183
+ })
1184
+ ]
1185
+ }),
1186
+ /* @__PURE__ */ P(H, {
1187
+ style: q.weekDays,
1188
+ children: [
1189
+ "Sun",
1190
+ "Mon",
1191
+ "Tue",
1192
+ "Wed",
1193
+ "Thu",
1194
+ "Fri",
1195
+ "Sat"
1196
+ ].map((e) => /* @__PURE__ */ P(B, {
1197
+ style: [q.weekDay, { color: h.textMuted }],
1198
+ children: e
1199
+ }, e))
1200
+ }),
1201
+ /* @__PURE__ */ P(le, {
1202
+ data: O,
1203
+ keyExtractor: (e, t) => `${e.date.getTime()}-${t}`,
1204
+ numColumns: 7,
1205
+ scrollEnabled: !1,
1206
+ style: q.calendar,
1207
+ contentContainerStyle: q.calendarContent,
1208
+ renderItem: ({ item: e }) => {
1209
+ let t = j(e.date), n = ne(e.date), r = re(e.date);
1210
+ return /* @__PURE__ */ P(V, {
1211
+ style: [
1212
+ q.dayCell,
1213
+ !e.isCurrentMonth && q.dayCellOtherMonth,
1214
+ n && { backgroundColor: h.primaryLight },
1215
+ r && {
1216
+ backgroundColor: h.primary,
1217
+ borderRadius: 20
1218
+ },
1219
+ t && q.dayCellDisabled
1220
+ ],
1221
+ onPress: () => k(e.date),
1222
+ disabled: t,
1223
+ activeOpacity: .7,
1224
+ children: /* @__PURE__ */ P(B, {
1225
+ style: [
1226
+ q.dayText,
1227
+ { color: h.text },
1228
+ !e.isCurrentMonth && { color: h.textMuted },
1229
+ n && { color: h.primary },
1230
+ r && {
1231
+ color: h.background,
1232
+ fontWeight: "600"
1233
+ },
1234
+ t && { color: h.textMuted }
1235
+ ],
1236
+ children: e.day
1237
+ })
1238
+ });
1239
+ }
1240
+ })
1241
+ ]
1242
+ })
1243
+ })
1244
+ }),
1245
+ d && /* @__PURE__ */ P(B, {
1246
+ style: [q.error, { color: h.error }],
1247
+ children: d
1248
+ }),
1249
+ p && !d && /* @__PURE__ */ P(B, {
1250
+ style: [q.helperText, { color: h.textMuted }],
1251
+ children: p
1252
+ })
1253
+ ]
1254
+ });
1255
+ }, q = z.create({
1256
+ calendar: {
1257
+ flexGrow: 0,
1258
+ flexShrink: 1
1259
+ },
1260
+ calendarContent: { flexGrow: 0 },
1261
+ calendarHeader: {
1262
+ alignItems: "center",
1263
+ flexDirection: "row",
1264
+ justifyContent: "space-between",
1265
+ marginBottom: 16,
1266
+ paddingHorizontal: 8
1267
+ },
1268
+ closeButton: {
1269
+ fontSize: 24,
1270
+ fontWeight: "300"
1271
+ },
1272
+ container: { marginBottom: 16 },
1273
+ dayCell: {
1274
+ alignItems: "center",
1275
+ aspectRatio: 1,
1276
+ flex: 1,
1277
+ justifyContent: "center",
1278
+ margin: 2,
1279
+ maxWidth: "14.28%"
1280
+ },
1281
+ dayCellDisabled: { opacity: .3 },
1282
+ dayCellOtherMonth: { opacity: .3 },
1283
+ dayText: { fontSize: 14 },
1284
+ error: {
1285
+ fontSize: 12,
1286
+ marginTop: 4
1287
+ },
1288
+ helperText: {
1289
+ fontSize: 12,
1290
+ marginTop: 4
1291
+ },
1292
+ icon: { fontSize: 16 },
1293
+ modalContent: {
1294
+ borderRadius: 12,
1295
+ maxHeight: "80%",
1296
+ padding: 16,
1297
+ width: "90%"
1298
+ },
1299
+ modalHeader: {
1300
+ alignItems: "center",
1301
+ borderBottomWidth: 1,
1302
+ flexDirection: "row",
1303
+ justifyContent: "space-between",
1304
+ marginBottom: 12,
1305
+ paddingBottom: 12
1306
+ },
1307
+ modalOverlay: {
1308
+ alignItems: "center",
1309
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
1310
+ flex: 1,
1311
+ justifyContent: "center"
1312
+ },
1313
+ modalTitle: {
1314
+ fontSize: 18,
1315
+ fontWeight: "600"
1316
+ },
1317
+ monthYear: {
1318
+ fontSize: 16,
1319
+ fontWeight: "600"
1320
+ },
1321
+ navButton: { padding: 8 },
1322
+ navButtonText: {
1323
+ fontSize: 24,
1324
+ fontWeight: "600"
1325
+ },
1326
+ rangeIndicator: {
1327
+ alignItems: "center",
1328
+ borderRadius: 6,
1329
+ marginBottom: 12,
1330
+ paddingVertical: 8
1331
+ },
1332
+ rangeIndicatorText: {
1333
+ fontSize: 14,
1334
+ fontWeight: "600"
1335
+ },
1336
+ trigger: {
1337
+ alignItems: "center",
1338
+ borderRadius: 6,
1339
+ borderWidth: 1,
1340
+ flexDirection: "row",
1341
+ justifyContent: "space-between",
1342
+ paddingHorizontal: 12,
1343
+ paddingVertical: 10
1344
+ },
1345
+ triggerText: {
1346
+ flex: 1,
1347
+ fontSize: 14
1348
+ },
1349
+ weekDay: {
1350
+ flex: 1,
1351
+ fontSize: 12,
1352
+ fontWeight: "600",
1353
+ maxWidth: "14.28%",
1354
+ textAlign: "center"
1355
+ },
1356
+ weekDays: {
1357
+ flexDirection: "row",
1358
+ marginBottom: 8
1359
+ }
1360
+ }), De = ({ field: e, extra: t }) => {
1361
+ let [n, r] = N(null), [i, a] = N(!0), { value: o } = e, { InputLabel: c, node: l, setValue: u, error: f, label: p, helperText: h } = t, { colors: g } = b(), _ = s(), v = d(o), y = l.data.multiple, x = ie(async () => {
1362
+ if (n) try {
1363
+ let e = (await n({ allowMultiSelection: y })).map((e) => ({
1364
+ data: e.uri,
1365
+ lastModified: Date.now(),
1366
+ name: e.name,
1367
+ size: e.size,
1368
+ type: e.type || "application/octet-stream"
1369
+ }));
1370
+ u(y ? [...v, ...e] : e[0] || null);
1371
+ } catch (e) {
1372
+ e.code !== "DOCUMENT_PICKER_CANCELED" && I.alert("Error", _("renderer.defaultInputs.filePickerError"));
1373
+ }
1374
+ }, [
1375
+ n,
1376
+ v,
1377
+ y,
1378
+ u,
1379
+ _
1380
+ ]), S = ie((e) => {
1381
+ let t = v.filter((t, n) => n !== e);
1382
+ u(t.length > 0 ? t : null);
1383
+ }, [v, u]);
1384
+ return ae(() => {
1385
+ (async () => {
1386
+ try {
1387
+ let { pick: e } = await import("react-native-document-picker");
1388
+ r(() => e);
1389
+ } catch {
1390
+ r(null);
1391
+ } finally {
1392
+ a(!1);
1393
+ }
1394
+ })();
1395
+ }, []), i ? null : n ? /* @__PURE__ */ F(H, {
1396
+ style: J.container,
1397
+ children: [
1398
+ /* @__PURE__ */ P(c, {
1399
+ label: p,
1400
+ required: l.data.required
1401
+ }),
1402
+ v.length > 0 && /* @__PURE__ */ P(H, {
1403
+ style: J.filesList,
1404
+ children: v.map((e, t) => /* @__PURE__ */ F(H, {
1405
+ style: [J.fileItem, {
1406
+ backgroundColor: g.card,
1407
+ borderColor: g.separator
1408
+ }],
1409
+ children: [
1410
+ /* @__PURE__ */ P(H, {
1411
+ style: [J.fileIcon, { backgroundColor: g.muted }],
1412
+ children: /* @__PURE__ */ P(B, {
1413
+ style: J.fileIconText,
1414
+ children: "📄"
1415
+ })
1416
+ }),
1417
+ /* @__PURE__ */ F(H, {
1418
+ style: J.fileInfo,
1419
+ children: [/* @__PURE__ */ P(B, {
1420
+ style: [J.fileName, { color: g.text }],
1421
+ numberOfLines: 1,
1422
+ children: e.name
1423
+ }), e.size > 0 && /* @__PURE__ */ P(B, {
1424
+ style: [J.fileSize, { color: g.textMuted }],
1425
+ children: m(e.size)
1426
+ })]
1427
+ }),
1428
+ /* @__PURE__ */ P(V, {
1429
+ style: J.removeButton,
1430
+ onPress: () => S(t),
1431
+ activeOpacity: .7,
1432
+ accessibilityLabel: _("renderer.defaultInputs.removeFile"),
1433
+ children: /* @__PURE__ */ P(B, {
1434
+ style: [J.removeButtonText, { color: g.textMuted }],
1435
+ children: "✕"
1436
+ })
1437
+ })
1438
+ ]
1439
+ }, `${e.name}-${t}`))
1440
+ }),
1441
+ /* @__PURE__ */ P(V, {
1442
+ style: [J.pickButton, {
1443
+ backgroundColor: g.input,
1444
+ borderColor: g.border
1445
+ }],
1446
+ onPress: x,
1447
+ activeOpacity: .7,
1448
+ children: /* @__PURE__ */ P(B, {
1449
+ style: [J.pickButtonText, { color: g.textMuted }],
1450
+ children: v.length === 0 ? _(y ? "renderer.defaultInputs.selectFiles" : "renderer.defaultInputs.selectFile") : _(y ? "renderer.defaultInputs.addMoreFiles" : "renderer.defaultInputs.replaceFile")
1451
+ })
1452
+ }),
1453
+ f && /* @__PURE__ */ P(B, {
1454
+ style: [J.error, { color: g.error }],
1455
+ children: f
1456
+ }),
1457
+ h && !f && /* @__PURE__ */ P(B, {
1458
+ style: [J.helperText, { color: g.textMuted }],
1459
+ children: h
1460
+ })
1461
+ ]
1462
+ }) : /* @__PURE__ */ F(H, {
1463
+ style: J.container,
1464
+ children: [
1465
+ /* @__PURE__ */ P(c, {
1466
+ label: p,
1467
+ required: l.data.required
1468
+ }),
1469
+ /* @__PURE__ */ P(H, {
1470
+ style: [J.unavailableContainer, {
1471
+ backgroundColor: g.errorLight,
1472
+ borderColor: g.error
1473
+ }],
1474
+ children: /* @__PURE__ */ P(B, {
1475
+ style: [J.unavailableText, { color: g.error }],
1476
+ children: _("renderer.defaultInputs.filePickerUnavailable")
1477
+ })
1478
+ }),
1479
+ h && /* @__PURE__ */ P(B, {
1480
+ style: [J.helperText, { color: g.textMuted }],
1481
+ children: h
1482
+ })
1483
+ ]
1484
+ });
1485
+ }, J = z.create({
1486
+ container: { marginBottom: 16 },
1487
+ error: {
1488
+ fontSize: 12,
1489
+ marginTop: 4
1490
+ },
1491
+ fileIcon: {
1492
+ alignItems: "center",
1493
+ borderRadius: 6,
1494
+ height: 40,
1495
+ justifyContent: "center",
1496
+ width: 40
1497
+ },
1498
+ fileIconText: { fontSize: 20 },
1499
+ fileInfo: {
1500
+ flex: 1,
1501
+ marginLeft: 12
1502
+ },
1503
+ fileItem: {
1504
+ alignItems: "center",
1505
+ borderRadius: 6,
1506
+ borderWidth: 1,
1507
+ flexDirection: "row",
1508
+ marginBottom: 8,
1509
+ padding: 12
1510
+ },
1511
+ fileName: {
1512
+ fontSize: 14,
1513
+ fontWeight: "500"
1514
+ },
1515
+ fileSize: {
1516
+ fontSize: 12,
1517
+ marginTop: 2
1518
+ },
1519
+ filesList: { marginBottom: 12 },
1520
+ helperText: {
1521
+ fontSize: 12,
1522
+ marginTop: 4
1523
+ },
1524
+ pickButton: {
1525
+ alignItems: "center",
1526
+ borderRadius: 6,
1527
+ borderStyle: "dashed",
1528
+ borderWidth: 2,
1529
+ justifyContent: "center",
1530
+ paddingVertical: 16
1531
+ },
1532
+ pickButtonText: {
1533
+ fontSize: 14,
1534
+ fontWeight: "500"
1535
+ },
1536
+ removeButton: { padding: 4 },
1537
+ removeButtonText: { fontSize: 18 },
1538
+ unavailableContainer: {
1539
+ alignItems: "center",
1540
+ borderRadius: 6,
1541
+ borderWidth: 1,
1542
+ justifyContent: "center",
1543
+ paddingVertical: 16
1544
+ },
1545
+ unavailableText: {
1546
+ fontSize: 12,
1547
+ textAlign: "center"
1548
+ }
1549
+ }), Oe = (e) => null, ke = ({ missing: e, children: t }) => {
1550
+ let n = s(), { colors: r } = b();
1551
+ return /* @__PURE__ */ F(se, { children: [t, e.length > 0 && /* @__PURE__ */ F(H, {
1552
+ style: Ae.container,
1553
+ children: [/* @__PURE__ */ P(B, {
1554
+ style: [Ae.title, { color: r.textMuted }],
1555
+ children: n("renderer.dependencyHint.title")
1556
+ }), e.map((e) => /* @__PURE__ */ F(B, {
1557
+ style: [Ae.item, { color: r.textMuted }],
1558
+ children: [
1559
+ "•",
1560
+ " ",
1561
+ e.label
1562
+ ]
1563
+ }, e.id))]
1564
+ })] });
1565
+ }, Ae = z.create({
1566
+ container: {
1567
+ gap: 2,
1568
+ marginTop: 4
1569
+ },
1570
+ item: { fontSize: 12 },
1571
+ title: {
1572
+ fontSize: 12,
1573
+ fontWeight: "500"
1574
+ }
1575
+ }), je = (e) => e.replace(/<[^>]*>/g, ""), Me = (e) => e.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&#x27;/g, "'").replace(/&#x2F;/g, "/"), Ne = (e, t = {}) => e == null || e === "" ? "" : Me(je(String(e))), Pe = 100, Fe = (e, t = {}, n = 0, r = /* @__PURE__ */ new WeakSet()) => {
1576
+ if (n > Pe) return console.warn(`sanitizeHttpResponse: Maximum depth (${Pe}) exceeded.`), typeof e == "string" ? Ne(e, t) : "[Max Depth Exceeded]";
1577
+ if (e == null) return e;
1578
+ if (typeof e == "string") return Ne(e, t);
1579
+ if (Array.isArray(e)) return e.map((e) => Fe(e, t, n + 1, r));
1580
+ if (typeof e == "object") {
1581
+ if (r.has(e)) return console.warn("sanitizeHttpResponse: Circular reference detected. Breaking cycle to prevent infinite recursion."), "[Circular Reference]";
1582
+ r.add(e);
1583
+ let i = {};
1584
+ for (let [a, o] of Object.entries(e)) i[a] = Fe(o, t, n + 1, r);
1585
+ return r.delete(e), i;
1586
+ }
1587
+ return e;
1588
+ }, Ie = (e) => {
1589
+ let t = e.matchAll(/{{([\w-]+)}}/g);
1590
+ return Array.from(t, (e) => e[1]);
1591
+ }, Le = (e, t) => Ie(e).every((e) => {
1592
+ let n = t[e];
1593
+ return n != null && n !== "";
1594
+ }), Re = (e, t, n = !1) => e.replace(/{{([\w-]+)}}/g, (e, r) => {
1595
+ let i = t[r], a = i == null ? "" : String(i);
1596
+ return n ? encodeURIComponent(a) : a;
1597
+ }), ze = ({ field: r, extra: i }) => {
1598
+ let [u, d] = N(!1), [f, p] = N(null), [m, h] = N([]), [g, v] = N(""), [y, x] = N(!1), { value: S, placeholder: w } = r, { InputLabel: T, node: D, setValue: O, error: k, label: A, helperText: ee, missingDependencies: te } = i, { formValues: j, inputNodes: ne, headers: re, baseUrl: se } = a(), { colors: I } = b(), { httpConfig: L } = D.data, R = s(), de = M(!1), z = M(!1), fe = M(""), me = M(L), he = M(j), ge = M(ne), _e = M(re), ve = M(se), ye = M(O), be = M(null), U = M(null), Se = M(D.data.normalizeOptionLabels !== !1), Ce = oe(() => L?.url ? Ie(L.url) : [], [L?.url]), W = Ce.length > 0, we = oe(() => Ce.map((e) => `${e}:${String(j[e] ?? "")}`).join("|"), [Ce, j]), G = oe(() => L?.url ? W ? Le(L.url, j) : !0 : !1, [
1599
+ L?.url,
1600
+ W,
1601
+ j
1602
+ ]), Te = ie(async (r) => {
1603
+ U.current && U.current.abort();
1604
+ let i = new AbortController();
1605
+ U.current = i;
1606
+ let a = me.current, s = he.current, u = ye.current;
1607
+ if (!a?.url) {
1608
+ p(R("renderer.defaultHttpInput.noUrlConfigured")), U.current = null;
1609
+ return;
1610
+ }
1611
+ if (a.url && !Le(a.url, s)) {
1612
+ U.current = null;
1613
+ return;
1614
+ }
1615
+ d(!0), p(null);
1616
+ try {
1617
+ let d = _(Re(a.url, s, !0), ve.current), f = t(a.searchParam && r ? `${d}${d.includes("?") ? "&" : "?"}${a.searchParam}=${encodeURIComponent(r)}` : d, e(a.queryParams, s)), m = n({ "Content-Type": "application/json" }, e(_e.current, s), e(a.headers, s)), g = [
1618
+ "POST",
1619
+ "PUT",
1620
+ "PATCH"
1621
+ ].includes(a.method || "") ? a.sendAllFormValues ? JSON.stringify(C(s, ge.current)) : c(a.body, s, ge.current) : void 0, v = setTimeout(() => i.abort(), 3e4), y = await fetch(f, {
1622
+ body: g || void 0,
1623
+ headers: Object.fromEntries(Object.entries(m).filter(([, e]) => e)),
1624
+ method: a.method || "GET",
1625
+ signal: i.signal
1626
+ });
1627
+ if (clearTimeout(v), !y.ok) {
1628
+ p(`HTTP Error ${y.status}: ${y.statusText}`);
1629
+ return;
1630
+ }
1631
+ let b = o(await y.text());
1632
+ if (!b.ok) {
1633
+ p(R("renderer.defaultHttpInput.invalidJson"));
1634
+ return;
1635
+ }
1636
+ let x = Fe(b.value), S = a.responsePath ? l(x, a.responsePath) : x;
1637
+ if (a.responseMapping && Array.isArray(S)) {
1638
+ let { valueField: e = "value", labelField: t = "label", descriptionField: n, imageField: r } = a.responseMapping, i = Se.current;
1639
+ h(S.map((a) => {
1640
+ let o = n ? l(a, n) : void 0, s = r ? l(a, r) : void 0, c = String(l(a, t) || "");
1641
+ return {
1642
+ description: o != null && o !== "" ? String(o) : void 0,
1643
+ image: typeof s == "string" && s !== "" ? s : void 0,
1644
+ label: i ? E(c) : c,
1645
+ value: String(l(a, e) || "")
1646
+ };
1647
+ }));
1648
+ } else u(typeof S == "string" ? S : JSON.stringify(S));
1649
+ } catch (e) {
1650
+ if (e instanceof Error && e.name === "AbortError") return;
1651
+ p(e instanceof Error ? e.message : R("renderer.defaultHttpInput.fetchFailed")), console.error("HTTP Input fetch error:", e);
1652
+ } finally {
1653
+ U.current === i && (d(!1), U.current = null);
1654
+ }
1655
+ }, [R]);
1656
+ if (ae(() => {
1657
+ me.current = L, he.current = j, ge.current = ne, _e.current = re, ve.current = se, ye.current = O, be.current = Te, Se.current = D.data.normalizeOptionLabels !== !1;
1658
+ }, [
1659
+ L,
1660
+ j,
1661
+ ne,
1662
+ re,
1663
+ se,
1664
+ O,
1665
+ Te,
1666
+ D.data.normalizeOptionLabels
1667
+ ]), ae(() => () => {
1668
+ U.current && U.current.abort(), de.current = !1, z.current = !1;
1669
+ }, []), ae(() => {
1670
+ if (de.current) return;
1671
+ de.current = !0;
1672
+ let e = me.current, t = he.current, n = be.current, r = e?.url && Le(e.url, t);
1673
+ e?.fetchOnMount && r && n && (n(), e.url && (fe.current = Ie(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
1674
+ }, []), ae(() => {
1675
+ if (!de.current || !W || fe.current === we || !G) return;
1676
+ let e = setTimeout(() => {
1677
+ Te(), fe.current = we;
1678
+ }, 500);
1679
+ return () => clearTimeout(e);
1680
+ }, [
1681
+ we,
1682
+ W,
1683
+ G,
1684
+ Te
1685
+ ]), ae(() => {
1686
+ if (!z.current) {
1687
+ z.current = !0;
1688
+ return;
1689
+ }
1690
+ let e = me.current, t = he.current, n = be.current, r = e?.url && Le(e.url, t);
1691
+ e?.fetchOnMount && r && n && (n(), e.url && (fe.current = Ie(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
1692
+ }, [oe(() => JSON.stringify({
1693
+ body: L?.body,
1694
+ fetchOnMount: L?.fetchOnMount,
1695
+ headers: L?.headers,
1696
+ method: L?.method,
1697
+ queryParams: L?.queryParams,
1698
+ responseMapping: L?.responseMapping,
1699
+ responsePath: L?.responsePath,
1700
+ searchParam: L?.searchParam,
1701
+ sendAllFormValues: L?.sendAllFormValues,
1702
+ url: L?.url
1703
+ }), [L])]), ae(() => {
1704
+ if (!(L?.searchParam && g)) return;
1705
+ let e = setTimeout(() => {
1706
+ Te(g);
1707
+ }, 300);
1708
+ return () => clearTimeout(e);
1709
+ }, [
1710
+ g,
1711
+ L?.searchParam,
1712
+ Te
1713
+ ]), L?.responseMapping) {
1714
+ let e = Array.isArray(S) ? S[0] : S, t = m.find((t) => t.value === e);
1715
+ if (L.searchParam) {
1716
+ let n = u && L?.showLoading;
1717
+ return /* @__PURE__ */ F(H, {
1718
+ style: Y.container,
1719
+ children: [
1720
+ /* @__PURE__ */ P(T, {
1721
+ label: A,
1722
+ required: D.data.required
1723
+ }),
1724
+ /* @__PURE__ */ P(ke, {
1725
+ missing: te,
1726
+ children: /* @__PURE__ */ F(V, {
1727
+ style: [
1728
+ Y.trigger,
1729
+ {
1730
+ backgroundColor: I.input,
1731
+ borderColor: I.border
1732
+ },
1733
+ k && { borderColor: I.error },
1734
+ te.length > 0 && { backgroundColor: I.muted }
1735
+ ],
1736
+ onPress: () => x(!0),
1737
+ disabled: te.length > 0,
1738
+ activeOpacity: .7,
1739
+ children: [
1740
+ /* @__PURE__ */ P(B, {
1741
+ style: [
1742
+ Y.triggerText,
1743
+ { color: I.text },
1744
+ !t && { color: I.textMuted }
1745
+ ],
1746
+ numberOfLines: 1,
1747
+ children: t?.label || w || R("renderer.defaultHttpInput.search")
1748
+ }),
1749
+ n && /* @__PURE__ */ P(ce, {
1750
+ size: "small",
1751
+ color: I.primary,
1752
+ style: Y.triggerLoader
1753
+ }),
1754
+ e ? /* @__PURE__ */ P(V, {
1755
+ onPress: () => O(""),
1756
+ hitSlop: {
1757
+ bottom: 8,
1758
+ left: 8,
1759
+ right: 8,
1760
+ top: 8
1761
+ },
1762
+ style: Y.clearButton,
1763
+ children: /* @__PURE__ */ P(B, {
1764
+ style: [Y.clearIcon, { color: I.textMuted }],
1765
+ children: "✕"
1766
+ })
1767
+ }) : null,
1768
+ /* @__PURE__ */ P(B, {
1769
+ style: [Y.arrow, { color: I.textMuted }],
1770
+ children: "▼"
1771
+ })
1772
+ ]
1773
+ })
1774
+ }),
1775
+ /* @__PURE__ */ P(ue, {
1776
+ visible: y,
1777
+ transparent: !0,
1778
+ animationType: "fade",
1779
+ onRequestClose: () => x(!1),
1780
+ children: /* @__PURE__ */ P(V, {
1781
+ style: Y.modalOverlay,
1782
+ activeOpacity: 1,
1783
+ onPress: () => x(!1),
1784
+ children: /* @__PURE__ */ F(V, {
1785
+ style: [Y.modalContent, { backgroundColor: I.card }],
1786
+ activeOpacity: 1,
1787
+ onPress: () => {},
1788
+ children: [
1789
+ /* @__PURE__ */ F(H, {
1790
+ style: [Y.modalHeader, { borderBottomColor: I.separator }],
1791
+ children: [/* @__PURE__ */ P(B, {
1792
+ style: [Y.modalTitle, { color: I.text }],
1793
+ children: A || w || R("renderer.defaultHttpInput.search")
1794
+ }), /* @__PURE__ */ P(V, {
1795
+ onPress: () => x(!1),
1796
+ children: /* @__PURE__ */ P(B, {
1797
+ style: [Y.closeButton, { color: I.textMuted }],
1798
+ children: "✕"
1799
+ })
1800
+ })]
1801
+ }),
1802
+ /* @__PURE__ */ P(H, {
1803
+ style: Y.searchContainer,
1804
+ children: /* @__PURE__ */ P(pe, {
1805
+ style: [Y.searchInput, {
1806
+ backgroundColor: I.muted,
1807
+ borderColor: I.border,
1808
+ color: I.text
1809
+ }],
1810
+ placeholder: R("renderer.defaultHttpInput.search"),
1811
+ placeholderTextColor: I.textMuted,
1812
+ value: g,
1813
+ onChangeText: (e) => {
1814
+ v(e), p(null);
1815
+ },
1816
+ autoFocus: !0,
1817
+ autoCapitalize: "none",
1818
+ autoCorrect: !1
1819
+ })
1820
+ }),
1821
+ u ? /* @__PURE__ */ P(H, {
1822
+ style: Y.loadingContainer,
1823
+ children: /* @__PURE__ */ P(ce, {
1824
+ size: "small",
1825
+ color: I.primary
1826
+ })
1827
+ }) : f ? /* @__PURE__ */ F(H, {
1828
+ style: Y.errorContainer,
1829
+ children: [/* @__PURE__ */ P(B, {
1830
+ style: [Y.errorText, { color: I.error }],
1831
+ children: f
1832
+ }), /* @__PURE__ */ P(V, {
1833
+ onPress: () => Te(g),
1834
+ style: Y.retryButton,
1835
+ children: /* @__PURE__ */ P(B, {
1836
+ style: [Y.retryButtonText, { color: I.primary }],
1837
+ children: R("renderer.defaultHttpInput.retry")
1838
+ })
1839
+ })]
1840
+ }) : /* @__PURE__ */ P(le, {
1841
+ data: m,
1842
+ keyExtractor: (e) => e.value,
1843
+ style: Y.optionsList,
1844
+ contentContainerStyle: Y.optionsListContent,
1845
+ ListEmptyComponent: /* @__PURE__ */ P(H, {
1846
+ style: Y.emptyContainer,
1847
+ children: /* @__PURE__ */ P(B, {
1848
+ style: [Y.emptyText, { color: I.textMuted }],
1849
+ children: R("renderer.defaultHttpInput.noResults")
1850
+ })
1851
+ }),
1852
+ renderItem: ({ item: t }) => {
1853
+ let n = t.value === e;
1854
+ return /* @__PURE__ */ F(V, {
1855
+ style: [Y.option, n && { backgroundColor: I.primaryLight }],
1856
+ onPress: () => {
1857
+ O(t.value), x(!1);
1858
+ },
1859
+ activeOpacity: .7,
1860
+ children: [/* @__PURE__ */ P(xe, {
1861
+ label: t.label,
1862
+ description: t.description,
1863
+ image: t.image
1864
+ }), n && /* @__PURE__ */ P(B, {
1865
+ style: [Y.checkmark, { color: I.primary }],
1866
+ children: "✓"
1867
+ })]
1868
+ });
1869
+ }
1870
+ })
1871
+ ]
1872
+ })
1873
+ })
1874
+ }),
1875
+ k && /* @__PURE__ */ P(B, {
1876
+ style: [Y.error, { color: I.error }],
1877
+ children: k
1878
+ }),
1879
+ ee && !k && /* @__PURE__ */ P(B, {
1880
+ style: [Y.helperText, { color: I.textMuted }],
1881
+ children: ee
1882
+ })
1883
+ ]
1884
+ });
1885
+ }
1886
+ let n = u && L?.showLoading, r = te.length === 0 && m.length === 0 && !n ? f ?? R("renderer.defaultHttpInput.noDataAvailable") : void 0;
1887
+ return /* @__PURE__ */ F(H, {
1888
+ style: Y.container,
1889
+ children: [
1890
+ /* @__PURE__ */ P(T, {
1891
+ label: A,
1892
+ required: D.data.required
1893
+ }),
1894
+ /* @__PURE__ */ P(ke, {
1895
+ missing: te,
1896
+ children: /* @__PURE__ */ F(V, {
1897
+ style: [
1898
+ Y.trigger,
1899
+ {
1900
+ backgroundColor: I.input,
1901
+ borderColor: I.border
1902
+ },
1903
+ k && { borderColor: I.error },
1904
+ (n || m.length === 0) && { backgroundColor: I.muted }
1905
+ ],
1906
+ onPress: () => x(!0),
1907
+ disabled: n || m.length === 0,
1908
+ activeOpacity: .7,
1909
+ children: [
1910
+ /* @__PURE__ */ P(B, {
1911
+ style: [
1912
+ Y.triggerText,
1913
+ { color: I.text },
1914
+ !t && { color: I.textMuted }
1915
+ ],
1916
+ numberOfLines: 1,
1917
+ children: t?.label || w || R("renderer.defaultHttpInput.selectOption")
1918
+ }),
1919
+ n && /* @__PURE__ */ P(ce, {
1920
+ size: "small",
1921
+ color: I.primary,
1922
+ style: Y.triggerLoader
1923
+ }),
1924
+ e ? /* @__PURE__ */ P(V, {
1925
+ onPress: () => O(""),
1926
+ hitSlop: {
1927
+ bottom: 8,
1928
+ left: 8,
1929
+ right: 8,
1930
+ top: 8
1931
+ },
1932
+ style: Y.clearButton,
1933
+ children: /* @__PURE__ */ P(B, {
1934
+ style: [Y.clearIcon, { color: I.textMuted }],
1935
+ children: "✕"
1936
+ })
1937
+ }) : null,
1938
+ /* @__PURE__ */ P(B, {
1939
+ style: [Y.arrow, { color: I.textMuted }],
1940
+ children: "▼"
1941
+ })
1942
+ ]
1943
+ })
1944
+ }),
1945
+ r && /* @__PURE__ */ P(B, {
1946
+ style: [Y.disabledMessage, { color: I.error }],
1947
+ children: r
1948
+ }),
1949
+ /* @__PURE__ */ P(ue, {
1950
+ visible: y,
1951
+ transparent: !0,
1952
+ animationType: "fade",
1953
+ onRequestClose: () => x(!1),
1954
+ children: /* @__PURE__ */ P(V, {
1955
+ style: Y.modalOverlay,
1956
+ activeOpacity: 1,
1957
+ onPress: () => x(!1),
1958
+ children: /* @__PURE__ */ F(V, {
1959
+ style: [Y.modalContent, { backgroundColor: I.card }],
1960
+ activeOpacity: 1,
1961
+ onPress: () => {},
1962
+ children: [/* @__PURE__ */ F(H, {
1963
+ style: [Y.modalHeader, { borderBottomColor: I.separator }],
1964
+ children: [/* @__PURE__ */ P(B, {
1965
+ style: [Y.modalTitle, { color: I.text }],
1966
+ children: A || w || R("renderer.defaultHttpInput.selectOption")
1967
+ }), /* @__PURE__ */ P(V, {
1968
+ onPress: () => x(!1),
1969
+ children: /* @__PURE__ */ P(B, {
1970
+ style: [Y.closeButton, { color: I.textMuted }],
1971
+ children: "✕"
1972
+ })
1973
+ })]
1974
+ }), /* @__PURE__ */ P(le, {
1975
+ data: m,
1976
+ keyExtractor: (e) => e.value,
1977
+ style: Y.optionsList,
1978
+ contentContainerStyle: Y.optionsListContent,
1979
+ renderItem: ({ item: t }) => {
1980
+ let n = t.value === e;
1981
+ return /* @__PURE__ */ F(V, {
1982
+ style: [Y.option, n && { backgroundColor: I.primaryLight }],
1983
+ onPress: () => {
1984
+ O(t.value), x(!1);
1985
+ },
1986
+ activeOpacity: .7,
1987
+ children: [/* @__PURE__ */ P(xe, {
1988
+ label: t.label,
1989
+ description: t.description,
1990
+ image: t.image
1991
+ }), n && /* @__PURE__ */ P(B, {
1992
+ style: [Y.checkmark, { color: I.primary }],
1993
+ children: "✓"
1994
+ })]
1995
+ });
1996
+ }
1997
+ })]
1998
+ })
1999
+ })
2000
+ }),
2001
+ k && /* @__PURE__ */ P(B, {
2002
+ style: [Y.error, { color: I.error }],
2003
+ children: k
2004
+ }),
2005
+ ee && !k && /* @__PURE__ */ P(B, {
2006
+ style: [Y.helperText, { color: I.textMuted }],
2007
+ children: ee
2008
+ })
2009
+ ]
2010
+ });
2011
+ }
2012
+ return /* @__PURE__ */ F(H, {
2013
+ style: Y.container,
2014
+ children: [
2015
+ /* @__PURE__ */ P(T, {
2016
+ label: A,
2017
+ required: D.data.required
2018
+ }),
2019
+ /* @__PURE__ */ P(pe, {
2020
+ style: [Y.input, {
2021
+ backgroundColor: I.muted,
2022
+ borderColor: I.border,
2023
+ color: I.textMuted
2024
+ }],
2025
+ value: typeof S == "string" ? S : JSON.stringify(S),
2026
+ editable: !1
2027
+ }),
2028
+ k && /* @__PURE__ */ P(B, {
2029
+ style: [Y.error, { color: I.error }],
2030
+ children: k
2031
+ }),
2032
+ ee && !k && /* @__PURE__ */ P(B, {
2033
+ style: [Y.helperText, { color: I.textMuted }],
2034
+ children: ee
2035
+ })
2036
+ ]
2037
+ });
2038
+ }, Y = z.create({
2039
+ arrow: { fontSize: 12 },
2040
+ checkmark: {
2041
+ fontSize: 18,
2042
+ fontWeight: "700"
2043
+ },
2044
+ clearButton: {
2045
+ marginRight: 8,
2046
+ paddingHorizontal: 2
2047
+ },
2048
+ clearIcon: { fontSize: 14 },
2049
+ closeButton: {
2050
+ fontSize: 24,
2051
+ fontWeight: "300"
2052
+ },
2053
+ container: { marginBottom: 16 },
2054
+ disabledMessage: {
2055
+ fontSize: 12,
2056
+ marginTop: 4
2057
+ },
2058
+ emptyContainer: {
2059
+ alignItems: "center",
2060
+ paddingVertical: 24
2061
+ },
2062
+ emptyText: { fontSize: 14 },
2063
+ error: {
2064
+ fontSize: 12,
2065
+ marginTop: 4
2066
+ },
2067
+ errorContainer: {
2068
+ alignItems: "center",
2069
+ paddingVertical: 16
2070
+ },
2071
+ errorText: {
2072
+ fontSize: 14,
2073
+ textAlign: "center"
2074
+ },
2075
+ helperText: {
2076
+ fontSize: 12,
2077
+ marginTop: 4
2078
+ },
2079
+ input: {
2080
+ borderRadius: 6,
2081
+ borderWidth: 1,
2082
+ fontSize: 14,
2083
+ paddingHorizontal: 12,
2084
+ paddingVertical: 10
2085
+ },
2086
+ loadingContainer: {
2087
+ alignItems: "center",
2088
+ paddingVertical: 24
2089
+ },
2090
+ modalContent: {
2091
+ borderRadius: 12,
2092
+ maxHeight: "80%",
2093
+ padding: 16,
2094
+ width: "90%"
2095
+ },
2096
+ modalHeader: {
2097
+ alignItems: "center",
2098
+ borderBottomWidth: 1,
2099
+ flexDirection: "row",
2100
+ justifyContent: "space-between",
2101
+ marginBottom: 12,
2102
+ paddingBottom: 12
2103
+ },
2104
+ modalOverlay: {
2105
+ alignItems: "center",
2106
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
2107
+ flex: 1,
2108
+ justifyContent: "center"
2109
+ },
2110
+ modalTitle: {
2111
+ fontSize: 18,
2112
+ fontWeight: "600"
2113
+ },
2114
+ option: {
2115
+ alignItems: "center",
2116
+ borderRadius: 6,
2117
+ flexDirection: "row",
2118
+ justifyContent: "space-between",
2119
+ paddingHorizontal: 12,
2120
+ paddingVertical: 12
2121
+ },
2122
+ optionsList: {
2123
+ flexGrow: 0,
2124
+ flexShrink: 1
2125
+ },
2126
+ optionsListContent: { flexGrow: 0 },
2127
+ retryButton: { marginTop: 12 },
2128
+ retryButtonText: {
2129
+ fontSize: 14,
2130
+ textDecorationLine: "underline"
2131
+ },
2132
+ searchContainer: { marginBottom: 12 },
2133
+ searchInput: {
2134
+ borderRadius: 6,
2135
+ borderWidth: 1,
2136
+ fontSize: 14,
2137
+ paddingHorizontal: 12,
2138
+ paddingVertical: 10
2139
+ },
2140
+ trigger: {
2141
+ alignItems: "center",
2142
+ borderRadius: 6,
2143
+ borderWidth: 1,
2144
+ flexDirection: "row",
2145
+ justifyContent: "space-between",
2146
+ paddingHorizontal: 12,
2147
+ paddingVertical: 10
2148
+ },
2149
+ triggerLoader: { marginRight: 8 },
2150
+ triggerText: {
2151
+ flex: 1,
2152
+ fontSize: 14
2153
+ }
2154
+ }), Be = ({ field: e, extra: t }) => {
2155
+ let { value: n, placeholder: r, name: i } = e, [a, o] = N(n?.toString() ?? ""), { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f } = t, { colors: p } = b();
2156
+ return ae(() => {
2157
+ o(n?.toString() ?? "");
2158
+ }, [n]), /* @__PURE__ */ F(H, {
2159
+ style: Ve.container,
2160
+ children: [
2161
+ /* @__PURE__ */ P(s, {
2162
+ label: d,
2163
+ required: c.data.required
2164
+ }),
2165
+ /* @__PURE__ */ P(pe, {
2166
+ style: [
2167
+ Ve.input,
2168
+ {
2169
+ backgroundColor: p.input,
2170
+ borderColor: p.border,
2171
+ color: p.text
2172
+ },
2173
+ u && { borderColor: p.error }
2174
+ ],
2175
+ value: a,
2176
+ onChangeText: (e) => {
2177
+ if (o(e), e.trim() === "") {
2178
+ l(null);
2179
+ return;
2180
+ }
2181
+ let t = Number(e);
2182
+ Number.isNaN(t) || l(t);
2183
+ },
2184
+ placeholder: r,
2185
+ placeholderTextColor: p.textMuted,
2186
+ keyboardType: "numeric",
2187
+ accessibilityLabel: i
2188
+ }),
2189
+ u && /* @__PURE__ */ P(B, {
2190
+ style: [Ve.error, { color: p.error }],
2191
+ children: u
2192
+ }),
2193
+ f && !u && /* @__PURE__ */ P(B, {
2194
+ style: [Ve.helperText, { color: p.textMuted }],
2195
+ children: f
2196
+ })
2197
+ ]
2198
+ });
2199
+ }, Ve = z.create({
2200
+ container: { marginBottom: 16 },
2201
+ error: {
2202
+ fontSize: 12,
2203
+ marginTop: 4
2204
+ },
2205
+ helperText: {
2206
+ fontSize: 12,
2207
+ marginTop: 4
2208
+ },
2209
+ input: {
2210
+ borderRadius: 6,
2211
+ borderWidth: 1,
2212
+ fontSize: 14,
2213
+ paddingHorizontal: 12,
2214
+ paddingVertical: 8
2215
+ }
2216
+ }), He = ({ field: e, extra: t }) => {
2217
+ let [n, r] = N(!1), { value: i, placeholder: a, name: o } = e, { InputLabel: s, node: c, setValue: l, error: u, label: d, helperText: f } = t, { colors: p } = b();
2218
+ return /* @__PURE__ */ F(H, {
2219
+ style: Ue.container,
2220
+ children: [
2221
+ /* @__PURE__ */ P(s, {
2222
+ label: d,
2223
+ required: c.data.required
2224
+ }),
2225
+ /* @__PURE__ */ F(H, {
2226
+ style: Ue.inputWrapper,
2227
+ children: [/* @__PURE__ */ P(pe, {
2228
+ style: [
2229
+ Ue.input,
2230
+ {
2231
+ backgroundColor: p.input,
2232
+ borderColor: p.border,
2233
+ color: p.text
2234
+ },
2235
+ u && { borderColor: p.error }
2236
+ ],
2237
+ value: i ?? "",
2238
+ onChangeText: l,
2239
+ placeholder: a,
2240
+ placeholderTextColor: p.textMuted,
2241
+ secureTextEntry: !n,
2242
+ accessibilityLabel: o
2243
+ }), /* @__PURE__ */ P(V, {
2244
+ style: Ue.toggleButton,
2245
+ onPress: () => r(!n),
2246
+ activeOpacity: .7,
2247
+ children: /* @__PURE__ */ P(B, {
2248
+ style: [Ue.toggleText, { color: p.primary }],
2249
+ children: n ? "Hide" : "Show"
2250
+ })
2251
+ })]
2252
+ }),
2253
+ u && /* @__PURE__ */ P(B, {
2254
+ style: [Ue.error, { color: p.error }],
2255
+ children: u
2256
+ }),
2257
+ f && !u && /* @__PURE__ */ P(B, {
2258
+ style: [Ue.helperText, { color: p.textMuted }],
2259
+ children: f
2260
+ })
2261
+ ]
2262
+ });
2263
+ }, Ue = z.create({
2264
+ container: { marginBottom: 16 },
2265
+ error: {
2266
+ fontSize: 12,
2267
+ marginTop: 4
2268
+ },
2269
+ helperText: {
2270
+ fontSize: 12,
2271
+ marginTop: 4
2272
+ },
2273
+ input: {
2274
+ borderRadius: 6,
2275
+ borderWidth: 1,
2276
+ flex: 1,
2277
+ fontSize: 14,
2278
+ paddingHorizontal: 12,
2279
+ paddingVertical: 8
2280
+ },
2281
+ inputWrapper: {
2282
+ alignItems: "center",
2283
+ flexDirection: "row",
2284
+ position: "relative"
2285
+ },
2286
+ toggleButton: {
2287
+ paddingHorizontal: 12,
2288
+ paddingVertical: 8,
2289
+ position: "absolute",
2290
+ right: 0
2291
+ },
2292
+ toggleText: {
2293
+ fontSize: 12,
2294
+ fontWeight: "600"
2295
+ }
2296
+ }), We = ({ field: e, extra: t }) => {
2297
+ let { value: n } = e, { InputLabel: r, node: i, setValue: a, error: o, label: c, helperText: l } = t, { colors: u } = b(), d = s(), f = i.data.options || [], p = n || "", m = i.data.variant !== "default", h = (e) => {
2298
+ a(e);
2299
+ };
2300
+ return /* @__PURE__ */ F(H, {
2301
+ style: X.container,
2302
+ children: [
2303
+ /* @__PURE__ */ P(r, {
2304
+ label: c,
2305
+ required: i.data.required
2306
+ }),
2307
+ f.map((e) => {
2308
+ let t = p === e.value, n = d(e.label) || e.value, r = d(e.description);
2309
+ return m ? /* @__PURE__ */ F(V, {
2310
+ style: [
2311
+ X.card,
2312
+ {
2313
+ backgroundColor: u.input,
2314
+ borderColor: u.border
2315
+ },
2316
+ t && {
2317
+ backgroundColor: `${u.primary}10`,
2318
+ borderColor: u.primary
2319
+ },
2320
+ e.disabled && { opacity: .5 }
2321
+ ],
2322
+ onPress: () => h(e.value),
2323
+ disabled: e.disabled,
2324
+ activeOpacity: .7,
2325
+ children: [
2326
+ e.image && /* @__PURE__ */ P(R, {
2327
+ source: { uri: e.image },
2328
+ style: X.cardImage
2329
+ }),
2330
+ /* @__PURE__ */ F(H, {
2331
+ style: X.cardTextContainer,
2332
+ children: [/* @__PURE__ */ P(B, {
2333
+ style: [X.cardLabel, { color: u.textSecondary }],
2334
+ children: n
2335
+ }), r && /* @__PURE__ */ P(B, {
2336
+ style: [X.cardDescription, { color: u.textMuted }],
2337
+ children: r
2338
+ })]
2339
+ }),
2340
+ /* @__PURE__ */ P(H, {
2341
+ style: [
2342
+ X.radio,
2343
+ X.cardRadio,
2344
+ {
2345
+ backgroundColor: u.input,
2346
+ borderColor: u.border
2347
+ },
2348
+ t && { borderColor: u.primary }
2349
+ ],
2350
+ children: t && /* @__PURE__ */ P(H, { style: [X.radioInner, { backgroundColor: u.primary }] })
2351
+ })
2352
+ ]
2353
+ }, e.value) : /* @__PURE__ */ F(V, {
2354
+ style: X.option,
2355
+ onPress: () => h(e.value),
2356
+ disabled: e.disabled,
2357
+ activeOpacity: .7,
2358
+ children: [
2359
+ /* @__PURE__ */ P(H, {
2360
+ style: [
2361
+ X.radio,
2362
+ {
2363
+ backgroundColor: u.input,
2364
+ borderColor: u.border
2365
+ },
2366
+ t && { borderColor: u.primary }
2367
+ ],
2368
+ children: t && /* @__PURE__ */ P(H, { style: [X.radioInner, { backgroundColor: u.primary }] })
2369
+ }),
2370
+ e.image && /* @__PURE__ */ P(R, {
2371
+ source: { uri: e.image },
2372
+ style: X.image
2373
+ }),
2374
+ /* @__PURE__ */ F(H, {
2375
+ style: X.optionTextContainer,
2376
+ children: [/* @__PURE__ */ P(B, {
2377
+ style: [
2378
+ X.optionLabel,
2379
+ { color: u.textSecondary },
2380
+ e.disabled && { color: u.textMuted }
2381
+ ],
2382
+ children: n
2383
+ }), r && /* @__PURE__ */ P(B, {
2384
+ style: [X.optionDescription, { color: u.textMuted }],
2385
+ children: r
2386
+ })]
2387
+ })
2388
+ ]
2389
+ }, e.value);
2390
+ }),
2391
+ o && /* @__PURE__ */ P(B, {
2392
+ style: [X.error, { color: u.error }],
2393
+ children: o
2394
+ }),
2395
+ l && !o && /* @__PURE__ */ P(B, {
2396
+ style: [X.helperText, { color: u.textMuted }],
2397
+ children: l
2398
+ })
2399
+ ]
2400
+ });
2401
+ }, X = z.create({
2402
+ card: {
2403
+ alignItems: "center",
2404
+ borderRadius: 8,
2405
+ borderWidth: 1,
2406
+ flexDirection: "row",
2407
+ marginBottom: 8,
2408
+ padding: 16
2409
+ },
2410
+ cardDescription: {
2411
+ fontSize: 12,
2412
+ marginTop: 4
2413
+ },
2414
+ cardImage: {
2415
+ borderRadius: 4,
2416
+ height: 40,
2417
+ marginRight: 12,
2418
+ width: 40
2419
+ },
2420
+ cardLabel: {
2421
+ fontSize: 14,
2422
+ fontWeight: "500"
2423
+ },
2424
+ cardRadio: {
2425
+ marginLeft: 12,
2426
+ marginRight: 0
2427
+ },
2428
+ cardTextContainer: { flex: 1 },
2429
+ container: { marginBottom: 16 },
2430
+ error: {
2431
+ fontSize: 12,
2432
+ marginTop: 4
2433
+ },
2434
+ helperText: {
2435
+ fontSize: 12,
2436
+ marginTop: 4
2437
+ },
2438
+ image: {
2439
+ borderRadius: 4,
2440
+ height: 32,
2441
+ marginRight: 8,
2442
+ width: 32
2443
+ },
2444
+ option: {
2445
+ alignItems: "center",
2446
+ flexDirection: "row",
2447
+ marginBottom: 8
2448
+ },
2449
+ optionDescription: {
2450
+ fontSize: 12,
2451
+ marginTop: 2
2452
+ },
2453
+ optionLabel: { fontSize: 14 },
2454
+ optionTextContainer: { flex: 1 },
2455
+ radio: {
2456
+ alignItems: "center",
2457
+ borderRadius: 10,
2458
+ borderWidth: 2,
2459
+ height: 20,
2460
+ justifyContent: "center",
2461
+ marginRight: 12,
2462
+ width: 20
2463
+ },
2464
+ radioInner: {
2465
+ borderRadius: 5,
2466
+ height: 10,
2467
+ width: 10
2468
+ }
2469
+ }), Ge = ({ field: e, extra: t }) => {
2470
+ let [n, r] = N(!1), { value: i, placeholder: a } = e, { InputLabel: o, node: c, setValue: l, error: u, label: d, helperText: f } = t, { colors: p } = b(), m = s(), h = c.data.options || [], g = c.data.multiple, _ = Array.isArray(i) ? i : i ? [i] : [], v = (e) => {
2471
+ g ? l(_.includes(e) ? _.filter((t) => t !== e) : [..._, e]) : (l(e), r(!1));
2472
+ };
2473
+ return /* @__PURE__ */ F(H, {
2474
+ style: Z.container,
2475
+ children: [
2476
+ /* @__PURE__ */ P(o, {
2477
+ label: d,
2478
+ required: c.data.required
2479
+ }),
2480
+ /* @__PURE__ */ F(V, {
2481
+ style: [
2482
+ Z.trigger,
2483
+ {
2484
+ backgroundColor: p.input,
2485
+ borderColor: p.border
2486
+ },
2487
+ u && { borderColor: p.error }
2488
+ ],
2489
+ onPress: () => r(!0),
2490
+ activeOpacity: .7,
2491
+ children: [
2492
+ /* @__PURE__ */ P(B, {
2493
+ style: [
2494
+ Z.triggerText,
2495
+ { color: p.text },
2496
+ _.length === 0 && { color: p.textMuted }
2497
+ ],
2498
+ children: (() => {
2499
+ if (_.length === 0) return a || "Select...";
2500
+ if (g) return h.filter((e) => _.includes(e.value)).map((e) => m(e.label) || e.value).join(", ");
2501
+ let e = h.find((e) => e.value === _[0]);
2502
+ return e ? m(e.label) || e.value : a || "Select...";
2503
+ })()
2504
+ }),
2505
+ _.length > 0 && /* @__PURE__ */ P(V, {
2506
+ onPress: () => l(g ? [] : ""),
2507
+ hitSlop: {
2508
+ bottom: 8,
2509
+ left: 8,
2510
+ right: 8,
2511
+ top: 8
2512
+ },
2513
+ style: Z.clearButton,
2514
+ children: /* @__PURE__ */ P(B, {
2515
+ style: [Z.clearIcon, { color: p.textMuted }],
2516
+ children: "✕"
2517
+ })
2518
+ }),
2519
+ /* @__PURE__ */ P(B, {
2520
+ style: [Z.arrow, { color: p.textMuted }],
2521
+ children: "▼"
2522
+ })
2523
+ ]
2524
+ }),
2525
+ /* @__PURE__ */ P(ue, {
2526
+ visible: n,
2527
+ transparent: !0,
2528
+ animationType: "fade",
2529
+ onRequestClose: () => r(!1),
2530
+ children: /* @__PURE__ */ P(V, {
2531
+ style: Z.modalOverlay,
2532
+ activeOpacity: 1,
2533
+ onPress: () => r(!1),
2534
+ children: /* @__PURE__ */ F(H, {
2535
+ style: [Z.modalContent, { backgroundColor: p.card }],
2536
+ onStartShouldSetResponder: () => !0,
2537
+ children: [
2538
+ /* @__PURE__ */ F(H, {
2539
+ style: [Z.modalHeader, { borderBottomColor: p.border }],
2540
+ children: [/* @__PURE__ */ P(B, {
2541
+ style: [Z.modalTitle, { color: p.text }],
2542
+ children: d || a || m("renderer.defaultSelectInput.selectOption")
2543
+ }), /* @__PURE__ */ P(V, {
2544
+ onPress: () => r(!1),
2545
+ children: /* @__PURE__ */ P(B, {
2546
+ style: [Z.closeButton, { color: p.textMuted }],
2547
+ children: "✕"
2548
+ })
2549
+ })]
2550
+ }),
2551
+ /* @__PURE__ */ P(de, {
2552
+ style: Z.optionsList,
2553
+ children: h.map((e) => {
2554
+ let t = _.includes(e.value);
2555
+ return /* @__PURE__ */ F(V, {
2556
+ style: [Z.option, t && { backgroundColor: `${p.primary}20` }],
2557
+ onPress: () => v(e.value),
2558
+ disabled: e.disabled,
2559
+ activeOpacity: .7,
2560
+ children: [/* @__PURE__ */ P(xe, {
2561
+ label: m(e.label) || e.value,
2562
+ description: m(e.description),
2563
+ image: e.image,
2564
+ disabled: e.disabled
2565
+ }), t && /* @__PURE__ */ P(B, {
2566
+ style: [Z.checkmark, { color: p.primary }],
2567
+ children: "✓"
2568
+ })]
2569
+ }, e.value);
2570
+ })
2571
+ }),
2572
+ g && /* @__PURE__ */ P(V, {
2573
+ style: [Z.doneButton, { backgroundColor: p.primary }],
2574
+ onPress: () => r(!1),
2575
+ children: /* @__PURE__ */ P(B, {
2576
+ style: Z.doneButtonText,
2577
+ children: "Done"
2578
+ })
2579
+ })
2580
+ ]
2581
+ })
2582
+ })
2583
+ }),
2584
+ u && /* @__PURE__ */ P(B, {
2585
+ style: [Z.error, { color: p.error }],
2586
+ children: u
2587
+ }),
2588
+ f && !u && /* @__PURE__ */ P(B, {
2589
+ style: [Z.helperText, { color: p.textMuted }],
2590
+ children: f
2591
+ })
2592
+ ]
2593
+ });
2594
+ }, Z = z.create({
2595
+ arrow: { fontSize: 12 },
2596
+ checkmark: {
2597
+ fontSize: 18,
2598
+ fontWeight: "700"
2599
+ },
2600
+ clearButton: {
2601
+ marginRight: 8,
2602
+ paddingHorizontal: 2
2603
+ },
2604
+ clearIcon: { fontSize: 14 },
2605
+ closeButton: {
2606
+ fontSize: 24,
2607
+ fontWeight: "300"
2608
+ },
2609
+ container: { marginBottom: 16 },
2610
+ doneButton: {
2611
+ alignItems: "center",
2612
+ borderRadius: 6,
2613
+ marginTop: 12,
2614
+ paddingVertical: 12
2615
+ },
2616
+ doneButtonText: {
2617
+ color: "#FFFFFF",
2618
+ fontSize: 16,
2619
+ fontWeight: "600"
2620
+ },
2621
+ error: {
2622
+ fontSize: 12,
2623
+ marginTop: 4
2624
+ },
2625
+ helperText: {
2626
+ fontSize: 12,
2627
+ marginTop: 4
2628
+ },
2629
+ modalContent: {
2630
+ borderRadius: 12,
2631
+ maxHeight: "80%",
2632
+ padding: 16,
2633
+ width: "90%"
2634
+ },
2635
+ modalHeader: {
2636
+ alignItems: "center",
2637
+ borderBottomWidth: 1,
2638
+ flexDirection: "row",
2639
+ justifyContent: "space-between",
2640
+ marginBottom: 12,
2641
+ paddingBottom: 12
2642
+ },
2643
+ modalOverlay: {
2644
+ alignItems: "center",
2645
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
2646
+ flex: 1,
2647
+ justifyContent: "center"
2648
+ },
2649
+ modalTitle: {
2650
+ fontSize: 18,
2651
+ fontWeight: "600"
2652
+ },
2653
+ option: {
2654
+ alignItems: "center",
2655
+ borderRadius: 6,
2656
+ flexDirection: "row",
2657
+ justifyContent: "space-between",
2658
+ paddingHorizontal: 12,
2659
+ paddingVertical: 12
2660
+ },
2661
+ optionsList: { maxHeight: 300 },
2662
+ trigger: {
2663
+ alignItems: "center",
2664
+ borderRadius: 6,
2665
+ borderWidth: 1,
2666
+ flexDirection: "row",
2667
+ justifyContent: "space-between",
2668
+ paddingHorizontal: 12,
2669
+ paddingVertical: 10
2670
+ },
2671
+ triggerText: {
2672
+ flex: 1,
2673
+ fontSize: 14
2674
+ }
2675
+ }), Ke = (e) => null, qe = ({ field: e, extra: t }) => {
2676
+ let { value: n } = e, { InputLabel: r, node: i, setValue: a, error: o, label: s, helperText: c } = t, { colors: l } = b(), u = !!n;
2677
+ return /* @__PURE__ */ F(H, {
2678
+ style: Je.container,
2679
+ children: [
2680
+ /* @__PURE__ */ F(H, {
2681
+ style: Je.row,
2682
+ children: [/* @__PURE__ */ P(H, {
2683
+ style: Je.labelContainer,
2684
+ children: /* @__PURE__ */ P(r, {
2685
+ label: s,
2686
+ required: i.data.required
2687
+ })
2688
+ }), /* @__PURE__ */ P(fe, {
2689
+ trackColor: {
2690
+ false: l.border,
2691
+ true: `${l.primary}80`
2692
+ },
2693
+ thumbColor: u ? l.primary : l.card,
2694
+ ios_backgroundColor: l.border,
2695
+ onValueChange: a,
2696
+ value: u
2697
+ })]
2698
+ }),
2699
+ o && /* @__PURE__ */ P(B, {
2700
+ style: [Je.error, { color: l.error }],
2701
+ children: o
2702
+ }),
2703
+ c && !o && /* @__PURE__ */ P(B, {
2704
+ style: [Je.helperText, { color: l.textMuted }],
2705
+ children: c
2706
+ })
2707
+ ]
2708
+ });
2709
+ }, Je = z.create({
2710
+ container: { marginBottom: 16 },
2711
+ error: {
2712
+ fontSize: 12,
2713
+ marginTop: 4
2714
+ },
2715
+ helperText: {
2716
+ fontSize: 12,
2717
+ marginTop: 4
2718
+ },
2719
+ labelContainer: { flex: 1 },
2720
+ row: {
2721
+ alignItems: "center",
2722
+ flexDirection: "row",
2723
+ justifyContent: "space-between"
2724
+ }
2725
+ }), Ye = ({ field: e, extra: t }) => {
2726
+ let { value: n, placeholder: r, name: i } = e, { InputLabel: a, node: o, setValue: s, error: c, label: l, helperText: u } = t, { colors: d } = b();
2727
+ return /* @__PURE__ */ F(H, {
2728
+ style: Xe.container,
2729
+ children: [
2730
+ /* @__PURE__ */ P(a, {
2731
+ label: l,
2732
+ required: o.data.required
2733
+ }),
2734
+ /* @__PURE__ */ P(pe, {
2735
+ style: [
2736
+ Xe.textarea,
2737
+ {
2738
+ backgroundColor: d.input,
2739
+ borderColor: d.border,
2740
+ color: d.text
2741
+ },
2742
+ c && { borderColor: d.error }
2743
+ ],
2744
+ value: n ?? "",
2745
+ onChangeText: s,
2746
+ placeholder: r,
2747
+ placeholderTextColor: d.textMuted,
2748
+ multiline: !0,
2749
+ numberOfLines: 4,
2750
+ textAlignVertical: "top",
2751
+ accessibilityLabel: i
2752
+ }),
2753
+ c && /* @__PURE__ */ P(B, {
2754
+ style: [Xe.error, { color: d.error }],
2755
+ children: c
2756
+ }),
2757
+ u && !c && /* @__PURE__ */ P(B, {
2758
+ style: [Xe.helperText, { color: d.textMuted }],
2759
+ children: u
2760
+ })
2761
+ ]
2762
+ });
2763
+ }, Xe = z.create({
2764
+ container: { marginBottom: 16 },
2765
+ error: {
2766
+ fontSize: 12,
2767
+ marginTop: 4
2768
+ },
2769
+ helperText: {
2770
+ fontSize: 12,
2771
+ marginTop: 4
2772
+ },
2773
+ textarea: {
2774
+ borderRadius: 6,
2775
+ borderWidth: 1,
2776
+ fontSize: 14,
2777
+ minHeight: 100,
2778
+ paddingHorizontal: 12,
2779
+ paddingVertical: 8
2780
+ }
2781
+ }), Ze = ({ field: e, extra: t }) => {
2782
+ let { value: n, placeholder: r, name: i } = e, { InputLabel: a, node: o, setValue: s, error: c, label: l, helperText: u } = t, { colors: d } = b();
2783
+ return /* @__PURE__ */ F(H, {
2784
+ style: Qe.container,
2785
+ children: [
2786
+ /* @__PURE__ */ P(a, {
2787
+ label: l,
2788
+ required: o.data.required
2789
+ }),
2790
+ /* @__PURE__ */ P(pe, {
2791
+ style: [
2792
+ Qe.input,
2793
+ {
2794
+ backgroundColor: d.input,
2795
+ borderColor: d.border,
2796
+ color: d.text
2797
+ },
2798
+ c && { borderColor: d.error }
2799
+ ],
2800
+ value: n ?? "",
2801
+ onChangeText: s,
2802
+ placeholder: r,
2803
+ placeholderTextColor: d.textMuted,
2804
+ accessibilityLabel: i
2805
+ }),
2806
+ c && /* @__PURE__ */ P(B, {
2807
+ style: [Qe.error, { color: d.error }],
2808
+ children: c
2809
+ }),
2810
+ u && !c && /* @__PURE__ */ P(B, {
2811
+ style: [Qe.helperText, { color: d.textMuted }],
2812
+ children: u
2813
+ })
2814
+ ]
2815
+ });
2816
+ }, Qe = z.create({
2817
+ container: { marginBottom: 16 },
2818
+ error: {
2819
+ fontSize: 12,
2820
+ marginTop: 4
2821
+ },
2822
+ helperText: {
2823
+ fontSize: 12,
2824
+ marginTop: 4
2825
+ },
2826
+ input: {
2827
+ borderRadius: 6,
2828
+ borderWidth: 1,
2829
+ fontSize: 14,
2830
+ paddingHorizontal: 12,
2831
+ paddingVertical: 8
2832
+ }
2833
+ }), $e = ({ field: e, extra: t }) => {
2834
+ let { value: n, placeholder: r } = e, i = (n || "").split(":"), a = Number.parseInt(i[0], 10), o = Number.parseInt(i[1], 10), c = Number.isNaN(a) ? 0 : a, l = Number.isNaN(o) ? 0 : o, [u, d] = N(c || 0), [f, p] = N(l || 0), [m, h] = N(!1), { InputLabel: g, node: _, setValue: v, error: y, label: x, helperText: S } = t, { colors: C } = b(), w = s(), T = M(null), E = M(null), D = Array.from({ length: 24 }, (e, t) => t), O = Array.from({ length: 60 }, (e, t) => t), k = () => n || r || w("renderer.defaultInputs.selectTime"), A = ie(() => {
2835
+ v(`${String(u).padStart(2, "0")}:${String(f).padStart(2, "0")}`), h(!1);
2836
+ }, [
2837
+ u,
2838
+ f,
2839
+ v
2840
+ ]);
2841
+ return /* @__PURE__ */ F(H, {
2842
+ style: Q.container,
2843
+ children: [
2844
+ /* @__PURE__ */ P(g, {
2845
+ label: x,
2846
+ required: _.data.required
2847
+ }),
2848
+ /* @__PURE__ */ F(V, {
2849
+ style: [
2850
+ Q.trigger,
2851
+ {
2852
+ backgroundColor: C.input,
2853
+ borderColor: C.border
2854
+ },
2855
+ y && { borderColor: C.error }
2856
+ ],
2857
+ onPress: () => {
2858
+ d(c || 0), p(l || 0), h(!0);
2859
+ },
2860
+ activeOpacity: .7,
2861
+ children: [/* @__PURE__ */ P(B, {
2862
+ style: [
2863
+ Q.triggerText,
2864
+ { color: C.text },
2865
+ !n && { color: C.textMuted }
2866
+ ],
2867
+ numberOfLines: 1,
2868
+ children: k()
2869
+ }), /* @__PURE__ */ P(B, {
2870
+ style: Q.icon,
2871
+ children: "🕐"
2872
+ })]
2873
+ }),
2874
+ /* @__PURE__ */ P(ue, {
2875
+ visible: m,
2876
+ transparent: !0,
2877
+ animationType: "fade",
2878
+ onRequestClose: () => h(!1),
2879
+ children: /* @__PURE__ */ P(V, {
2880
+ style: Q.modalOverlay,
2881
+ activeOpacity: 1,
2882
+ onPress: () => h(!1),
2883
+ children: /* @__PURE__ */ F(V, {
2884
+ style: [Q.modalContent, { backgroundColor: C.card }],
2885
+ activeOpacity: 1,
2886
+ onPress: () => {},
2887
+ children: [
2888
+ /* @__PURE__ */ F(H, {
2889
+ style: [Q.modalHeader, { borderBottomColor: C.separator }],
2890
+ children: [/* @__PURE__ */ P(B, {
2891
+ style: [Q.modalTitle, { color: C.text }],
2892
+ children: x || r || w("renderer.defaultInputs.selectTime")
2893
+ }), /* @__PURE__ */ P(V, {
2894
+ onPress: () => h(!1),
2895
+ children: /* @__PURE__ */ P(B, {
2896
+ style: [Q.closeButton, { color: C.textMuted }],
2897
+ children: "✕"
2898
+ })
2899
+ })]
2900
+ }),
2901
+ /* @__PURE__ */ F(H, {
2902
+ style: Q.pickerContainer,
2903
+ children: [
2904
+ /* @__PURE__ */ F(H, {
2905
+ style: Q.pickerColumn,
2906
+ children: [/* @__PURE__ */ P(B, {
2907
+ style: [Q.pickerLabel, { color: C.textMuted }],
2908
+ children: "Hour"
2909
+ }), /* @__PURE__ */ P(de, {
2910
+ ref: T,
2911
+ style: Q.picker,
2912
+ contentContainerStyle: Q.pickerContent,
2913
+ showsVerticalScrollIndicator: !1,
2914
+ children: D.map((e) => /* @__PURE__ */ P(V, {
2915
+ style: [Q.pickerItem, u === e && { backgroundColor: C.primary }],
2916
+ onPress: () => d(e),
2917
+ activeOpacity: .7,
2918
+ children: /* @__PURE__ */ P(B, {
2919
+ style: [
2920
+ Q.pickerItemText,
2921
+ { color: C.text },
2922
+ u === e && {
2923
+ color: C.background,
2924
+ fontWeight: "600"
2925
+ }
2926
+ ],
2927
+ children: String(e).padStart(2, "0")
2928
+ })
2929
+ }, e))
2930
+ })]
2931
+ }),
2932
+ /* @__PURE__ */ P(B, {
2933
+ style: [Q.pickerSeparator, { color: C.text }],
2934
+ children: ":"
2935
+ }),
2936
+ /* @__PURE__ */ F(H, {
2937
+ style: Q.pickerColumn,
2938
+ children: [/* @__PURE__ */ P(B, {
2939
+ style: [Q.pickerLabel, { color: C.textMuted }],
2940
+ children: "Minute"
2941
+ }), /* @__PURE__ */ P(de, {
2942
+ ref: E,
2943
+ style: Q.picker,
2944
+ contentContainerStyle: Q.pickerContent,
2945
+ showsVerticalScrollIndicator: !1,
2946
+ children: O.map((e) => /* @__PURE__ */ P(V, {
2947
+ style: [Q.pickerItem, f === e && { backgroundColor: C.primary }],
2948
+ onPress: () => p(e),
2949
+ activeOpacity: .7,
2950
+ children: /* @__PURE__ */ P(B, {
2951
+ style: [
2952
+ Q.pickerItemText,
2953
+ { color: C.text },
2954
+ f === e && {
2955
+ color: C.background,
2956
+ fontWeight: "600"
2957
+ }
2958
+ ],
2959
+ children: String(e).padStart(2, "0")
2960
+ })
2961
+ }, e))
2962
+ })]
2963
+ })
2964
+ ]
2965
+ }),
2966
+ /* @__PURE__ */ P(V, {
2967
+ style: [Q.confirmButton, { backgroundColor: C.primary }],
2968
+ onPress: A,
2969
+ activeOpacity: .7,
2970
+ children: /* @__PURE__ */ P(B, {
2971
+ style: [Q.confirmButtonText, { color: C.background }],
2972
+ children: "Confirm"
2973
+ })
2974
+ })
2975
+ ]
2976
+ })
2977
+ })
2978
+ }),
2979
+ y && /* @__PURE__ */ P(B, {
2980
+ style: [Q.error, { color: C.error }],
2981
+ children: y
2982
+ }),
2983
+ S && !y && /* @__PURE__ */ P(B, {
2984
+ style: [Q.helperText, { color: C.textMuted }],
2985
+ children: S
2986
+ })
2987
+ ]
2988
+ });
2989
+ }, Q = z.create({
2990
+ closeButton: {
2991
+ fontSize: 24,
2992
+ fontWeight: "300"
2993
+ },
2994
+ confirmButton: {
2995
+ alignItems: "center",
2996
+ borderRadius: 6,
2997
+ marginTop: 16,
2998
+ paddingVertical: 12
2999
+ },
3000
+ confirmButtonText: {
3001
+ fontSize: 16,
3002
+ fontWeight: "600"
3003
+ },
3004
+ container: { marginBottom: 16 },
3005
+ error: {
3006
+ fontSize: 12,
3007
+ marginTop: 4
3008
+ },
3009
+ helperText: {
3010
+ fontSize: 12,
3011
+ marginTop: 4
3012
+ },
3013
+ icon: { fontSize: 16 },
3014
+ modalContent: {
3015
+ borderRadius: 12,
3016
+ padding: 16,
3017
+ width: "80%"
3018
+ },
3019
+ modalHeader: {
3020
+ alignItems: "center",
3021
+ borderBottomWidth: 1,
3022
+ flexDirection: "row",
3023
+ justifyContent: "space-between",
3024
+ marginBottom: 16,
3025
+ paddingBottom: 12
3026
+ },
3027
+ modalOverlay: {
3028
+ alignItems: "center",
3029
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
3030
+ flex: 1,
3031
+ justifyContent: "center"
3032
+ },
3033
+ modalTitle: {
3034
+ fontSize: 18,
3035
+ fontWeight: "600"
3036
+ },
3037
+ picker: { maxHeight: 200 },
3038
+ pickerColumn: { flex: 1 },
3039
+ pickerContainer: {
3040
+ alignItems: "center",
3041
+ flexDirection: "row",
3042
+ gap: 8
3043
+ },
3044
+ pickerContent: { paddingVertical: 8 },
3045
+ pickerItem: {
3046
+ alignItems: "center",
3047
+ borderRadius: 6,
3048
+ marginVertical: 2,
3049
+ paddingVertical: 10
3050
+ },
3051
+ pickerItemText: { fontSize: 18 },
3052
+ pickerLabel: {
3053
+ fontSize: 12,
3054
+ fontWeight: "600",
3055
+ marginBottom: 8,
3056
+ textAlign: "center"
3057
+ },
3058
+ pickerSeparator: {
3059
+ fontSize: 24,
3060
+ fontWeight: "600"
3061
+ },
3062
+ trigger: {
3063
+ alignItems: "center",
3064
+ borderRadius: 6,
3065
+ borderWidth: 1,
3066
+ flexDirection: "row",
3067
+ justifyContent: "space-between",
3068
+ paddingHorizontal: 12,
3069
+ paddingVertical: 10
3070
+ },
3071
+ triggerText: {
3072
+ flex: 1,
3073
+ fontSize: 14
3074
+ }
3075
+ }), et = ({ field: e, extra: t }) => {
3076
+ let [n, r] = N(!1), [i, a] = N(!0), { value: o } = e, { InputLabel: c, node: l, setValue: u, error: d, label: f, helperText: p } = t, { colors: m } = b(), h = s(), g = Array.isArray(o) ? o : [], _ = g[0] || "", v = g[1] || "", y = _.split(":"), x = Number.parseInt(y[0], 10), S = Number.parseInt(y[1], 10), C = Number.isNaN(x) ? 0 : x, w = Number.isNaN(S) ? 0 : S, T = v.split(":"), E = Number.parseInt(T[0], 10), D = Number.parseInt(T[1], 10), O = Number.isNaN(E) ? 0 : E, k = Number.isNaN(D) ? 0 : D, [A, ee] = N(0), [te, j] = N(0), ne = Array.from({ length: 24 }, (e, t) => t), re = Array.from({ length: 60 }, (e, t) => t), ae = () => _ && v ? `${_} - ${v}` : _ || h("renderer.defaultInputs.selectTimeRange"), oe = ie(() => {
3077
+ let e = `${String(A).padStart(2, "0")}:${String(te).padStart(2, "0")}`;
3078
+ i ? (u([e, v]), a(!1), ee(O || 0), j(k || 0)) : (u([_, e]), r(!1), a(!0));
3079
+ }, [
3080
+ i,
3081
+ A,
3082
+ te,
3083
+ _,
3084
+ v,
3085
+ O,
3086
+ k,
3087
+ u
3088
+ ]);
3089
+ return /* @__PURE__ */ F(H, {
3090
+ style: $.container,
3091
+ children: [
3092
+ /* @__PURE__ */ P(c, {
3093
+ label: f,
3094
+ required: l.data.required
3095
+ }),
3096
+ /* @__PURE__ */ F(V, {
3097
+ style: [
3098
+ $.trigger,
3099
+ {
3100
+ backgroundColor: m.input,
3101
+ borderColor: m.border
3102
+ },
3103
+ d && { borderColor: m.error }
3104
+ ],
3105
+ onPress: () => {
3106
+ ee(C || 0), j(w || 0), a(!0), r(!0);
3107
+ },
3108
+ activeOpacity: .7,
3109
+ children: [/* @__PURE__ */ P(B, {
3110
+ style: [
3111
+ $.triggerText,
3112
+ { color: m.text },
3113
+ !_ && { color: m.textMuted }
3114
+ ],
3115
+ numberOfLines: 1,
3116
+ children: ae()
3117
+ }), /* @__PURE__ */ P(B, {
3118
+ style: $.icon,
3119
+ children: "🕐"
3120
+ })]
3121
+ }),
3122
+ /* @__PURE__ */ P(ue, {
3123
+ visible: n,
3124
+ transparent: !0,
3125
+ animationType: "fade",
3126
+ onRequestClose: () => r(!1),
3127
+ children: /* @__PURE__ */ P(V, {
3128
+ style: $.modalOverlay,
3129
+ activeOpacity: 1,
3130
+ onPress: () => r(!1),
3131
+ children: /* @__PURE__ */ F(V, {
3132
+ style: [$.modalContent, { backgroundColor: m.card }],
3133
+ activeOpacity: 1,
3134
+ onPress: () => {},
3135
+ children: [
3136
+ /* @__PURE__ */ F(H, {
3137
+ style: [$.modalHeader, { borderBottomColor: m.separator }],
3138
+ children: [/* @__PURE__ */ P(B, {
3139
+ style: [$.modalTitle, { color: m.text }],
3140
+ children: f || h("renderer.defaultInputs.selectTimeRange")
3141
+ }), /* @__PURE__ */ P(V, {
3142
+ onPress: () => r(!1),
3143
+ children: /* @__PURE__ */ P(B, {
3144
+ style: [$.closeButton, { color: m.textMuted }],
3145
+ children: "✕"
3146
+ })
3147
+ })]
3148
+ }),
3149
+ /* @__PURE__ */ P(H, {
3150
+ style: [$.rangeIndicator, { backgroundColor: m.primaryLight }],
3151
+ children: /* @__PURE__ */ P(B, {
3152
+ style: [$.rangeIndicatorText, { color: m.primary }],
3153
+ children: h(i ? "renderer.defaultInputs.startTime" : "renderer.defaultInputs.endTime")
3154
+ })
3155
+ }),
3156
+ /* @__PURE__ */ F(H, {
3157
+ style: $.pickerContainer,
3158
+ children: [
3159
+ /* @__PURE__ */ F(H, {
3160
+ style: $.pickerColumn,
3161
+ children: [/* @__PURE__ */ P(B, {
3162
+ style: [$.pickerLabel, { color: m.textMuted }],
3163
+ children: "Hour"
3164
+ }), /* @__PURE__ */ P(de, {
3165
+ style: $.picker,
3166
+ contentContainerStyle: $.pickerContent,
3167
+ showsVerticalScrollIndicator: !1,
3168
+ children: ne.map((e) => /* @__PURE__ */ P(V, {
3169
+ style: [$.pickerItem, A === e && { backgroundColor: m.primary }],
3170
+ onPress: () => ee(e),
3171
+ activeOpacity: .7,
3172
+ children: /* @__PURE__ */ P(B, {
3173
+ style: [
3174
+ $.pickerItemText,
3175
+ { color: m.text },
3176
+ A === e && {
3177
+ color: m.background,
3178
+ fontWeight: "600"
3179
+ }
3180
+ ],
3181
+ children: String(e).padStart(2, "0")
3182
+ })
3183
+ }, e))
3184
+ })]
3185
+ }),
3186
+ /* @__PURE__ */ P(B, {
3187
+ style: [$.pickerSeparator, { color: m.text }],
3188
+ children: ":"
3189
+ }),
3190
+ /* @__PURE__ */ F(H, {
3191
+ style: $.pickerColumn,
3192
+ children: [/* @__PURE__ */ P(B, {
3193
+ style: [$.pickerLabel, { color: m.textMuted }],
3194
+ children: "Minute"
3195
+ }), /* @__PURE__ */ P(de, {
3196
+ style: $.picker,
3197
+ contentContainerStyle: $.pickerContent,
3198
+ showsVerticalScrollIndicator: !1,
3199
+ children: re.map((e) => /* @__PURE__ */ P(V, {
3200
+ style: [$.pickerItem, te === e && { backgroundColor: m.primary }],
3201
+ onPress: () => j(e),
3202
+ activeOpacity: .7,
3203
+ children: /* @__PURE__ */ P(B, {
3204
+ style: [
3205
+ $.pickerItemText,
3206
+ { color: m.text },
3207
+ te === e && {
3208
+ color: m.background,
3209
+ fontWeight: "600"
3210
+ }
3211
+ ],
3212
+ children: String(e).padStart(2, "0")
3213
+ })
3214
+ }, e))
3215
+ })]
3216
+ })
3217
+ ]
3218
+ }),
3219
+ /* @__PURE__ */ P(V, {
3220
+ style: [$.confirmButton, { backgroundColor: m.primary }],
3221
+ onPress: oe,
3222
+ activeOpacity: .7,
3223
+ children: /* @__PURE__ */ P(B, {
3224
+ style: [$.confirmButtonText, { color: m.background }],
3225
+ children: i ? "Next" : "Confirm"
3226
+ })
3227
+ })
3228
+ ]
3229
+ })
3230
+ })
3231
+ }),
3232
+ d && /* @__PURE__ */ P(B, {
3233
+ style: [$.error, { color: m.error }],
3234
+ children: d
3235
+ }),
3236
+ p && !d && /* @__PURE__ */ P(B, {
3237
+ style: [$.helperText, { color: m.textMuted }],
3238
+ children: p
3239
+ })
3240
+ ]
3241
+ });
3242
+ }, $ = z.create({
3243
+ closeButton: {
3244
+ fontSize: 24,
3245
+ fontWeight: "300"
3246
+ },
3247
+ confirmButton: {
3248
+ alignItems: "center",
3249
+ borderRadius: 6,
3250
+ marginTop: 16,
3251
+ paddingVertical: 12
3252
+ },
3253
+ confirmButtonText: {
3254
+ fontSize: 16,
3255
+ fontWeight: "600"
3256
+ },
3257
+ container: { marginBottom: 16 },
3258
+ error: {
3259
+ fontSize: 12,
3260
+ marginTop: 4
3261
+ },
3262
+ helperText: {
3263
+ fontSize: 12,
3264
+ marginTop: 4
3265
+ },
3266
+ icon: { fontSize: 16 },
3267
+ modalContent: {
3268
+ borderRadius: 12,
3269
+ padding: 16,
3270
+ width: "80%"
3271
+ },
3272
+ modalHeader: {
3273
+ alignItems: "center",
3274
+ borderBottomWidth: 1,
3275
+ flexDirection: "row",
3276
+ justifyContent: "space-between",
3277
+ marginBottom: 12,
3278
+ paddingBottom: 12
3279
+ },
3280
+ modalOverlay: {
3281
+ alignItems: "center",
3282
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
3283
+ flex: 1,
3284
+ justifyContent: "center"
3285
+ },
3286
+ modalTitle: {
3287
+ fontSize: 18,
3288
+ fontWeight: "600"
3289
+ },
3290
+ picker: { maxHeight: 200 },
3291
+ pickerColumn: { flex: 1 },
3292
+ pickerContainer: {
3293
+ alignItems: "center",
3294
+ flexDirection: "row",
3295
+ gap: 8
3296
+ },
3297
+ pickerContent: { paddingVertical: 8 },
3298
+ pickerItem: {
3299
+ alignItems: "center",
3300
+ borderRadius: 6,
3301
+ marginVertical: 2,
3302
+ paddingVertical: 10
3303
+ },
3304
+ pickerItemText: { fontSize: 18 },
3305
+ pickerLabel: {
3306
+ fontSize: 12,
3307
+ fontWeight: "600",
3308
+ marginBottom: 8,
3309
+ textAlign: "center"
3310
+ },
3311
+ pickerSeparator: {
3312
+ fontSize: 24,
3313
+ fontWeight: "600"
3314
+ },
3315
+ rangeIndicator: {
3316
+ alignItems: "center",
3317
+ borderRadius: 6,
3318
+ marginBottom: 12,
3319
+ paddingVertical: 8
3320
+ },
3321
+ rangeIndicatorText: {
3322
+ fontSize: 14,
3323
+ fontWeight: "600"
3324
+ },
3325
+ trigger: {
3326
+ alignItems: "center",
3327
+ borderRadius: 6,
3328
+ borderWidth: 1,
3329
+ flexDirection: "row",
3330
+ justifyContent: "space-between",
3331
+ paddingHorizontal: 12,
3332
+ paddingVertical: 10
3333
+ },
3334
+ triggerText: {
3335
+ flex: 1,
3336
+ fontSize: 14
3337
+ }
3338
+ }), tt = {
3339
+ address: be,
3340
+ autocomplete: Ce,
3341
+ checkbox: we,
3342
+ date: Te,
3343
+ daterange: Ee,
3344
+ file: De,
3345
+ hidden: Oe,
3346
+ http: ze,
3347
+ number: Be,
3348
+ password: He,
3349
+ radio: We,
3350
+ select: Ge,
3351
+ submit: Ke,
3352
+ switch: qe,
3353
+ text: Ze,
3354
+ textarea: Ye,
3355
+ time: $e,
3356
+ timerange: et
3357
+ }, nt = ({ step: e, label: t, children: n, canGoBack: r, isLastStep: i, canContinue: a, isSubmitting: o, onBack: c, onContinue: l }) => {
3358
+ let { colors: d } = b(), f = s(), p = !a || o, m = e.nodes.find((e) => u(e) && e.data.type === "submit"), h = m && u(m) ? f(m.data.label) : void 0, g = i ? h || f("renderer.defaultSubmitButton.submit") : f("renderer.step.continue");
3359
+ return /* @__PURE__ */ F(H, { children: [
3360
+ t ? /* @__PURE__ */ P(B, {
3361
+ style: [rt.label, { color: d.text }],
3362
+ children: t
3363
+ }) : null,
3364
+ /* @__PURE__ */ P(H, {
3365
+ style: rt.content,
3366
+ children: n
3367
+ }),
3368
+ /* @__PURE__ */ F(H, {
3369
+ style: rt.actions,
3370
+ children: [r ? /* @__PURE__ */ P(V, {
3371
+ style: [
3372
+ rt.backButton,
3373
+ { borderColor: d.border },
3374
+ o && rt.disabled
3375
+ ],
3376
+ onPress: c,
3377
+ disabled: o,
3378
+ activeOpacity: .7,
3379
+ children: /* @__PURE__ */ P(B, {
3380
+ style: [rt.backButtonText, { color: d.text }],
3381
+ children: f("renderer.step.back")
3382
+ })
3383
+ }) : /* @__PURE__ */ P(H, {}), /* @__PURE__ */ P(V, {
3384
+ style: [
3385
+ rt.continueButton,
3386
+ { backgroundColor: d.primary },
3387
+ p && {
3388
+ backgroundColor: d.primaryDisabled,
3389
+ opacity: .6
3390
+ }
3391
+ ],
3392
+ onPress: l,
3393
+ disabled: p,
3394
+ activeOpacity: .7,
3395
+ children: o ? /* @__PURE__ */ P(ce, { color: d.primaryForeground }) : /* @__PURE__ */ P(B, {
3396
+ style: [rt.continueButtonText, { color: d.primaryForeground }],
3397
+ children: g
3398
+ })
3399
+ })]
3400
+ })
3401
+ ] });
3402
+ }, rt = z.create({
3403
+ actions: {
3404
+ alignItems: "center",
3405
+ flexDirection: "row",
3406
+ justifyContent: "space-between",
3407
+ marginTop: 24
3408
+ },
3409
+ backButton: {
3410
+ borderRadius: 6,
3411
+ borderWidth: 1,
3412
+ paddingHorizontal: 16,
3413
+ paddingVertical: 10
3414
+ },
3415
+ backButtonText: {
3416
+ fontSize: 14,
3417
+ fontWeight: "500"
3418
+ },
3419
+ content: { gap: 8 },
3420
+ continueButton: {
3421
+ alignItems: "center",
3422
+ borderRadius: 6,
3423
+ justifyContent: "center",
3424
+ paddingHorizontal: 24,
3425
+ paddingVertical: 12
3426
+ },
3427
+ continueButtonText: {
3428
+ fontSize: 14,
3429
+ fontWeight: "600"
3430
+ },
3431
+ disabled: { opacity: .5 },
3432
+ label: {
3433
+ fontSize: 16,
3434
+ fontWeight: "600",
3435
+ marginBottom: 12
3436
+ }
3437
+ }), it = ({ children: e = "Submit", disabled: t, isSubmitting: n, onPress: r }) => {
3438
+ let { colors: i } = b();
3439
+ return /* @__PURE__ */ P(V, {
3440
+ style: [
3441
+ at.button,
3442
+ { backgroundColor: i.primary },
3443
+ (t || n) && {
3444
+ backgroundColor: i.primaryDisabled,
3445
+ opacity: .6
3446
+ }
3447
+ ],
3448
+ disabled: t || n,
3449
+ onPress: r,
3450
+ activeOpacity: .7,
3451
+ children: n ? /* @__PURE__ */ P(ce, { color: i.primaryForeground }) : /* @__PURE__ */ P(B, {
3452
+ style: [at.buttonText, { color: i.primaryForeground }],
3453
+ children: e
3454
+ })
3455
+ });
3456
+ }, at = z.create({
3457
+ button: {
3458
+ alignItems: "center",
3459
+ borderRadius: 6,
3460
+ justifyContent: "center",
3461
+ marginTop: 16,
3462
+ paddingHorizontal: 24,
3463
+ paddingVertical: 12
3464
+ },
3465
+ buttonText: {
3466
+ fontSize: 16,
3467
+ fontWeight: "600"
3468
+ }
3469
+ }), ot = ({ children: e }) => e, st = ({ node: e }) => {
3470
+ let t = s(), { colors: n } = b(), r = t(e.data?.label);
3471
+ return /* @__PURE__ */ P(B, {
3472
+ style: [lt.title, { color: n.text }],
3473
+ children: r
3474
+ });
3475
+ }, ct = () => {
3476
+ let { colors: e } = b();
3477
+ return /* @__PURE__ */ P(H, { style: [lt.divider, { backgroundColor: e.separator }] });
3478
+ }, lt = z.create({
3479
+ divider: {
3480
+ height: 1,
3481
+ marginBottom: 16,
3482
+ marginTop: 0
3483
+ },
3484
+ title: {
3485
+ fontSize: 20,
3486
+ fontWeight: "700",
3487
+ marginBottom: 16
3488
+ }
3489
+ }), ut = {
3490
+ divider: ct,
3491
+ title: st
3492
+ }, dt = ({ node: e, children: t }) => {
3493
+ let { image: n } = e.data;
3494
+ return /* @__PURE__ */ F(H, { children: [n && /* @__PURE__ */ P(R, {
3495
+ source: { uri: n },
3496
+ style: ft.image,
3497
+ resizeMode: "cover"
3498
+ }), t] });
3499
+ }, ft = z.create({ image: {
3500
+ borderRadius: 6,
3501
+ height: 160,
3502
+ marginBottom: 8,
3503
+ width: "100%"
3504
+ } }), pt = ({ style: e }) => {
3505
+ let { colors: t } = b(), n = M(new L.Value(.5)).current;
3506
+ return ae(() => {
3507
+ let e = L.loop(L.sequence([L.timing(n, {
3508
+ duration: 600,
3509
+ toValue: 1,
3510
+ useNativeDriver: !0
3511
+ }), L.timing(n, {
3512
+ duration: 600,
3513
+ toValue: .5,
3514
+ useNativeDriver: !0
3515
+ })]));
3516
+ return e.start(), () => e.stop();
3517
+ }, [n]), /* @__PURE__ */ P(L.View, { style: [
3518
+ ht.bar,
3519
+ {
3520
+ backgroundColor: t.muted,
3521
+ opacity: n
3522
+ },
3523
+ e
3524
+ ] });
3525
+ }, mt = () => /* @__PURE__ */ F(H, {
3526
+ accessibilityState: { busy: !0 },
3527
+ children: [
3528
+ /* @__PURE__ */ P(pt, { style: ht.title }),
3529
+ /* @__PURE__ */ P(H, {
3530
+ style: ht.fields,
3531
+ children: [
3532
+ 0,
3533
+ 1,
3534
+ 2
3535
+ ].map((e) => /* @__PURE__ */ F(H, {
3536
+ style: ht.field,
3537
+ children: [/* @__PURE__ */ P(pt, { style: ht.fieldLabel }), /* @__PURE__ */ P(pt, { style: ht.fieldInput })]
3538
+ }, e))
3539
+ }),
3540
+ /* @__PURE__ */ P(H, {
3541
+ style: ht.actions,
3542
+ children: /* @__PURE__ */ P(pt, { style: ht.button })
3543
+ })
3544
+ ]
3545
+ }), ht = z.create({
3546
+ actions: {
3547
+ alignItems: "flex-end",
3548
+ marginTop: 24
3549
+ },
3550
+ bar: { borderRadius: 6 },
3551
+ button: {
3552
+ height: 44,
3553
+ width: 120
3554
+ },
3555
+ field: { gap: 8 },
3556
+ fieldInput: {
3557
+ height: 44,
3558
+ width: "100%"
3559
+ },
3560
+ fieldLabel: {
3561
+ height: 16,
3562
+ width: "25%"
3563
+ },
3564
+ fields: { gap: 24 },
3565
+ title: {
3566
+ height: 24,
3567
+ marginBottom: 24,
3568
+ width: "33%"
3569
+ }
3570
+ }), gt = ({ baseUrl: e, components: t, contentContainerStyle: n, flow: r, googleApiKey: a, headers: o, initialValues: s, isLoading: c = !1, isSubmitting: l = !1, language: u, onBack: d, onChange: f, onSubmit: p, showPoweredBy: m, style: h, theme: g, validate: _, validationMode: v }) => {
3571
+ let { colors: y } = b(), { canContinueStep: x, canSubmit: S, clearSubmitMessage: C, config: w, currentStep: T, currentStepGroupNode: E, currentStepIndex: D, formErrors: O, formValues: k, goToNextStep: A, goToPreviousStep: te, handleSubmit: j, inputNodes: ne, isFirstStep: ae, isLastStep: M, isSubmitting: N, missingRequiredFields: se, setFieldValue: ce, steps: I, submitMessage: L, t: le } = ee({
3572
+ baseUrl: e,
3573
+ components: t,
3574
+ flow: r,
3575
+ googleApiKey: a,
3576
+ headers: o,
3577
+ initialValues: s,
3578
+ language: u,
3579
+ onChange: f,
3580
+ onSubmit: p,
3581
+ showPoweredBy: m,
3582
+ theme: g,
3583
+ validate: _,
3584
+ validationMode: v
3585
+ }), R = l || N, { FormWrapper: ue, SubmitButtonWrapper: z, renderNode: fe } = re({
3586
+ config: w,
3587
+ DefaultFormWrapper: me,
3588
+ DefaultInputLabel: ge,
3589
+ DefaultInputWrapper: dt,
3590
+ DefaultSubmitButton: it,
3591
+ DefaultSubmitButtonWrapper: ot,
3592
+ defaultInputRenderers: tt,
3593
+ defaultUI: ut,
3594
+ formErrors: O,
3595
+ formValues: k,
3596
+ inputNodes: ne,
3597
+ isSubmitting: R,
3598
+ missingRequiredFields: se,
3599
+ setFieldValue: ce
3600
+ }), pe = w.components.step ?? nt, V = w.components.loadingSkeleton ?? mt, he = oe(() => le(E?.data?.label), [le, E]), _e = ie(() => {
3601
+ if (M) {
3602
+ j();
3603
+ return;
3604
+ }
3605
+ A();
3606
+ }, [
3607
+ M,
3608
+ j,
3609
+ A
3610
+ ]), ve = ie(() => {
3611
+ if (ae) {
3612
+ d?.();
3613
+ return;
3614
+ }
3615
+ te();
3616
+ }, [
3617
+ ae,
3618
+ d,
3619
+ te
3620
+ ]), ye = !ae || !!d;
3621
+ return /* @__PURE__ */ P(de, {
3622
+ nestedScrollEnabled: !0,
3623
+ style: [
3624
+ vt.container,
3625
+ { backgroundColor: y.background },
3626
+ h
3627
+ ],
3628
+ contentContainerStyle: n,
3629
+ children: c ? /* @__PURE__ */ P(V, {}) : /* @__PURE__ */ F(i, {
3630
+ value: {
3631
+ baseUrl: w.baseUrl,
3632
+ flow: r,
3633
+ formErrors: O,
3634
+ formValues: k,
3635
+ googleApiKey: w.googleApiKey,
3636
+ headers: w.headers,
3637
+ inputNodes: ne,
3638
+ language: w.language,
3639
+ setFieldValue: ce
3640
+ },
3641
+ children: [/* @__PURE__ */ F(ue, {
3642
+ onSubmit: j,
3643
+ children: [T && /* @__PURE__ */ P(z, {
3644
+ missingFields: se,
3645
+ children: /* @__PURE__ */ P(pe, {
3646
+ step: T,
3647
+ groupNode: E,
3648
+ stepIndex: D,
3649
+ totalSteps: I.length,
3650
+ isFirstStep: ae,
3651
+ isLastStep: M,
3652
+ canContinue: x && (!M || S),
3653
+ canGoBack: ye,
3654
+ isSubmitting: R,
3655
+ onBack: ve,
3656
+ onContinue: _e,
3657
+ label: he,
3658
+ children: T.nodes.map((e) => fe(e))
3659
+ })
3660
+ }), w.showPoweredBy && /* @__PURE__ */ P(B, {
3661
+ style: [vt.poweredBy, { color: y.textMuted }],
3662
+ children: "Powered by Treege"
3663
+ })]
3664
+ }), L && /* @__PURE__ */ F(H, {
3665
+ style: [vt.message, { backgroundColor: L.type === "success" ? y.successBg : y.errorBg }],
3666
+ children: [/* @__PURE__ */ P(B, {
3667
+ style: [vt.messageText, { color: L.type === "success" ? y.success : y.error }],
3668
+ children: L.message
3669
+ }), /* @__PURE__ */ P(B, {
3670
+ style: [vt.messageClose, { color: L.type === "success" ? y.success : y.error }],
3671
+ onPress: C,
3672
+ children: le("common.close")
3673
+ })]
3674
+ })]
3675
+ })
3676
+ });
3677
+ }, _t = (e) => /* @__PURE__ */ P(w, {
3678
+ theme: e.theme,
3679
+ storageKey: "treege-renderer-theme",
3680
+ children: /* @__PURE__ */ P(gt, { ...e })
3681
+ }), vt = z.create({
3682
+ container: { flex: 1 },
3683
+ message: {
3684
+ borderRadius: 6,
3685
+ marginVertical: 16,
3686
+ padding: 16
3687
+ },
3688
+ messageClose: {
3689
+ fontSize: 14,
3690
+ marginTop: 8,
3691
+ textDecorationLine: "underline"
3692
+ },
3693
+ messageText: {
3694
+ fontSize: 14,
3695
+ fontWeight: "500"
3696
+ },
3697
+ poweredBy: {
3698
+ fontSize: 12,
3699
+ paddingVertical: 8,
3700
+ textAlign: "right"
3701
+ }
3702
+ });
3703
+ //#endregion
3704
+ export { be as DefaultAddressInput, Ce as DefaultAutocompleteInput, we as DefaultCheckboxInput, Te as DefaultDateInput, Ee as DefaultDateRangeInput, ct as DefaultDividerUI, De as DefaultFileInput, Oe as DefaultHiddenInput, ze as DefaultHttpInput, ge as DefaultInputLabel, Be as DefaultNumberInput, He as DefaultPasswordInput, We as DefaultRadioInput, Ge as DefaultSelectInput, qe as DefaultSwitchInput, Ze as DefaultTextInput, Ye as DefaultTextareaInput, $e as DefaultTimeInput, et as DefaultTimeRangeInput, st as DefaultTitleUI, _t as TreegeRenderer, O as TreegeRendererProvider, S as applyReferenceTransformation, g as buildInitialFormValues, f as calculateReferenceFieldUpdates, x as checkFormFieldHasValue, C as convertFormValuesToNamedFormat, tt as defaultInputRenderers, ut as defaultUI, te as evaluateCondition, ne as evaluateConditions, y as fileToSerializable, h as filesToSerializable, j as findStartNode, m as formatFileSize, k as getFlowRenderState, r as getTranslatedText, p as isFieldEmpty, D as isStartNode, d as normalizeSerializableFiles, v as resolveNodeDefaultValue, Ne as sanitize, Fe as sanitizeHttpResponse, T as serializableToFile, ee as useTreegeRenderer, A as useTreegeRendererConfig };