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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/LICENSE +18 -12
  2. package/README.md +474 -79
  3. package/dist/DefaultSubmitButton-Dg9GPvh-.js +1853 -0
  4. package/dist/ThemeContext-BgTIhoK6.js +985 -0
  5. package/dist/editor/components/input/ComboboxWithCreate.d.ts +2 -1
  6. package/dist/editor/components/styles/EditorStyles.d.ts +2 -0
  7. package/dist/editor/constants/defaultNode.d.ts +1 -1
  8. package/dist/editor/constants/edgeTypes.d.ts +3 -2
  9. package/dist/editor/constants/inputTypeIcons.d.ts +3 -0
  10. package/dist/editor/constants/nodeSpacing.d.ts +25 -0
  11. package/dist/editor/constants/nodeTypes.d.ts +4 -5
  12. package/dist/editor/context/OpenApiContext.d.ts +79 -0
  13. package/dist/editor/context/TreegeEditorRuntimeProvider.d.ts +78 -0
  14. package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
  15. package/dist/editor/features/TreegeEditor/controls/MiniMapControl.d.ts +6 -0
  16. package/dist/editor/features/TreegeEditor/dialogs/AuthorizeDialog.d.ts +20 -0
  17. package/dist/editor/features/TreegeEditor/dialogs/ChangeNodeTypeDialog.d.ts +2 -0
  18. package/dist/editor/features/TreegeEditor/dialogs/DeleteNodeDialog.d.ts +2 -0
  19. package/dist/editor/features/TreegeEditor/dialogs/HeadersDialog.d.ts +19 -0
  20. package/dist/editor/features/TreegeEditor/dialogs/OpenApiDialog.d.ts +6 -0
  21. package/dist/editor/features/TreegeEditor/edges/ConditionalEdge.d.ts +2 -2
  22. package/dist/editor/features/TreegeEditor/edges/DefaultEdge.d.ts +3 -0
  23. package/dist/editor/features/TreegeEditor/forms/HttpConfigForm.d.ts +4 -1
  24. package/dist/editor/features/TreegeEditor/forms/JsonTemplateEditor.d.ts +13 -0
  25. package/dist/editor/features/TreegeEditor/forms/OptionsMappingFields.d.ts +34 -0
  26. package/dist/editor/features/TreegeEditor/forms/OptionsSourceForm.d.ts +7 -0
  27. package/dist/editor/features/TreegeEditor/forms/SensitiveHeaderWarning.d.ts +13 -0
  28. package/dist/editor/features/TreegeEditor/forms/SubmitConfigForm.d.ts +7 -0
  29. package/dist/editor/features/TreegeEditor/inputs/ApiUrlCombobox.d.ts +20 -0
  30. package/dist/editor/features/TreegeEditor/inputs/ComboboxPattern.d.ts +2 -1
  31. package/dist/editor/features/TreegeEditor/inputs/DefaultFileValueField.d.ts +14 -0
  32. package/dist/editor/features/TreegeEditor/inputs/OptionImageField.d.ts +6 -0
  33. package/dist/editor/features/TreegeEditor/inputs/SelectNodeGroup.d.ts +22 -1
  34. package/dist/editor/features/TreegeEditor/layout/AutoLayout.d.ts +15 -0
  35. package/dist/editor/features/TreegeEditor/listeners/FlowChangeEmitter.d.ts +19 -0
  36. package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +5 -0
  37. package/dist/editor/features/TreegeEditor/nodes/components/BottomHandleDropdown.d.ts +25 -0
  38. package/dist/editor/features/TreegeEditor/nodes/components/NodeGroupBadge.d.ts +6 -0
  39. package/dist/editor/features/TreegeEditor/nodes/components/NodeImage.d.ts +5 -0
  40. package/dist/editor/features/TreegeEditor/nodes/components/NodeImageButton.d.ts +6 -0
  41. package/dist/editor/features/TreegeEditor/nodes/components/NodeInputPreview.d.ts +12 -0
  42. package/dist/editor/features/TreegeEditor/nodes/components/NodeLabelInput.d.ts +10 -0
  43. package/dist/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.d.ts +6 -0
  44. package/dist/editor/features/TreegeEditor/nodes/components/NodeRequiredButton.d.ts +6 -0
  45. package/dist/editor/features/TreegeEditor/nodes/components/NodeStackOrderButtons.d.ts +6 -0
  46. package/dist/editor/features/TreegeEditor/nodes/components/NodeTypeBadge.d.ts +7 -0
  47. package/dist/editor/features/TreegeEditor/nodes/components/NodeTypePickerMenuContent.d.ts +12 -0
  48. package/dist/editor/features/TreegeEditor/nodes/layout/NodeWrapper.d.ts +4 -2
  49. package/dist/editor/features/TreegeEditor/panel/AIGeneratorDialog.d.ts +16 -0
  50. package/dist/editor/features/TreegeEditor/panel/ActionsPanel.d.ts +7 -2
  51. package/dist/editor/features/TreegeEditor/panel/MultiSelectionPanel.d.ts +7 -0
  52. package/dist/editor/hooks/useAvailableParentFields.d.ts +13 -0
  53. package/dist/editor/hooks/useFlowActions.d.ts +6 -2
  54. package/dist/editor/hooks/useFlowConnections.d.ts +14 -0
  55. package/dist/editor/hooks/useFlowContent.d.ts +16 -0
  56. package/dist/editor/hooks/useHistoryStore.d.ts +26 -0
  57. package/dist/editor/hooks/useIsStackedEdge.d.ts +8 -0
  58. package/dist/editor/hooks/useKeyValueRows.d.ts +15 -0
  59. package/dist/editor/hooks/useNodesSelection.d.ts +5 -5
  60. package/dist/editor/hooks/useStackPosition.d.ts +14 -0
  61. package/dist/editor/hooks/useTranslate.d.ts +1 -1
  62. package/dist/editor/hooks/useUndoRedo.d.ts +31 -0
  63. package/dist/editor/types/ai.d.ts +65 -0
  64. package/dist/editor/types/editor.d.ts +106 -10
  65. package/dist/editor/types/openapi.d.ts +106 -0
  66. package/dist/editor/utils/aiFlowGenerator.d.ts +5 -0
  67. package/dist/editor/utils/cleanEmptyData.d.ts +18 -0
  68. package/dist/editor/utils/cleanNodeConfig.d.ts +5 -0
  69. package/dist/editor/utils/dagreLayout.d.ts +8 -0
  70. package/dist/editor/utils/edge.d.ts +50 -0
  71. package/dist/editor/utils/groupColor.d.ts +14 -0
  72. package/dist/editor/utils/image.d.ts +7 -0
  73. package/dist/editor/utils/inputTypeIcon.d.ts +6 -0
  74. package/dist/editor/utils/jsonBindTarget.d.ts +15 -0
  75. package/dist/editor/utils/openApiPayload.d.ts +12 -0
  76. package/dist/editor/utils/openapi.d.ts +35 -0
  77. package/dist/editor/utils/sensitiveHeaders.d.ts +20 -0
  78. package/dist/editor/utils/stackPositionIndex.d.ts +9 -0
  79. package/dist/editor-h20-TVM8.js +6575 -0
  80. package/dist/editor.js +3 -7
  81. package/dist/main.js +6 -52
  82. package/dist/renderer/context/TreegeRenderRuntimeProvider.d.ts +135 -0
  83. package/dist/renderer/context/TreegeRendererProvider.d.ts +15 -0
  84. package/dist/renderer/features/TreegeRenderer/native/TreegeRenderer.d.ts +19 -11
  85. package/dist/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.d.ts +7 -7
  86. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputLabel.d.ts +10 -0
  87. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputWrapper.d.ts +9 -0
  88. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +20 -15
  89. package/dist/renderer/features/TreegeRenderer/native/components/DefaultLoadingSkeleton.d.ts +8 -0
  90. package/dist/renderer/features/TreegeRenderer/native/components/DefaultStep.d.ts +3 -0
  91. package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButton.d.ts +9 -7
  92. package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButtonWrapper.d.ts +11 -0
  93. package/dist/renderer/features/TreegeRenderer/native/components/DefaultUI.d.ts +8 -7
  94. package/dist/renderer/features/TreegeRenderer/native/components/DependencyHint.d.ts +15 -0
  95. package/dist/renderer/features/TreegeRenderer/native/components/OptionItemContent.d.ts +17 -0
  96. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts +3 -0
  97. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts +3 -0
  98. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultCheckboxInput.d.ts +3 -0
  99. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateInput.d.ts +3 -0
  100. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateRangeInput.d.ts +3 -0
  101. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultFileInput.d.ts +3 -0
  102. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHiddenInput.d.ts +3 -0
  103. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHttpInput.d.ts +3 -0
  104. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts +3 -0
  105. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts +3 -0
  106. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultRadioInput.d.ts +3 -0
  107. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts +3 -0
  108. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSubmitInput.d.ts +11 -0
  109. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSwitchInput.d.ts +3 -0
  110. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextInput.d.ts +3 -0
  111. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts +3 -0
  112. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeInput.d.ts +3 -0
  113. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeRangeInput.d.ts +3 -0
  114. package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +97 -24
  115. package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
  116. package/dist/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.d.ts +3 -2
  117. package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputLabel.d.ts +9 -0
  118. package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputWrapper.d.ts +9 -0
  119. package/dist/renderer/features/TreegeRenderer/web/components/DefaultLoadingSkeleton.d.ts +7 -0
  120. package/dist/renderer/features/TreegeRenderer/web/components/DefaultStep.d.ts +3 -0
  121. package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButton.d.ts +5 -1
  122. package/dist/renderer/features/TreegeRenderer/web/components/DependencyHint.d.ts +22 -0
  123. package/dist/renderer/features/TreegeRenderer/web/components/OptionItemContent.d.ts +17 -0
  124. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +1 -1
  125. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +1 -1
  126. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +1 -1
  127. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +1 -1
  128. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +1 -1
  129. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +1 -1
  130. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +1 -1
  131. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +1 -1
  132. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +1 -1
  133. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +1 -1
  134. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +1 -1
  135. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +1 -1
  136. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSubmitInput.d.ts +11 -0
  137. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +1 -1
  138. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +1 -1
  139. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +1 -1
  140. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +1 -1
  141. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +1 -1
  142. package/dist/renderer/features/TreegeRenderer/web/components/styles/RendererStyles.d.ts +2 -0
  143. package/dist/renderer/hooks/useInputOptions.d.ts +28 -0
  144. package/dist/renderer/hooks/useRenderNode.d.ts +62 -0
  145. package/dist/renderer/hooks/useSubmitHandler.d.ts +36 -0
  146. package/dist/renderer/hooks/useTranslate.d.ts +7 -5
  147. package/dist/renderer/index.d.ts +5 -2
  148. package/dist/renderer/index.native.d.ts +20 -0
  149. package/dist/renderer/types/renderer.d.ts +316 -42
  150. package/dist/renderer/utils/file.d.ts +11 -10
  151. package/dist/renderer/utils/flow.d.ts +1 -18
  152. package/dist/renderer/utils/form.d.ts +54 -2
  153. package/dist/renderer/utils/http.d.ts +177 -0
  154. package/dist/renderer/utils/jsonTemplate.d.ts +30 -0
  155. package/dist/renderer/utils/node.d.ts +29 -1
  156. package/dist/renderer/utils/sanitize.d.ts +85 -0
  157. package/dist/renderer/utils/sanitize.native.d.ts +69 -0
  158. package/dist/renderer/utils/step.d.ts +27 -0
  159. package/dist/renderer/utils/submit.d.ts +49 -0
  160. package/dist/renderer/utils/templateDependencies.d.ts +17 -0
  161. package/dist/renderer-DI6nF4St.js +256 -0
  162. package/dist/renderer-native.d.ts +2 -0
  163. package/dist/renderer-native.js +3704 -0
  164. package/dist/renderer.js +5 -45
  165. package/dist/shared/components/ui/badge.d.ts +2 -2
  166. package/dist/shared/components/ui/button.d.ts +3 -3
  167. package/dist/shared/components/ui/collapsible.d.ts +1 -1
  168. package/dist/shared/components/ui/command.d.ts +1 -1
  169. package/dist/shared/components/ui/dropdown-menu.d.ts +1 -1
  170. package/dist/shared/components/ui/field.d.ts +24 -0
  171. package/dist/shared/components/ui/form.d.ts +1 -1
  172. package/dist/shared/components/ui/item.d.ts +23 -0
  173. package/dist/shared/components/ui/popover.d.ts +10 -2
  174. package/dist/shared/components/ui/select.d.ts +3 -1
  175. package/dist/shared/components/ui/sheet.d.ts +1 -1
  176. package/dist/shared/components/ui/skeleton.d.ts +3 -0
  177. package/dist/shared/components/ui/toggle-group.d.ts +7 -0
  178. package/dist/shared/components/ui/toggle.d.ts +9 -0
  179. package/dist/shared/components/ui/tooltip.d.ts +1 -1
  180. package/dist/shared/constants/colors.d.ts +45 -0
  181. package/dist/shared/constants/inputType.d.ts +6 -0
  182. package/dist/shared/constants/node.d.ts +0 -1
  183. package/dist/shared/context/PortalContainerContext.d.ts +5 -0
  184. package/dist/shared/context/ThemeContext.d.ts +2 -0
  185. package/dist/shared/context/ThemeContext.native.d.ts +22 -0
  186. package/dist/shared/hooks/useMediaQuery.d.ts +12 -0
  187. package/dist/shared/hooks/useThemeColors.d.ts +37 -0
  188. package/dist/shared/locales/ar.json.d.ts +259 -19
  189. package/dist/shared/locales/de.json.d.ts +260 -20
  190. package/dist/shared/locales/en.json.d.ts +261 -21
  191. package/dist/shared/locales/es.json.d.ts +260 -20
  192. package/dist/shared/locales/fr.json.d.ts +260 -20
  193. package/dist/shared/locales/it.json.d.ts +260 -20
  194. package/dist/shared/locales/pt.json.d.ts +260 -20
  195. package/dist/shared/types/edge.d.ts +6 -0
  196. package/dist/shared/types/file.d.ts +14 -0
  197. package/dist/shared/types/node.d.ts +155 -19
  198. package/dist/shared/utils/httpRecord.d.ts +20 -0
  199. package/dist/shared/utils/inputTypeGuards.d.ts +7 -0
  200. package/dist/shared/utils/nodeTypeGuards.d.ts +1 -6
  201. package/dist/shared/utils/normalizeLabel.d.ts +21 -0
  202. package/dist/useRenderNode-B1sfwbia.js +527 -0
  203. package/package.json +54 -22
  204. package/dist/ThemeContext-BIvs8Kw-.js +0 -758
  205. package/dist/TreegeEditor-Lv5Tn9_F.js +0 -2152
  206. package/dist/TreegeRenderer-D3EvsEfJ.js +0 -1413
  207. package/dist/editor/context/TreegeEditorContext.d.ts +0 -12
  208. package/dist/editor/features/TreegeEditor/forms/FlowNodeForm.d.ts +0 -2
  209. package/dist/editor/features/TreegeEditor/inputs/SelectInputType.d.ts +0 -7
  210. package/dist/editor/features/TreegeEditor/nodes/FlowNode.d.ts +0 -6
  211. package/dist/editor/features/TreegeEditor/nodes/GroupNode.d.ts +0 -6
  212. package/dist/editor/features/TreegeEditor/nodes/InputNode.d.ts +0 -6
  213. package/dist/editor/features/TreegeEditor/nodes/UINode.d.ts +0 -6
  214. package/dist/editor/hooks/useEdgesSelection.d.ts +0 -11
  215. package/dist/renderer/context/TreegeConfigContext.d.ts +0 -39
  216. package/dist/renderer/context/TreegeRendererContext.d.ts +0 -25
  217. package/dist/renderer/features/TreegeRenderer/native/components/DefaultGroup.d.ts +0 -7
  218. package/dist/renderer/features/TreegeRenderer/web/components/DefaultGroup.d.ts +0 -6
  219. /package/dist/editor/components/{data-display/logo.d.ts → branding/Logo.d.ts} +0 -0
