treege 3.0.0-beta.6 → 3.0.0-beta.60

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