treege 3.0.0-beta.6 → 3.0.0-beta.61

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