@godxjp/ui 5.0.2 → 6.0.1

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 (242) hide show
  1. package/README.md +101 -142
  2. package/dist/app/index.d.ts +140 -0
  3. package/dist/app/index.js +38 -0
  4. package/dist/app.prop-IobwLwaM.d.ts +90 -0
  5. package/dist/checkbox-NkFkqsQ8.d.ts +13 -0
  6. package/dist/chunk-2XW7J3EI.js +226 -0
  7. package/dist/chunk-3F2AKYRD.js +416 -0
  8. package/dist/chunk-3KPEZ5CF.js +37 -0
  9. package/dist/chunk-3UGU5TYP.js +89 -0
  10. package/dist/chunk-6RA3KSVK.js +588 -0
  11. package/dist/chunk-7NZFVD24.js +122 -0
  12. package/dist/chunk-7PWBC4BY.js +25 -0
  13. package/dist/chunk-7S7MYFXE.js +61 -0
  14. package/dist/chunk-7WRZG2IG.js +71 -0
  15. package/dist/chunk-B775Y6BE.js +1 -0
  16. package/dist/chunk-BHV2FUOA.js +111 -0
  17. package/dist/chunk-BI3HERR7.js +70 -0
  18. package/dist/chunk-BPSKQUL2.js +68 -0
  19. package/dist/chunk-CDWPQ5RP.js +187 -0
  20. package/dist/chunk-CP2LET6N.js +244 -0
  21. package/dist/chunk-CQBADMFG.js +20 -0
  22. package/dist/chunk-CRERCLIZ.js +33 -0
  23. package/dist/chunk-DU6ZYZRP.js +238 -0
  24. package/dist/chunk-DY5C44UP.js +55 -0
  25. package/dist/chunk-E4HJNQ62.js +117 -0
  26. package/dist/chunk-E76QIYSY.js +93 -0
  27. package/dist/chunk-F7PG4OEV.js +37 -0
  28. package/dist/chunk-GDSVW62T.js +171 -0
  29. package/dist/chunk-H2FHJOLU.js +178 -0
  30. package/dist/chunk-HJEBRCXL.js +55 -0
  31. package/dist/chunk-ICM6XBST.js +16 -0
  32. package/dist/chunk-IK7I3ABN.js +88 -0
  33. package/dist/chunk-L6J44O74.js +144 -0
  34. package/dist/chunk-LDSLS6HE.js +1 -0
  35. package/dist/chunk-LVNUHUEZ.js +191 -0
  36. package/dist/chunk-M64MVRLS.js +92 -0
  37. package/dist/chunk-NGQW3KEM.js +402 -0
  38. package/dist/chunk-NZ4FOC5N.js +559 -0
  39. package/dist/chunk-PIIRNAXA.js +26 -0
  40. package/dist/chunk-S66TJXJU.js +33 -0
  41. package/dist/chunk-SMLKNECP.js +133 -0
  42. package/dist/chunk-TAHBM3F2.js +66 -0
  43. package/dist/chunk-TO33OY4L.js +150 -0
  44. package/dist/chunk-TO7URV7U.js +51 -0
  45. package/dist/chunk-TOO5AEKL.js +81 -0
  46. package/dist/chunk-U3GHAOIJ.js +299 -0
  47. package/dist/chunk-U7N2A7A3.js +9 -0
  48. package/dist/chunk-UX634MYF.js +123 -0
  49. package/dist/chunk-V6UWJKZF.js +28 -0
  50. package/dist/chunk-VOHTRR5X.js +28 -0
  51. package/dist/chunk-WRFKVUPW.js +332 -0
  52. package/dist/chunk-WXW43RK5.js +24 -0
  53. package/dist/chunk-XG7XDYIM.js +60 -0
  54. package/dist/chunk-YFCQKO3B.js +842 -0
  55. package/dist/chunk-ZDWXGWLY.js +73 -0
  56. package/dist/chunk-ZLK5SPT6.js +11 -0
  57. package/dist/chunk-ZS6DTAM2.js +31 -0
  58. package/dist/chunk-ZT5UEUBO.js +1 -0
  59. package/dist/components/admin/index.d.ts +80 -0
  60. package/dist/components/admin/index.js +38 -0
  61. package/dist/components/data-display/badge.d.ts +12 -0
  62. package/dist/components/data-display/badge.js +3 -0
  63. package/dist/components/data-display/card.d.ts +87 -0
  64. package/dist/components/data-display/card.js +2 -0
  65. package/dist/components/data-display/index.d.ts +72 -0
  66. package/dist/components/data-display/index.js +89 -0
  67. package/dist/components/data-display/popover.d.ts +13 -0
  68. package/dist/components/data-display/popover.js +2 -0
  69. package/dist/components/data-display/scroll-area.d.ts +7 -0
  70. package/dist/components/data-display/scroll-area.js +2 -0
  71. package/dist/components/data-display/table.d.ts +10 -0
  72. package/dist/components/data-display/table.js +3 -0
  73. package/dist/components/data-entry/autocomplete.d.ts +16 -0
  74. package/dist/components/data-entry/autocomplete.js +8 -0
  75. package/dist/components/data-entry/calendar.d.ts +16 -0
  76. package/dist/components/data-entry/calendar.js +4 -0
  77. package/dist/components/data-entry/cascader.d.ts +32 -0
  78. package/dist/components/data-entry/cascader.js +13 -0
  79. package/dist/components/data-entry/checkbox.d.ts +13 -0
  80. package/dist/components/data-entry/checkbox.js +4 -0
  81. package/dist/components/data-entry/color-picker.d.ts +16 -0
  82. package/dist/components/data-entry/color-picker.js +6 -0
  83. package/dist/components/data-entry/command.d.ts +69 -0
  84. package/dist/components/data-entry/command.js +3 -0
  85. package/dist/components/data-entry/date-picker.d.ts +16 -0
  86. package/dist/components/data-entry/date-picker.js +8 -0
  87. package/dist/components/data-entry/date-range-picker.d.ts +16 -0
  88. package/dist/components/data-entry/date-range-picker.js +8 -0
  89. package/dist/components/data-entry/index.d.ts +53 -0
  90. package/dist/components/data-entry/index.js +152 -0
  91. package/dist/components/data-entry/input.d.ts +6 -0
  92. package/dist/components/data-entry/input.js +2 -0
  93. package/dist/components/data-entry/label.d.ts +8 -0
  94. package/dist/components/data-entry/label.js +2 -0
  95. package/dist/components/data-entry/radio.d.ts +24 -0
  96. package/dist/components/data-entry/radio.js +4 -0
  97. package/dist/components/data-entry/select.d.ts +18 -0
  98. package/dist/components/data-entry/select.js +3 -0
  99. package/dist/components/data-entry/slider.d.ts +16 -0
  100. package/dist/components/data-entry/slider.js +2 -0
  101. package/dist/components/data-entry/switch.d.ts +17 -0
  102. package/dist/components/data-entry/switch.js +2 -0
  103. package/dist/components/data-entry/textarea.d.ts +6 -0
  104. package/dist/components/data-entry/textarea.js +3 -0
  105. package/dist/components/data-entry/time-picker.d.ts +16 -0
  106. package/dist/components/data-entry/time-picker.js +7 -0
  107. package/dist/components/data-entry/transfer.d.ts +17 -0
  108. package/dist/components/data-entry/transfer.js +11 -0
  109. package/dist/components/data-entry/tree-select.d.ts +26 -0
  110. package/dist/components/data-entry/tree-select.js +13 -0
  111. package/dist/components/data-entry/upload.d.ts +42 -0
  112. package/dist/components/data-entry/upload.js +11 -0
  113. package/dist/components/feedback/alert.d.ts +60 -0
  114. package/dist/components/feedback/alert.js +7 -0
  115. package/dist/components/feedback/dialog.d.ts +64 -0
  116. package/dist/components/feedback/dialog.js +7 -0
  117. package/dist/components/feedback/index.d.ts +16 -0
  118. package/dist/components/feedback/index.js +14 -0
  119. package/dist/components/feedback/sheet.d.ts +24 -0
  120. package/dist/components/feedback/sheet.js +2 -0
  121. package/dist/components/feedback/sonner.d.ts +6 -0
  122. package/dist/components/feedback/sonner.js +1 -0
  123. package/dist/components/general/button.d.ts +20 -0
  124. package/dist/components/general/button.js +2 -0
  125. package/dist/components/general/index.d.ts +6 -0
  126. package/dist/components/general/index.js +2 -0
  127. package/dist/components/layout/index.d.ts +71 -0
  128. package/dist/components/layout/index.js +5 -0
  129. package/dist/components/navigation/dropdown-menu.d.ts +28 -0
  130. package/dist/components/navigation/dropdown-menu.js +2 -0
  131. package/dist/components/navigation/index.d.ts +32 -0
  132. package/dist/components/navigation/index.js +12 -0
  133. package/dist/components/navigation/pagination.d.ts +11 -0
  134. package/dist/components/navigation/pagination.js +7 -0
  135. package/dist/components/navigation/steps.d.ts +12 -0
  136. package/dist/components/navigation/steps.js +3 -0
  137. package/dist/components/navigation/tabs-items.d.ts +12 -0
  138. package/dist/components/navigation/tabs-items.js +3 -0
  139. package/dist/components/navigation/tabs.d.ts +12 -0
  140. package/dist/components/navigation/tabs.js +2 -0
  141. package/dist/components/query/index.d.ts +43 -0
  142. package/dist/components/query/index.js +8 -0
  143. package/dist/components/ui/index.d.ts +57 -0
  144. package/dist/components/ui/index.js +37 -0
  145. package/dist/content.prop-D1Dd3TAc.d.ts +31 -0
  146. package/dist/data-display.prop-DNTAzmDy.d.ts +58 -0
  147. package/dist/data-entry.prop-BEGA1lTq.d.ts +323 -0
  148. package/dist/data-table-D1u_rKLK.d.ts +83 -0
  149. package/dist/data.prop-BVvfKC_g.d.ts +41 -0
  150. package/dist/feedback.prop-BmxUlpAW.d.ts +64 -0
  151. package/dist/filter-bar-B7OGFO9S.d.ts +10 -0
  152. package/dist/form/index.d.ts +21 -0
  153. package/dist/form/index.js +4 -0
  154. package/dist/form.prop-BHgpuFFm.d.ts +41 -0
  155. package/dist/format-date-ByyZoqI5.d.ts +51 -0
  156. package/dist/general.prop-D7brMPNL.d.ts +16 -0
  157. package/dist/i18n/index.d.ts +217 -0
  158. package/dist/i18n/index.js +2 -0
  159. package/dist/index.d.ts +46 -26
  160. package/dist/index.js +39 -13062
  161. package/dist/inline-C5u6ptJV.d.ts +10 -0
  162. package/dist/interaction.prop-Cdn7wOtq.d.ts +25 -0
  163. package/dist/layout.prop-4TCNvyQZ.d.ts +20 -0
  164. package/dist/layout.prop-C795F0qg.d.ts +112 -0
  165. package/dist/lib/datetime/index.d.ts +31 -0
  166. package/dist/lib/datetime/index.js +1 -0
  167. package/dist/lib/utils.d.ts +5 -0
  168. package/dist/lib/utils.js +1 -0
  169. package/dist/navigation.prop-DpZqcXey.d.ts +78 -0
  170. package/dist/navigation.prop-DxBiClEH.d.ts +20 -0
  171. package/dist/props/components/index.d.ts +27 -0
  172. package/dist/props/components/index.js +1 -0
  173. package/dist/props/index.d.ts +28 -0
  174. package/dist/props/index.js +3 -0
  175. package/dist/props/registry.d.ts +649 -0
  176. package/dist/props/registry.js +1 -0
  177. package/dist/props/vocabulary/index.d.ts +7 -0
  178. package/dist/props/vocabulary/index.js +1 -0
  179. package/dist/query.prop-hIPrk2zI.d.ts +71 -0
  180. package/dist/search-input-uP01rY1L.d.ts +22 -0
  181. package/dist/shared.prop-BNRJc9K0.d.ts +45 -0
  182. package/dist/styles/alert-layout.css +191 -0
  183. package/dist/styles/badge-layout.css +22 -0
  184. package/dist/styles/card-layout.css +373 -0
  185. package/dist/styles/control.css +504 -0
  186. package/dist/styles/data-display-layout.css +246 -0
  187. package/dist/styles/density.css +43 -0
  188. package/dist/styles/dialog-layout.css +84 -0
  189. package/dist/styles/index.css +105 -0
  190. package/dist/styles/layout.css +479 -0
  191. package/dist/styles/shell-layout.css +604 -0
  192. package/dist/styles/table-layout.css +109 -0
  193. package/dist/theme/example.service.css +37 -0
  194. package/dist/tokens/base.css +13 -0
  195. package/dist/tokens/foundation.css +151 -0
  196. package/dist/tokens/primitives/badge.css +13 -0
  197. package/dist/tokens/primitives/card.css +29 -0
  198. package/dist/tokens/primitives/control.css +55 -0
  199. package/dist/tokens/primitives/feedback.css +17 -0
  200. package/dist/tokens/primitives/layout.css +20 -0
  201. package/dist/tokens/primitives/navigation.css +13 -0
  202. package/dist/tokens/primitives/table.css +10 -0
  203. package/dist/types-mvzYGrma.d.ts +37 -0
  204. package/dist/use-toast-Dol5bdY3.d.ts +34 -0
  205. package/package.json +279 -117
  206. package/scripts/ui-audit.mjs +179 -0
  207. package/BRAND.md +0 -296
  208. package/CHANGELOG.md +0 -668
  209. package/config/eslint.js +0 -54
  210. package/config/prettier.cjs +0 -20
  211. package/config/tsconfig.base.json +0 -22
  212. package/config/vitest.base.ts +0 -26
  213. package/dist/MiniMonth-YAmPGEpC.d.ts +0 -143
  214. package/dist/Table.types-BbsxoIYE.d.ts +0 -352
  215. package/dist/color-DO0qqUAb.d.ts +0 -38
  216. package/dist/components/composites.d.ts +0 -963
  217. package/dist/components/composites.js +0 -7343
  218. package/dist/components/composites.js.map +0 -1
  219. package/dist/components/primitives.d.ts +0 -2744
  220. package/dist/components/primitives.js +0 -7356
  221. package/dist/components/primitives.js.map +0 -1
  222. package/dist/components/shell.d.ts +0 -182
  223. package/dist/components/shell.js +0 -774
  224. package/dist/components/shell.js.map +0 -1
  225. package/dist/hooks.d.ts +0 -100
  226. package/dist/hooks.js +0 -558
  227. package/dist/hooks.js.map +0 -1
  228. package/dist/i18n.d.ts +0 -61
  229. package/dist/i18n.js +0 -860
  230. package/dist/i18n.js.map +0 -1
  231. package/dist/index.js.map +0 -1
  232. package/dist/padding-DY0JV5Ja.d.ts +0 -16
  233. package/dist/preferences.d.ts +0 -132
  234. package/dist/preferences.js +0 -262
  235. package/dist/preferences.js.map +0 -1
  236. package/dist/props.d.ts +0 -86
  237. package/dist/props.js +0 -16
  238. package/dist/props.js.map +0 -1
  239. package/dist/size-CQwNvOWd.d.ts +0 -19
  240. package/dist/types-LTj-2bl-.d.ts +0 -30
  241. package/dist/useTableViews-D5NIAJ7h.d.ts +0 -154
  242. package/src/tokens/tailwind.css +0 -158