@@ -0,0 +1,1853 @@
1
+ import { A as e, C as t, D as n, E as r, F as i, L as a, M as o, N as s, S as c, T as l, _ as u, b as d, g as f, h as p, j as m, k as h, m as g, s as _, w as v, y } from "./ThemeContext-BgTIhoK6.js";
2
+ import * as b from "react";
3
+ import { createContext as x, forwardRef as S, useCallback as C, useContext as w, useEffect as T, useMemo as ee, useRef as E, useState as D } from "react";
4
+ import { Fragment as te, jsx as O, jsxs as k } from "react/jsx-runtime";
5
+ import { Check as ne, CheckIcon as A, ChevronDownIcon as j, ChevronLeftIcon as M, ChevronRightIcon as re, ChevronUpIcon as ie, ChevronsUpDown as ae, CircleIcon as N, File as P, FileUp as F, Loader2 as I, MapPin as L, SearchIcon as oe, X as se, XIcon as ce } from "lucide-react";
6
+ import { Slot as R } from "@radix-ui/react-slot";
7
+ import { cva as z } from "class-variance-authority";
8
+ import { clsx as le } from "clsx";
9
+ import { extendTailwindMerge as ue } from "tailwind-merge";
10
+ import * as B from "@radix-ui/react-checkbox";
11
+ import * as de from "@radix-ui/react-label";
12
+ import * as fe from "@radix-ui/react-popover";
13
+ import * as V from "@radix-ui/react-select";
14
+ import * as H from "@radix-ui/react-tooltip";
15
+ import * as pe from "@radix-ui/react-separator";
16
+ import { Command as U } from "cmdk";
17
+ import * as W from "@radix-ui/react-dialog";
18
+ import { DayPicker as me, getDefaultClassNames as he } from "react-day-picker";
19
+ import * as ge from "@radix-ui/react-radio-group";
20
+ import * as _e from "@radix-ui/react-switch";
21
+ //#region src/shared/lib/utils.ts
22
+ var G = ue({ prefix: "tg" });
23
+ function K(...e) {
24
+ return G(le(e));
25
+ }
26
+ //#endregion
27
+ //#region src/shared/components/ui/button.tsx
28
+ var ve = z("tg:inline-flex tg:items-center tg:justify-center tg:gap-2 tg:whitespace-nowrap tg:rounded-md tg:text-sm tg:font-medium tg:transition-all tg:disabled:pointer-events-none tg:disabled:opacity-50 tg:[&_svg]:pointer-events-none tg:[&_svg:not([class*='size-'])]:size-4 tg:shrink-0 tg:[&_svg]:shrink-0 tg:outline-none tg:focus-visible:border-ring tg:focus-visible:ring-ring/50 tg:focus-visible:ring-[3px] tg:aria-invalid:ring-destructive/20 tg:dark:aria-invalid:ring-destructive/40 tg:aria-invalid:border-destructive", {
29
+ defaultVariants: {
30
+ size: "default",
31
+ variant: "default"
32
+ },
33
+ variants: {
34
+ size: {
35
+ default: "tg:h-9 tg:px-4 tg:py-2 tg:has-[>svg]:px-3",
36
+ icon: "tg:size-9",
37
+ "icon-lg": "tg:size-10",
38
+ "icon-sm": "tg:size-8",
39
+ lg: "tg:h-10 tg:rounded-md tg:px-6 tg:has-[>svg]:px-4",
40
+ sm: "tg:h-8 tg:rounded-md tg:gap-1.5 tg:px-3 tg:has-[>svg]:px-2.5",
41
+ xs: "tg:h-6 tg:rounded-md tg:gap-1 tg:px-2 tg:text-xs tg:has-[>svg]:px-1.5"
42
+ },
43
+ variant: {
44
+ default: "tg:bg-primary tg:text-primary-foreground tg:hover:bg-primary/90",
45
+ destructive: "tg:bg-destructive tg:text-white tg:hover:bg-destructive/90 tg:focus-visible:ring-destructive/20 tg:dark:focus-visible:ring-destructive/40 tg:dark:bg-destructive/60",
46
+ ghost: "tg:hover:bg-accent tg:hover:text-accent-foreground tg:dark:hover:bg-accent/50",
47
+ icon: "tg:opacity-60 tg:hover:bg-transparent! tg:hover:opacity-100",
48
+ link: "tg:text-primary tg:underline-offset-4 tg:hover:underline",
49
+ outline: "tg:border tg:bg-background tg:shadow-xs tg:hover:bg-accent tg:hover:text-accent-foreground tg:dark:bg-input/30 tg:dark:border-input tg:dark:hover:bg-input/50",
50
+ secondary: "tg:bg-secondary tg:text-secondary-foreground tg:hover:bg-secondary/80"
51
+ }
52
+ }
53
+ });
54
+ function q({ className: e, variant: t, size: n, asChild: r = !1, ...i }) {
55
+ return /* @__PURE__ */ O(r ? R : "button", {
56
+ "data-slot": "button",
57
+ className: K(ve({
58
+ className: e,
59
+ size: n,
60
+ variant: t
61
+ })),
62
+ ...i
63
+ });
64
+ }
65
+ //#endregion
66
+ //#region src/shared/components/ui/checkbox.tsx
67
+ function ye({ className: e, ...t }) {
68
+ return /* @__PURE__ */ O(B.Root, {
69
+ "data-slot": "checkbox",
70
+ className: K("tg:peer tg:size-4 tg:shrink-0 tg:rounded-[4px] tg:border tg:border-input tg:shadow-xs tg:outline-none tg:transition-shadow tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:data-[state=checked]:border-primary tg:data-[state=checked]:bg-primary tg:data-[state=checked]:text-primary-foreground tg:dark:bg-input/30 tg:dark:data-[state=checked]:bg-primary tg:dark:aria-invalid:ring-destructive/40", e),
71
+ ...t,
72
+ children: /* @__PURE__ */ O(B.Indicator, {
73
+ "data-slot": "checkbox-indicator",
74
+ className: "tg:grid tg:place-content-center tg:text-current tg:transition-none",
75
+ children: /* @__PURE__ */ O(A, { className: "tg:size-3.5" })
76
+ })
77
+ });
78
+ }
79
+ //#endregion
80
+ //#region src/shared/components/ui/form.tsx
81
+ function J({ className: e, ...t }) {
82
+ return /* @__PURE__ */ O("div", {
83
+ "data-slot": "form-item",
84
+ className: K("tg:grid tg:gap-2", e),
85
+ ...t
86
+ });
87
+ }
88
+ function Y({ className: e, ...t }) {
89
+ return /* @__PURE__ */ O("p", {
90
+ "data-slot": "form-description",
91
+ className: K("tg:text-muted-foreground tg:text-xs", e),
92
+ ...t
93
+ });
94
+ }
95
+ function X({ className: e, ...t }) {
96
+ return /* @__PURE__ */ O("p", {
97
+ "data-slot": "form-error",
98
+ className: K("tg:text-destructive tg:text-xs", e),
99
+ ...t
100
+ });
101
+ }
102
+ //#endregion
103
+ //#region src/shared/components/ui/input.tsx
104
+ function Z({ className: e, type: t, ...n }) {
105
+ return /* @__PURE__ */ O("input", {
106
+ type: t,
107
+ "data-slot": "input",
108
+ className: K("tg:h-9 tg:w-full tg:min-w-0 tg:rounded-md tg:border tg:border-input tg:bg-transparent tg:px-3 tg:py-1 tg:text-base tg:shadow-xs tg:outline-none tg:transition-[color,box-shadow] tg:selection:bg-primary tg:selection:text-primary-foreground tg:file:inline-flex tg:file:h-7 tg:file:border-0 tg:file:bg-transparent tg:file:font-medium tg:file:text-foreground tg:file:text-sm tg:placeholder:text-muted-foreground tg:disabled:pointer-events-none tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:md:text-sm tg:dark:bg-input/30", "tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50", "tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:dark:aria-invalid:ring-destructive/40", e),
109
+ ...n
110
+ });
111
+ }
112
+ //#endregion
113
+ //#region src/shared/components/ui/label.tsx
114
+ var Q = ({ className: e, ...t }) => /* @__PURE__ */ O(de.Root, {
115
+ "data-slot": "label",
116
+ className: K("tg:flex tg:select-none tg:items-center tg:gap-2 tg:font-medium tg:text-muted-foreground tg:text-sm tg:leading-none tg:peer-disabled:cursor-not-allowed tg:peer-disabled:opacity-50 tg:group-data-[disabled=true]:pointer-events-none tg:group-data-[disabled=true]:opacity-50", e),
117
+ ...t
118
+ }), be = x(null), xe = () => w(be), $ = ({ container: e, children: t }) => /* @__PURE__ */ O(be.Provider, {
119
+ value: e,
120
+ children: t
121
+ });
122
+ //#endregion
123
+ //#region src/shared/components/ui/popover.tsx
124
+ function Se({ ...e }) {
125
+ return /* @__PURE__ */ O(fe.Root, {
126
+ "data-slot": "popover",
127
+ ...e
128
+ });
129
+ }
130
+ function Ce({ ...e }) {
131
+ return /* @__PURE__ */ O(fe.Trigger, {
132
+ "data-slot": "popover-trigger",
133
+ ...e
134
+ });
135
+ }
136
+ function we({ className: e, align: t = "center", sideOffset: n = 4, disablePortal: r = !1, container: i, ...a }) {
137
+ let o = xe(), s = i ?? o, c = /* @__PURE__ */ O(fe.Content, {
138
+ "data-slot": "popover-content",
139
+ align: t,
140
+ sideOffset: n,
141
+ className: K("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:data-[state=closed]:zoom-out-95 tg:data-[state=open]:zoom-in-95 tg:data-[side=bottom]:slide-in-from-top-2 tg:data-[side=left]:slide-in-from-right-2 tg:data-[side=right]:slide-in-from-left-2 tg:data-[side=top]:slide-in-from-bottom-2 tg:z-[2000] tg:w-72 tg:origin-(--radix-popover-content-transform-origin) tg:rounded-md tg:border tg:bg-popover tg:p-4 tg:text-popover-foreground tg:shadow-md tg:outline-hidden tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in", e),
142
+ ...a
143
+ });
144
+ return r ? c : /* @__PURE__ */ O(fe.Portal, {
145
+ container: s ?? void 0,
146
+ children: c
147
+ });
148
+ }
149
+ //#endregion
150
+ //#region src/shared/components/ui/select.tsx
151
+ var Te = ({ ...e }) => /* @__PURE__ */ O(V.Root, {
152
+ "data-slot": "select",
153
+ ...e
154
+ }), Ee = ({ ...e }) => /* @__PURE__ */ O(V.Group, {
155
+ "data-slot": "select-group",
156
+ ...e
157
+ }), De = ({ ...e }) => /* @__PURE__ */ O(V.Value, {
158
+ "data-slot": "select-value",
159
+ ...e
160
+ }), Oe = ({ className: e, size: t = "default", children: n, ...r }) => /* @__PURE__ */ k(V.Trigger, {
161
+ "data-slot": "select-trigger",
162
+ "data-size": t,
163
+ className: K("tg:flex tg:w-fit tg:items-center tg:justify-between tg:gap-2 tg:whitespace-nowrap tg:rounded-md tg:border tg:border-input tg:bg-transparent tg:px-3 tg:py-2 tg:text-sm tg:shadow-xs tg:outline-none tg:transition-[color,box-shadow] tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:data-[size=default]:h-9 tg:data-[size=sm]:h-8 tg:data-[placeholder]:text-muted-foreground tg:*:data-[slot=select-value]:line-clamp-1 tg:*:data-[slot=select-value]:flex tg:*:data-[slot=select-value]:items-center tg:*:data-[slot=select-value]:gap-2 tg:dark:bg-input/30 tg:dark:aria-invalid:ring-destructive/40 tg:dark:hover:bg-input/50 tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg:not([class*='text-'])]:text-muted-foreground tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0", e),
164
+ ...r,
165
+ children: [n, /* @__PURE__ */ O(V.Icon, {
166
+ asChild: !0,
167
+ children: /* @__PURE__ */ O(j, { className: "tg:size-4 tg:opacity-50" })
168
+ })]
169
+ }), ke = ({ className: e, children: t, position: n = "popper", ...r }) => /* @__PURE__ */ O(V.Portal, {
170
+ container: xe() ?? void 0,
171
+ children: /* @__PURE__ */ k(V.Content, {
172
+ "data-slot": "select-content",
173
+ className: K("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:data-[state=closed]:zoom-out-95 tg:data-[state=open]:zoom-in-95 tg:data-[side=bottom]:slide-in-from-top-2 tg:data-[side=left]:slide-in-from-right-2 tg:data-[side=right]:slide-in-from-left-2 tg:data-[side=top]:slide-in-from-bottom-2 tg:relative tg:z-[2000] tg:max-h-(--radix-select-content-available-height) tg:min-w-[8rem] tg:origin-(--radix-select-content-transform-origin) tg:overflow-y-auto tg:overflow-x-hidden tg:rounded-md tg:border tg:bg-popover tg:text-popover-foreground tg:shadow-md tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in", n === "popper" && "tg:data-[side=left]:-translate-x-1 tg:data-[side=top]:-translate-y-1 tg:data-[side=right]:translate-x-1 tg:data-[side=bottom]:translate-y-1", e),
174
+ position: n,
175
+ ...r,
176
+ children: [
177
+ /* @__PURE__ */ O(Ne, {}),
178
+ /* @__PURE__ */ O(V.Viewport, {
179
+ className: K("tg:p-1", n === "popper" && "tg:h-[var(--radix-select-trigger-height)] tg:w-full tg:min-w-[var(--radix-select-trigger-width)] tg:scroll-my-1"),
180
+ children: t
181
+ }),
182
+ /* @__PURE__ */ O(Pe, {})
183
+ ]
184
+ })
185
+ }), Ae = ({ className: e, htmlFor: t, children: n, ...r }) => /* @__PURE__ */ O(V.Label, {
186
+ "data-slot": "select-label",
187
+ className: K("tg:pb-1.5 tg:font-medium tg:text-muted-foreground tg:text-sm", e),
188
+ ...r,
189
+ children: /* @__PURE__ */ O("label", {
190
+ htmlFor: t,
191
+ children: n
192
+ })
193
+ }), je = ({ className: e, children: t, ...n }) => /* @__PURE__ */ k(V.Item, {
194
+ "data-slot": "select-item",
195
+ className: K("tg:relative tg:flex tg:w-full tg:cursor-pointer tg:select-none tg:items-center tg:gap-2 tg:rounded-sm tg:py-1.5 tg:pr-8 tg:pl-2 tg:text-sm tg:outline-hidden tg:focus:bg-accent tg:focus:text-accent-foreground tg:data-[disabled]:pointer-events-none tg:data-[disabled]:opacity-50 tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg:not([class*='text-'])]:text-muted-foreground tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0 tg:*:[span]:last:flex tg:*:[span]:last:items-center tg:*:[span]:last:gap-2", e),
196
+ ...n,
197
+ children: [/* @__PURE__ */ O("span", {
198
+ className: "tg:absolute tg:right-2 tg:flex tg:size-3.5 tg:items-center tg:justify-center",
199
+ children: /* @__PURE__ */ O(V.ItemIndicator, { children: /* @__PURE__ */ O(A, { className: "tg:size-4" }) })
200
+ }), /* @__PURE__ */ O(V.ItemText, { children: t })]
201
+ }), Me = ({ className: e, ...t }) => /* @__PURE__ */ O(V.Separator, {
202
+ "data-slot": "select-separator",
203
+ className: K("tg:-mx-1 tg:pointer-events-none tg:my-1 tg:h-px tg:bg-border", e),
204
+ ...t
205
+ }), Ne = ({ className: e, ...t }) => /* @__PURE__ */ O(V.ScrollUpButton, {
206
+ "data-slot": "select-scroll-up-button",
207
+ className: K("tg:flex tg:cursor-default tg:items-center tg:justify-center tg:py-1", e),
208
+ ...t,
209
+ children: /* @__PURE__ */ O(ie, { className: "tg:size-4" })
210
+ }), Pe = ({ className: e, ...t }) => /* @__PURE__ */ O(V.ScrollDownButton, {
211
+ "data-slot": "select-scroll-down-button",
212
+ className: K("tg:flex tg:cursor-default tg:items-center tg:justify-center tg:py-1", e),
213
+ ...t,
214
+ children: /* @__PURE__ */ O(j, { className: "tg:size-4" })
215
+ });
216
+ //#endregion
217
+ //#region src/shared/components/ui/tooltip.tsx
218
+ function Fe({ delayDuration: e = 0, ...t }) {
219
+ return /* @__PURE__ */ O(H.Provider, {
220
+ "data-slot": "tooltip-provider",
221
+ delayDuration: e,
222
+ ...t
223
+ });
224
+ }
225
+ function Ie({ ...e }) {
226
+ return /* @__PURE__ */ O(Fe, { children: /* @__PURE__ */ O(H.Root, {
227
+ "data-slot": "tooltip",
228
+ ...e
229
+ }) });
230
+ }
231
+ function Le({ ...e }) {
232
+ return /* @__PURE__ */ O(H.Trigger, {
233
+ "data-slot": "tooltip-trigger",
234
+ ...e
235
+ });
236
+ }
237
+ function Re({ className: e, sideOffset: t = 0, children: n, ...r }) {
238
+ return /* @__PURE__ */ O(H.Portal, {
239
+ container: xe() ?? void 0,
240
+ children: /* @__PURE__ */ k(H.Content, {
241
+ "data-slot": "tooltip-content",
242
+ sideOffset: t,
243
+ className: K("tg:fade-in-0 tg:zoom-in-95 tg:data-[state=closed]:fade-out-0 tg:data-[state=closed]:zoom-out-95 tg:data-[side=bottom]:slide-in-from-top-2 tg:data-[side=left]:slide-in-from-right-2 tg:data-[side=right]:slide-in-from-left-2 tg:data-[side=top]:slide-in-from-bottom-2 tg:z-[2000] tg:w-fit tg:origin-(--radix-tooltip-content-transform-origin) tg:animate-in tg:text-balance tg:rounded-md tg:bg-foreground tg:px-3 tg:py-1.5 tg:text-background tg:text-xs tg:data-[state=closed]:animate-out", e),
244
+ ...r,
245
+ children: [n, /* @__PURE__ */ O(H.Arrow, { className: "tg:z-[2000] tg:size-2.5 tg:translate-y-[calc(-50%_-_2px)] tg:rotate-45 tg:rounded-[2px] tg:bg-foreground tg:fill-foreground" })]
246
+ })
247
+ });
248
+ }
249
+ //#endregion
250
+ //#region src/shared/components/ui/separator.tsx
251
+ function ze({ className: e, orientation: t = "horizontal", decorative: n = !0, ...r }) {
252
+ return /* @__PURE__ */ O(pe.Root, {
253
+ "data-slot": "separator",
254
+ decorative: n,
255
+ orientation: t,
256
+ className: K("tg:shrink-0 tg:bg-border tg:data-[orientation=horizontal]:h-px tg:data-[orientation=vertical]:h-full tg:data-[orientation=horizontal]:w-full tg:data-[orientation=vertical]:w-px", e),
257
+ ...r
258
+ });
259
+ }
260
+ //#endregion
261
+ //#region src/renderer/features/TreegeRenderer/web/components/DefaultInputLabel.tsx
262
+ var Be = ({ label: e, required: t, htmlFor: n, id: r, className: i }) => e ? /* @__PURE__ */ k(Q, {
263
+ htmlFor: n,
264
+ id: r,
265
+ className: i,
266
+ children: [e, t && /* @__PURE__ */ O("span", {
267
+ className: "tg:text-red-500",
268
+ children: "*"
269
+ })]
270
+ }) : null;
271
+ //#endregion
272
+ //#region src/shared/components/ui/dialog.tsx
273
+ function Ve({ ...e }) {
274
+ return /* @__PURE__ */ O(W.Root, {
275
+ "data-slot": "dialog",
276
+ ...e
277
+ });
278
+ }
279
+ function He({ ...e }) {
280
+ return /* @__PURE__ */ O(W.Trigger, {
281
+ "data-slot": "dialog-trigger",
282
+ ...e
283
+ });
284
+ }
285
+ function Ue({ ...e }) {
286
+ return /* @__PURE__ */ O(W.Portal, {
287
+ "data-slot": "dialog-portal",
288
+ ...e
289
+ });
290
+ }
291
+ function We({ className: e, ...t }) {
292
+ return /* @__PURE__ */ O(W.Overlay, {
293
+ "data-slot": "dialog-overlay",
294
+ className: K("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:fixed tg:inset-0 tg:z-[2000] tg:bg-black/50 tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in", e),
295
+ ...t
296
+ });
297
+ }
298
+ function Ge({ className: e, children: t, showCloseButton: n = !0, ...r }) {
299
+ let [i, a] = b.useState(null);
300
+ return /* @__PURE__ */ k(Ue, {
301
+ "data-slot": "dialog-portal",
302
+ children: [/* @__PURE__ */ O(We, {}), /* @__PURE__ */ O(W.Content, {
303
+ ref: a,
304
+ "data-slot": "dialog-content",
305
+ className: K("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:data-[state=closed]:zoom-out-95 tg:data-[state=open]:zoom-in-95 tg:fixed tg:top-[50%] tg:left-[50%] tg:z-[2000] tg:grid tg:w-full tg:max-w-[calc(100%-2rem)] tg:translate-x-[-50%] tg:translate-y-[-50%] tg:gap-4 tg:rounded-lg tg:border tg:bg-background tg:p-6 tg:shadow-lg tg:duration-200 tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in tg:sm:max-w-lg", e),
306
+ ...r,
307
+ children: /* @__PURE__ */ k($, {
308
+ container: i,
309
+ children: [t, n && /* @__PURE__ */ k(W.Close, {
310
+ "data-slot": "dialog-close",
311
+ className: "tg:absolute tg:top-4 tg:right-4 tg:rounded-xs tg:opacity-70 tg:ring-offset-background tg:transition-opacity tg:hover:opacity-100 tg:focus:outline-hidden tg:focus:ring-2 tg:focus:ring-ring tg:focus:ring-offset-2 tg:disabled:pointer-events-none tg:data-[state=open]:bg-accent tg:data-[state=open]:text-muted-foreground tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0",
312
+ children: [/* @__PURE__ */ O(ce, {}), /* @__PURE__ */ O("span", {
313
+ className: "tg:sr-only",
314
+ children: "Close"
315
+ })]
316
+ })]
317
+ })
318
+ })]
319
+ });
320
+ }
321
+ function Ke({ className: e, ...t }) {
322
+ return /* @__PURE__ */ O("div", {
323
+ "data-slot": "dialog-header",
324
+ className: K("tg:flex tg:flex-col tg:gap-2 tg:text-center tg:sm:text-left", e),
325
+ ...t
326
+ });
327
+ }
328
+ function qe({ className: e, ...t }) {
329
+ return /* @__PURE__ */ O("div", {
330
+ "data-slot": "dialog-footer",
331
+ className: K("tg:flex tg:flex-col-reverse tg:gap-2 tg:sm:flex-row tg:sm:justify-end", e),
332
+ ...t
333
+ });
334
+ }
335
+ function Je({ className: e, ...t }) {
336
+ return /* @__PURE__ */ O(W.Title, {
337
+ "data-slot": "dialog-title",
338
+ className: K("tg:font-semibold tg:text-lg tg:leading-none", e),
339
+ ...t
340
+ });
341
+ }
342
+ function Ye({ className: e, ...t }) {
343
+ return /* @__PURE__ */ O(W.Description, {
344
+ "data-slot": "dialog-description",
345
+ className: K("tg:text-muted-foreground tg:text-sm", e),
346
+ ...t
347
+ });
348
+ }
349
+ //#endregion
350
+ //#region src/shared/components/ui/command.tsx
351
+ function Xe({ className: e, ...t }) {
352
+ return /* @__PURE__ */ O(U, {
353
+ "data-slot": "command",
354
+ className: K("tg:flex tg:h-full tg:w-full tg:flex-col tg:overflow-hidden tg:rounded-md tg:bg-popover tg:text-popover-foreground", e),
355
+ ...t
356
+ });
357
+ }
358
+ function Ze({ className: e, ...t }) {
359
+ return /* @__PURE__ */ k("div", {
360
+ "data-slot": "command-input-wrapper",
361
+ className: "tg:flex tg:h-9 tg:items-center tg:gap-2 tg:border-b tg:px-3",
362
+ children: [/* @__PURE__ */ O(oe, { className: "tg:size-4 tg:shrink-0 tg:opacity-50" }), /* @__PURE__ */ O(U.Input, {
363
+ "data-slot": "command-input",
364
+ className: K("tg:flex tg:h-10 tg:w-full tg:rounded-md tg:bg-transparent tg:py-3 tg:text-sm tg:outline-hidden tg:placeholder:text-muted-foreground tg:disabled:cursor-not-allowed tg:disabled:opacity-50", e),
365
+ ...t
366
+ })]
367
+ });
368
+ }
369
+ function Qe({ className: e, ...t }) {
370
+ return /* @__PURE__ */ O(U.List, {
371
+ "data-slot": "command-list",
372
+ className: K("tg:max-h-[300px] tg:scroll-py-1 tg:overflow-y-auto tg:overflow-x-hidden", e),
373
+ ...t
374
+ });
375
+ }
376
+ function $e({ ...e }) {
377
+ return /* @__PURE__ */ O(U.Empty, {
378
+ "data-slot": "command-empty",
379
+ className: "tg:py-6 tg:text-center tg:text-sm",
380
+ ...e
381
+ });
382
+ }
383
+ function et({ className: e, ...t }) {
384
+ return /* @__PURE__ */ O(U.Group, {
385
+ "data-slot": "command-group",
386
+ className: K("tg:overflow-hidden tg:p-1 tg:text-foreground tg:[&_[cmdk-group-heading]]:px-2 tg:[&_[cmdk-group-heading]]:py-1.5 tg:[&_[cmdk-group-heading]]:font-medium tg:[&_[cmdk-group-heading]]:text-muted-foreground tg:[&_[cmdk-group-heading]]:text-xs", e),
387
+ ...t
388
+ });
389
+ }
390
+ function tt({ className: e, ...t }) {
391
+ return /* @__PURE__ */ O(U.Item, {
392
+ "data-slot": "command-item",
393
+ className: K("tg:relative tg:flex tg:cursor-default tg:select-none tg:items-center tg:gap-2 tg:rounded-sm tg:px-2 tg:py-1.5 tg:text-sm tg:outline-hidden tg:data-[disabled=true]:pointer-events-none tg:data-[selected=true]:bg-accent tg:data-[selected=true]:text-accent-foreground tg:data-[disabled=true]:opacity-50 tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg:not([class*='text-'])]:text-muted-foreground tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0", e),
394
+ ...t
395
+ });
396
+ }
397
+ //#endregion
398
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.tsx
399
+ var nt = async (e, t) => {
400
+ if (!e || e.trim().length < 3) return [];
401
+ try {
402
+ let n = await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&format=jsonv2&addressdetails=1&limit=5`, { headers: {
403
+ Accept: "application/json",
404
+ "User-Agent": "Treege Renderer",
405
+ ...t && { "Accept-Language": t }
406
+ } });
407
+ return n.ok ? (await n.json()).map((e) => ({
408
+ label: e.display_name,
409
+ value: e.display_name
410
+ })) : [];
411
+ } catch (e) {
412
+ return console.error("Nominatim fetch error:", e), [];
413
+ }
414
+ }, rt = (e) => !e || e.trim().length < 3 ? Promise.resolve([]) : new Promise((t) => {
415
+ if (!window.google?.maps?.places) {
416
+ console.warn("Google Places SDK not loaded yet"), t([]);
417
+ return;
418
+ }
419
+ new window.google.maps.places.AutocompleteService().getPlacePredictions({ input: e }, (e, n) => {
420
+ if (n !== google.maps.places.PlacesServiceStatus.OK || !e) {
421
+ console.warn("Google Places API status:", n), t([]);
422
+ return;
423
+ }
424
+ t(e.map((e) => ({
425
+ label: e.description,
426
+ value: e.description
427
+ })));
428
+ });
429
+ }), it = ({ field: e, extra: t }) => {
430
+ let [n, r] = D(""), [i, o] = D([]), [c, l] = D(!1), { id: u, name: d, value: f, placeholder: p } = e, { InputLabel: m, node: h, setValue: g, error: _, label: v, helperText: y } = t, { googleApiKey: b, language: x } = a(), S = s(), w = C((e) => {
431
+ g(e.value), r(e.value), l(!1);
432
+ }, [g]), ee = C((e) => {
433
+ g(e), r(e), e.length >= 3 && l(!0);
434
+ }, [g]);
435
+ return T(() => {
436
+ if (!n || n.trim().length < 3) {
437
+ o([]);
438
+ return;
439
+ }
440
+ let e = setTimeout(async () => {
441
+ o(b ? await rt(n) : await nt(n, x));
442
+ }, 300);
443
+ return () => clearTimeout(e);
444
+ }, [
445
+ n,
446
+ b,
447
+ x
448
+ ]), /* @__PURE__ */ k(te, { children: [b && /* @__PURE__ */ O("script", {
449
+ async: !0,
450
+ src: `https://maps.googleapis.com/maps/api/js?key=${b}&libraries=places`
451
+ }), /* @__PURE__ */ k(J, {
452
+ className: "tg:mb-4",
453
+ children: [
454
+ /* @__PURE__ */ O(m, {
455
+ htmlFor: u,
456
+ label: v,
457
+ required: h.data.required
458
+ }),
459
+ /* @__PURE__ */ k("div", {
460
+ className: "tg:relative",
461
+ children: [
462
+ /* @__PURE__ */ O(Z, {
463
+ type: "text",
464
+ id: u,
465
+ name: d,
466
+ "aria-label": v || h.data.name,
467
+ value: f || "",
468
+ onChange: (e) => ee(e.target.value),
469
+ onFocus: () => {
470
+ i.length > 0 && l(!0);
471
+ },
472
+ placeholder: p || S("renderer.defaultAddressInput.enterAddress"),
473
+ className: "tg:pr-10",
474
+ autoComplete: "off"
475
+ }),
476
+ /* @__PURE__ */ O(L, { className: "tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-3 tg:h-4 tg:w-4 tg:-translate-y-1/2 tg:text-muted-foreground" }),
477
+ c && /* @__PURE__ */ O("div", {
478
+ className: "tg:absolute tg:z-50 tg:mt-1 tg:w-full tg:rounded-md tg:border tg:bg-popover tg:shadow-md",
479
+ children: /* @__PURE__ */ O(Xe, { children: /* @__PURE__ */ k(Qe, { children: [/* @__PURE__ */ O($e, { children: S("renderer.defaultAddressInput.noAddressesFound") }), /* @__PURE__ */ O(et, { children: i.map((e, t) => /* @__PURE__ */ k(tt, {
480
+ value: e.value,
481
+ onSelect: () => w(e),
482
+ onMouseDown: (e) => e.preventDefault(),
483
+ children: [/* @__PURE__ */ O(L, { className: "tg:mr-2 tg:h-4 tg:w-4" }), e.label]
484
+ }, t)) })] }) })
485
+ })
486
+ ]
487
+ }),
488
+ _ && /* @__PURE__ */ O(X, { children: _ }),
489
+ y && !_ && /* @__PURE__ */ O(Y, { children: y })
490
+ ]
491
+ })] });
492
+ }, at = ({ missing: e }) => /* @__PURE__ */ k(te, { children: [/* @__PURE__ */ O("p", {
493
+ className: "tg:font-medium",
494
+ children: s()("renderer.dependencyHint.title")
495
+ }), /* @__PURE__ */ O("ul", {
496
+ className: "tg:mt-1 tg:list-disc tg:pl-4",
497
+ children: e.map((e) => /* @__PURE__ */ O("li", { children: e.label }, e.id))
498
+ })] }), ot = ({ missing: e, children: t }) => e.length === 0 ? /* @__PURE__ */ O(te, { children: t }) : /* @__PURE__ */ O(Fe, { children: /* @__PURE__ */ k(Ie, { children: [/* @__PURE__ */ O(Le, {
499
+ asChild: !0,
500
+ children: /* @__PURE__ */ O("div", {
501
+ className: "tg:w-full",
502
+ children: t
503
+ })
504
+ }), /* @__PURE__ */ O(Re, { children: /* @__PURE__ */ O(at, { missing: e }) })] }) }), st = ({ missing: e }) => e.length === 0 ? null : /* @__PURE__ */ O("div", {
505
+ className: "tg:text-muted-foreground tg:text-sm",
506
+ children: /* @__PURE__ */ O(at, { missing: e })
507
+ });
508
+ z("tg:group/item tg:flex tg:flex-wrap tg:items-center tg:rounded-md tg:border tg:border-transparent tg:text-sm tg:outline-none tg:transition-colors tg:duration-100 tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:[a]:transition-colors tg:[a]:hover:bg-accent/50", {
509
+ defaultVariants: {
510
+ size: "default",
511
+ variant: "default"
512
+ },
513
+ variants: {
514
+ size: {
515
+ default: "tg:gap-4 tg:p-4",
516
+ sm: "tg:gap-2.5 tg:px-4 tg:py-3"
517
+ },
518
+ variant: {
519
+ default: "tg:bg-transparent",
520
+ muted: "tg:bg-muted/50",
521
+ outline: "tg:border-border"
522
+ }
523
+ }
524
+ });
525
+ var ct = z("tg:flex tg:shrink-0 tg:items-center tg:justify-center tg:gap-2 tg:group-has-[[data-slot=item-description]]/item:translate-y-0.5 tg:group-has-[[data-slot=item-description]]/item:self-start tg:[&_svg]:pointer-events-none", {
526
+ defaultVariants: { variant: "default" },
527
+ variants: { variant: {
528
+ default: "tg:bg-transparent",
529
+ icon: "tg:size-8 tg:rounded-sm tg:border tg:bg-muted tg:[&_svg:not([class*='size-'])]:size-4",
530
+ image: "tg:size-10 tg:overflow-hidden tg:rounded-sm tg:[&_img]:size-full tg:[&_img]:object-cover"
531
+ } }
532
+ });
533
+ function lt({ className: e, variant: t = "default", ...n }) {
534
+ return /* @__PURE__ */ O("div", {
535
+ "data-slot": "item-media",
536
+ "data-variant": t,
537
+ className: K(ct({
538
+ className: e,
539
+ variant: t
540
+ })),
541
+ ...n
542
+ });
543
+ }
544
+ function ut({ className: e, ...t }) {
545
+ return /* @__PURE__ */ O("div", {
546
+ "data-slot": "item-content",
547
+ className: K("tg:flex tg:flex-1 tg:flex-col tg:gap-1 tg:[&+[data-slot=item-content]]:flex-none", e),
548
+ ...t
549
+ });
550
+ }
551
+ function dt({ className: e, ...t }) {
552
+ return /* @__PURE__ */ O("div", {
553
+ "data-slot": "item-title",
554
+ className: K("tg:flex tg:w-fit tg:items-center tg:gap-2 tg:font-medium tg:text-sm tg:leading-snug", e),
555
+ ...t
556
+ });
557
+ }
558
+ function ft({ className: e, ...t }) {
559
+ return /* @__PURE__ */ O("p", {
560
+ "data-slot": "item-description",
561
+ className: K("tg:line-clamp-2 tg:text-balance tg:font-normal tg:text-muted-foreground tg:text-sm tg:leading-normal", "tg:[&>a]:underline tg:[&>a]:underline-offset-4 tg:[&>a:hover]:text-primary", e),
562
+ ...t
563
+ });
564
+ }
565
+ //#endregion
566
+ //#region src/renderer/features/TreegeRenderer/web/components/OptionItemContent.tsx
567
+ var pt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ k(te, { children: [n && /* @__PURE__ */ O(lt, {
568
+ variant: "image",
569
+ children: /* @__PURE__ */ O("img", {
570
+ src: n,
571
+ alt: ""
572
+ })
573
+ }), /* @__PURE__ */ k(ut, {
574
+ className: "tg:min-w-0 tg:gap-0",
575
+ children: [/* @__PURE__ */ O(dt, {
576
+ className: "tg:block tg:w-full tg:truncate tg:font-normal",
577
+ children: e
578
+ }), t && /* @__PURE__ */ O(ft, {
579
+ className: "tg:line-clamp-1",
580
+ children: t
581
+ })]
582
+ })] }), mt = /\{\{([\w-]+)}}/g, ht = (t) => {
583
+ let [i, o] = D({
584
+ error: null,
585
+ fetched: null,
586
+ isLoading: !1
587
+ }), { baseUrl: s, formValues: l, headers: u } = a(), f = t.data.optionsSource, p = t.data.options, g = ee(() => {
588
+ if (!(f?.url && f.mapping?.valueField && f.mapping?.labelField) || !Array.from(f.url.matchAll(mt), (e) => e[1]).every((e) => {
589
+ let t = l[e];
590
+ return t != null && t !== "";
591
+ })) return null;
592
+ let t = f.method ?? "GET", r = {
593
+ body: [
594
+ "POST",
595
+ "PUT",
596
+ "PATCH"
597
+ ].includes(t) ? c(f.body, l, []) : void 0,
598
+ headers: n(e(u, l), e(f.headers, l)),
599
+ mapping: f.mapping,
600
+ method: t,
601
+ queryParams: e(f.queryParams, l) ?? {},
602
+ responsePath: f.responsePath,
603
+ url: m(h(f.url, l, { encode: !0 }), s)
604
+ };
605
+ return JSON.stringify(r);
606
+ }, [
607
+ s,
608
+ f,
609
+ l,
610
+ u
611
+ ]);
612
+ T(() => {
613
+ if (!g) {
614
+ o({
615
+ error: null,
616
+ fetched: null,
617
+ isLoading: !1
618
+ });
619
+ return;
620
+ }
621
+ let e = JSON.parse(g), t = new AbortController();
622
+ return o((e) => ({
623
+ ...e,
624
+ error: null,
625
+ isLoading: !0
626
+ })), (async () => {
627
+ let n = await r({
628
+ body: e.body,
629
+ headers: e.headers,
630
+ method: e.method,
631
+ queryParams: e.queryParams,
632
+ signal: t.signal,
633
+ url: e.url
634
+ });
635
+ if (!t.signal.aborted) {
636
+ if (!n.success) {
637
+ o({
638
+ error: n.error ?? "Fetch failed",
639
+ fetched: null,
640
+ isLoading: !1
641
+ });
642
+ return;
643
+ }
644
+ o({
645
+ error: null,
646
+ fetched: v(n.data, e.responsePath, e.mapping),
647
+ isLoading: !1
648
+ });
649
+ }
650
+ })(), () => t.abort();
651
+ }, [g]);
652
+ let _ = t.data.normalizeOptionLabels !== !1, y = ee(() => i.fetched ? _ ? i.fetched.map((e) => ({
653
+ ...e,
654
+ label: d(e.label)
655
+ })) : i.fetched : p ?? [], [
656
+ i.fetched,
657
+ p,
658
+ _
659
+ ]);
660
+ return {
661
+ error: i.error,
662
+ isLoading: i.isLoading,
663
+ options: y
664
+ };
665
+ }, gt = ({ field: e, extra: t }) => {
666
+ let [n, r] = D(!1), { id: i, value: a, placeholder: o } = e, { InputLabel: c, node: l, setValue: u, error: d, label: f, helperText: p, missingDependencies: m } = t, { options: h, isLoading: g, error: _ } = ht(l), v = s(), y = `${i}-trigger`, b = `${i}-error`, x = h.find((e) => e.value === a);
667
+ return /* @__PURE__ */ k(J, {
668
+ className: "tg:mb-4",
669
+ children: [
670
+ /* @__PURE__ */ O(c, {
671
+ htmlFor: y,
672
+ label: f,
673
+ required: l.data.required
674
+ }),
675
+ /* @__PURE__ */ O(ot, {
676
+ missing: m,
677
+ children: /* @__PURE__ */ k("div", {
678
+ className: "tg:relative",
679
+ children: [
680
+ /* @__PURE__ */ k(Se, {
681
+ open: n,
682
+ onOpenChange: r,
683
+ children: [/* @__PURE__ */ O(Ce, {
684
+ asChild: !0,
685
+ children: /* @__PURE__ */ k(q, {
686
+ id: y,
687
+ variant: "outline",
688
+ role: "combobox",
689
+ "aria-label": f || l.data.name,
690
+ "aria-expanded": n,
691
+ "aria-invalid": !!d || void 0,
692
+ "aria-describedby": d ? b : void 0,
693
+ disabled: g || m.length > 0,
694
+ className: K("tg:w-full tg:justify-between tg:font-normal", (a || g) && "tg:pr-14"),
695
+ children: [/* @__PURE__ */ O("span", {
696
+ className: "tg:flex tg:items-center tg:gap-2 tg:truncate",
697
+ children: a ? x?.label ? v(x.label) : a : o || v("renderer.defaultAutocompleteInput.selectOption")
698
+ }), /* @__PURE__ */ O(ae, { className: "tg:ml-2 tg:size-4 tg:shrink-0 tg:opacity-50" })]
699
+ })
700
+ }), /* @__PURE__ */ O(we, {
701
+ className: "tg:w-(--radix-popover-trigger-width) tg:p-0",
702
+ align: "start",
703
+ children: /* @__PURE__ */ k(Xe, { children: [/* @__PURE__ */ O(Ze, { placeholder: o || v("renderer.defaultAutocompleteInput.search") }), /* @__PURE__ */ k(Qe, { children: [/* @__PURE__ */ O($e, { children: v("renderer.defaultAutocompleteInput.noResults") }), /* @__PURE__ */ O(et, { children: h.map((e) => /* @__PURE__ */ k(tt, {
704
+ value: e.value,
705
+ disabled: e.disabled,
706
+ onSelect: () => {
707
+ u(e.value === a ? "" : e.value), r(!1);
708
+ },
709
+ children: [/* @__PURE__ */ O(ne, { className: K("tg:mr-2 tg:size-4", a === e.value ? "tg:opacity-100" : "tg:opacity-0") }), /* @__PURE__ */ O(pt, {
710
+ label: v(e.label) || e.value,
711
+ description: v(e.description),
712
+ image: e.image
713
+ })]
714
+ }, e.value)) })] })] })
715
+ })]
716
+ }),
717
+ g && /* @__PURE__ */ O(I, { className: "tg:-translate-y-1/2 tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-8 tg:size-4 tg:animate-spin tg:text-muted-foreground" }),
718
+ a && !g && m.length === 0 && /* @__PURE__ */ O("button", {
719
+ type: "button",
720
+ "aria-label": v("common.clear"),
721
+ onClick: () => u(""),
722
+ className: "tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:right-8 tg:rounded-sm tg:p-0.5 tg:text-muted-foreground tg:opacity-70 tg:transition-opacity tg:hover:opacity-100",
723
+ children: /* @__PURE__ */ O(se, { className: "tg:size-4" })
724
+ })
725
+ ]
726
+ })
727
+ }),
728
+ d && /* @__PURE__ */ O(X, {
729
+ id: b,
730
+ children: d
731
+ }),
732
+ _ && !d && /* @__PURE__ */ O(X, { children: _ }),
733
+ p && !d && !_ && /* @__PURE__ */ O(Y, { children: p })
734
+ ]
735
+ });
736
+ }, _t = ({ field: e, extra: t }) => {
737
+ let { id: n, name: r, value: i } = e, { InputLabel: o, node: c, setValue: l, error: u, label: d, helperText: f, renderOptionExtras: p, compactOptions: m, missingDependencies: h } = t, { options: g, isLoading: _, error: v } = ht(c), { optionsDisplayLimit: y } = a(), b = s();
738
+ if (g.length > 0 || c.data.optionsSource) {
739
+ let e = `${n}-label`, t = Array.isArray(i) ? i.map(String) : [], a = y ? g.slice(0, y) : g, s = g.length - a.length, x = (e, n) => {
740
+ l(n ? [...t, e] : t.filter((t) => t !== e));
741
+ };
742
+ return /* @__PURE__ */ k(J, {
743
+ className: "tg:mb-4",
744
+ children: [
745
+ /* @__PURE__ */ O(o, {
746
+ className: "tg:mb-1",
747
+ id: e,
748
+ label: d,
749
+ required: c.data.required
750
+ }),
751
+ /* @__PURE__ */ O(st, { missing: h }),
752
+ _ && /* @__PURE__ */ k("div", {
753
+ className: "tg:flex tg:items-center tg:gap-2 tg:py-2 tg:text-muted-foreground tg:text-sm",
754
+ children: [/* @__PURE__ */ O(I, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ O("span", { children: b("renderer.defaultCheckboxInput.loadingOptions") })]
755
+ }),
756
+ /* @__PURE__ */ k("div", {
757
+ role: "group",
758
+ "aria-labelledby": d ? e : void 0,
759
+ "aria-label": d ? void 0 : c.data.name,
760
+ className: "tg:min-w-0 tg:space-y-2",
761
+ children: [a.map((e, i) => {
762
+ let a = b(e.description);
763
+ return /* @__PURE__ */ k("div", {
764
+ className: K("tg:group/option tg:pointer-events-auto tg:relative tg:flex tg:items-start tg:gap-3", m && "tg:pr-22"),
765
+ children: [
766
+ /* @__PURE__ */ O(ye, {
767
+ id: `${n}-${e.value}`,
768
+ name: r,
769
+ checked: t.includes(String(e.value)),
770
+ onCheckedChange: (t) => x(String(e.value), !!t),
771
+ disabled: e.disabled,
772
+ className: "tg:mt-0.5"
773
+ }),
774
+ e.image && /* @__PURE__ */ O("img", {
775
+ src: e.image,
776
+ alt: "",
777
+ className: "tg:h-8 tg:w-8 tg:shrink-0 tg:rounded tg:object-cover"
778
+ }),
779
+ /* @__PURE__ */ k("div", {
780
+ className: K("tg:flex tg:flex-col", m && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
781
+ children: [/* @__PURE__ */ O(Q, {
782
+ htmlFor: `${n}-${e.value}`,
783
+ className: K("tg:cursor-pointer tg:font-normal tg:text-sm", m && "tg:block tg:max-w-full tg:truncate"),
784
+ children: b(e.label) ? b(e.label) : e.value
785
+ }), a && /* @__PURE__ */ O("span", {
786
+ className: K("tg:text-muted-foreground tg:text-xs", m && "tg:block tg:max-w-full tg:truncate"),
787
+ children: a
788
+ })]
789
+ }),
790
+ p?.({
791
+ index: i,
792
+ option: e
793
+ })
794
+ ]
795
+ }, e.value + i);
796
+ }), s > 0 && /* @__PURE__ */ O("div", {
797
+ className: "tg:px-2 tg:text-muted-foreground tg:text-xs",
798
+ children: "…"
799
+ })]
800
+ }),
801
+ u && /* @__PURE__ */ O(X, { children: u }),
802
+ v && !u && /* @__PURE__ */ O(X, { children: v }),
803
+ f && !u && !v && /* @__PURE__ */ O(Y, { children: f })
804
+ ]
805
+ });
806
+ }
807
+ return /* @__PURE__ */ k(J, {
808
+ className: "tg:mb-4",
809
+ children: [/* @__PURE__ */ k("div", {
810
+ className: "tg:flex tg:items-center tg:gap-3",
811
+ children: [/* @__PURE__ */ O(ye, {
812
+ id: n,
813
+ name: r,
814
+ "aria-label": d || c.data.name,
815
+ checked: typeof i == "boolean" ? i : !1,
816
+ onCheckedChange: (e) => l(!!e)
817
+ }), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O(o, {
818
+ htmlFor: n,
819
+ label: d,
820
+ required: c.data.required,
821
+ className: "tg:cursor-pointer tg:font-medium tg:text-sm"
822
+ }), f && !u && /* @__PURE__ */ O(Y, { children: f })] })]
823
+ }), u && /* @__PURE__ */ O(X, { children: u })]
824
+ });
825
+ };
826
+ //#endregion
827
+ //#region src/shared/components/ui/calendar.tsx
828
+ function vt({ className: e, classNames: t, showOutsideDays: n = !0, captionLayout: r = "label", buttonVariant: i = "ghost", formatters: a, components: o, ...s }) {
829
+ let c = he();
830
+ return /* @__PURE__ */ O(me, {
831
+ showOutsideDays: n,
832
+ className: K("tg:group/calendar tg:bg-background tg:p-3 tg:[--cell-size:--spacing(8)] tg:[[data-slot=card-content]_&]:bg-transparent tg:[[data-slot=popover-content]_&]:bg-transparent", String.raw`tg:rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`tg:rtl:**:[.rdp-button\_previous>svg]:rotate-180`, e),
833
+ captionLayout: r,
834
+ formatters: {
835
+ formatMonthDropdown: (e) => e.toLocaleString("default", { month: "short" }),
836
+ ...a
837
+ },
838
+ classNames: {
839
+ button_next: K(ve({ variant: i }), "tg:size-(--cell-size) tg:aria-disabled:opacity-50 tg:p-0 tg:select-none", c.button_next),
840
+ button_previous: K(ve({ variant: i }), "tg:size-(--cell-size) tg:aria-disabled:opacity-50 tg:p-0 tg:select-none", c.button_previous),
841
+ caption_label: K("tg:select-none tg:font-medium", r === "label" ? "tg:text-sm" : "tg:rounded-md tg:pl-2 tg:pr-1 tg:flex tg:items-center tg:gap-1 tg:text-sm tg:h-8 tg:[&>svg]:text-muted-foreground tg:[&>svg]:size-3.5", c.caption_label),
842
+ day: K("tg:relative tg:w-full tg:h-full tg:p-0 tg:text-center tg:[&:first-child[data-selected=true]_button]:rounded-l-md tg:[&:last-child[data-selected=true]_button]:rounded-r-md tg:group/day tg:aspect-square tg:select-none", c.day),
843
+ disabled: K("tg:text-muted-foreground tg:opacity-50", c.disabled),
844
+ dropdown: K("tg:absolute tg:bg-popover tg:inset-0 tg:opacity-0", c.dropdown),
845
+ dropdown_root: K("tg:relative tg:has-focus:border-ring tg:border tg:border-input tg:shadow-xs tg:has-focus:ring-ring/50 tg:has-focus:ring-[3px] tg:rounded-md", c.dropdown_root),
846
+ dropdowns: K("tg:w-full tg:flex tg:items-center tg:text-sm tg:font-medium tg:justify-center tg:h-(--cell-size) tg:gap-1.5", c.dropdowns),
847
+ hidden: K("tg:invisible", c.hidden),
848
+ month: K("tg:flex tg:flex-col tg:w-full tg:gap-4", c.month),
849
+ month_caption: K("tg:flex tg:items-center tg:justify-center tg:h-(--cell-size) tg:w-full tg:px-(--cell-size)", c.month_caption),
850
+ months: K("tg:flex tg:gap-4 tg:flex-col tg:md:flex-row tg:relative", c.months),
851
+ nav: K("tg:flex tg:items-center tg:gap-1 tg:w-full tg:absolute tg:top-0 tg:inset-x-0 tg:justify-between", c.nav),
852
+ outside: K("tg:text-muted-foreground tg:aria-selected:text-muted-foreground", c.outside),
853
+ range_end: K("tg:rounded-r-md tg:bg-accent", c.range_end),
854
+ range_middle: K("tg:rounded-none", c.range_middle),
855
+ range_start: K("tg:rounded-l-md tg:bg-accent", c.range_start),
856
+ root: K("tg:w-fit", c.root),
857
+ table: "tg:w-full tg:border-collapse",
858
+ today: K("tg:bg-accent tg:text-accent-foreground tg:rounded-md tg:data-[selected=true]:rounded-none", c.today),
859
+ week: K("tg:flex tg:w-full tg:mt-2", c.week),
860
+ week_number: K("tg:text-[0.8rem] tg:select-none tg:text-muted-foreground", c.week_number),
861
+ week_number_header: K("tg:select-none tg:w-(--cell-size)", c.week_number_header),
862
+ weekday: K("tg:text-muted-foreground tg:rounded-md tg:flex-1 tg:font-normal tg:text-[0.8rem] tg:select-none", c.weekday),
863
+ weekdays: K("tg:flex", c.weekdays),
864
+ ...t
865
+ },
866
+ components: {
867
+ Chevron: ({ className: e, orientation: t, ...n }) => O(t === "left" ? M : t === "right" ? re : j, {
868
+ className: K("tg:size-4", e),
869
+ ...n
870
+ }),
871
+ DayButton: yt,
872
+ Root: ({ className: e, rootRef: t, ...n }) => /* @__PURE__ */ O("div", {
873
+ "data-slot": "calendar",
874
+ ref: t,
875
+ className: K(e),
876
+ ...n
877
+ }),
878
+ WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */ O("td", {
879
+ ...t,
880
+ children: /* @__PURE__ */ O("div", {
881
+ className: "tg:flex tg:size-(--cell-size) tg:items-center tg:justify-center tg:text-center",
882
+ children: e
883
+ })
884
+ }),
885
+ ...o
886
+ },
887
+ ...s
888
+ });
889
+ }
890
+ function yt({ className: e, day: t, modifiers: n, ...r }) {
891
+ let i = he(), a = b.useRef(null);
892
+ return b.useEffect(() => {
893
+ n.focused && a.current?.focus();
894
+ }, [n.focused]), /* @__PURE__ */ O(q, {
895
+ ref: a,
896
+ variant: "ghost",
897
+ size: "icon",
898
+ "data-day": t.date.toLocaleDateString(),
899
+ "data-selected-single": n.selected && !n.range_start && !n.range_end && !n.range_middle,
900
+ "data-range-start": n.range_start,
901
+ "data-range-end": n.range_end,
902
+ "data-range-middle": n.range_middle,
903
+ className: K("tg:flex tg:aspect-square tg:size-auto tg:w-full tg:min-w-(--cell-size) tg:flex-col tg:gap-1 tg:font-normal tg:leading-none tg:data-[range-end=true]:rounded-md tg:data-[range-middle=true]:rounded-none tg:data-[range-start=true]:rounded-md tg:data-[range-end=true]:rounded-r-md tg:data-[range-start=true]:rounded-l-md tg:data-[range-end=true]:bg-primary tg:data-[range-middle=true]:bg-accent tg:data-[range-start=true]:bg-primary tg:data-[selected-single=true]:bg-primary tg:data-[range-end=true]:text-primary-foreground tg:data-[range-middle=true]:text-accent-foreground tg:data-[range-start=true]:text-primary-foreground tg:data-[selected-single=true]:text-primary-foreground tg:group-data-[focused=true]/day:relative tg:group-data-[focused=true]/day:z-10 tg:group-data-[focused=true]/day:border-ring tg:group-data-[focused=true]/day:ring-[3px] tg:group-data-[focused=true]/day:ring-ring/50 tg:dark:hover:text-accent-foreground tg:[&>span]:text-xs tg:[&>span]:opacity-70", i.day, e),
904
+ ...r
905
+ });
906
+ }
907
+ //#endregion
908
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.tsx
909
+ var bt = ({ field: e, extra: t }) => {
910
+ let [n, r] = D(!1), { id: i, name: a, value: o, placeholder: c } = e, { InputLabel: l, node: u, setValue: d, error: f, label: p, helperText: m } = t, h = s(), g = o ? new Date(o) : void 0;
911
+ return /* @__PURE__ */ k(J, {
912
+ className: "tg:mb-4",
913
+ children: [
914
+ /* @__PURE__ */ O(l, {
915
+ htmlFor: i,
916
+ label: p,
917
+ required: u.data.required
918
+ }),
919
+ /* @__PURE__ */ k(Se, {
920
+ open: n,
921
+ onOpenChange: r,
922
+ children: [/* @__PURE__ */ O(Ce, {
923
+ asChild: !0,
924
+ children: /* @__PURE__ */ k(q, {
925
+ variant: "outline",
926
+ id: i,
927
+ name: a,
928
+ "aria-label": p || u.data.name,
929
+ className: "tg:w-full tg:justify-between tg:font-normal",
930
+ children: [g ? g.toLocaleDateString() : c || h("renderer.defaultInputs.selectDate"), /* @__PURE__ */ O(j, { className: "tg:size-4" })]
931
+ })
932
+ }), /* @__PURE__ */ O(we, {
933
+ className: "tg:w-auto tg:overflow-hidden tg:p-0",
934
+ align: "start",
935
+ children: /* @__PURE__ */ O(vt, {
936
+ mode: "single",
937
+ selected: g,
938
+ captionLayout: "dropdown",
939
+ disabled: (e) => {
940
+ if (u.data.disablePast) {
941
+ let t = /* @__PURE__ */ new Date();
942
+ return t.setHours(0, 0, 0, 0), e < t;
943
+ }
944
+ return !1;
945
+ },
946
+ onSelect: (e) => {
947
+ d(e ? e.toISOString() : ""), r(!1);
948
+ }
949
+ })
950
+ })]
951
+ }),
952
+ f && /* @__PURE__ */ O(X, { children: f }),
953
+ m && !f && /* @__PURE__ */ O(Y, { children: m })
954
+ ]
955
+ });
956
+ }, xt = ({ field: e, extra: t }) => {
957
+ let [n, r] = D(!1), { id: i, value: a } = e, { InputLabel: o, node: c, setValue: l, error: u, label: d, helperText: f } = t, p = s(), m = Array.isArray(a) ? a : [], h = m[0] ? new Date(m[0]) : void 0, g = m[1] ? new Date(m[1]) : void 0;
958
+ return /* @__PURE__ */ k(J, {
959
+ className: "tg:mb-4",
960
+ children: [
961
+ /* @__PURE__ */ O(o, {
962
+ htmlFor: i,
963
+ label: d,
964
+ required: c.data.required
965
+ }),
966
+ /* @__PURE__ */ k(Se, {
967
+ open: n,
968
+ onOpenChange: r,
969
+ children: [/* @__PURE__ */ O(Ce, {
970
+ asChild: !0,
971
+ children: /* @__PURE__ */ k(q, {
972
+ id: i,
973
+ variant: "outline",
974
+ "aria-label": d || c.data.name,
975
+ className: "tg:w-full tg:justify-between tg:font-normal",
976
+ children: [h && g ? `${h.toLocaleDateString()} - ${g.toLocaleDateString()}` : h ? h.toLocaleDateString() : p("renderer.defaultInputs.selectDateRange"), /* @__PURE__ */ O(j, { className: "tg:size-4" })]
977
+ })
978
+ }), /* @__PURE__ */ O(we, {
979
+ className: "tg:w-auto tg:overflow-hidden tg:p-0",
980
+ align: "start",
981
+ children: /* @__PURE__ */ O(vt, {
982
+ mode: "range",
983
+ selected: {
984
+ from: h,
985
+ to: g
986
+ },
987
+ captionLayout: "dropdown",
988
+ disabled: (e) => {
989
+ if (c.data.disablePast) {
990
+ let t = /* @__PURE__ */ new Date();
991
+ return t.setHours(0, 0, 0, 0), e < t;
992
+ }
993
+ return !1;
994
+ },
995
+ onSelect: (e) => {
996
+ l([e?.from ? e.from.toISOString() : void 0, e?.to ? e.to.toISOString() : void 0]);
997
+ },
998
+ numberOfMonths: 2
999
+ })
1000
+ })]
1001
+ }),
1002
+ u && /* @__PURE__ */ O(X, { children: u }),
1003
+ f && !u && /* @__PURE__ */ O(Y, { children: f })
1004
+ ]
1005
+ });
1006
+ }, St = ({ field: e, extra: t }) => {
1007
+ let { id: n, name: r, value: i } = e, { InputLabel: a, node: o, setValue: c, error: l, label: d, helperText: m } = t, h = s(), _ = E(null), v = u(i), y = o.data.multiple, b = async (e) => {
1008
+ let { files: t } = e.target;
1009
+ if (!(!t || t.length === 0)) {
1010
+ if (y) {
1011
+ let e = await p(Array.from(t));
1012
+ c([...v, ...e]);
1013
+ } else c(await g(t[0]));
1014
+ e.target.value = "";
1015
+ }
1016
+ }, x = (e) => {
1017
+ let t = v.filter((t, n) => n !== e);
1018
+ c(t.length > 0 ? t : null);
1019
+ };
1020
+ return /* @__PURE__ */ k(J, {
1021
+ className: "tg:mb-4",
1022
+ children: [
1023
+ /* @__PURE__ */ O(a, {
1024
+ htmlFor: n,
1025
+ label: d,
1026
+ required: o.data.required
1027
+ }),
1028
+ v.length > 0 && /* @__PURE__ */ O("ul", {
1029
+ className: "tg:flex tg:flex-col tg:gap-2",
1030
+ children: v.map((e, t) => /* @__PURE__ */ k("li", {
1031
+ className: "tg:flex tg:items-center tg:gap-2 tg:rounded-md tg:border tg:bg-card tg:px-3 tg:py-2 tg:text-sm",
1032
+ children: [
1033
+ /* @__PURE__ */ O(P, { className: "tg:size-4 tg:shrink-0 tg:text-muted-foreground" }),
1034
+ /* @__PURE__ */ O("span", {
1035
+ className: "tg:flex-1 tg:truncate",
1036
+ title: e.name,
1037
+ children: e.name
1038
+ }),
1039
+ e.size > 0 && /* @__PURE__ */ O("span", {
1040
+ className: "tg:shrink-0 tg:text-muted-foreground tg:text-xs",
1041
+ children: f(e.size)
1042
+ }),
1043
+ /* @__PURE__ */ O(q, {
1044
+ type: "button",
1045
+ variant: "ghost",
1046
+ size: "icon-sm",
1047
+ onClick: () => x(t),
1048
+ "aria-label": h("renderer.defaultInputs.removeFile"),
1049
+ children: /* @__PURE__ */ O(se, { className: "tg:size-4" })
1050
+ })
1051
+ ]
1052
+ }, `${e.name}-${t}`))
1053
+ }),
1054
+ /* @__PURE__ */ O("input", {
1055
+ ref: _,
1056
+ type: "file",
1057
+ name: r,
1058
+ id: n,
1059
+ className: "tg:hidden",
1060
+ onChange: b,
1061
+ multiple: y
1062
+ }),
1063
+ /* @__PURE__ */ k(q, {
1064
+ type: "button",
1065
+ variant: "outline",
1066
+ onClick: () => _.current?.click(),
1067
+ "aria-label": d || o.data.name,
1068
+ children: [/* @__PURE__ */ O(F, { className: "tg:size-4" }), v.length === 0 ? h(y ? "renderer.defaultInputs.selectFiles" : "renderer.defaultInputs.selectFile") : h(y ? "renderer.defaultInputs.addMoreFiles" : "renderer.defaultInputs.replaceFile")]
1069
+ }),
1070
+ l && /* @__PURE__ */ O(X, { children: l }),
1071
+ m && !l && /* @__PURE__ */ O(Y, { children: m })
1072
+ ]
1073
+ });
1074
+ }, Ct = ({ field: e }) => {
1075
+ let { id: t, name: n, value: r } = e;
1076
+ return /* @__PURE__ */ O(Z, {
1077
+ type: "hidden",
1078
+ id: t,
1079
+ name: n,
1080
+ value: r ?? ""
1081
+ });
1082
+ }, wt = (e) => {
1083
+ let t = e.matchAll(/{{([\w-]+)}}/g);
1084
+ return Array.from(t, (e) => e[1]);
1085
+ }, Tt = (e, t) => wt(e).every((e) => {
1086
+ let n = t[e];
1087
+ return n != null && n !== "";
1088
+ }), Et = (e, t, n = !1) => e.replace(/{{([\w-]+)}}/g, (e, r) => {
1089
+ let i = t[r], a = i == null ? "" : String(i);
1090
+ return n ? encodeURIComponent(a) : a;
1091
+ }), Dt = ({ field: r, extra: u }) => {
1092
+ let [d, f] = D(!1), [p, h] = D(null), [g, v] = D([]), [b, x] = D(""), [S, w] = D(!1), { id: A, name: j, value: M, placeholder: re } = r, { InputLabel: ie, node: N, setValue: P, error: F, label: L, helperText: oe, missingDependencies: ce } = u, { formValues: R, inputNodes: z, headers: le, baseUrl: ue } = a(), { httpConfig: B } = N.data, de = E(!1), fe = E(!1), V = E(""), H = s(), pe = E(B), U = E(R), W = E(z), me = E(le), he = E(ue), ge = E(P), _e = E(null), G = E(null), ve = E(N.data.normalizeOptionLabels !== !1), ye = ee(() => B?.url ? wt(B.url) : [], [B?.url]), Q = ye.length > 0, be = ee(() => ye.map((e) => `${e}:${String(R[e] ?? "")}`).join("|"), [ye, R]), xe = ee(() => B?.url ? Q ? Tt(B.url, R) : !0 : !1, [
1093
+ B?.url,
1094
+ Q,
1095
+ R
1096
+ ]), $ = C(async (r) => {
1097
+ G.current && G.current.abort();
1098
+ let a = new AbortController();
1099
+ G.current = a;
1100
+ let s = pe.current, u = U.current, d = ge.current;
1101
+ if (!s?.url) {
1102
+ h(H("renderer.defaultHttpInput.noUrlConfigured")), G.current = null;
1103
+ return;
1104
+ }
1105
+ if (s.url && !Tt(s.url, u)) {
1106
+ G.current = null;
1107
+ return;
1108
+ }
1109
+ f(!0), h(null);
1110
+ try {
1111
+ let f = m(Et(s.url, u, !0), he.current), p = t(s.searchParam && r ? `${f}${f.includes("?") ? "&" : "?"}${s.searchParam}=${encodeURIComponent(r)}` : f, e(s.queryParams, u)), g = n({ "Content-Type": "application/json" }, e(me.current, u), e(s.headers, u)), b = [
1112
+ "POST",
1113
+ "PUT",
1114
+ "PATCH"
1115
+ ].includes(s.method || "") ? s.sendAllFormValues ? JSON.stringify(_(u, W.current)) : c(s.body, u, W.current) : void 0, x = setTimeout(() => a.abort(), 3e4), S = await fetch(p, {
1116
+ body: b || void 0,
1117
+ headers: Object.fromEntries(Object.entries(g).filter(([, e]) => e)),
1118
+ method: s.method || "GET",
1119
+ signal: a.signal
1120
+ });
1121
+ if (clearTimeout(x), !S.ok) {
1122
+ h(`HTTP Error ${S.status}: ${S.statusText}`);
1123
+ return;
1124
+ }
1125
+ let C = o(await S.text());
1126
+ if (!C.ok) {
1127
+ h(H("renderer.defaultHttpInput.invalidJson"));
1128
+ return;
1129
+ }
1130
+ let w = i(C.value), T = s.responsePath ? l(w, s.responsePath) : w;
1131
+ if (s.responseMapping && Array.isArray(T)) {
1132
+ let { valueField: e = "value", labelField: t = "label", descriptionField: n, imageField: r } = s.responseMapping, i = ve.current;
1133
+ v(T.map((a) => {
1134
+ let o = n ? l(a, n) : void 0, s = r ? l(a, r) : void 0, c = String(l(a, t) || "");
1135
+ return {
1136
+ description: o != null && o !== "" ? String(o) : void 0,
1137
+ image: typeof s == "string" && s !== "" ? s : void 0,
1138
+ label: i ? y(c) : c,
1139
+ value: String(l(a, e) || "")
1140
+ };
1141
+ }));
1142
+ } else d(typeof T == "string" ? T : JSON.stringify(T));
1143
+ } catch (e) {
1144
+ if (e instanceof Error && e.name === "AbortError") return;
1145
+ h(e instanceof Error ? e.message : H("renderer.defaultHttpInput.fetchFailed")), console.error("HTTP Input fetch error:", e);
1146
+ } finally {
1147
+ G.current === a && (f(!1), G.current = null);
1148
+ }
1149
+ }, [H]);
1150
+ if (T(() => {
1151
+ pe.current = B, U.current = R, W.current = z, me.current = le, he.current = ue, ge.current = P, _e.current = $, ve.current = N.data.normalizeOptionLabels !== !1;
1152
+ }, [
1153
+ B,
1154
+ R,
1155
+ z,
1156
+ le,
1157
+ ue,
1158
+ P,
1159
+ $,
1160
+ N.data.normalizeOptionLabels
1161
+ ]), T(() => () => {
1162
+ G.current && G.current.abort(), de.current = !1, fe.current = !1;
1163
+ }, []), T(() => {
1164
+ if (de.current) return;
1165
+ de.current = !0;
1166
+ let e = pe.current, t = U.current, n = _e.current, r = e?.url && Tt(e.url, t);
1167
+ e?.fetchOnMount && r && n && (n(), e.url && (V.current = wt(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
1168
+ }, []), T(() => {
1169
+ if (!de.current || !Q || V.current === be || !xe) return;
1170
+ let e = setTimeout(() => {
1171
+ $(), V.current = be;
1172
+ }, 500);
1173
+ return () => clearTimeout(e);
1174
+ }, [
1175
+ be,
1176
+ Q,
1177
+ xe,
1178
+ $
1179
+ ]), T(() => {
1180
+ if (!fe.current) {
1181
+ fe.current = !0;
1182
+ return;
1183
+ }
1184
+ let e = pe.current, t = U.current, n = _e.current, r = e?.url && Tt(e.url, t);
1185
+ e?.fetchOnMount && r && n && (n(), e.url && (V.current = wt(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
1186
+ }, [ee(() => JSON.stringify({
1187
+ body: B?.body,
1188
+ fetchOnMount: B?.fetchOnMount,
1189
+ headers: B?.headers,
1190
+ method: B?.method,
1191
+ queryParams: B?.queryParams,
1192
+ responseMapping: B?.responseMapping,
1193
+ responsePath: B?.responsePath,
1194
+ searchParam: B?.searchParam,
1195
+ sendAllFormValues: B?.sendAllFormValues,
1196
+ url: B?.url
1197
+ }), [B])]), T(() => {
1198
+ if (!(B?.searchParam && b)) return;
1199
+ let e = setTimeout(() => {
1200
+ $(b);
1201
+ }, 300);
1202
+ return () => clearTimeout(e);
1203
+ }, [
1204
+ b,
1205
+ B?.searchParam,
1206
+ $
1207
+ ]), B?.responseMapping) {
1208
+ let e = Array.isArray(M) ? M[0] : M, t = g.find((t) => t.value === e);
1209
+ if (B.searchParam) {
1210
+ let n = d && B?.showLoading, r = t?.label || re || H("renderer.defaultHttpInput.search");
1211
+ return /* @__PURE__ */ k(J, {
1212
+ className: "tg:mb-4",
1213
+ children: [
1214
+ /* @__PURE__ */ O(ie, {
1215
+ htmlFor: A,
1216
+ label: L,
1217
+ required: N.data.required
1218
+ }),
1219
+ /* @__PURE__ */ O(ot, {
1220
+ missing: ce,
1221
+ children: /* @__PURE__ */ k("div", {
1222
+ className: "tg:relative",
1223
+ children: [
1224
+ /* @__PURE__ */ k(Se, {
1225
+ open: S,
1226
+ onOpenChange: w,
1227
+ children: [/* @__PURE__ */ O(Ce, {
1228
+ asChild: !0,
1229
+ children: /* @__PURE__ */ k(q, {
1230
+ id: A,
1231
+ variant: "outline",
1232
+ role: "combobox",
1233
+ "aria-label": L || N.data.name,
1234
+ "aria-expanded": S,
1235
+ disabled: ce.length > 0,
1236
+ className: K("tg:w-full tg:justify-between", (e || n) && "tg:pr-14"),
1237
+ children: [/* @__PURE__ */ O("span", {
1238
+ className: "tg:truncate",
1239
+ children: r
1240
+ }), /* @__PURE__ */ O(ae, { className: "tg:ml-2 tg:h-4 tg:w-4 tg:shrink-0 tg:opacity-50" })]
1241
+ })
1242
+ }), /* @__PURE__ */ O(we, {
1243
+ className: "tg:w-[var(--radix-popover-trigger-width)] tg:p-0",
1244
+ align: "start",
1245
+ children: /* @__PURE__ */ k(Xe, {
1246
+ shouldFilter: !1,
1247
+ children: [/* @__PURE__ */ O(Ze, {
1248
+ placeholder: H("renderer.defaultHttpInput.search"),
1249
+ value: b,
1250
+ onValueChange: (e) => {
1251
+ x(e), h(null);
1252
+ }
1253
+ }), /* @__PURE__ */ k(Qe, { children: [
1254
+ d && /* @__PURE__ */ O("div", {
1255
+ className: "tg:flex tg:items-center tg:justify-center tg:p-4",
1256
+ children: /* @__PURE__ */ O(I, { className: "tg:h-4 tg:w-4 tg:animate-spin" })
1257
+ }),
1258
+ !d && p && /* @__PURE__ */ k("div", {
1259
+ className: "tg:p-4 tg:text-destructive tg:text-sm",
1260
+ children: [/* @__PURE__ */ O("div", { children: p }), /* @__PURE__ */ O("button", {
1261
+ type: "button",
1262
+ onClick: () => $(b),
1263
+ className: "tg:mt-2 tg:block tg:text-primary tg:hover:underline",
1264
+ children: H("renderer.defaultHttpInput.retry")
1265
+ })]
1266
+ }),
1267
+ !(d || p) && /* @__PURE__ */ k(te, { children: [/* @__PURE__ */ O($e, { children: H("renderer.defaultHttpInput.noResults") }), /* @__PURE__ */ O(et, { children: g.map((e) => /* @__PURE__ */ k(tt, {
1268
+ value: e.value,
1269
+ onSelect: () => {
1270
+ P(e.value === M ? "" : e.value), w(!1);
1271
+ },
1272
+ children: [/* @__PURE__ */ O(ne, { className: K("tg:mr-2 tg:h-4 tg:w-4", M === e.value ? "tg:opacity-100" : "tg:opacity-0") }), /* @__PURE__ */ O(pt, {
1273
+ label: e.label,
1274
+ description: e.description,
1275
+ image: e.image
1276
+ })]
1277
+ }, e.value)) })] })
1278
+ ] })]
1279
+ })
1280
+ })]
1281
+ }),
1282
+ n && /* @__PURE__ */ O(I, { className: "tg:-translate-y-1/2 tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-8 tg:size-4 tg:animate-spin tg:text-muted-foreground" }),
1283
+ e && !n && ce.length === 0 && /* @__PURE__ */ O("button", {
1284
+ type: "button",
1285
+ "aria-label": H("common.clear"),
1286
+ onClick: () => P(""),
1287
+ className: "tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:right-8 tg:rounded-sm tg:p-0.5 tg:text-muted-foreground tg:opacity-70 tg:transition-opacity tg:hover:opacity-100",
1288
+ children: /* @__PURE__ */ O(se, { className: "tg:size-4" })
1289
+ })
1290
+ ]
1291
+ })
1292
+ }),
1293
+ F && /* @__PURE__ */ O(X, { children: F }),
1294
+ oe && !F && /* @__PURE__ */ O(Y, { children: oe })
1295
+ ]
1296
+ });
1297
+ }
1298
+ let n = d && B?.showLoading, r = ce.length === 0 && g.length === 0 && !n ? p ?? H("renderer.defaultHttpInput.noDataAvailable") : void 0, i = Array.isArray(M) ? M[0] ?? "" : M ?? "", a = /* @__PURE__ */ k("div", {
1299
+ className: "tg:relative",
1300
+ children: [
1301
+ /* @__PURE__ */ k(Te, {
1302
+ value: i,
1303
+ onValueChange: (e) => P(e),
1304
+ disabled: n || g.length === 0,
1305
+ name: j,
1306
+ children: [/* @__PURE__ */ O(Oe, {
1307
+ id: A,
1308
+ name: j,
1309
+ "aria-label": L || N.data.name,
1310
+ className: K("tg:w-full", (i || n) && "tg:pr-14"),
1311
+ children: /* @__PURE__ */ O(De, { placeholder: re || H("renderer.defaultHttpInput.selectOption") })
1312
+ }), /* @__PURE__ */ O(ke, { children: /* @__PURE__ */ O(Ee, { children: g.map((e, t) => /* @__PURE__ */ O(je, {
1313
+ value: e.value,
1314
+ children: /* @__PURE__ */ O(pt, {
1315
+ label: e.label,
1316
+ description: e.description,
1317
+ image: e.image
1318
+ })
1319
+ }, e.value + t)) }) })]
1320
+ }),
1321
+ n && /* @__PURE__ */ O(I, { className: "tg:-translate-y-1/2 tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-8 tg:size-4 tg:animate-spin tg:text-muted-foreground" }),
1322
+ i && !n && /* @__PURE__ */ O("button", {
1323
+ type: "button",
1324
+ "aria-label": H("common.clear"),
1325
+ onClick: () => P(""),
1326
+ className: "tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:right-8 tg:rounded-sm tg:p-0.5 tg:text-muted-foreground tg:opacity-70 tg:transition-opacity tg:hover:opacity-100",
1327
+ children: /* @__PURE__ */ O(se, { className: "tg:size-4" })
1328
+ })
1329
+ ]
1330
+ });
1331
+ return /* @__PURE__ */ k(J, {
1332
+ className: "tg:mb-4",
1333
+ children: [
1334
+ /* @__PURE__ */ O(ie, {
1335
+ htmlFor: A,
1336
+ label: L,
1337
+ required: N.data.required
1338
+ }),
1339
+ /* @__PURE__ */ O(ot, {
1340
+ missing: ce,
1341
+ children: r ? /* @__PURE__ */ O(Fe, { children: /* @__PURE__ */ k(Ie, { children: [/* @__PURE__ */ O(Le, {
1342
+ asChild: !0,
1343
+ children: /* @__PURE__ */ O("div", {
1344
+ className: "tg:w-full",
1345
+ children: a
1346
+ })
1347
+ }), /* @__PURE__ */ O(Re, { children: /* @__PURE__ */ O("p", { children: r }) })] }) }) : a
1348
+ }),
1349
+ F && /* @__PURE__ */ O(X, { children: F }),
1350
+ oe && !F && /* @__PURE__ */ O(Y, { children: oe })
1351
+ ]
1352
+ });
1353
+ }
1354
+ return /* @__PURE__ */ k(J, {
1355
+ className: "tg:mb-4",
1356
+ children: [
1357
+ /* @__PURE__ */ O(ie, {
1358
+ htmlFor: A,
1359
+ label: L,
1360
+ required: N.data.required
1361
+ }),
1362
+ /* @__PURE__ */ O(Z, {
1363
+ type: "text",
1364
+ name: j,
1365
+ id: A,
1366
+ "aria-label": L || N.data.name,
1367
+ value: typeof M == "string" ? M : JSON.stringify(M),
1368
+ readOnly: !0,
1369
+ disabled: !0
1370
+ }),
1371
+ F && /* @__PURE__ */ O(X, { children: F }),
1372
+ oe && !F && /* @__PURE__ */ O(Y, { children: oe })
1373
+ ]
1374
+ });
1375
+ }, Ot = ({ field: e, extra: t }) => {
1376
+ let { id: n, name: r, value: i, placeholder: a } = e, { InputLabel: o, node: s, setValue: c, error: l, label: u, helperText: d } = t;
1377
+ return /* @__PURE__ */ k(J, {
1378
+ className: "tg:mb-4",
1379
+ children: [
1380
+ /* @__PURE__ */ O(o, {
1381
+ htmlFor: n,
1382
+ label: u,
1383
+ required: s.data.required
1384
+ }),
1385
+ /* @__PURE__ */ O(Z, {
1386
+ id: n,
1387
+ type: "number",
1388
+ name: r,
1389
+ "aria-label": u || s.data.name,
1390
+ value: i ?? "",
1391
+ onChange: (e) => c(e.target.value === "" ? null : Number(e.target.value)),
1392
+ placeholder: a
1393
+ }),
1394
+ l && /* @__PURE__ */ O(X, { children: l }),
1395
+ d && !l && /* @__PURE__ */ O(Y, { children: d })
1396
+ ]
1397
+ });
1398
+ }, kt = ({ field: e, extra: t }) => {
1399
+ let { id: n, name: r, value: i, placeholder: a } = e, { InputLabel: o, node: s, setValue: c, error: l, label: u, helperText: d } = t;
1400
+ return /* @__PURE__ */ k(J, {
1401
+ className: "tg:mb-4",
1402
+ children: [
1403
+ /* @__PURE__ */ O(o, {
1404
+ htmlFor: n,
1405
+ label: u,
1406
+ required: s.data.required
1407
+ }),
1408
+ /* @__PURE__ */ O(Z, {
1409
+ id: n,
1410
+ name: r,
1411
+ type: "password",
1412
+ "aria-label": u || s.data.name,
1413
+ value: i ?? "",
1414
+ onChange: (e) => c(e.target.value),
1415
+ placeholder: a,
1416
+ autoComplete: "new-password"
1417
+ }),
1418
+ l && /* @__PURE__ */ O(X, { children: l }),
1419
+ d && !l && /* @__PURE__ */ O(Y, { children: d })
1420
+ ]
1421
+ });
1422
+ }, At = z("tg:group/field tg:flex tg:w-full tg:gap-3 tg:data-[invalid=true]:text-destructive", {
1423
+ defaultVariants: { orientation: "vertical" },
1424
+ variants: { orientation: {
1425
+ horizontal: [
1426
+ "tg:flex-row tg:items-center",
1427
+ "tg:[&>[data-slot=field-label]]:flex-auto",
1428
+ "tg:has-[>[data-slot=field-content]]:items-start tg:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
1429
+ ],
1430
+ responsive: [
1431
+ "tg:flex-col tg:@md/field-group:flex-row tg:@md/field-group:items-center tg:[&>*]:w-full tg:@md/field-group:[&>*]:w-auto tg:[&>.sr-only]:w-auto",
1432
+ "tg:@md/field-group:[&>[data-slot=field-label]]:flex-auto",
1433
+ "tg:@md/field-group:has-[>[data-slot=field-content]]:items-start tg:@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
1434
+ ],
1435
+ vertical: ["tg:flex-col tg:[&>*]:w-full tg:[&>.sr-only]:w-auto"]
1436
+ } }
1437
+ });
1438
+ function jt({ className: e, orientation: t = "vertical", ...n }) {
1439
+ return /* @__PURE__ */ O("div", {
1440
+ role: "group",
1441
+ "data-slot": "field",
1442
+ "data-orientation": t,
1443
+ className: K(At({ orientation: t }), e),
1444
+ ...n
1445
+ });
1446
+ }
1447
+ function Mt({ className: e, ...t }) {
1448
+ return /* @__PURE__ */ O("div", {
1449
+ "data-slot": "field-content",
1450
+ className: K("tg:group/field-content tg:flex tg:flex-1 tg:flex-col tg:gap-1.5 tg:leading-snug", e),
1451
+ ...t
1452
+ });
1453
+ }
1454
+ function Nt({ className: e, ...t }) {
1455
+ return /* @__PURE__ */ O(Q, {
1456
+ "data-slot": "field-label",
1457
+ className: K("tg:group/field-label tg:peer/field-label tg:flex tg:w-fit tg:gap-2 tg:leading-snug tg:group-data-[disabled=true]/field:opacity-50", "tg:has-[>[data-slot=field]]:w-full tg:has-[>[data-slot=field]]:flex-col tg:has-[>[data-slot=field]]:rounded-md tg:has-[>[data-slot=field]]:border tg:[&>*]:data-[slot=field]:p-4", "tg:has-data-[state=checked]:border-primary tg:has-data-[state=checked]:bg-primary/5 tg:dark:has-data-[state=checked]:bg-primary/10", e),
1458
+ ...t
1459
+ });
1460
+ }
1461
+ function Pt({ className: e, ...t }) {
1462
+ return /* @__PURE__ */ O("div", {
1463
+ "data-slot": "field-label",
1464
+ className: K("tg:flex tg:w-fit tg:items-center tg:gap-2 tg:font-medium tg:text-sm tg:leading-snug tg:group-data-[disabled=true]/field:opacity-50", e),
1465
+ ...t
1466
+ });
1467
+ }
1468
+ function Ft({ className: e, ...t }) {
1469
+ return /* @__PURE__ */ O("p", {
1470
+ "data-slot": "field-description",
1471
+ className: K("tg:font-normal tg:text-muted-foreground tg:text-sm tg:leading-normal tg:group-has-[[data-orientation=horizontal]]/field:text-balance", "tg:last:mt-0 tg:nth-last-2:-mt-1 tg:[[data-variant=legend]+&]:-mt-1.5", "tg:[&>a]:underline tg:[&>a]:underline-offset-4 tg:[&>a:hover]:text-primary", e),
1472
+ ...t
1473
+ });
1474
+ }
1475
+ //#endregion
1476
+ //#region src/shared/components/ui/radio-group.tsx
1477
+ function It({ className: e, ...t }) {
1478
+ return /* @__PURE__ */ O(ge.Root, {
1479
+ "data-slot": "radio-group",
1480
+ className: K("tg:grid tg:gap-3", e),
1481
+ ...t
1482
+ });
1483
+ }
1484
+ function Lt({ className: e, ...t }) {
1485
+ return /* @__PURE__ */ O(ge.Item, {
1486
+ "data-slot": "radio-group-item",
1487
+ className: K("tg:aspect-square tg:size-4 tg:shrink-0 tg:rounded-full tg:border tg:border-input tg:text-primary tg:shadow-xs tg:outline-none tg:transition-[color,box-shadow] tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:dark:bg-input/30 tg:dark:aria-invalid:ring-destructive/40", e),
1488
+ ...t,
1489
+ children: /* @__PURE__ */ O(ge.Indicator, {
1490
+ "data-slot": "radio-group-indicator",
1491
+ className: "tg:relative tg:flex tg:items-center tg:justify-center",
1492
+ children: /* @__PURE__ */ O(N, { className: "tg:-translate-x-1/2 tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:left-1/2 tg:size-2 tg:fill-primary" })
1493
+ })
1494
+ });
1495
+ }
1496
+ //#endregion
1497
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.tsx
1498
+ var Rt = ({ field: e, extra: t }) => {
1499
+ let { id: n, name: r, value: i } = e, { InputLabel: o, node: c, setValue: l, error: u, label: d, helperText: f, renderOptionExtras: p, compactOptions: m, missingDependencies: h } = t, { options: g, isLoading: _, error: v } = ht(c), { optionsDisplayLimit: y } = a(), b = s(), x = i ? String(i) : "", S = c.data.variant !== "default", C = `${n}-label`, w = y ? g.slice(0, y) : g, T = g.length - w.length;
1500
+ return /* @__PURE__ */ k(J, {
1501
+ className: "tg:mb-4",
1502
+ children: [
1503
+ /* @__PURE__ */ O(o, {
1504
+ className: "tg:mb-1",
1505
+ id: C,
1506
+ label: d,
1507
+ required: c.data.required
1508
+ }),
1509
+ /* @__PURE__ */ O(st, { missing: h }),
1510
+ _ && /* @__PURE__ */ k("div", {
1511
+ className: "tg:flex tg:items-center tg:gap-2 tg:py-2 tg:text-muted-foreground tg:text-sm",
1512
+ children: [/* @__PURE__ */ O(I, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ O("span", { children: b("renderer.defaultRadioInput.loadingOptions") })]
1513
+ }),
1514
+ /* @__PURE__ */ k(It, {
1515
+ value: x,
1516
+ onValueChange: (e) => l(e),
1517
+ "aria-labelledby": d ? C : void 0,
1518
+ "aria-label": d ? void 0 : c.data.name,
1519
+ name: r,
1520
+ className: K("tg:min-w-0", S && "tg:flex tg:flex-col tg:gap-2"),
1521
+ children: [w.map((e, t) => {
1522
+ let r = `${n}-${e.value}`, i = b(e.label) || e.value, a = b(e.description), o = String(e.value);
1523
+ return S ? /* @__PURE__ */ k(Nt, {
1524
+ htmlFor: r,
1525
+ className: K("tg:group/option tg:pointer-events-auto tg:relative", m && "tg:group-hover/option:pr-16"),
1526
+ children: [/* @__PURE__ */ k(jt, {
1527
+ orientation: "horizontal",
1528
+ "data-disabled": e.disabled || void 0,
1529
+ children: [
1530
+ e.image && /* @__PURE__ */ O("img", {
1531
+ src: e.image,
1532
+ alt: "",
1533
+ className: "tg:h-10 tg:w-10 tg:shrink-0 tg:self-center tg:rounded tg:object-cover"
1534
+ }),
1535
+ /* @__PURE__ */ k(Mt, {
1536
+ className: K(m && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
1537
+ children: [/* @__PURE__ */ O(Pt, {
1538
+ className: K(m && "tg:block tg:max-w-full tg:truncate"),
1539
+ children: i
1540
+ }), a && /* @__PURE__ */ O(Ft, {
1541
+ className: K(m && "tg:block tg:max-w-full tg:truncate"),
1542
+ children: a
1543
+ })]
1544
+ }),
1545
+ /* @__PURE__ */ O(Lt, {
1546
+ value: o,
1547
+ id: r,
1548
+ disabled: e.disabled,
1549
+ className: K(m && "tg:ml-auto tg:shrink-0 tg:group-hover/option:invisible")
1550
+ })
1551
+ ]
1552
+ }), p?.({
1553
+ index: t,
1554
+ option: e,
1555
+ variant: "card"
1556
+ })]
1557
+ }, e.value + t) : /* @__PURE__ */ k("div", {
1558
+ className: K("tg:group/option tg:pointer-events-auto tg:relative tg:flex tg:items-start tg:space-x-2", m && "tg:min-w-0 tg:pr-22"),
1559
+ children: [
1560
+ /* @__PURE__ */ O(Lt, {
1561
+ value: o,
1562
+ id: r,
1563
+ disabled: e.disabled,
1564
+ className: "tg:mt-0.5"
1565
+ }),
1566
+ e.image && /* @__PURE__ */ O("img", {
1567
+ src: e.image,
1568
+ alt: "",
1569
+ className: "tg:h-8 tg:w-8 tg:rounded tg:object-cover"
1570
+ }),
1571
+ /* @__PURE__ */ k("div", {
1572
+ className: K("tg:flex tg:flex-col", m && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
1573
+ children: [/* @__PURE__ */ O(Q, {
1574
+ htmlFor: r,
1575
+ className: K("tg:cursor-pointer tg:font-normal tg:text-sm", m && "tg:block tg:max-w-full tg:truncate"),
1576
+ children: i
1577
+ }), a && /* @__PURE__ */ O("span", {
1578
+ className: K("tg:text-muted-foreground tg:text-xs", m && "tg:block tg:max-w-full tg:truncate"),
1579
+ children: a
1580
+ })]
1581
+ }),
1582
+ p?.({
1583
+ index: t,
1584
+ option: e,
1585
+ variant: "default"
1586
+ })
1587
+ ]
1588
+ }, e.value + t);
1589
+ }), T > 0 && /* @__PURE__ */ O("div", {
1590
+ className: "tg:px-2 tg:py-1 tg:text-muted-foreground tg:text-xs",
1591
+ children: "…"
1592
+ })]
1593
+ }),
1594
+ u && /* @__PURE__ */ O(X, { children: u }),
1595
+ v && !u && /* @__PURE__ */ O(X, { children: v }),
1596
+ f && !u && !v && /* @__PURE__ */ O(Y, { children: f })
1597
+ ]
1598
+ });
1599
+ }, zt = ({ field: e, extra: t }) => {
1600
+ let { id: n, name: r, value: i, placeholder: a } = e, { InputLabel: o, node: c, setValue: l, error: u, label: d, helperText: f, missingDependencies: p } = t, { options: m, isLoading: h, error: g } = ht(c), _ = s(), v = i ? String(i) : "";
1601
+ return /* @__PURE__ */ k(J, {
1602
+ className: "tg:mb-4",
1603
+ children: [
1604
+ /* @__PURE__ */ O(o, {
1605
+ htmlFor: n,
1606
+ label: d,
1607
+ required: c.data.required
1608
+ }),
1609
+ /* @__PURE__ */ O(ot, {
1610
+ missing: p,
1611
+ children: /* @__PURE__ */ k("div", {
1612
+ className: "tg:relative",
1613
+ children: [
1614
+ /* @__PURE__ */ k(Te, {
1615
+ name: r,
1616
+ value: v,
1617
+ onValueChange: (e) => l(e),
1618
+ disabled: h || p.length > 0,
1619
+ children: [/* @__PURE__ */ O(Oe, {
1620
+ id: n,
1621
+ name: r,
1622
+ "aria-label": d || c.data.name,
1623
+ className: K("tg:w-full", (v || h) && "tg:pr-14"),
1624
+ children: /* @__PURE__ */ O(De, { placeholder: a || _("renderer.defaultSelectInput.selectOption") })
1625
+ }), /* @__PURE__ */ O(ke, { children: /* @__PURE__ */ O(Ee, { children: m.map((e, t) => /* @__PURE__ */ O(je, {
1626
+ value: String(e.value),
1627
+ disabled: e.disabled,
1628
+ children: /* @__PURE__ */ O(pt, {
1629
+ label: _(e.label) || e.value,
1630
+ description: _(e.description),
1631
+ image: e.image
1632
+ })
1633
+ }, `${e.value}-${t}`)) }) })]
1634
+ }),
1635
+ h && /* @__PURE__ */ O(I, { className: "tg:-translate-y-1/2 tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-8 tg:size-4 tg:animate-spin tg:text-muted-foreground" }),
1636
+ v && !h && p.length === 0 && /* @__PURE__ */ O("button", {
1637
+ type: "button",
1638
+ "aria-label": _("common.clear"),
1639
+ onClick: () => l(""),
1640
+ className: "tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:right-8 tg:rounded-sm tg:p-0.5 tg:text-muted-foreground tg:opacity-70 tg:transition-opacity tg:hover:opacity-100",
1641
+ children: /* @__PURE__ */ O(se, { className: "tg:size-4" })
1642
+ })
1643
+ ]
1644
+ })
1645
+ }),
1646
+ u && /* @__PURE__ */ O(X, { children: u }),
1647
+ g && !u && /* @__PURE__ */ O(X, { children: g }),
1648
+ f && !u && !g && /* @__PURE__ */ O(Y, { children: f })
1649
+ ]
1650
+ });
1651
+ }, Bt = (e) => null;
1652
+ //#endregion
1653
+ //#region src/shared/components/ui/switch.tsx
1654
+ function Vt({ className: e, ...t }) {
1655
+ return /* @__PURE__ */ O(_e.Root, {
1656
+ "data-slot": "switch",
1657
+ className: K("tg:peer tg:inline-flex tg:h-[1.15rem] tg:w-8 tg:shrink-0 tg:items-center tg:rounded-full tg:border tg:border-transparent tg:shadow-xs tg:outline-none tg:transition-all tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:data-[state=checked]:bg-primary tg:data-[state=unchecked]:bg-input tg:dark:data-[state=unchecked]:bg-input/80", e),
1658
+ ...t,
1659
+ children: /* @__PURE__ */ O(_e.Thumb, {
1660
+ "data-slot": "switch-thumb",
1661
+ className: K("tg:pointer-events-none tg:block tg:size-4 tg:rounded-full tg:bg-background tg:ring-0 tg:transition-transform tg:data-[state=checked]:translate-x-[calc(100%-2px)] tg:data-[state=unchecked]:translate-x-0 tg:dark:data-[state=checked]:bg-primary-foreground tg:dark:data-[state=unchecked]:bg-foreground")
1662
+ })
1663
+ });
1664
+ }
1665
+ //#endregion
1666
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.tsx
1667
+ var Ht = ({ field: e, extra: t }) => {
1668
+ let { id: n, name: r, value: i } = e, { InputLabel: a, node: o, setValue: s, error: c, label: l, helperText: u } = t;
1669
+ return /* @__PURE__ */ k(J, {
1670
+ className: "tg:mb-4",
1671
+ children: [
1672
+ /* @__PURE__ */ O(a, {
1673
+ htmlFor: n,
1674
+ label: l,
1675
+ required: o.data.required
1676
+ }),
1677
+ /* @__PURE__ */ O(Vt, {
1678
+ id: n,
1679
+ name: r,
1680
+ "aria-label": l || o.data.name,
1681
+ checked: i,
1682
+ onCheckedChange: s
1683
+ }),
1684
+ u && !c && /* @__PURE__ */ O(Y, { children: u }),
1685
+ c && /* @__PURE__ */ O(X, { children: c })
1686
+ ]
1687
+ });
1688
+ };
1689
+ //#endregion
1690
+ //#region src/shared/components/ui/textarea.tsx
1691
+ function Ut({ className: e, ...t }) {
1692
+ return /* @__PURE__ */ O("textarea", {
1693
+ "data-slot": "textarea",
1694
+ className: K("tg:field-sizing-content tg:flex tg:min-h-16 tg:w-full tg:rounded-md tg:border tg:border-input tg:bg-transparent tg:px-3 tg:py-2 tg:text-base tg:shadow-xs tg:outline-none tg:transition-[color,box-shadow] tg:placeholder:text-muted-foreground tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:md:text-sm tg:dark:bg-input/30 tg:dark:aria-invalid:ring-destructive/40", e),
1695
+ ...t
1696
+ });
1697
+ }
1698
+ //#endregion
1699
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.tsx
1700
+ var Wt = ({ field: e, extra: t }) => {
1701
+ let { id: n, name: r, value: i, placeholder: a } = e, { InputLabel: o, node: s, setValue: c, error: l, label: u, helperText: d } = t;
1702
+ return /* @__PURE__ */ k(J, {
1703
+ className: "tg:mb-4",
1704
+ children: [
1705
+ /* @__PURE__ */ O(o, {
1706
+ htmlFor: n,
1707
+ label: u,
1708
+ required: s.data.required
1709
+ }),
1710
+ /* @__PURE__ */ O(Ut, {
1711
+ id: n,
1712
+ name: r,
1713
+ "aria-label": u || s.data.name,
1714
+ value: i ?? "",
1715
+ onChange: (e) => c(e.target.value),
1716
+ placeholder: a,
1717
+ className: "tg:w-full tg:rounded-md tg:border tg:px-3 tg:py-2",
1718
+ rows: 4
1719
+ }),
1720
+ l && /* @__PURE__ */ O(X, { children: l }),
1721
+ d && !l && /* @__PURE__ */ O(Y, { children: d })
1722
+ ]
1723
+ });
1724
+ }, Gt = ({ field: e, extra: t }) => {
1725
+ let { id: n, name: r, value: i, placeholder: a } = e, { InputLabel: o, node: s, setValue: c, error: l, label: u, helperText: d } = t;
1726
+ return /* @__PURE__ */ k(J, {
1727
+ className: "tg:mb-4",
1728
+ children: [
1729
+ /* @__PURE__ */ O(o, {
1730
+ htmlFor: n,
1731
+ label: u,
1732
+ required: s.data.required
1733
+ }),
1734
+ /* @__PURE__ */ O(Z, {
1735
+ type: "text",
1736
+ id: n,
1737
+ name: r,
1738
+ "aria-label": u || s.data.name,
1739
+ value: i ?? "",
1740
+ onChange: (e) => c(e.target.value),
1741
+ placeholder: a
1742
+ }),
1743
+ l && /* @__PURE__ */ O(X, { children: l }),
1744
+ d && !l && /* @__PURE__ */ O(Y, { children: d })
1745
+ ]
1746
+ });
1747
+ }, Kt = ({ field: e, extra: t }) => {
1748
+ let { id: n, name: r, value: i, placeholder: a } = e, { InputLabel: o, node: s, setValue: c, error: l, label: u, helperText: d } = t;
1749
+ return /* @__PURE__ */ k(J, {
1750
+ className: "tg:mb-4",
1751
+ children: [
1752
+ /* @__PURE__ */ O(o, {
1753
+ htmlFor: n,
1754
+ label: u,
1755
+ required: s.data.required
1756
+ }),
1757
+ /* @__PURE__ */ O(Z, {
1758
+ type: "time",
1759
+ id: n,
1760
+ name: r,
1761
+ "aria-label": u || s.data.name,
1762
+ value: i ?? "",
1763
+ onChange: (e) => c(e.target.value),
1764
+ placeholder: a,
1765
+ className: "tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
1766
+ }),
1767
+ l && /* @__PURE__ */ O(X, { children: l }),
1768
+ d && !l && /* @__PURE__ */ O(Y, { children: d })
1769
+ ]
1770
+ });
1771
+ }, qt = ({ field: e, extra: t }) => {
1772
+ let { id: n, name: r, value: i } = e, { InputLabel: a, node: o, setValue: c, error: l, label: u, helperText: d } = t, f = s(), p = Array.isArray(i) ? i : [], m = p[0] || "", h = p[1] || "", g = (e) => {
1773
+ c([e, h]);
1774
+ }, _ = (e) => {
1775
+ c([m, e]);
1776
+ };
1777
+ return /* @__PURE__ */ k(J, {
1778
+ className: "tg:mb-4",
1779
+ children: [
1780
+ /* @__PURE__ */ O(a, {
1781
+ htmlFor: `${n}-start`,
1782
+ label: u,
1783
+ required: o.data.required
1784
+ }),
1785
+ /* @__PURE__ */ k("div", {
1786
+ className: "tg:flex tg:gap-2",
1787
+ children: [/* @__PURE__ */ O(Z, {
1788
+ id: `${n}-start`,
1789
+ name: `${r}-start`,
1790
+ "aria-label": `${u || o.data.name} - ${f("renderer.defaultInputs.startTime")}`,
1791
+ "aria-invalid": !!l,
1792
+ "aria-describedby": l ? `${o.id}-error` : void 0,
1793
+ type: "time",
1794
+ value: m,
1795
+ onChange: (e) => g(e.target.value),
1796
+ placeholder: f("renderer.defaultInputs.startTime"),
1797
+ className: "tg:flex-1 tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
1798
+ }), /* @__PURE__ */ O(Z, {
1799
+ id: `${n}-end`,
1800
+ name: `${r}-end`,
1801
+ "aria-label": `${u || o.data.name} - ${f("renderer.defaultInputs.endTime")}`,
1802
+ "aria-invalid": !!l,
1803
+ "aria-describedby": l ? `${o.id}-error` : void 0,
1804
+ type: "time",
1805
+ value: h,
1806
+ onChange: (e) => _(e.target.value),
1807
+ placeholder: f("renderer.defaultInputs.endTime"),
1808
+ className: "tg:flex-1 tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
1809
+ })]
1810
+ }),
1811
+ l && /* @__PURE__ */ O(X, { children: l }),
1812
+ d && !l && /* @__PURE__ */ O(Y, { children: d })
1813
+ ]
1814
+ });
1815
+ }, Jt = {
1816
+ address: it,
1817
+ autocomplete: gt,
1818
+ checkbox: _t,
1819
+ date: bt,
1820
+ daterange: xt,
1821
+ file: St,
1822
+ hidden: Ct,
1823
+ http: Dt,
1824
+ number: Ot,
1825
+ password: kt,
1826
+ radio: Rt,
1827
+ select: zt,
1828
+ submit: Bt,
1829
+ switch: Ht,
1830
+ text: Gt,
1831
+ textarea: Wt,
1832
+ time: Kt,
1833
+ timerange: qt
1834
+ }, Yt = S(({ label: e, id: t, disabled: n, isSubmitting: r, onBlur: i, onClick: a, onFocus: o, onPointerDown: c, onPointerLeave: l, onPointerMove: u, ...d }, f) => {
1835
+ let p = s();
1836
+ return /* @__PURE__ */ k("button", {
1837
+ ref: f,
1838
+ id: t,
1839
+ onBlur: i,
1840
+ onClick: a,
1841
+ onFocus: o,
1842
+ onPointerDown: c,
1843
+ disabled: n || r,
1844
+ onPointerLeave: l,
1845
+ onPointerMove: u,
1846
+ type: "submit",
1847
+ className: "tg:inline-flex tg:items-center tg:justify-center tg:gap-2 tg:rounded-md tg:bg-gray-900 tg:px-4 tg:py-2 tg:font-medium tg:text-sm tg:text-white tg:transition-colors tg:hover:bg-gray-800 tg:focus:outline-none tg:focus:ring-2 tg:focus:ring-gray-900 tg:focus:ring-offset-2 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:dark:bg-white tg:dark:text-gray-900 tg:dark:focus:ring-white tg:dark:hover:bg-gray-100",
1848
+ ...d,
1849
+ children: [r && /* @__PURE__ */ O(I, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), e || p("renderer.defaultSubmitButton.submit")]
1850
+ });
1851
+ });
1852
+ //#endregion
1853
+ export { Ce as $, Ve as A, Re as B, it as C, Ze as D, et as E, Je as F, Ee as G, Le as H, He as I, Me as J, je as K, Be as L, Ye as M, qe as N, tt as O, Ke as P, we as Q, ze as R, gt as S, $e as T, Te as U, Fe as V, ke as W, De as X, Oe as Y, Se as Z, Ct as _, Gt as a, J as at, bt as b, Ht as c, K as ct, Rt as d, $ as et, It as f, Dt as g, Ot as h, Kt as i, Y as it, Ge as j, Qe as k, Vt as l, kt as m, Jt as n, Q as nt, Wt as o, ye as ot, Lt as p, Ae as q, qt as r, Z as rt, Ut as s, q as st, Yt as t, xe as tt, zt as u, St as v, Xe as w, _t as x, xt as y, Ie as z };