@@ -0,0 +1,842 @@
1
+ import { ja as ja$1, enUS as enUS$1, vi as vi$1 } from 'date-fns/locale';
2
+ import { ja, enUS, vi } from 'react-day-picker/locale';
3
+ import { TZDate } from '@date-fns/tz';
4
+ import { parseISO, formatDistanceToNow, format } from 'date-fns';
5
+
6
+ // src/app/locales.ts
7
+ var APP_LOCALE_CONFIG = {
8
+ vi: { code: "vi", dateFns: vi$1, dayPicker: vi },
9
+ en: { code: "en", dateFns: enUS$1, dayPicker: enUS },
10
+ ja: { code: "ja", dateFns: ja$1, dayPicker: ja }
11
+ };
12
+ function isAppLocale(value) {
13
+ return value === "vi" || value === "en" || value === "ja";
14
+ }
15
+ function getDateFnsLocale(locale) {
16
+ return APP_LOCALE_CONFIG[locale].dateFns;
17
+ }
18
+ function getDayPickerLocale(locale) {
19
+ return APP_LOCALE_CONFIG[locale].dayPicker;
20
+ }
21
+
22
+ // src/app/time-formats.ts
23
+ var APP_TIME_FORMATS = ["24h", "12h"];
24
+ var APP_REQUEST_HEADER_TIME_FORMAT = "x-time-format";
25
+ function getTimePattern(timeFormat) {
26
+ return timeFormat === "24h" ? "HH:mm" : "h:mm a";
27
+ }
28
+ function isAppTimeFormat(value) {
29
+ return value === "24h" || value === "12h";
30
+ }
31
+
32
+ // src/app/date-formats.ts
33
+ var APP_DATE_FORMATS = ["iso", "dmy", "mdy"];
34
+ var APP_REQUEST_HEADER_DATE_FORMAT = "x-date-format";
35
+ function getDatePattern(dateFormat) {
36
+ switch (dateFormat) {
37
+ case "dmy":
38
+ return "dd/MM/yyyy";
39
+ case "mdy":
40
+ return "MM/dd/yyyy";
41
+ case "iso":
42
+ default:
43
+ return "yyyy-MM-dd";
44
+ }
45
+ }
46
+ function getDateTimePattern(timeFormat, dateFormat) {
47
+ return `${getDatePattern(dateFormat)} ${getTimePattern(timeFormat)}`;
48
+ }
49
+ function isAppDateFormat(value) {
50
+ return value === "iso" || value === "dmy" || value === "mdy";
51
+ }
52
+
53
+ // src/i18n/messages/en.json
54
+ var en_default = {
55
+ common: {
56
+ cancel: "Cancel",
57
+ continue: "Continue",
58
+ delete: "Delete",
59
+ error: "Something went wrong",
60
+ working: "Working\u2026",
61
+ retry: "Retry",
62
+ search: "Search",
63
+ clearSearch: "Clear search",
64
+ clearFilters: "Clear filters",
65
+ first: "First",
66
+ next: "Next \u2192",
67
+ selectedCount: "{count} selected",
68
+ typeToConfirm: "Type {phrase} to confirm"
69
+ },
70
+ dataEntry: {
71
+ datePicker: {
72
+ placeholder: "Select date"
73
+ },
74
+ dateRangePicker: {
75
+ placeholder: "Select date range"
76
+ },
77
+ timePicker: {
78
+ placeholder: "Select time",
79
+ hour: "Hour",
80
+ minute: "Minute",
81
+ typeLabel: "Type time HH:mm"
82
+ },
83
+ searchInput: {
84
+ placeholder: "Search\u2026"
85
+ },
86
+ autocomplete: {
87
+ placeholder: "Search or select\u2026",
88
+ empty: "No results found"
89
+ },
90
+ colorPicker: {
91
+ ariaLabel: "Pick color"
92
+ },
93
+ upload: {
94
+ dropzoneLabel: "Upload files",
95
+ dropzoneHint: "Drag and drop files here, or click to browse",
96
+ dropzoneMeta: "Uploads go to temp storage \u2014 promote on form save",
97
+ buttonLabel: "Choose file",
98
+ addImage: "Add image",
99
+ uploading: "Uploading\u2026",
100
+ pendingReplace: "New image",
101
+ pendingReplaceHint: "New image staged \u2014 save form to apply",
102
+ avatarLabel: "Profile photo",
103
+ change: "Change",
104
+ removeAvatar: "Remove photo",
105
+ markedForDelete: "Photo will be removed when you save",
106
+ undo: "Undo",
107
+ cropTitle: "Crop photo",
108
+ cropZoom: "Zoom",
109
+ cropConfirm: "Use photo"
110
+ },
111
+ cascader: {
112
+ placeholder: "Select\u2026",
113
+ searchPlaceholder: "Search\u2026",
114
+ empty: "No results"
115
+ },
116
+ treeSelect: {
117
+ placeholder: "Select\u2026",
118
+ searchPlaceholder: "Search\u2026",
119
+ empty: "No data",
120
+ expand: "Expand",
121
+ collapse: "Collapse"
122
+ },
123
+ transfer: {
124
+ source: "Source",
125
+ target: "Target",
126
+ searchPlaceholder: "Search\u2026",
127
+ empty: "No data",
128
+ moveRight: "Move to target",
129
+ moveLeft: "Move to source"
130
+ }
131
+ },
132
+ feedback: {
133
+ errorPanel: {
134
+ title: "Couldn't load this section"
135
+ },
136
+ genericError: "Something went wrong. Please retry."
137
+ },
138
+ navigation: {
139
+ localePicker: {
140
+ ariaLabel: "Language"
141
+ },
142
+ timezonePicker: {
143
+ ariaLabel: "Timezone"
144
+ },
145
+ timeFormatPicker: {
146
+ ariaLabel: "Time format"
147
+ },
148
+ dateFormatPicker: {
149
+ ariaLabel: "Date format"
150
+ },
151
+ pagination: {
152
+ ariaLabel: "Pagination",
153
+ prev: "Previous page",
154
+ next: "Next page",
155
+ page: "Page {page}",
156
+ pageSize: "Page size",
157
+ pageSizeOption: "{size} / page",
158
+ total: "Total {total} items"
159
+ }
160
+ },
161
+ locale: {
162
+ vi: "Ti\u1EBFng Vi\u1EC7t",
163
+ en: "English",
164
+ ja: "\u65E5\u672C\u8A9E"
165
+ },
166
+ timeFormat: {
167
+ "24h": "24-hour",
168
+ "12h": "12-hour (AM/PM)"
169
+ },
170
+ dateFormat: {
171
+ iso: "ISO (yyyy-MM-dd)",
172
+ dmy: "Day / Month / Year",
173
+ mdy: "Month / Day / Year"
174
+ },
175
+ timezone: {
176
+ "Asia/Ho_Chi_Minh": "Vietnam (Ho Chi Minh)",
177
+ "Asia/Tokyo": "Japan (Tokyo)",
178
+ "Asia/Bangkok": "Thailand (Bangkok)",
179
+ "Asia/Singapore": "Singapore",
180
+ "Asia/Seoul": "Korea (Seoul)",
181
+ "Asia/Shanghai": "China (Shanghai)",
182
+ "Asia/Taipei": "Taiwan (Taipei)",
183
+ "Asia/Hong_Kong": "Hong Kong",
184
+ UTC: "UTC",
185
+ "Europe/London": "UK (London)",
186
+ "America/Los_Angeles": "US (Los Angeles)",
187
+ "America/New_York": "US (New York)"
188
+ },
189
+ dataTable: {
190
+ selectAll: "Select all rows",
191
+ selectRow: "Select row {id}",
192
+ bulkActions: "Bulk actions",
193
+ densityCompact: "Compact",
194
+ densityComfortable: "Comfortable",
195
+ densitySwitch: "Switch to {density} density",
196
+ rowActions: "Row actions"
197
+ },
198
+ status: {
199
+ active: "Active",
200
+ completed: "Completed",
201
+ delivered: "Delivered",
202
+ done: "Done",
203
+ permanent: "Permanent",
204
+ succeeded: "Succeeded",
205
+ draft: "Draft",
206
+ pending: "Pending",
207
+ scheduled: "Scheduled",
208
+ sending: "Sending",
209
+ temporary: "Temporary",
210
+ bounced: "Bounced",
211
+ cancelled: "Cancelled",
212
+ deleted: "Deleted",
213
+ failed: "Failed",
214
+ private: "Private",
215
+ internal: "Internal",
216
+ public: "Public",
217
+ ASSIGNMENT_STATUS_ACTIVE: "Active",
218
+ ASSIGNMENT_STATUS_SUSPENDED: "Suspended",
219
+ ASSIGNMENT_STATUS_TERMINATED: "Terminated"
220
+ },
221
+ query: {
222
+ loadMore: "Load more"
223
+ }
224
+ };
225
+
226
+ // src/i18n/messages/ja.json
227
+ var ja_default = {
228
+ common: {
229
+ cancel: "\u30AD\u30E3\u30F3\u30BB\u30EB",
230
+ continue: "\u7D9A\u884C",
231
+ delete: "\u524A\u9664",
232
+ error: "\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F",
233
+ working: "\u51E6\u7406\u4E2D\u2026",
234
+ retry: "\u518D\u8A66\u884C",
235
+ search: "\u691C\u7D22",
236
+ clearSearch: "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
237
+ clearFilters: "\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u30AF\u30EA\u30A2",
238
+ first: "\u6700\u521D",
239
+ next: "\u6B21\u3078 \u2192",
240
+ selectedCount: "{count} \u4EF6\u9078\u629E",
241
+ typeToConfirm: "\u78BA\u8A8D\u306E\u305F\u3081 {phrase} \u3068\u5165\u529B"
242
+ },
243
+ dataEntry: {
244
+ datePicker: {
245
+ placeholder: "\u65E5\u4ED8\u3092\u9078\u629E"
246
+ },
247
+ dateRangePicker: {
248
+ placeholder: "\u671F\u9593\u3092\u9078\u629E"
249
+ },
250
+ timePicker: {
251
+ placeholder: "\u6642\u523B\u3092\u9078\u629E",
252
+ hour: "\u6642",
253
+ minute: "\u5206",
254
+ typeLabel: "HH:mm \u3092\u5165\u529B"
255
+ },
256
+ searchInput: {
257
+ placeholder: "\u691C\u7D22\u2026"
258
+ },
259
+ autocomplete: {
260
+ placeholder: "\u691C\u7D22\u307E\u305F\u306F\u9078\u629E\u2026",
261
+ empty: "\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"
262
+ },
263
+ colorPicker: {
264
+ ariaLabel: "\u8272\u3092\u9078\u629E"
265
+ },
266
+ upload: {
267
+ dropzoneLabel: "\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",
268
+ dropzoneHint: "\u3053\u3053\u306B\u30C9\u30E9\u30C3\u30B0\uFF06\u30C9\u30ED\u30C3\u30D7\u3001\u307E\u305F\u306F\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u9078\u629E",
269
+ dropzoneMeta: "\u4E00\u6642\u30B9\u30C8\u30EC\u30FC\u30B8\u306B\u4FDD\u5B58 \u2014 \u30D5\u30A9\u30FC\u30E0\u4FDD\u5B58\u6642\u306B promote",
270
+ buttonLabel: "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E",
271
+ addImage: "\u753B\u50CF\u3092\u8FFD\u52A0",
272
+ uploading: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u4E2D\u2026",
273
+ pendingReplace: "\u65B0\u3057\u3044\u753B\u50CF",
274
+ pendingReplaceHint: "\u65B0\u3057\u3044\u753B\u50CF\u3092\u4FDD\u7559\u4E2D \u2014 \u4FDD\u5B58\u3067\u53CD\u6620",
275
+ avatarLabel: "\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB\u5199\u771F",
276
+ change: "\u5909\u66F4",
277
+ removeAvatar: "\u5199\u771F\u3092\u524A\u9664",
278
+ markedForDelete: "\u4FDD\u5B58\u6642\u306B\u5199\u771F\u304C\u524A\u9664\u3055\u308C\u307E\u3059",
279
+ undo: "\u5143\u306B\u623B\u3059",
280
+ cropTitle: "\u5199\u771F\u3092\u5207\u308A\u629C\u304D",
281
+ cropZoom: "\u30BA\u30FC\u30E0",
282
+ cropConfirm: "\u3053\u306E\u5199\u771F\u3092\u4F7F\u7528"
283
+ },
284
+ cascader: {
285
+ placeholder: "\u9078\u629E\u2026",
286
+ searchPlaceholder: "\u691C\u7D22\u2026",
287
+ empty: "\u7D50\u679C\u306A\u3057"
288
+ },
289
+ treeSelect: {
290
+ placeholder: "\u9078\u629E\u2026",
291
+ searchPlaceholder: "\u691C\u7D22\u2026",
292
+ empty: "\u30C7\u30FC\u30BF\u306A\u3057",
293
+ expand: "\u5C55\u958B",
294
+ collapse: "\u6298\u308A\u305F\u305F\u3080"
295
+ },
296
+ transfer: {
297
+ source: "\u30BD\u30FC\u30B9",
298
+ target: "\u30BF\u30FC\u30B2\u30C3\u30C8",
299
+ searchPlaceholder: "\u691C\u7D22\u2026",
300
+ empty: "\u30C7\u30FC\u30BF\u306A\u3057",
301
+ moveRight: "\u30BF\u30FC\u30B2\u30C3\u30C8\u3078\u79FB\u52D5",
302
+ moveLeft: "\u30BD\u30FC\u30B9\u3078\u623B\u3059"
303
+ }
304
+ },
305
+ feedback: {
306
+ errorPanel: {
307
+ title: "\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F"
308
+ },
309
+ genericError: "\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"
310
+ },
311
+ navigation: {
312
+ localePicker: {
313
+ ariaLabel: "\u8A00\u8A9E"
314
+ },
315
+ timezonePicker: {
316
+ ariaLabel: "\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3"
317
+ },
318
+ timeFormatPicker: {
319
+ ariaLabel: "\u6642\u523B\u5F62\u5F0F"
320
+ },
321
+ dateFormatPicker: {
322
+ ariaLabel: "\u65E5\u4ED8\u5F62\u5F0F"
323
+ },
324
+ pagination: {
325
+ ariaLabel: "\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3",
326
+ prev: "\u524D\u306E\u30DA\u30FC\u30B8",
327
+ next: "\u6B21\u306E\u30DA\u30FC\u30B8",
328
+ page: "\u30DA\u30FC\u30B8 {page}",
329
+ pageSize: "\u30DA\u30FC\u30B8\u30B5\u30A4\u30BA",
330
+ pageSizeOption: "{size} / \u30DA\u30FC\u30B8",
331
+ total: "\u5168 {total} \u4EF6"
332
+ }
333
+ },
334
+ locale: {
335
+ vi: "Ti\u1EBFng Vi\u1EC7t",
336
+ en: "English",
337
+ ja: "\u65E5\u672C\u8A9E"
338
+ },
339
+ timeFormat: {
340
+ "24h": "24\u6642\u9593",
341
+ "12h": "12\u6642\u9593 (\u5348\u524D/\u5348\u5F8C)"
342
+ },
343
+ dateFormat: {
344
+ iso: "YYYY-MM-DD\uFF08\u5E74-\u6708-\u65E5\uFF09",
345
+ dmy: "\u65E5/\u6708/\u5E74",
346
+ mdy: "\u6708/\u65E5/\u5E74"
347
+ },
348
+ timezone: {
349
+ "Asia/Ho_Chi_Minh": "\u30D9\u30C8\u30CA\u30E0\uFF08\u30DB\u30FC\u30C1\u30DF\u30F3\uFF09",
350
+ "Asia/Tokyo": "\u65E5\u672C\uFF08\u6771\u4EAC\uFF09",
351
+ "Asia/Bangkok": "\u30BF\u30A4\uFF08\u30D0\u30F3\u30B3\u30AF\uFF09",
352
+ "Asia/Singapore": "\u30B7\u30F3\u30AC\u30DD\u30FC\u30EB",
353
+ "Asia/Seoul": "\u97D3\u56FD\uFF08\u30BD\u30A6\u30EB\uFF09",
354
+ "Asia/Shanghai": "\u4E2D\u56FD\uFF08\u4E0A\u6D77\uFF09",
355
+ "Asia/Taipei": "\u53F0\u6E7E\uFF08\u53F0\u5317\uFF09",
356
+ "Asia/Hong_Kong": "\u9999\u6E2F",
357
+ UTC: "UTC",
358
+ "Europe/London": "\u82F1\u56FD\uFF08\u30ED\u30F3\u30C9\u30F3\uFF09",
359
+ "America/Los_Angeles": "\u7C73\u56FD\uFF08\u30ED\u30B5\u30F3\u30BC\u30EB\u30B9\uFF09",
360
+ "America/New_York": "\u7C73\u56FD\uFF08\u30CB\u30E5\u30FC\u30E8\u30FC\u30AF\uFF09"
361
+ },
362
+ dataTable: {
363
+ selectAll: "\u3059\u3079\u3066\u306E\u884C\u3092\u9078\u629E",
364
+ selectRow: "\u884C {id} \u3092\u9078\u629E",
365
+ bulkActions: "\u4E00\u62EC\u64CD\u4F5C",
366
+ densityCompact: "\u30B3\u30F3\u30D1\u30AF\u30C8",
367
+ densityComfortable: "\u5FEB\u9069",
368
+ densitySwitch: "{density} \u8868\u793A\u306B\u5207\u308A\u66FF\u3048",
369
+ rowActions: "\u884C\u306E\u64CD\u4F5C"
370
+ },
371
+ status: {
372
+ active: "\u6709\u52B9",
373
+ completed: "\u5B8C\u4E86",
374
+ delivered: "\u914D\u9054\u6E08\u307F",
375
+ done: "\u5B8C\u4E86",
376
+ permanent: "\u6C38\u4E45",
377
+ succeeded: "\u6210\u529F",
378
+ draft: "\u4E0B\u66F8\u304D",
379
+ pending: "\u4FDD\u7559",
380
+ scheduled: "\u4E88\u5B9A",
381
+ sending: "\u9001\u4FE1\u4E2D",
382
+ temporary: "\u4E00\u6642",
383
+ bounced: "\u30D0\u30A6\u30F3\u30B9",
384
+ cancelled: "\u30AD\u30E3\u30F3\u30BB\u30EB",
385
+ deleted: "\u524A\u9664\u6E08\u307F",
386
+ failed: "\u5931\u6557",
387
+ private: "\u975E\u516C\u958B",
388
+ internal: "\u5185\u90E8",
389
+ public: "\u516C\u958B",
390
+ ASSIGNMENT_STATUS_ACTIVE: "\u6709\u52B9",
391
+ ASSIGNMENT_STATUS_SUSPENDED: "\u505C\u6B62",
392
+ ASSIGNMENT_STATUS_TERMINATED: "\u7D42\u4E86"
393
+ },
394
+ query: {
395
+ loadMore: "\u3055\u3089\u306B\u8AAD\u307F\u8FBC\u3080"
396
+ }
397
+ };
398
+
399
+ // src/i18n/messages/vi.json
400
+ var vi_default = {
401
+ common: {
402
+ cancel: "H\u1EE7y",
403
+ continue: "Ti\u1EBFp t\u1EE5c",
404
+ delete: "X\xF3a",
405
+ error: "\u0110\xE3 x\u1EA3y ra l\u1ED7i",
406
+ working: "\u0110ang x\u1EED l\xFD\u2026",
407
+ retry: "Th\u1EED l\u1EA1i",
408
+ search: "T\xECm ki\u1EBFm",
409
+ clearSearch: "X\xF3a t\xECm ki\u1EBFm",
410
+ clearFilters: "X\xF3a b\u1ED9 l\u1ECDc",
411
+ first: "\u0110\u1EA7u",
412
+ next: "Ti\u1EBFp \u2192",
413
+ selectedCount: "{count} \u0111\xE3 ch\u1ECDn",
414
+ typeToConfirm: "Nh\u1EADp {phrase} \u0111\u1EC3 x\xE1c nh\u1EADn"
415
+ },
416
+ dataEntry: {
417
+ datePicker: {
418
+ placeholder: "Ch\u1ECDn ng\xE0y"
419
+ },
420
+ dateRangePicker: {
421
+ placeholder: "Ch\u1ECDn kho\u1EA3ng ng\xE0y"
422
+ },
423
+ timePicker: {
424
+ placeholder: "Ch\u1ECDn gi\u1EDD",
425
+ hour: "Gi\u1EDD",
426
+ minute: "Ph\xFAt",
427
+ typeLabel: "Nh\u1EADp gi\u1EDD HH:mm"
428
+ },
429
+ searchInput: {
430
+ placeholder: "T\xECm ki\u1EBFm\u2026"
431
+ },
432
+ autocomplete: {
433
+ placeholder: "T\xECm ho\u1EB7c ch\u1ECDn\u2026",
434
+ empty: "Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3"
435
+ },
436
+ colorPicker: {
437
+ ariaLabel: "Ch\u1ECDn m\xE0u"
438
+ },
439
+ upload: {
440
+ dropzoneLabel: "T\u1EA3i file l\xEAn",
441
+ dropzoneHint: "K\xE9o th\u1EA3 file v\xE0o \u0111\xE2y, ho\u1EB7c b\u1EA5m \u0111\u1EC3 ch\u1ECDn",
442
+ dropzoneMeta: "Upload v\xE0o temp \u2014 promote khi l\u01B0u form",
443
+ buttonLabel: "Ch\u1ECDn file",
444
+ addImage: "Th\xEAm \u1EA3nh",
445
+ uploading: "\u0110ang t\u1EA3i l\xEAn\u2026",
446
+ pendingReplace: "\u1EA2nh m\u1EDBi",
447
+ pendingReplaceHint: "\u1EA2nh m\u1EDBi \u0111ang ch\u1EDD \u2014 l\u01B0u form \u0111\u1EC3 \xE1p d\u1EE5ng",
448
+ avatarLabel: "\u1EA2nh \u0111\u1EA1i di\u1EC7n",
449
+ change: "\u0110\u1ED5i",
450
+ removeAvatar: "X\xF3a \u1EA3nh",
451
+ markedForDelete: "\u1EA2nh s\u1EBD b\u1ECB x\xF3a khi b\u1EA1n l\u01B0u",
452
+ undo: "Ho\xE0n t\xE1c",
453
+ cropTitle: "C\u1EAFt \u1EA3nh",
454
+ cropZoom: "Thu ph\xF3ng",
455
+ cropConfirm: "D\xF9ng \u1EA3nh n\xE0y"
456
+ },
457
+ cascader: {
458
+ placeholder: "Ch\u1ECDn\u2026",
459
+ searchPlaceholder: "T\xECm ki\u1EBFm\u2026",
460
+ empty: "Kh\xF4ng c\xF3 k\u1EBFt qu\u1EA3"
461
+ },
462
+ treeSelect: {
463
+ placeholder: "Ch\u1ECDn\u2026",
464
+ searchPlaceholder: "T\xECm ki\u1EBFm\u2026",
465
+ empty: "Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",
466
+ expand: "M\u1EDF r\u1ED9ng",
467
+ collapse: "Thu g\u1ECDn"
468
+ },
469
+ transfer: {
470
+ source: "Ngu\u1ED3n",
471
+ target: "\u0110\xEDch",
472
+ searchPlaceholder: "T\xECm ki\u1EBFm\u2026",
473
+ empty: "Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",
474
+ moveRight: "Chuy\u1EC3n sang \u0111\xEDch",
475
+ moveLeft: "Chuy\u1EC3n v\u1EC1 ngu\u1ED3n"
476
+ }
477
+ },
478
+ feedback: {
479
+ errorPanel: {
480
+ title: "Kh\xF4ng t\u1EA3i \u0111\u01B0\u1EE3c n\u1ED9i dung n\xE0y"
481
+ },
482
+ genericError: "\u0110\xE3 x\u1EA3y ra l\u1ED7i. Vui l\xF2ng th\u1EED l\u1EA1i."
483
+ },
484
+ navigation: {
485
+ localePicker: {
486
+ ariaLabel: "Ng\xF4n ng\u1EEF"
487
+ },
488
+ timezonePicker: {
489
+ ariaLabel: "M\xFAi gi\u1EDD"
490
+ },
491
+ timeFormatPicker: {
492
+ ariaLabel: "\u0110\u1ECBnh d\u1EA1ng gi\u1EDD"
493
+ },
494
+ dateFormatPicker: {
495
+ ariaLabel: "\u0110\u1ECBnh d\u1EA1ng ng\xE0y"
496
+ },
497
+ pagination: {
498
+ ariaLabel: "Ph\xE2n trang",
499
+ prev: "Trang tr\u01B0\u1EDBc",
500
+ next: "Trang sau",
501
+ page: "Trang {page}",
502
+ pageSize: "S\u1ED1 d\xF2ng m\u1ED7i trang",
503
+ pageSizeOption: "{size} / trang",
504
+ total: "T\u1ED5ng {total} m\u1EE5c"
505
+ }
506
+ },
507
+ locale: {
508
+ vi: "Ti\u1EBFng Vi\u1EC7t",
509
+ en: "English",
510
+ ja: "\u65E5\u672C\u8A9E"
511
+ },
512
+ timeFormat: {
513
+ "24h": "24 gi\u1EDD",
514
+ "12h": "12 gi\u1EDD (SA/CH)"
515
+ },
516
+ dateFormat: {
517
+ iso: "ISO (yyyy-MM-dd)",
518
+ dmy: "Ng\xE0y / Th\xE1ng / N\u0103m",
519
+ mdy: "Th\xE1ng / Ng\xE0y / N\u0103m"
520
+ },
521
+ timezone: {
522
+ "Asia/Ho_Chi_Minh": "Vi\u1EC7t Nam (HCM)",
523
+ "Asia/Tokyo": "Nh\u1EADt B\u1EA3n (Tokyo)",
524
+ "Asia/Bangkok": "Th\xE1i Lan (Bangkok)",
525
+ "Asia/Singapore": "Singapore",
526
+ "Asia/Seoul": "H\xE0n Qu\u1ED1c (Seoul)",
527
+ "Asia/Shanghai": "Trung Qu\u1ED1c (Shanghai)",
528
+ "Asia/Taipei": "\u0110\xE0i Loan (Taipei)",
529
+ "Asia/Hong_Kong": "H\u1ED3ng K\xF4ng",
530
+ UTC: "UTC",
531
+ "Europe/London": "Anh (London)",
532
+ "America/Los_Angeles": "M\u1EF9 (Los Angeles)",
533
+ "America/New_York": "M\u1EF9 (New York)"
534
+ },
535
+ dataTable: {
536
+ selectAll: "Ch\u1ECDn t\u1EA5t c\u1EA3 c\xE1c d\xF2ng",
537
+ selectRow: "Ch\u1ECDn d\xF2ng {id}",
538
+ bulkActions: "Thao t\xE1c h\xE0ng lo\u1EA1t",
539
+ densityCompact: "G\u1ECDn",
540
+ densityComfortable: "Tho\u1EA3i m\xE1i",
541
+ densitySwitch: "Chuy\u1EC3n sang m\u1EADt \u0111\u1ED9 {density}",
542
+ rowActions: "Thao t\xE1c d\xF2ng"
543
+ },
544
+ status: {
545
+ active: "\u0110ang ho\u1EA1t \u0111\u1ED9ng",
546
+ completed: "Ho\xE0n th\xE0nh",
547
+ delivered: "\u0110\xE3 giao",
548
+ done: "Xong",
549
+ permanent: "V\u0129nh vi\u1EC5n",
550
+ succeeded: "Th\xE0nh c\xF4ng",
551
+ draft: "Nh\xE1p",
552
+ pending: "Ch\u1EDD x\u1EED l\xFD",
553
+ scheduled: "\u0110\xE3 l\xEAn l\u1ECBch",
554
+ sending: "\u0110ang g\u1EEDi",
555
+ temporary: "T\u1EA1m th\u1EDDi",
556
+ bounced: "B\u1ECB tr\u1EA3 l\u1EA1i",
557
+ cancelled: "\u0110\xE3 h\u1EE7y",
558
+ deleted: "\u0110\xE3 x\xF3a",
559
+ failed: "Th\u1EA5t b\u1EA1i",
560
+ private: "Ri\xEAng t\u01B0",
561
+ internal: "N\u1ED9i b\u1ED9",
562
+ public: "C\xF4ng khai",
563
+ ASSIGNMENT_STATUS_ACTIVE: "\u0110ang ho\u1EA1t \u0111\u1ED9ng",
564
+ ASSIGNMENT_STATUS_SUSPENDED: "T\u1EA1m ng\u01B0ng",
565
+ ASSIGNMENT_STATUS_TERMINATED: "Ch\u1EA5m d\u1EE9t"
566
+ },
567
+ query: {
568
+ loadMore: "T\u1EA3i th\xEAm"
569
+ }
570
+ };
571
+
572
+ // src/i18n/translate.ts
573
+ var MESSAGE_CATALOG = {
574
+ vi: vi_default,
575
+ en: en_default,
576
+ ja: ja_default
577
+ };
578
+ function getNested(obj, path) {
579
+ const parts = path.split(".");
580
+ let current = obj;
581
+ for (const part of parts) {
582
+ if (current == null || typeof current !== "object") return void 0;
583
+ current = current[part];
584
+ }
585
+ return typeof current === "string" ? current : void 0;
586
+ }
587
+ function interpolate(template, params) {
588
+ if (!params) return template;
589
+ return Object.entries(params).reduce(
590
+ (text, [key, value]) => text.replaceAll(`{${key}}`, String(value)),
591
+ template
592
+ );
593
+ }
594
+ function translate(locale, fallbackLocale, key, params) {
595
+ const primary = getNested(MESSAGE_CATALOG[locale], key);
596
+ const fallback = getNested(MESSAGE_CATALOG[fallbackLocale], key);
597
+ const text = primary ?? fallback ?? key;
598
+ return interpolate(text, params);
599
+ }
600
+ function translateCurrent(key, params) {
601
+ return translate(getSyncedLocale(), getSyncedFallbackLocale(), key, params);
602
+ }
603
+ var syncedLocale = "vi";
604
+ var syncedFallbackLocale = "en";
605
+ function syncI18nLocale(locale, fallbackLocale) {
606
+ syncedLocale = locale;
607
+ syncedFallbackLocale = fallbackLocale;
608
+ }
609
+ function getSyncedLocale() {
610
+ return syncedLocale;
611
+ }
612
+ function getSyncedFallbackLocale() {
613
+ return syncedFallbackLocale;
614
+ }
615
+ function resetI18nLocale() {
616
+ syncedLocale = "vi";
617
+ syncedFallbackLocale = "en";
618
+ }
619
+
620
+ // src/app/date-format-labels.ts
621
+ var APP_DATE_FORMAT_OPTIONS = APP_DATE_FORMATS.map((value) => ({ value }));
622
+ function getDateFormatLabel(dateFormat, locale, fallbackLocale = "en") {
623
+ return translate(locale, fallbackLocale, `dateFormat.${dateFormat}`);
624
+ }
625
+ function resolveDefaultDateFormat(locale) {
626
+ if (locale === "en") return "mdy";
627
+ if (locale === "ja") return "iso";
628
+ return "dmy";
629
+ }
630
+
631
+ // src/lib/datetime/sync.ts
632
+ var DEFAULT_LOCALE = "vi";
633
+ var defaultContext = () => ({
634
+ locale: DEFAULT_LOCALE,
635
+ dateFnsLocale: getDateFnsLocale(DEFAULT_LOCALE),
636
+ timezone: "Asia/Ho_Chi_Minh",
637
+ timeFormat: "24h",
638
+ dateFormat: resolveDefaultDateFormat(DEFAULT_LOCALE)
639
+ });
640
+ var syncedContext = defaultContext();
641
+ function syncDatetimeContext(partial) {
642
+ syncedContext = {
643
+ locale: partial.locale,
644
+ timezone: partial.timezone,
645
+ timeFormat: partial.timeFormat,
646
+ dateFormat: partial.dateFormat,
647
+ dateFnsLocale: partial.dateFnsLocale ?? getDateFnsLocale(partial.locale)
648
+ };
649
+ }
650
+ function getDatetimeContext() {
651
+ return syncedContext;
652
+ }
653
+ function resetDatetimeContextForTests() {
654
+ syncedContext = defaultContext();
655
+ }
656
+
657
+ // src/lib/datetime/detect.ts
658
+ var DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
659
+ function detectFormatDateKind(value) {
660
+ if (value instanceof Date) return "datetime";
661
+ const trimmed = value.trim();
662
+ if (isValidHhmm(trimmed)) return "time";
663
+ if (DATE_ONLY_RE.test(trimmed)) return "date";
664
+ return "datetime";
665
+ }
666
+ function isDateOnlyString(value) {
667
+ return DATE_ONLY_RE.test(value.trim());
668
+ }
669
+
670
+ // src/lib/datetime/parse.ts
671
+ function parseDateInput(value) {
672
+ if (value == null) return null;
673
+ if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value;
674
+ const trimmed = value.trim();
675
+ if (isDateOnlyString(trimmed)) {
676
+ const [year, month, day] = trimmed.split("-").map(Number);
677
+ return new Date(year, month - 1, day);
678
+ }
679
+ const parsed = parseISO(trimmed);
680
+ return Number.isNaN(parsed.getTime()) ? null : parsed;
681
+ }
682
+ function calendarDateToTZDate(date, timezone) {
683
+ return new TZDate(date.getFullYear(), date.getMonth(), date.getDate(), timezone);
684
+ }
685
+ var HHMM_RE = /^([01]?\d|2[0-3]):([0-5]\d)$/;
686
+ function isValidHhmm(value) {
687
+ return HHMM_RE.test(value.trim());
688
+ }
689
+ function normalizeHhmm(value) {
690
+ const trimmed = value.trim();
691
+ if (isValidHhmm(trimmed)) {
692
+ const [h, m] = trimmed.split(":");
693
+ return `${h.padStart(2, "0")}:${m}`;
694
+ }
695
+ const loose = /^(\d{1,2}):(\d{2})$/.exec(trimmed);
696
+ if (!loose) return null;
697
+ const hours = Number(loose[1]);
698
+ const minutes = Number(loose[2]);
699
+ if (hours > 23 || minutes > 59) return null;
700
+ return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}`;
701
+ }
702
+ function hhmmToTZDate(hhmm, timezone) {
703
+ const normalized = normalizeHhmm(hhmm);
704
+ if (!normalized) return null;
705
+ const [h, m] = normalized.split(":").map(Number);
706
+ const today = TZDate.tz(timezone);
707
+ return new TZDate(today.getFullYear(), today.getMonth(), today.getDate(), h, m, 0, 0, timezone);
708
+ }
709
+ function resolveLocale(locale) {
710
+ if (!locale) return getDatetimeContext().dateFnsLocale;
711
+ if (typeof locale === "string") return getDateFnsLocale(locale);
712
+ return locale;
713
+ }
714
+ function resolveOptions(options) {
715
+ const ctx = getDatetimeContext();
716
+ return {
717
+ locale: resolveLocale(options?.locale),
718
+ timezone: options?.timezone ?? ctx.timezone,
719
+ timeFormat: options?.timeFormat ?? ctx.timeFormat,
720
+ dateFormat: options?.dateFormat ?? ctx.dateFormat
721
+ };
722
+ }
723
+ function formatTZDate(zoned, pattern, options) {
724
+ return format(zoned, pattern, { locale: options.locale });
725
+ }
726
+ function instantToTZDate(value, timezone) {
727
+ return new TZDate(value, timezone);
728
+ }
729
+ var EMPTY = "\u2014";
730
+ function formatCalendarDate(value, options) {
731
+ if (!value) return EMPTY;
732
+ const resolved = resolveOptions(options);
733
+ const zoned = calendarDateToTZDate(value, resolved.timezone);
734
+ return formatTZDate(zoned, getDatePattern(resolved.dateFormat), resolved);
735
+ }
736
+ function formatAppDate(value, options) {
737
+ const resolved = resolveOptions(options);
738
+ if (typeof value === "string" && isDateOnlyString(value)) {
739
+ const [year, month, day] = value.split("-").map(Number);
740
+ const zoned2 = new TZDate(year, month - 1, day, resolved.timezone);
741
+ return formatTZDate(zoned2, getDatePattern(resolved.dateFormat), resolved);
742
+ }
743
+ const parsed = parseDateInput(value);
744
+ if (!parsed) return EMPTY;
745
+ const zoned = instantToTZDate(parsed, resolved.timezone);
746
+ return formatTZDate(zoned, getDatePattern(resolved.dateFormat), resolved);
747
+ }
748
+ function formatAppDateTime(value, options) {
749
+ const parsed = parseDateInput(value);
750
+ if (!parsed) return EMPTY;
751
+ const resolved = resolveOptions(options);
752
+ const zoned = instantToTZDate(parsed, resolved.timezone);
753
+ return formatTZDate(
754
+ zoned,
755
+ getDateTimePattern(resolved.timeFormat, resolved.dateFormat),
756
+ resolved
757
+ );
758
+ }
759
+ function formatAppTime(value, options) {
760
+ const parsed = parseDateInput(value);
761
+ if (!parsed) return EMPTY;
762
+ const resolved = resolveOptions(options);
763
+ const zoned = instantToTZDate(parsed, resolved.timezone);
764
+ return formatTZDate(zoned, getTimePattern(resolved.timeFormat), resolved);
765
+ }
766
+ function formatAppDateLong(value, options) {
767
+ const parsed = parseDateInput(value);
768
+ if (!parsed) return EMPTY;
769
+ const resolved = resolveOptions(options);
770
+ const zoned = instantToTZDate(parsed, resolved.timezone);
771
+ return formatTZDate(zoned, "PPP", resolved);
772
+ }
773
+ function formatAppRelative(value, options) {
774
+ const parsed = parseDateInput(value);
775
+ if (!parsed) return EMPTY;
776
+ const locale = resolveLocale(options?.locale);
777
+ return formatDistanceToNow(parsed, { addSuffix: true, locale });
778
+ }
779
+ function formatTimeOfDay(hhmm, options) {
780
+ if (!hhmm) return EMPTY;
781
+ const resolved = resolveOptions(options);
782
+ const zoned = hhmmToTZDate(hhmm, resolved.timezone);
783
+ if (!zoned) return hhmm;
784
+ return formatTZDate(zoned, getTimePattern(resolved.timeFormat), resolved);
785
+ }
786
+
787
+ // src/lib/datetime/format-date.ts
788
+ var EMPTY2 = "\u2014";
789
+ function resolveKind(value, options) {
790
+ if (options?.kind && options.kind !== "auto") return options.kind;
791
+ if (options?.calendar && value instanceof Date) return "calendar";
792
+ return detectFormatDateKind(value);
793
+ }
794
+ function formatDate(value, options) {
795
+ if (value == null || value === "") return EMPTY2;
796
+ if (typeof value === "string") {
797
+ const trimmed = value.trim();
798
+ if (!trimmed) return EMPTY2;
799
+ const kind2 = resolveKind(trimmed, options);
800
+ switch (kind2) {
801
+ case "time":
802
+ return isValidHhmm(trimmed) ? formatTimeOfDay(trimmed, options) : formatAppTime(trimmed, options);
803
+ case "date":
804
+ return formatAppDate(trimmed, options);
805
+ case "long":
806
+ return formatAppDateLong(trimmed, options);
807
+ case "relative":
808
+ return formatAppRelative(trimmed, options);
809
+ case "calendar":
810
+ case "datetime":
811
+ default:
812
+ return formatAppDateTime(trimmed, options);
813
+ }
814
+ }
815
+ if (!(value instanceof Date) || Number.isNaN(value.getTime())) return EMPTY2;
816
+ const kind = resolveKind(value, options);
817
+ switch (kind) {
818
+ case "calendar":
819
+ return formatCalendarDate(value, options);
820
+ case "date":
821
+ return formatCalendarDate(value, options);
822
+ case "time":
823
+ return formatAppTime(value, options);
824
+ case "long":
825
+ return formatAppDateLong(value, options);
826
+ case "relative":
827
+ return formatAppRelative(value, options);
828
+ case "datetime":
829
+ default:
830
+ return formatAppDateTime(value, options);
831
+ }
832
+ }
833
+ function isFormatDateValue(value) {
834
+ if (value instanceof Date) return !Number.isNaN(value.getTime());
835
+ if (typeof value !== "string") return false;
836
+ const trimmed = value.trim();
837
+ if (!trimmed) return false;
838
+ if (isValidHhmm(trimmed)) return true;
839
+ return parseDateInput(trimmed) != null;
840
+ }
841
+
842
+ export { APP_DATE_FORMATS, APP_DATE_FORMAT_OPTIONS, APP_LOCALE_CONFIG, APP_REQUEST_HEADER_DATE_FORMAT, APP_REQUEST_HEADER_TIME_FORMAT, APP_TIME_FORMATS, MESSAGE_CATALOG, calendarDateToTZDate, detectFormatDateKind, formatAppDate, formatAppDateLong, formatAppDateTime, formatAppRelative, formatAppTime, formatCalendarDate, formatDate, formatTimeOfDay, getDateFnsLocale, getDateFormatLabel, getDatePattern, getDateTimePattern, getDatetimeContext, getDayPickerLocale, getTimePattern, hhmmToTZDate, isAppDateFormat, isAppLocale, isAppTimeFormat, isDateOnlyString, isFormatDateValue, isValidHhmm, normalizeHhmm, parseDateInput, resetDatetimeContextForTests, resetI18nLocale, resolveDefaultDateFormat, syncDatetimeContext, syncI18nLocale, translate, translateCurrent };