@burdenoff/microfe-theglobalfuel 2026.705.5 → 2026.709.2

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 (241) hide show
  1. package/README.md +3 -0
  2. package/dist/dev/main.d.ts +2 -0
  3. package/dist/dev/main.d.ts.map +1 -0
  4. package/dist/generated/global-operations.d.ts +2 -0
  5. package/dist/generated/global-operations.d.ts.map +1 -0
  6. package/dist/generated/global-types.d.ts +18199 -0
  7. package/dist/generated/global-types.d.ts.map +1 -0
  8. package/dist/generated/wspace-operations.d.ts +2 -0
  9. package/dist/generated/wspace-operations.d.ts.map +1 -0
  10. package/dist/generated/wspace-types.d.ts +43046 -0
  11. package/dist/generated/wspace-types.d.ts.map +1 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +3 -1
  15. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts +5 -0
  16. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +1 -0
  17. package/dist/theglobalfuel/TheGlobalFuelRoot.js +106 -104
  18. package/dist/theglobalfuel/TheGlobalFuelRoot.js.map +1 -1
  19. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts +4 -0
  20. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +1 -0
  21. package/dist/theglobalfuel/TheGlobalFuelRoutes.js +60 -38
  22. package/dist/theglobalfuel/TheGlobalFuelRoutes.js.map +1 -1
  23. package/dist/theglobalfuel/components/DataTable.d.ts +30 -0
  24. package/dist/theglobalfuel/components/DataTable.d.ts.map +1 -0
  25. package/dist/theglobalfuel/components/DataTable.js.map +1 -1
  26. package/dist/theglobalfuel/components/EmptyState.d.ts +18 -0
  27. package/dist/theglobalfuel/components/EmptyState.d.ts.map +1 -0
  28. package/dist/theglobalfuel/components/EvidenceUpload.d.ts +14 -0
  29. package/dist/theglobalfuel/components/EvidenceUpload.d.ts.map +1 -0
  30. package/dist/theglobalfuel/components/FileLink.d.ts +15 -0
  31. package/dist/theglobalfuel/components/FileLink.d.ts.map +1 -0
  32. package/dist/theglobalfuel/components/FilterTabs.d.ts +18 -0
  33. package/dist/theglobalfuel/components/FilterTabs.d.ts.map +1 -0
  34. package/dist/theglobalfuel/components/MetricsCard.d.ts +23 -0
  35. package/dist/theglobalfuel/components/MetricsCard.d.ts.map +1 -0
  36. package/dist/theglobalfuel/components/MiniBar.d.ts +16 -0
  37. package/dist/theglobalfuel/components/MiniBar.d.ts.map +1 -0
  38. package/dist/theglobalfuel/components/PageLayout.d.ts +18 -0
  39. package/dist/theglobalfuel/components/PageLayout.d.ts.map +1 -0
  40. package/dist/theglobalfuel/components/PageLayout.js +2 -1
  41. package/dist/theglobalfuel/components/PageLayout.js.map +1 -1
  42. package/dist/theglobalfuel/components/Pagination.d.ts +22 -0
  43. package/dist/theglobalfuel/components/Pagination.d.ts.map +1 -0
  44. package/dist/theglobalfuel/components/StateViews.d.ts +24 -0
  45. package/dist/theglobalfuel/components/StateViews.d.ts.map +1 -0
  46. package/dist/theglobalfuel/components/StatusBadge.d.ts +9 -0
  47. package/dist/theglobalfuel/components/StatusBadge.d.ts.map +1 -0
  48. package/dist/theglobalfuel/components/Tabs.d.ts +17 -0
  49. package/dist/theglobalfuel/components/Tabs.d.ts.map +1 -0
  50. package/dist/theglobalfuel/components/TheDiscussion.d.ts +18 -0
  51. package/dist/theglobalfuel/components/TheDiscussion.d.ts.map +1 -0
  52. package/dist/theglobalfuel/components/TheTags.d.ts +17 -0
  53. package/dist/theglobalfuel/components/TheTags.d.ts.map +1 -0
  54. package/dist/theglobalfuel/components/WorldMap.d.ts +18 -0
  55. package/dist/theglobalfuel/components/WorldMap.d.ts.map +1 -0
  56. package/dist/theglobalfuel/components/WorldMap.js.map +1 -1
  57. package/dist/theglobalfuel/components/index.d.ts +21 -0
  58. package/dist/theglobalfuel/components/index.d.ts.map +1 -0
  59. package/dist/theglobalfuel/components/viz/AllocationBar.d.ts +21 -0
  60. package/dist/theglobalfuel/components/viz/AllocationBar.d.ts.map +1 -0
  61. package/dist/theglobalfuel/components/viz/AreaChart.d.ts +18 -0
  62. package/dist/theglobalfuel/components/viz/AreaChart.d.ts.map +1 -0
  63. package/dist/theglobalfuel/components/viz/AvatarStack.d.ts +13 -0
  64. package/dist/theglobalfuel/components/viz/AvatarStack.d.ts.map +1 -0
  65. package/dist/theglobalfuel/components/viz/BarChart.d.ts +17 -0
  66. package/dist/theglobalfuel/components/viz/BarChart.d.ts.map +1 -0
  67. package/dist/theglobalfuel/components/viz/CertificateCard.d.ts +14 -0
  68. package/dist/theglobalfuel/components/viz/CertificateCard.d.ts.map +1 -0
  69. package/dist/theglobalfuel/components/viz/DonutChart.d.ts +20 -0
  70. package/dist/theglobalfuel/components/viz/DonutChart.d.ts.map +1 -0
  71. package/dist/theglobalfuel/components/viz/HBarFunnel.d.ts +17 -0
  72. package/dist/theglobalfuel/components/viz/HBarFunnel.d.ts.map +1 -0
  73. package/dist/theglobalfuel/components/viz/Heatmap.d.ts +26 -0
  74. package/dist/theglobalfuel/components/viz/Heatmap.d.ts.map +1 -0
  75. package/dist/theglobalfuel/components/viz/KanbanBoard.d.ts +17 -0
  76. package/dist/theglobalfuel/components/viz/KanbanBoard.d.ts.map +1 -0
  77. package/dist/theglobalfuel/components/viz/LineChart.d.ts +20 -0
  78. package/dist/theglobalfuel/components/viz/LineChart.d.ts.map +1 -0
  79. package/dist/theglobalfuel/components/viz/OrgTree.d.ts +14 -0
  80. package/dist/theglobalfuel/components/viz/OrgTree.d.ts.map +1 -0
  81. package/dist/theglobalfuel/components/viz/PathSteps.d.ts +17 -0
  82. package/dist/theglobalfuel/components/viz/PathSteps.d.ts.map +1 -0
  83. package/dist/theglobalfuel/components/viz/ProgressRing.d.ts +20 -0
  84. package/dist/theglobalfuel/components/viz/ProgressRing.d.ts.map +1 -0
  85. package/dist/theglobalfuel/components/viz/RatingStars.d.ts +14 -0
  86. package/dist/theglobalfuel/components/viz/RatingStars.d.ts.map +1 -0
  87. package/dist/theglobalfuel/components/viz/SegmentedTabs.d.ts +26 -0
  88. package/dist/theglobalfuel/components/viz/SegmentedTabs.d.ts.map +1 -0
  89. package/dist/theglobalfuel/components/viz/SkillBar.d.ts +17 -0
  90. package/dist/theglobalfuel/components/viz/SkillBar.d.ts.map +1 -0
  91. package/dist/theglobalfuel/components/viz/Sparkline.d.ts +16 -0
  92. package/dist/theglobalfuel/components/viz/Sparkline.d.ts.map +1 -0
  93. package/dist/theglobalfuel/components/viz/StatCard.d.ts +22 -0
  94. package/dist/theglobalfuel/components/viz/StatCard.d.ts.map +1 -0
  95. package/dist/theglobalfuel/components/viz/StepProgress.d.ts +17 -0
  96. package/dist/theglobalfuel/components/viz/StepProgress.d.ts.map +1 -0
  97. package/dist/theglobalfuel/components/viz/Timeline.d.ts +21 -0
  98. package/dist/theglobalfuel/components/viz/Timeline.d.ts.map +1 -0
  99. package/dist/theglobalfuel/components/viz/index.d.ts +35 -0
  100. package/dist/theglobalfuel/components/viz/index.d.ts.map +1 -0
  101. package/dist/theglobalfuel/components/viz/lib/Avatar.d.ts +15 -0
  102. package/dist/theglobalfuel/components/viz/lib/Avatar.d.ts.map +1 -0
  103. package/dist/theglobalfuel/components/viz/lib/CartesianFrame.d.ts +44 -0
  104. package/dist/theglobalfuel/components/viz/lib/CartesianFrame.d.ts.map +1 -0
  105. package/dist/theglobalfuel/components/viz/lib/ResponsiveSvg.d.ts +27 -0
  106. package/dist/theglobalfuel/components/viz/lib/ResponsiveSvg.d.ts.map +1 -0
  107. package/dist/theglobalfuel/components/viz/lib/format.d.ts +10 -0
  108. package/dist/theglobalfuel/components/viz/lib/format.d.ts.map +1 -0
  109. package/dist/theglobalfuel/components/viz/lib/geometry.d.ts +41 -0
  110. package/dist/theglobalfuel/components/viz/lib/geometry.d.ts.map +1 -0
  111. package/dist/theglobalfuel/components/viz/lib/hooks.d.ts +18 -0
  112. package/dist/theglobalfuel/components/viz/lib/hooks.d.ts.map +1 -0
  113. package/dist/theglobalfuel/components/viz/lib/palette.d.ts +31 -0
  114. package/dist/theglobalfuel/components/viz/lib/palette.d.ts.map +1 -0
  115. package/dist/theglobalfuel/components/viz/lib/types.d.ts +27 -0
  116. package/dist/theglobalfuel/components/viz/lib/types.d.ts.map +1 -0
  117. package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts +16 -0
  118. package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts.map +1 -0
  119. package/dist/theglobalfuel/context/index.d.ts +6 -0
  120. package/dist/theglobalfuel/context/index.d.ts.map +1 -0
  121. package/dist/theglobalfuel/hooks/index.d.ts +15 -0
  122. package/dist/theglobalfuel/hooks/index.d.ts.map +1 -0
  123. package/dist/theglobalfuel/hooks/index.js +4 -0
  124. package/dist/theglobalfuel/hooks/useCursorPager.d.ts +26 -0
  125. package/dist/theglobalfuel/hooks/useCursorPager.d.ts.map +1 -0
  126. package/dist/theglobalfuel/hooks/useNotify.d.ts +23 -0
  127. package/dist/theglobalfuel/hooks/useNotify.d.ts.map +1 -0
  128. package/dist/theglobalfuel/hooks/useTheAnalytics.d.ts +38 -0
  129. package/dist/theglobalfuel/hooks/useTheAnalytics.d.ts.map +1 -0
  130. package/dist/theglobalfuel/hooks/useTheAnalytics.js +46 -0
  131. package/dist/theglobalfuel/hooks/useTheAnalytics.js.map +1 -0
  132. package/dist/theglobalfuel/hooks/useTheComments.d.ts +36 -0
  133. package/dist/theglobalfuel/hooks/useTheComments.d.ts.map +1 -0
  134. package/dist/theglobalfuel/hooks/useTheFiles.d.ts +47 -0
  135. package/dist/theglobalfuel/hooks/useTheFiles.d.ts.map +1 -0
  136. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +79 -0
  137. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +1 -0
  138. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +2 -9
  139. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
  140. package/dist/theglobalfuel/hooks/useTheNativeControls.d.ts +20 -0
  141. package/dist/theglobalfuel/hooks/useTheNativeControls.d.ts.map +1 -0
  142. package/dist/theglobalfuel/hooks/useTheNativeControls.js +22 -0
  143. package/dist/theglobalfuel/hooks/useTheNativeControls.js.map +1 -0
  144. package/dist/theglobalfuel/hooks/useThePageView.d.ts +10 -0
  145. package/dist/theglobalfuel/hooks/useThePageView.d.ts.map +1 -0
  146. package/dist/theglobalfuel/hooks/useThePageView.js +13 -0
  147. package/dist/theglobalfuel/hooks/useThePageView.js.map +1 -0
  148. package/dist/theglobalfuel/hooks/useTheTags.d.ts +44 -0
  149. package/dist/theglobalfuel/hooks/useTheTags.d.ts.map +1 -0
  150. package/dist/theglobalfuel/hooks/useTheTranslation.d.ts +4 -0
  151. package/dist/theglobalfuel/hooks/useTheTranslation.d.ts.map +1 -0
  152. package/dist/theglobalfuel/hooks/useTheTranslation.js +12 -0
  153. package/dist/theglobalfuel/hooks/useTheTranslation.js.map +1 -0
  154. package/dist/theglobalfuel/index.d.ts +11 -0
  155. package/dist/theglobalfuel/index.d.ts.map +1 -0
  156. package/dist/theglobalfuel/index.js +2 -0
  157. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts +13 -0
  158. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts.map +1 -0
  159. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +395 -353
  160. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
  161. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts +10 -0
  162. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts.map +1 -0
  163. package/dist/theglobalfuel/pages/assets/AssetsPage.js +152 -146
  164. package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
  165. package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts +11 -0
  166. package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts.map +1 -0
  167. package/dist/theglobalfuel/pages/compliance/CompliancePage.js +233 -229
  168. package/dist/theglobalfuel/pages/compliance/CompliancePage.js.map +1 -1
  169. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts +9 -0
  170. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts.map +1 -0
  171. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js +410 -389
  172. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js.map +1 -1
  173. package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts +8 -0
  174. package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts.map +1 -0
  175. package/dist/theglobalfuel/pages/contracts/ContractsPage.js +237 -231
  176. package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
  177. package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts +17 -0
  178. package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts.map +1 -0
  179. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +255 -250
  180. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
  181. package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts +13 -0
  182. package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts.map +1 -0
  183. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +154 -150
  184. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -1
  185. package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts +11 -0
  186. package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts.map +1 -0
  187. package/dist/theglobalfuel/pages/inventory/InventoryPage.js +151 -147
  188. package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -1
  189. package/dist/theglobalfuel/pages/production/ProductionPage.d.ts +11 -0
  190. package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +1 -0
  191. package/dist/theglobalfuel/pages/production/ProductionPage.js +175 -171
  192. package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -1
  193. package/dist/theglobalfuel/pages/provenance/ProvenancePage.d.ts +23 -0
  194. package/dist/theglobalfuel/pages/provenance/ProvenancePage.d.ts.map +1 -0
  195. package/dist/theglobalfuel/pages/provenance/ProvenancePage.js +153 -146
  196. package/dist/theglobalfuel/pages/provenance/ProvenancePage.js.map +1 -1
  197. package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts +10 -0
  198. package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts.map +1 -0
  199. package/dist/theglobalfuel/pages/reserves/ReservesPage.js +168 -164
  200. package/dist/theglobalfuel/pages/reserves/ReservesPage.js.map +1 -1
  201. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts +11 -0
  202. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts.map +1 -0
  203. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +179 -175
  204. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -1
  205. package/dist/theglobalfuel/services/assistantApi.d.ts +25 -0
  206. package/dist/theglobalfuel/services/assistantApi.d.ts.map +1 -0
  207. package/dist/theglobalfuel/services/assistantApi.js +225 -0
  208. package/dist/theglobalfuel/services/assistantApi.js.map +1 -0
  209. package/dist/theglobalfuel/services/createSandboxAssistantTransport.d.ts +38 -0
  210. package/dist/theglobalfuel/services/createSandboxAssistantTransport.d.ts.map +1 -0
  211. package/dist/theglobalfuel/services/createSandboxAssistantTransport.js +120 -0
  212. package/dist/theglobalfuel/services/createSandboxAssistantTransport.js.map +1 -0
  213. package/dist/theglobalfuel/services/index.d.ts +7 -0
  214. package/dist/theglobalfuel/services/index.d.ts.map +1 -0
  215. package/dist/theglobalfuel/types/assistant.d.ts +65 -0
  216. package/dist/theglobalfuel/types/assistant.d.ts.map +1 -0
  217. package/dist/theglobalfuel/types/index.d.ts +376 -0
  218. package/dist/theglobalfuel/types/index.d.ts.map +1 -0
  219. package/dist/theglobalfuel/utils/cn.d.ts +4 -0
  220. package/dist/theglobalfuel/utils/cn.d.ts.map +1 -0
  221. package/dist/theglobalfuel/utils/formatters.d.ts +44 -0
  222. package/dist/theglobalfuel/utils/formatters.d.ts.map +1 -0
  223. package/dist/theglobalfuel/utils/i18n.d.ts +5 -0
  224. package/dist/theglobalfuel/utils/i18n.d.ts.map +1 -0
  225. package/dist/theglobalfuel/utils/i18n.js +15 -0
  226. package/dist/theglobalfuel/utils/i18n.js.map +1 -0
  227. package/dist/theglobalfuel/utils/index.d.ts +10 -0
  228. package/dist/theglobalfuel/utils/index.d.ts.map +1 -0
  229. package/dist/theglobalfuel/utils/navigation.d.ts +14 -0
  230. package/dist/theglobalfuel/utils/navigation.d.ts.map +1 -0
  231. package/dist/theglobalfuel/utils/pageContext.d.ts +26 -0
  232. package/dist/theglobalfuel/utils/pageContext.d.ts.map +1 -0
  233. package/dist/theglobalfuel/utils/pageContext.js +65 -0
  234. package/dist/theglobalfuel/utils/pageContext.js.map +1 -0
  235. package/dist/theglobalfuel/utils/transitions.d.ts +17 -0
  236. package/dist/theglobalfuel/utils/transitions.d.ts.map +1 -0
  237. package/package.json +5 -1
  238. package/dist/node_modules/clsx/dist/clsx.js +0 -18
  239. package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
  240. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -1716
  241. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
@@ -6,36 +6,40 @@ import { StatusBadge as c } from "../../components/StatusBadge.js";
6
6
  import { MiniBar as te } from "../../components/MiniBar.js";
7
7
  import { DataTable as ne } from "../../components/DataTable.js";
8
8
  import { ErrorView as re, LoadingView as ie, Section as ae } from "../../components/StateViews.js";
9
- import { EmptyState as l } from "../../components/EmptyState.js";
9
+ import { EmptyState as oe } from "../../components/EmptyState.js";
10
10
  import "../../context/index.js";
11
- import { useTheContract as oe, useTheDeliverShipment as se, useTheScheduleShipment as ce, useTheTransitionContract as le, useTheUpdateContract as ue } from "../../hooks/useTheGlobalFuelApi.js";
12
- import { useNotify as de } from "../../hooks/useNotify.js";
11
+ import { useTheContract as se, useTheDeliverShipment as ce, useTheScheduleShipment as le, useTheShipments as ue, useTheTransitionContract as de, useTheUpdateContract as fe } from "../../hooks/useTheGlobalFuelApi.js";
12
+ import { useCursorPager as pe } from "../../hooks/useCursorPager.js";
13
+ import { useNotify as me } from "../../hooks/useNotify.js";
14
+ import { useThePageView as he } from "../../hooks/useThePageView.js";
15
+ import { useTheNativeControls as ge } from "../../hooks/useTheNativeControls.js";
13
16
  import "../../hooks/index.js";
14
- import { CONTRACT_TRANSITIONS as fe, nextStatuses as pe } from "../../utils/transitions.js";
15
- import { Tabs as me } from "../../components/Tabs.js";
16
- import { EvidenceUpload as he } from "../../components/EvidenceUpload.js";
17
- import { FileLink as ge } from "../../components/FileLink.js";
18
- import { TheDiscussion as _e } from "../../components/TheDiscussion.js";
19
- import { TheTags as ve } from "../../components/TheTags.js";
20
- import { useState as u } from "react";
21
- import { ArrowLeft as d, Building2 as ye, Calendar as be, CheckCircle2 as xe, Coins as Se, FileSignature as Ce, Gauge as we, MapPin as Te, MessageSquare as Ee, Package as De, Pencil as Oe, Plus as f, Ship as p, Tag as ke } from "lucide-react";
22
- import { useParams as Ae } from "react-router-dom";
23
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
24
- import { Button as _, GlassCard as v, Input as y, Label as b, ResponsiveDialog as x, ResponsiveDialogContent as S, ResponsiveDialogDescription as C, ResponsiveDialogFooter as w, ResponsiveDialogHeader as T, ResponsiveDialogTitle as je, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Textarea as j } from "@burdenoff/fe-libs/ui";
17
+ import { CONTRACT_TRANSITIONS as _e, nextStatuses as ve } from "../../utils/transitions.js";
18
+ import { Tabs as ye } from "../../components/Tabs.js";
19
+ import { Pagination as be } from "../../components/Pagination.js";
20
+ import { EvidenceUpload as xe } from "../../components/EvidenceUpload.js";
21
+ import { FileLink as Se } from "../../components/FileLink.js";
22
+ import { TheDiscussion as Ce } from "../../components/TheDiscussion.js";
23
+ import { TheTags as we } from "../../components/TheTags.js";
24
+ import { useState as l } from "react";
25
+ import { ArrowLeft as Te, Building2 as Ee, Calendar as De, CheckCircle2 as Oe, Coins as ke, FileSignature as Ae, Gauge as je, MapPin as Me, MessageSquare as Ne, Package as Pe, Pencil as Fe, Plus as u, Ship as d, Tag as Ie } from "lucide-react";
26
+ import { useParams as Le } from "react-router-dom";
27
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
28
+ import { Button as h, GlassCard as g, Input as _, Label as v, ResponsiveDialog as y, ResponsiveDialogContent as b, ResponsiveDialogDescription as x, ResponsiveDialogFooter as S, ResponsiveDialogHeader as C, ResponsiveDialogTitle as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k, Textarea as A } from "@burdenoff/fe-libs/ui";
25
29
  //#region src/theglobalfuel/pages/contracts/ContractDetailPage.tsx
26
- var Me = [
30
+ var Re = [
27
31
  "FIXED",
28
32
  "INDEX_LINKED",
29
33
  "FORMULA",
30
34
  "SPOT"
31
- ], Ne = [
35
+ ], ze = [
32
36
  "PIPELINE",
33
37
  "TANKER",
34
38
  "VESSEL_BULK",
35
39
  "RAIL",
36
40
  "TRUCK",
37
41
  "GRID"
38
- ], M = [
42
+ ], Be = [
39
43
  "BARRELS",
40
44
  "CUBIC_METERS",
41
45
  "TONNES",
@@ -43,11 +47,11 @@ var Me = [
43
47
  "MWH",
44
48
  "GJ",
45
49
  "MCF"
46
- ], Pe = new Set([
50
+ ], Ve = new Set([
47
51
  "SCHEDULED",
48
52
  "LOADING",
49
53
  "IN_TRANSIT"
50
- ]), Fe = (e) => Math.max(0, Math.min(100, e)), N = (e) => e ? e.slice(0, 10) : "", P = (e) => ({
54
+ ]), j = 25, He = (e) => Math.max(0, Math.min(100, e)), Ue = (e) => e ? e.slice(0, 10) : "", M = (e) => ({
51
55
  reference: "",
52
56
  mode: "VESSEL_BULK",
53
57
  carrier: "",
@@ -58,130 +62,137 @@ var Me = [
58
62
  scheduledAt: "",
59
63
  notes: ""
60
64
  });
61
- function F() {
62
- let { id: F } = Ae(), { navigateTo: I } = e(), L = de(), { data: R, isLoading: Ie, isError: z, refetch: Le } = oe(F), B = ue(), Re = le(), V = ce(), H = se(), [U, ze] = u("shipments"), [Be, W] = u(!1), [G, K] = u(null), [Ve, q] = u(!1), [J, Y] = u(P("BARRELS")), [He, X] = u(null), [Z, Q] = u(null);
63
- if (Ie) return /* @__PURE__ */ h(t, {
65
+ function N() {
66
+ let { id: N } = Le(), { navigateTo: P } = e(), F = me();
67
+ he("contract-detail");
68
+ let { haptic: We } = ge(), { data: I, isLoading: Ge, isError: Ke, refetch: qe } = se(N), L = fe(), Je = de(), R = le(), Ye = ce(), z = pe(), B = ue(N, void 0, {
69
+ limit: j,
70
+ offset: z.page * j
71
+ }), [V, Xe] = l("shipments"), [Ze, H] = l(!1), [U, W] = l(null), [Qe, G] = l(!1), [K, q] = l(M("BARRELS")), [$e, J] = l(null), [Y, X] = l(null);
72
+ if (Ge) return /* @__PURE__ */ p(t, {
64
73
  title: "Contract",
65
- children: /* @__PURE__ */ h(ie, {})
74
+ dataTour: "theglobalfuel-contract-detail-page",
75
+ children: /* @__PURE__ */ p(ie, {})
66
76
  });
67
- if (z || !R) return /* @__PURE__ */ h(t, {
77
+ if (Ke || !I) return /* @__PURE__ */ p(t, {
68
78
  title: "Contract",
69
- actions: /* @__PURE__ */ g(_, {
79
+ dataTour: "theglobalfuel-contract-detail-page",
80
+ actions: /* @__PURE__ */ m(h, {
70
81
  variant: "ghost",
71
- onClick: () => I("contracts"),
72
- children: [/* @__PURE__ */ h(d, { className: "mr-1.5 h-4 w-4" }), " Back"]
82
+ onClick: () => P("contracts"),
83
+ children: [/* @__PURE__ */ p(Te, { className: "mr-1.5 h-4 w-4" }), " Back"]
73
84
  }),
74
- children: z ? /* @__PURE__ */ h(re, {
85
+ children: Ke ? /* @__PURE__ */ p(re, {
75
86
  message: "This contract could not be loaded.",
76
- onRetry: () => Le()
77
- }) : /* @__PURE__ */ h(l, {
87
+ onRetry: () => qe()
88
+ }) : /* @__PURE__ */ p(oe, {
78
89
  illustration: "empty-search",
79
- icon: /* @__PURE__ */ h(Ce, { className: "h-10 w-10" }),
90
+ icon: /* @__PURE__ */ p(Ae, { className: "h-10 w-10" }),
80
91
  title: "Contract not found",
81
92
  description: "This contract may have been removed or you may not have access to it.",
82
- action: /* @__PURE__ */ h(_, {
83
- onClick: () => I("contracts"),
93
+ action: /* @__PURE__ */ p(h, {
94
+ onClick: () => P("contracts"),
84
95
  children: "Back to contracts"
85
96
  })
86
97
  })
87
98
  });
88
- let $ = R.shipments ?? [], Ue = R.contractedVolume > 0 ? Fe(R.deliveredVolume / R.contractedVolume * 100) : 0, We = pe(fe, R.status), Ge = () => {
89
- K({
90
- counterparty: R.counterparty,
91
- pricingBasis: R.pricingBasis,
92
- pricePerUnit: R.pricePerUnit ? String(R.pricePerUnit) : "",
93
- priceIndex: R.priceIndex ?? "",
94
- currency: R.currency,
95
- contractedVolume: R.contractedVolume ? String(R.contractedVolume) : "",
96
- unit: R.unit,
97
- deliveryLocation: R.deliveryLocation ?? "",
98
- startDate: N(R.startDate),
99
- endDate: N(R.endDate),
100
- notes: R.notes ?? ""
101
- }), Q(null), W(!0);
102
- }, Ke = () => {
103
- Y(P(R.unit)), X(null), Q(null), q(!0);
104
- }, qe = (e) => {
105
- e !== R.status && (Q(null), Re.mutate({
106
- id: R.id,
99
+ let Z = B.data?.items ?? [], et = I.contractedVolume > 0 ? He(I.deliveredVolume / I.contractedVolume * 100) : 0, Q = ve(_e, I.status), tt = () => {
100
+ W({
101
+ counterparty: I.counterparty,
102
+ pricingBasis: I.pricingBasis,
103
+ pricePerUnit: I.pricePerUnit ? String(I.pricePerUnit) : "",
104
+ priceIndex: I.priceIndex ?? "",
105
+ currency: I.currency,
106
+ contractedVolume: I.contractedVolume ? String(I.contractedVolume) : "",
107
+ unit: I.unit,
108
+ deliveryLocation: I.deliveryLocation ?? "",
109
+ startDate: Ue(I.startDate),
110
+ endDate: Ue(I.endDate),
111
+ notes: I.notes ?? ""
112
+ }), X(null), H(!0);
113
+ }, $ = () => {
114
+ We("light"), q(M(I.unit)), J(null), X(null), G(!0);
115
+ }, nt = (e) => {
116
+ e !== I.status && (X(null), Je.mutate({
117
+ id: I.id,
107
118
  status: e
108
119
  }, {
109
- onSuccess: () => L.success("Contract status updated"),
120
+ onSuccess: () => F.success("Contract status updated"),
110
121
  onError: (e) => {
111
- Q(e instanceof Error ? e.message : "Failed to update contract status."), L.fromError(e);
122
+ X(e instanceof Error ? e.message : "Failed to update contract status."), F.fromError(e);
112
123
  }
113
124
  }));
114
- }, Je = async () => {
115
- if (G) {
116
- if (!G.counterparty.trim()) {
117
- Q("Counterparty is required.");
125
+ }, rt = async () => {
126
+ if (U) {
127
+ if (!U.counterparty.trim()) {
128
+ X("Counterparty is required.");
118
129
  return;
119
130
  }
120
- Q(null);
131
+ X(null);
121
132
  try {
122
- await B.mutateAsync({
123
- id: R.id,
133
+ await L.mutateAsync({
134
+ id: I.id,
124
135
  input: {
125
- counterparty: G.counterparty.trim(),
126
- pricingBasis: G.pricingBasis,
127
- pricePerUnit: G.pricePerUnit ? Number(G.pricePerUnit) : null,
128
- priceIndex: G.priceIndex.trim() || null,
129
- currency: G.currency.trim().toUpperCase() || "USD",
130
- contractedVolume: G.contractedVolume ? Number(G.contractedVolume) : null,
131
- unit: G.unit,
132
- deliveryLocation: G.deliveryLocation.trim() || null,
133
- startDate: s(G.startDate) ?? null,
134
- endDate: s(G.endDate) ?? null,
135
- notes: G.notes.trim() || null
136
+ counterparty: U.counterparty.trim(),
137
+ pricingBasis: U.pricingBasis,
138
+ pricePerUnit: U.pricePerUnit ? Number(U.pricePerUnit) : null,
139
+ priceIndex: U.priceIndex.trim() || null,
140
+ currency: U.currency.trim().toUpperCase() || "USD",
141
+ contractedVolume: U.contractedVolume ? Number(U.contractedVolume) : null,
142
+ unit: U.unit,
143
+ deliveryLocation: U.deliveryLocation.trim() || null,
144
+ startDate: s(U.startDate) ?? null,
145
+ endDate: s(U.endDate) ?? null,
146
+ notes: U.notes.trim() || null
136
147
  }
137
- }), L.success("Contract updated"), W(!1);
148
+ }), F.success("Contract updated"), H(!1);
138
149
  } catch (e) {
139
- Q(e instanceof Error ? e.message : "Failed to update contract."), L.fromError(e);
150
+ X(e instanceof Error ? e.message : "Failed to update contract."), F.fromError(e);
140
151
  }
141
152
  }
142
- }, Ye = async () => {
143
- if (!J.reference.trim()) {
144
- Q("Shipment reference is required.");
153
+ }, it = async () => {
154
+ if (!K.reference.trim()) {
155
+ X("Shipment reference is required.");
145
156
  return;
146
157
  }
147
- let e = Number(J.volume);
148
- if (!J.volume || Number.isNaN(e) || e <= 0) {
149
- Q("Enter a volume greater than zero."), L.error("Enter a volume greater than zero.");
158
+ let e = Number(K.volume);
159
+ if (!K.volume || Number.isNaN(e) || e <= 0) {
160
+ X("Enter a volume greater than zero."), F.error("Enter a volume greater than zero.");
150
161
  return;
151
162
  }
152
- Q(null);
163
+ X(null);
153
164
  try {
154
- await V.mutateAsync({
155
- contractId: R.id,
156
- reference: J.reference.trim(),
157
- mode: J.mode,
158
- carrier: J.carrier.trim() || null,
159
- origin: J.origin.trim() || null,
160
- destination: J.destination.trim() || null,
165
+ await R.mutateAsync({
166
+ contractId: I.id,
167
+ reference: K.reference.trim(),
168
+ mode: K.mode,
169
+ carrier: K.carrier.trim() || null,
170
+ origin: K.origin.trim() || null,
171
+ destination: K.destination.trim() || null,
161
172
  volume: e,
162
- unit: J.unit,
163
- scheduledAt: s(J.scheduledAt) ?? null,
164
- documentFileId: He?.fileId ?? null,
165
- notes: J.notes.trim() || null
166
- }), L.success("Shipment scheduled"), q(!1);
173
+ unit: K.unit,
174
+ scheduledAt: s(K.scheduledAt) ?? null,
175
+ documentFileId: $e?.fileId ?? null,
176
+ notes: K.notes.trim() || null
177
+ }), F.success("Shipment scheduled"), G(!1);
167
178
  } catch (e) {
168
- Q(e instanceof Error ? e.message : "Failed to schedule shipment."), L.fromError(e);
179
+ X(e instanceof Error ? e.message : "Failed to schedule shipment."), F.fromError(e);
169
180
  }
170
- }, Xe = (e) => {
171
- Q(null), H.mutate(e, {
172
- onSuccess: () => L.success("Shipment delivered"),
181
+ }, at = (e) => {
182
+ X(null), Ye.mutate(e, {
183
+ onSuccess: () => F.success("Shipment delivered"),
173
184
  onError: (e) => {
174
- Q(e instanceof Error ? e.message : "Failed to mark shipment delivered."), L.fromError(e);
185
+ X(e instanceof Error ? e.message : "Failed to mark shipment delivered."), F.fromError(e);
175
186
  }
176
187
  });
177
- }, Ze = [
188
+ }, ot = [
178
189
  {
179
190
  key: "reference",
180
191
  header: "Shipment",
181
- render: (e) => /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
192
+ render: (e) => /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
182
193
  className: "font-medium text-text-primary",
183
194
  children: e.reference
184
- }), /* @__PURE__ */ h("p", {
195
+ }), /* @__PURE__ */ p("p", {
185
196
  className: "text-xs text-text-tertiary",
186
197
  children: i(e.mode)
187
198
  })] })
@@ -189,13 +200,13 @@ function F() {
189
200
  {
190
201
  key: "status",
191
202
  header: "Status",
192
- render: (e) => /* @__PURE__ */ h(c, { status: e.status })
203
+ render: (e) => /* @__PURE__ */ p(c, { status: e.status })
193
204
  },
194
205
  {
195
206
  key: "carrier",
196
207
  header: "Carrier",
197
208
  hideOnMobile: !0,
198
- render: (e) => /* @__PURE__ */ h("span", {
209
+ render: (e) => /* @__PURE__ */ p("span", {
199
210
  className: "text-text-secondary",
200
211
  children: e.carrier ?? "—"
201
212
  })
@@ -204,19 +215,19 @@ function F() {
204
215
  key: "route",
205
216
  header: "Route",
206
217
  hideOnMobile: !0,
207
- render: (e) => e.origin || e.destination ? /* @__PURE__ */ g("span", {
218
+ render: (e) => e.origin || e.destination ? /* @__PURE__ */ m("span", {
208
219
  className: "text-text-secondary",
209
220
  children: [
210
221
  e.origin ?? "—",
211
222
  " ",
212
- /* @__PURE__ */ h("span", {
223
+ /* @__PURE__ */ p("span", {
213
224
  className: "text-text-tertiary",
214
225
  children: "→"
215
226
  }),
216
227
  " ",
217
228
  e.destination ?? "—"
218
229
  ]
219
- }) : /* @__PURE__ */ h("span", {
230
+ }) : /* @__PURE__ */ p("span", {
220
231
  className: "text-text-tertiary",
221
232
  children: "—"
222
233
  })
@@ -226,7 +237,7 @@ function F() {
226
237
  header: "Volume",
227
238
  align: "right",
228
239
  sortValue: (e) => e.volume,
229
- render: (e) => /* @__PURE__ */ h("span", {
240
+ render: (e) => /* @__PURE__ */ p("span", {
230
241
  className: "tabular-nums text-text-secondary",
231
242
  children: o(e.volume, e.unit)
232
243
  })
@@ -235,7 +246,7 @@ function F() {
235
246
  key: "schedule",
236
247
  header: "Scheduled",
237
248
  hideOnMobile: !0,
238
- render: (e) => /* @__PURE__ */ h("span", {
249
+ render: (e) => /* @__PURE__ */ p("span", {
239
250
  className: "text-text-tertiary",
240
251
  children: r(e.scheduledAt)
241
252
  })
@@ -244,7 +255,7 @@ function F() {
244
255
  key: "document",
245
256
  header: "Document",
246
257
  hideOnMobile: !0,
247
- render: (e) => e.document?.id ? /* @__PURE__ */ h(ge, { fileId: e.document.id }) : /* @__PURE__ */ h("span", {
258
+ render: (e) => e.document?.id ? /* @__PURE__ */ p(Se, { fileId: e.document.id }) : /* @__PURE__ */ p("span", {
248
259
  className: "text-text-tertiary",
249
260
  children: "—"
250
261
  })
@@ -253,543 +264,553 @@ function F() {
253
264
  key: "action",
254
265
  header: "",
255
266
  align: "right",
256
- render: (e) => Pe.has(e.status) ? /* @__PURE__ */ g(_, {
267
+ render: (e) => Ve.has(e.status) ? /* @__PURE__ */ m(h, {
257
268
  size: "sm",
258
269
  variant: "outline",
259
- onClick: () => Xe(e.id),
260
- disabled: H.isPending,
261
- children: [/* @__PURE__ */ h(xe, { className: "mr-1.5 h-4 w-4" }), " Mark delivered"]
270
+ onClick: () => at(e.id),
271
+ disabled: Ye.isPending,
272
+ children: [/* @__PURE__ */ p(Oe, { className: "mr-1.5 h-4 w-4" }), " Mark delivered"]
262
273
  }) : null
263
274
  }
264
- ], Qe = [
275
+ ], st = [
265
276
  {
266
277
  value: "shipments",
267
278
  label: "Shipments",
268
- icon: /* @__PURE__ */ h(p, { className: "h-4 w-4" }),
269
- count: $.length
279
+ icon: /* @__PURE__ */ p(d, { className: "h-4 w-4" }),
280
+ count: Z.length
270
281
  },
271
282
  {
272
283
  value: "tags",
273
284
  label: "Tags",
274
- icon: /* @__PURE__ */ h(ke, { className: "h-4 w-4" })
285
+ icon: /* @__PURE__ */ p(Ie, { className: "h-4 w-4" })
275
286
  },
276
287
  {
277
288
  value: "discussion",
278
289
  label: "Discussion",
279
- icon: /* @__PURE__ */ h(Ee, { className: "h-4 w-4" })
290
+ icon: /* @__PURE__ */ p(Ne, { className: "h-4 w-4" })
280
291
  }
281
- ], $e = R.startDate || R.endDate ? `${r(R.startDate)} – ${r(R.endDate)}` : "—";
282
- return /* @__PURE__ */ g(t, {
283
- title: R.reference,
284
- description: `${R.counterparty} · ${i(R.commodity)}`,
285
- actions: /* @__PURE__ */ g(m, { children: [
286
- /* @__PURE__ */ h(c, { status: R.status }),
287
- /* @__PURE__ */ g(E, {
288
- value: R.status,
289
- onValueChange: (e) => qe(e),
290
- disabled: We.length === 0,
291
- children: [/* @__PURE__ */ h(k, {
292
+ ], ct = I.startDate || I.endDate ? `${r(I.startDate)} – ${r(I.endDate)}` : "—";
293
+ return /* @__PURE__ */ m(t, {
294
+ title: I.reference,
295
+ description: `${I.counterparty} · ${i(I.commodity)}`,
296
+ dataTour: "theglobalfuel-contract-detail-page",
297
+ actions: /* @__PURE__ */ m(f, { children: [
298
+ /* @__PURE__ */ p(c, { status: I.status }),
299
+ /* @__PURE__ */ m(T, {
300
+ value: I.status,
301
+ onValueChange: (e) => nt(e),
302
+ disabled: Q.length === 0,
303
+ children: [/* @__PURE__ */ p(O, {
292
304
  className: "h-9 w-40",
293
305
  "aria-label": "Change contract status",
294
- children: /* @__PURE__ */ h(A, {})
295
- }), /* @__PURE__ */ g(D, { children: [/* @__PURE__ */ h(O, {
296
- value: R.status,
306
+ children: /* @__PURE__ */ p(k, {})
307
+ }), /* @__PURE__ */ m(E, { children: [/* @__PURE__ */ p(D, {
308
+ value: I.status,
297
309
  disabled: !0,
298
- children: i(R.status)
299
- }), We.map((e) => /* @__PURE__ */ h(O, {
310
+ children: i(I.status)
311
+ }), Q.map((e) => /* @__PURE__ */ p(D, {
300
312
  value: e,
301
313
  children: i(e)
302
314
  }, e))] })]
303
315
  }),
304
- /* @__PURE__ */ g(_, {
316
+ /* @__PURE__ */ m(h, {
305
317
  variant: "outline",
306
- onClick: Ge,
307
- children: [/* @__PURE__ */ h(Oe, { className: "mr-1.5 h-4 w-4" }), " Edit"]
318
+ onClick: tt,
319
+ children: [/* @__PURE__ */ p(Fe, { className: "mr-1.5 h-4 w-4" }), " Edit"]
308
320
  }),
309
- /* @__PURE__ */ g(_, {
321
+ /* @__PURE__ */ m(h, {
310
322
  variant: "ghost",
311
- onClick: () => I("contracts"),
312
- children: [/* @__PURE__ */ h(d, { className: "mr-1.5 h-4 w-4" }), " Back"]
323
+ onClick: () => P("contracts"),
324
+ children: [/* @__PURE__ */ p(Te, { className: "mr-1.5 h-4 w-4" }), " Back"]
313
325
  })
314
326
  ] }),
315
327
  children: [
316
- /* @__PURE__ */ g("div", {
328
+ /* @__PURE__ */ m("div", {
317
329
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
318
330
  children: [
319
- /* @__PURE__ */ h(n, {
320
- icon: /* @__PURE__ */ h(ye, { className: "h-5 w-5" }),
321
- value: R.counterparty,
331
+ /* @__PURE__ */ p(n, {
332
+ icon: /* @__PURE__ */ p(Ee, { className: "h-5 w-5" }),
333
+ value: I.counterparty,
322
334
  label: "Counterparty",
323
335
  featured: !0
324
336
  }),
325
- /* @__PURE__ */ h(n, {
326
- icon: /* @__PURE__ */ h(De, { className: "h-5 w-5" }),
327
- value: i(R.commodity),
337
+ /* @__PURE__ */ p(n, {
338
+ icon: /* @__PURE__ */ p(Pe, { className: "h-5 w-5" }),
339
+ value: i(I.commodity),
328
340
  label: "Commodity & side",
329
- footer: /* @__PURE__ */ h(c, { status: R.side })
341
+ footer: /* @__PURE__ */ p(c, { status: I.side })
330
342
  }),
331
- /* @__PURE__ */ h(n, {
332
- icon: /* @__PURE__ */ h(Se, { className: "h-5 w-5" }),
333
- value: ee(R.pricePerUnit, R.currency),
334
- label: `Price per ${a(R.unit)}`,
335
- footer: /* @__PURE__ */ h(c, { status: R.pricingBasis })
343
+ /* @__PURE__ */ p(n, {
344
+ icon: /* @__PURE__ */ p(ke, { className: "h-5 w-5" }),
345
+ value: ee(I.pricePerUnit, I.currency),
346
+ label: `Price per ${a(I.unit)}`,
347
+ footer: /* @__PURE__ */ p(c, { status: I.pricingBasis })
336
348
  }),
337
- /* @__PURE__ */ h(n, {
338
- icon: /* @__PURE__ */ h(we, { className: "h-5 w-5" }),
339
- value: o(R.deliveredVolume, R.unit),
340
- label: `of ${o(R.contractedVolume, R.unit)} delivered`,
341
- footer: /* @__PURE__ */ g("div", {
349
+ /* @__PURE__ */ p(n, {
350
+ icon: /* @__PURE__ */ p(je, { className: "h-5 w-5" }),
351
+ value: o(I.deliveredVolume, I.unit),
352
+ label: `of ${o(I.contractedVolume, I.unit)} delivered`,
353
+ footer: /* @__PURE__ */ m("div", {
342
354
  className: "space-y-2",
343
- children: [/* @__PURE__ */ h(te, {
344
- value: Ue,
355
+ children: [/* @__PURE__ */ p(te, {
356
+ value: et,
345
357
  barClassName: "bg-[var(--color-status-success-text)]"
346
- }), /* @__PURE__ */ g("p", {
358
+ }), /* @__PURE__ */ m("p", {
347
359
  className: "text-xs tabular-nums text-text-tertiary",
348
- children: [Math.round(Ue), "% fulfilled"]
360
+ children: [Math.round(et), "% fulfilled"]
349
361
  })]
350
362
  })
351
363
  })
352
364
  ]
353
365
  }),
354
- /* @__PURE__ */ g(v, {
366
+ /* @__PURE__ */ m(g, {
355
367
  treatment: "glass",
356
368
  className: "mt-4 p-6",
357
- children: [/* @__PURE__ */ g("dl", {
369
+ children: [/* @__PURE__ */ m("dl", {
358
370
  className: "grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3 lg:grid-cols-4",
359
371
  children: [
360
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("dt", {
372
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
361
373
  className: "text-xs text-text-tertiary",
362
374
  children: "Pricing basis"
363
- }), /* @__PURE__ */ h("dd", {
375
+ }), /* @__PURE__ */ p("dd", {
364
376
  className: "mt-1",
365
- children: /* @__PURE__ */ h(c, { status: R.pricingBasis })
377
+ children: /* @__PURE__ */ p(c, { status: I.pricingBasis })
366
378
  })] }),
367
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("dt", {
379
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
368
380
  className: "text-xs text-text-tertiary",
369
381
  children: "Price index"
370
- }), /* @__PURE__ */ h("dd", {
382
+ }), /* @__PURE__ */ p("dd", {
371
383
  className: "mt-0.5 text-sm text-text-primary",
372
- children: R.priceIndex ?? "—"
384
+ children: I.priceIndex ?? "—"
373
385
  })] }),
374
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("dt", {
386
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
375
387
  className: "text-xs text-text-tertiary",
376
388
  children: "Currency"
377
- }), /* @__PURE__ */ h("dd", {
389
+ }), /* @__PURE__ */ p("dd", {
378
390
  className: "mt-0.5 text-sm text-text-primary",
379
- children: R.currency
391
+ children: I.currency
380
392
  })] }),
381
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("dt", {
393
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
382
394
  className: "text-xs text-text-tertiary",
383
395
  children: "Delivery location"
384
- }), /* @__PURE__ */ h("dd", {
396
+ }), /* @__PURE__ */ p("dd", {
385
397
  className: "mt-0.5 flex items-center gap-1.5 text-sm text-text-primary",
386
- children: R.deliveryLocation ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(Te, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), R.deliveryLocation] }) : "—"
398
+ children: I.deliveryLocation ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Me, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), I.deliveryLocation] }) : "—"
387
399
  })] }),
388
- /* @__PURE__ */ g("div", {
400
+ /* @__PURE__ */ m("div", {
389
401
  className: "col-span-2",
390
- children: [/* @__PURE__ */ h("dt", {
402
+ children: [/* @__PURE__ */ p("dt", {
391
403
  className: "text-xs text-text-tertiary",
392
404
  children: "Term"
393
- }), /* @__PURE__ */ g("dd", {
405
+ }), /* @__PURE__ */ m("dd", {
394
406
  className: "mt-0.5 flex items-center gap-1.5 text-sm text-text-primary tabular-nums",
395
- children: [/* @__PURE__ */ h(be, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), $e]
407
+ children: [/* @__PURE__ */ p(De, { className: "h-3.5 w-3.5 shrink-0 text-text-tertiary" }), ct]
396
408
  })]
397
409
  }),
398
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("dt", {
410
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
399
411
  className: "text-xs text-text-tertiary",
400
412
  children: "Signed"
401
- }), /* @__PURE__ */ h("dd", {
413
+ }), /* @__PURE__ */ p("dd", {
402
414
  className: "mt-0.5 text-sm text-text-primary",
403
- children: r(R.signedAt)
415
+ children: r(I.signedAt)
404
416
  })] }),
405
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("dt", {
417
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("dt", {
406
418
  className: "text-xs text-text-tertiary",
407
419
  children: "Created"
408
- }), /* @__PURE__ */ h("dd", {
420
+ }), /* @__PURE__ */ p("dd", {
409
421
  className: "mt-0.5 text-sm text-text-primary",
410
- children: r(R.createdAt)
422
+ children: r(I.createdAt)
411
423
  })] })
412
424
  ]
413
- }), R.notes && /* @__PURE__ */ h("p", {
425
+ }), I.notes && /* @__PURE__ */ p("p", {
414
426
  className: "mt-5 rounded-lg bg-bg-sunken/60 p-3 text-sm text-text-secondary",
415
- children: R.notes
427
+ children: I.notes
416
428
  })]
417
429
  }),
418
- Z && /* @__PURE__ */ h("p", {
430
+ Y && /* @__PURE__ */ p("p", {
419
431
  className: "mt-4 text-sm text-status-error-text",
420
- children: Z
432
+ children: Y
421
433
  }),
422
- /* @__PURE__ */ h("div", {
434
+ /* @__PURE__ */ p("div", {
423
435
  className: "mt-6",
424
- children: /* @__PURE__ */ h(me, {
425
- items: Qe,
426
- value: U,
427
- onChange: ze
436
+ children: /* @__PURE__ */ p(ye, {
437
+ items: st,
438
+ value: V,
439
+ onChange: Xe
428
440
  })
429
441
  }),
430
- U === "shipments" && /* @__PURE__ */ h("div", {
442
+ V === "shipments" && /* @__PURE__ */ p("div", {
431
443
  className: "mt-6",
432
- children: /* @__PURE__ */ h(ae, {
444
+ children: /* @__PURE__ */ p(ae, {
433
445
  title: "Shipments",
434
446
  description: "Physical movements delivering against this contract's volume.",
435
- action: /* @__PURE__ */ g(_, {
447
+ action: /* @__PURE__ */ m(h, {
436
448
  size: "sm",
437
- onClick: Ke,
438
- children: [/* @__PURE__ */ h(f, { className: "mr-1.5 h-4 w-4" }), " Schedule shipment"]
449
+ onClick: $,
450
+ children: [/* @__PURE__ */ p(u, { className: "mr-1.5 h-4 w-4" }), " Schedule shipment"]
439
451
  }),
440
- children: $.length === 0 ? /* @__PURE__ */ h(l, {
452
+ children: B.isLoading ? /* @__PURE__ */ p(ie, { label: "Loading shipments…" }) : B.isError ? /* @__PURE__ */ p(re, {
453
+ message: "Couldn't load shipments.",
454
+ onRetry: () => B.refetch()
455
+ }) : Z.length === 0 ? /* @__PURE__ */ p(oe, {
441
456
  illustration: "empty-data",
442
- icon: /* @__PURE__ */ h(p, { className: "h-10 w-10" }),
457
+ icon: /* @__PURE__ */ p(d, { className: "h-10 w-10" }),
443
458
  title: "No shipments scheduled",
444
459
  description: "Schedule a shipment to start delivering against this contract.",
445
- action: /* @__PURE__ */ g(_, {
446
- onClick: Ke,
447
- children: [/* @__PURE__ */ h(f, { className: "mr-1.5 h-4 w-4" }), " Schedule shipment"]
460
+ action: /* @__PURE__ */ m(h, {
461
+ onClick: $,
462
+ children: [/* @__PURE__ */ p(u, { className: "mr-1.5 h-4 w-4" }), " Schedule shipment"]
448
463
  })
449
- }) : /* @__PURE__ */ h(ne, {
450
- columns: Ze,
451
- rows: $,
464
+ }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(ne, {
465
+ columns: ot,
466
+ rows: Z,
452
467
  rowKey: (e) => e.id
453
- })
468
+ }), /* @__PURE__ */ p(be, {
469
+ page: z.page,
470
+ pageSize: j,
471
+ itemCount: Z.length,
472
+ hasMore: B.data?.pageInfo?.hasMore ?? !1,
473
+ onPageChange: z.onPageChange
474
+ })] })
454
475
  })
455
476
  }),
456
- U === "tags" && /* @__PURE__ */ h("div", {
477
+ V === "tags" && /* @__PURE__ */ p("div", {
457
478
  className: "mt-6",
458
- children: /* @__PURE__ */ h(v, {
479
+ children: /* @__PURE__ */ p(g, {
459
480
  treatment: "glass",
460
481
  className: "p-6",
461
- children: /* @__PURE__ */ h(ve, {
482
+ children: /* @__PURE__ */ p(we, {
462
483
  entityType: "theglobalfuel-contract",
463
- entityId: R.id
484
+ entityId: I.id
464
485
  })
465
486
  })
466
487
  }),
467
- U === "discussion" && /* @__PURE__ */ h("div", {
488
+ V === "discussion" && /* @__PURE__ */ p("div", {
468
489
  className: "mt-6",
469
- children: /* @__PURE__ */ h(_e, {
490
+ children: /* @__PURE__ */ p(Ce, {
470
491
  entityType: "theglobalfuel-contract",
471
- entityId: R.id,
492
+ entityId: I.id,
472
493
  description: "Coordinate negotiation, delivery and settlement with your team."
473
494
  })
474
495
  }),
475
- /* @__PURE__ */ h(x, {
476
- open: Ve,
496
+ /* @__PURE__ */ p(y, {
497
+ open: Qe,
477
498
  onOpenChange: (e) => {
478
- q(e), e || (Y(P(R.unit)), X(null), Q(null));
499
+ G(e), e || (q(M(I.unit)), J(null), X(null));
479
500
  },
480
- children: /* @__PURE__ */ g(S, { children: [/* @__PURE__ */ g(T, { children: [/* @__PURE__ */ h(je, { children: "Schedule shipment" }), /* @__PURE__ */ g(C, { children: [
501
+ children: /* @__PURE__ */ m(b, { children: [/* @__PURE__ */ m(C, { children: [/* @__PURE__ */ p(w, { children: "Schedule shipment" }), /* @__PURE__ */ m(x, { children: [
481
502
  "Log a physical movement delivering against ",
482
- R.reference,
503
+ I.reference,
483
504
  "."
484
- ] })] }), /* @__PURE__ */ g("form", {
505
+ ] })] }), /* @__PURE__ */ m("form", {
485
506
  onSubmit: (e) => {
486
- e.preventDefault(), Ye();
507
+ e.preventDefault(), it();
487
508
  },
488
- children: [/* @__PURE__ */ g("div", {
509
+ children: [/* @__PURE__ */ m("div", {
489
510
  className: "grid gap-4 py-2",
490
511
  children: [
491
- /* @__PURE__ */ g("div", {
512
+ /* @__PURE__ */ m("div", {
492
513
  className: "grid gap-2 sm:grid-cols-2",
493
- children: [/* @__PURE__ */ g("div", {
514
+ children: [/* @__PURE__ */ m("div", {
494
515
  className: "grid gap-1.5",
495
- children: [/* @__PURE__ */ h(b, {
516
+ children: [/* @__PURE__ */ p(v, {
496
517
  htmlFor: "shipReference",
497
518
  children: "Reference *"
498
- }), /* @__PURE__ */ h(y, {
519
+ }), /* @__PURE__ */ p(_, {
499
520
  id: "shipReference",
500
- value: J.reference,
501
- onChange: (e) => Y({
502
- ...J,
521
+ value: K.reference,
522
+ onChange: (e) => q({
523
+ ...K,
503
524
  reference: e.target.value
504
525
  }),
505
526
  placeholder: "SHP-2026-0031"
506
527
  })]
507
- }), /* @__PURE__ */ g("div", {
528
+ }), /* @__PURE__ */ m("div", {
508
529
  className: "grid gap-1.5",
509
- children: [/* @__PURE__ */ h(b, {
530
+ children: [/* @__PURE__ */ p(v, {
510
531
  htmlFor: "shipMode",
511
532
  children: "Mode"
512
- }), /* @__PURE__ */ g(E, {
513
- value: J.mode,
514
- onValueChange: (e) => Y({
515
- ...J,
533
+ }), /* @__PURE__ */ m(T, {
534
+ value: K.mode,
535
+ onValueChange: (e) => q({
536
+ ...K,
516
537
  mode: e
517
538
  }),
518
- children: [/* @__PURE__ */ h(k, {
539
+ children: [/* @__PURE__ */ p(O, {
519
540
  id: "shipMode",
520
- children: /* @__PURE__ */ h(A, {})
521
- }), /* @__PURE__ */ h(D, { children: Ne.map((e) => /* @__PURE__ */ h(O, {
541
+ children: /* @__PURE__ */ p(k, {})
542
+ }), /* @__PURE__ */ p(E, { children: ze.map((e) => /* @__PURE__ */ p(D, {
522
543
  value: e,
523
544
  children: i(e)
524
545
  }, e)) })]
525
546
  })]
526
547
  })]
527
548
  }),
528
- /* @__PURE__ */ g("div", {
549
+ /* @__PURE__ */ m("div", {
529
550
  className: "grid gap-1.5",
530
- children: [/* @__PURE__ */ h(b, {
551
+ children: [/* @__PURE__ */ p(v, {
531
552
  htmlFor: "shipCarrier",
532
553
  children: "Carrier"
533
- }), /* @__PURE__ */ h(y, {
554
+ }), /* @__PURE__ */ p(_, {
534
555
  id: "shipCarrier",
535
- value: J.carrier,
536
- onChange: (e) => Y({
537
- ...J,
556
+ value: K.carrier,
557
+ onChange: (e) => q({
558
+ ...K,
538
559
  carrier: e.target.value
539
560
  }),
540
561
  placeholder: "Maersk Tankers"
541
562
  })]
542
563
  }),
543
- /* @__PURE__ */ g("div", {
564
+ /* @__PURE__ */ m("div", {
544
565
  className: "grid gap-2 sm:grid-cols-2",
545
- children: [/* @__PURE__ */ g("div", {
566
+ children: [/* @__PURE__ */ m("div", {
546
567
  className: "grid gap-1.5",
547
- children: [/* @__PURE__ */ h(b, {
568
+ children: [/* @__PURE__ */ p(v, {
548
569
  htmlFor: "shipOrigin",
549
570
  children: "Origin"
550
- }), /* @__PURE__ */ h(y, {
571
+ }), /* @__PURE__ */ p(_, {
551
572
  id: "shipOrigin",
552
- value: J.origin,
553
- onChange: (e) => Y({
554
- ...J,
573
+ value: K.origin,
574
+ onChange: (e) => q({
575
+ ...K,
555
576
  origin: e.target.value
556
577
  }),
557
578
  placeholder: "Ras Tanura"
558
579
  })]
559
- }), /* @__PURE__ */ g("div", {
580
+ }), /* @__PURE__ */ m("div", {
560
581
  className: "grid gap-1.5",
561
- children: [/* @__PURE__ */ h(b, {
582
+ children: [/* @__PURE__ */ p(v, {
562
583
  htmlFor: "shipDestination",
563
584
  children: "Destination"
564
- }), /* @__PURE__ */ h(y, {
585
+ }), /* @__PURE__ */ p(_, {
565
586
  id: "shipDestination",
566
- value: J.destination,
567
- onChange: (e) => Y({
568
- ...J,
587
+ value: K.destination,
588
+ onChange: (e) => q({
589
+ ...K,
569
590
  destination: e.target.value
570
591
  }),
571
592
  placeholder: "Rotterdam"
572
593
  })]
573
594
  })]
574
595
  }),
575
- /* @__PURE__ */ g("div", {
596
+ /* @__PURE__ */ m("div", {
576
597
  className: "grid gap-2 sm:grid-cols-3",
577
598
  children: [
578
- /* @__PURE__ */ g("div", {
599
+ /* @__PURE__ */ m("div", {
579
600
  className: "grid gap-1.5",
580
- children: [/* @__PURE__ */ h(b, {
601
+ children: [/* @__PURE__ */ p(v, {
581
602
  htmlFor: "shipVolume",
582
603
  children: "Volume *"
583
- }), /* @__PURE__ */ h(y, {
604
+ }), /* @__PURE__ */ p(_, {
584
605
  id: "shipVolume",
585
606
  type: "number",
586
607
  min: "0",
587
608
  step: "any",
588
- value: J.volume,
589
- onChange: (e) => Y({
590
- ...J,
609
+ value: K.volume,
610
+ onChange: (e) => q({
611
+ ...K,
591
612
  volume: e.target.value
592
613
  }),
593
614
  placeholder: "50000"
594
615
  })]
595
616
  }),
596
- /* @__PURE__ */ g("div", {
617
+ /* @__PURE__ */ m("div", {
597
618
  className: "grid gap-1.5",
598
- children: [/* @__PURE__ */ h(b, {
619
+ children: [/* @__PURE__ */ p(v, {
599
620
  htmlFor: "shipUnit",
600
621
  children: "Unit"
601
- }), /* @__PURE__ */ g(E, {
602
- value: J.unit,
603
- onValueChange: (e) => Y({
604
- ...J,
622
+ }), /* @__PURE__ */ m(T, {
623
+ value: K.unit,
624
+ onValueChange: (e) => q({
625
+ ...K,
605
626
  unit: e
606
627
  }),
607
- children: [/* @__PURE__ */ h(k, {
628
+ children: [/* @__PURE__ */ p(O, {
608
629
  id: "shipUnit",
609
- children: /* @__PURE__ */ h(A, {})
610
- }), /* @__PURE__ */ h(D, { children: M.map((e) => /* @__PURE__ */ h(O, {
630
+ children: /* @__PURE__ */ p(k, {})
631
+ }), /* @__PURE__ */ p(E, { children: Be.map((e) => /* @__PURE__ */ p(D, {
611
632
  value: e,
612
633
  children: a(e)
613
634
  }, e)) })]
614
635
  })]
615
636
  }),
616
- /* @__PURE__ */ g("div", {
637
+ /* @__PURE__ */ m("div", {
617
638
  className: "grid gap-1.5",
618
- children: [/* @__PURE__ */ h(b, {
639
+ children: [/* @__PURE__ */ p(v, {
619
640
  htmlFor: "shipScheduled",
620
641
  children: "Scheduled at"
621
- }), /* @__PURE__ */ h(y, {
642
+ }), /* @__PURE__ */ p(_, {
622
643
  id: "shipScheduled",
623
644
  type: "date",
624
- value: J.scheduledAt,
625
- onChange: (e) => Y({
626
- ...J,
645
+ value: K.scheduledAt,
646
+ onChange: (e) => q({
647
+ ...K,
627
648
  scheduledAt: e.target.value
628
649
  })
629
650
  })]
630
651
  })
631
652
  ]
632
653
  }),
633
- /* @__PURE__ */ h(he, {
654
+ /* @__PURE__ */ p(xe, {
634
655
  id: "ship-doc",
635
656
  label: "Bill of lading / document",
636
- value: He,
637
- onChange: X,
657
+ value: $e,
658
+ onChange: J,
638
659
  accept: "image/*,application/pdf",
639
660
  hint: "Attach the bill of lading or shipping document (PDF or image)."
640
661
  }),
641
- /* @__PURE__ */ g("div", {
662
+ /* @__PURE__ */ m("div", {
642
663
  className: "grid gap-1.5",
643
- children: [/* @__PURE__ */ h(b, {
664
+ children: [/* @__PURE__ */ p(v, {
644
665
  htmlFor: "shipNotes",
645
666
  children: "Notes"
646
- }), /* @__PURE__ */ h(j, {
667
+ }), /* @__PURE__ */ p(A, {
647
668
  id: "shipNotes",
648
669
  rows: 2,
649
- value: J.notes,
650
- onChange: (e) => Y({
651
- ...J,
670
+ value: K.notes,
671
+ onChange: (e) => q({
672
+ ...K,
652
673
  notes: e.target.value
653
674
  }),
654
675
  placeholder: "Optional context about this shipment."
655
676
  })]
656
677
  }),
657
- Z && /* @__PURE__ */ h("p", {
678
+ Y && /* @__PURE__ */ p("p", {
658
679
  className: "text-sm text-status-error-text",
659
- children: Z
680
+ children: Y
660
681
  })
661
682
  ]
662
- }), /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(_, {
683
+ }), /* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(h, {
663
684
  type: "button",
664
685
  variant: "outline",
665
686
  onClick: () => {
666
- q(!1), Y(P(R.unit)), X(null), Q(null);
687
+ G(!1), q(M(I.unit)), J(null), X(null);
667
688
  },
668
689
  children: "Cancel"
669
- }), /* @__PURE__ */ h(_, {
690
+ }), /* @__PURE__ */ p(h, {
670
691
  type: "submit",
671
- disabled: V.isPending,
672
- children: V.isPending ? "Scheduling…" : "Schedule shipment"
692
+ disabled: R.isPending,
693
+ children: R.isPending ? "Scheduling…" : "Schedule shipment"
673
694
  })] })]
674
695
  })] })
675
696
  }),
676
- /* @__PURE__ */ h(x, {
677
- open: Be,
678
- onOpenChange: W,
679
- children: /* @__PURE__ */ g(S, { children: [/* @__PURE__ */ g(T, { children: [/* @__PURE__ */ h(je, { children: "Edit contract" }), /* @__PURE__ */ g(C, { children: [
697
+ /* @__PURE__ */ p(y, {
698
+ open: Ze,
699
+ onOpenChange: H,
700
+ children: /* @__PURE__ */ m(b, { children: [/* @__PURE__ */ m(C, { children: [/* @__PURE__ */ p(w, { children: "Edit contract" }), /* @__PURE__ */ m(x, { children: [
680
701
  "Update the commercial terms of ",
681
- R.reference,
702
+ I.reference,
682
703
  "."
683
- ] })] }), /* @__PURE__ */ g("form", {
704
+ ] })] }), /* @__PURE__ */ m("form", {
684
705
  onSubmit: (e) => {
685
- e.preventDefault(), Je();
706
+ e.preventDefault(), rt();
686
707
  },
687
- children: [G && /* @__PURE__ */ g("div", {
708
+ children: [U && /* @__PURE__ */ m("div", {
688
709
  className: "grid gap-4 py-2",
689
710
  children: [
690
- /* @__PURE__ */ g("div", {
711
+ /* @__PURE__ */ m("div", {
691
712
  className: "grid gap-1.5",
692
- children: [/* @__PURE__ */ h(b, {
713
+ children: [/* @__PURE__ */ p(v, {
693
714
  htmlFor: "editCounterparty",
694
715
  children: "Counterparty *"
695
- }), /* @__PURE__ */ h(y, {
716
+ }), /* @__PURE__ */ p(_, {
696
717
  id: "editCounterparty",
697
- value: G.counterparty,
698
- onChange: (e) => K({
699
- ...G,
718
+ value: U.counterparty,
719
+ onChange: (e) => W({
720
+ ...U,
700
721
  counterparty: e.target.value
701
722
  }),
702
723
  placeholder: "Vitol S.A."
703
724
  })]
704
725
  }),
705
- /* @__PURE__ */ g("div", {
726
+ /* @__PURE__ */ m("div", {
706
727
  className: "grid gap-2 sm:grid-cols-2",
707
- children: [/* @__PURE__ */ g("div", {
728
+ children: [/* @__PURE__ */ m("div", {
708
729
  className: "grid gap-1.5",
709
- children: [/* @__PURE__ */ h(b, {
730
+ children: [/* @__PURE__ */ p(v, {
710
731
  htmlFor: "editPricingBasis",
711
732
  children: "Pricing basis"
712
- }), /* @__PURE__ */ g(E, {
713
- value: G.pricingBasis,
714
- onValueChange: (e) => K({
715
- ...G,
733
+ }), /* @__PURE__ */ m(T, {
734
+ value: U.pricingBasis,
735
+ onValueChange: (e) => W({
736
+ ...U,
716
737
  pricingBasis: e
717
738
  }),
718
- children: [/* @__PURE__ */ h(k, {
739
+ children: [/* @__PURE__ */ p(O, {
719
740
  id: "editPricingBasis",
720
- children: /* @__PURE__ */ h(A, {})
721
- }), /* @__PURE__ */ h(D, { children: Me.map((e) => /* @__PURE__ */ h(O, {
741
+ children: /* @__PURE__ */ p(k, {})
742
+ }), /* @__PURE__ */ p(E, { children: Re.map((e) => /* @__PURE__ */ p(D, {
722
743
  value: e,
723
744
  children: i(e)
724
745
  }, e)) })]
725
746
  })]
726
- }), /* @__PURE__ */ g("div", {
747
+ }), /* @__PURE__ */ m("div", {
727
748
  className: "grid gap-1.5",
728
- children: [/* @__PURE__ */ h(b, {
749
+ children: [/* @__PURE__ */ p(v, {
729
750
  htmlFor: "editPriceIndex",
730
751
  children: "Price index"
731
- }), /* @__PURE__ */ h(y, {
752
+ }), /* @__PURE__ */ p(_, {
732
753
  id: "editPriceIndex",
733
- value: G.priceIndex,
734
- onChange: (e) => K({
735
- ...G,
754
+ value: U.priceIndex,
755
+ onChange: (e) => W({
756
+ ...U,
736
757
  priceIndex: e.target.value
737
758
  }),
738
759
  placeholder: "Brent, TTF, Henry Hub"
739
760
  })]
740
761
  })]
741
762
  }),
742
- /* @__PURE__ */ g("div", {
763
+ /* @__PURE__ */ m("div", {
743
764
  className: "grid gap-2 sm:grid-cols-3",
744
765
  children: [
745
- /* @__PURE__ */ g("div", {
766
+ /* @__PURE__ */ m("div", {
746
767
  className: "grid gap-1.5",
747
- children: [/* @__PURE__ */ h(b, {
768
+ children: [/* @__PURE__ */ p(v, {
748
769
  htmlFor: "editPrice",
749
770
  children: "Price / unit"
750
- }), /* @__PURE__ */ h(y, {
771
+ }), /* @__PURE__ */ p(_, {
751
772
  id: "editPrice",
752
773
  type: "number",
753
774
  min: "0",
754
775
  step: "any",
755
- value: G.pricePerUnit,
756
- onChange: (e) => K({
757
- ...G,
776
+ value: U.pricePerUnit,
777
+ onChange: (e) => W({
778
+ ...U,
758
779
  pricePerUnit: e.target.value
759
780
  }),
760
781
  placeholder: "82.50"
761
782
  })]
762
783
  }),
763
- /* @__PURE__ */ g("div", {
784
+ /* @__PURE__ */ m("div", {
764
785
  className: "grid gap-1.5",
765
- children: [/* @__PURE__ */ h(b, {
786
+ children: [/* @__PURE__ */ p(v, {
766
787
  htmlFor: "editCurrency",
767
788
  children: "Currency"
768
- }), /* @__PURE__ */ h(y, {
789
+ }), /* @__PURE__ */ p(_, {
769
790
  id: "editCurrency",
770
- value: G.currency,
771
- onChange: (e) => K({
772
- ...G,
791
+ value: U.currency,
792
+ onChange: (e) => W({
793
+ ...U,
773
794
  currency: e.target.value
774
795
  }),
775
796
  placeholder: "USD"
776
797
  })]
777
798
  }),
778
- /* @__PURE__ */ g("div", {
799
+ /* @__PURE__ */ m("div", {
779
800
  className: "grid gap-1.5",
780
- children: [/* @__PURE__ */ h(b, {
801
+ children: [/* @__PURE__ */ p(v, {
781
802
  htmlFor: "editUnit",
782
803
  children: "Unit"
783
- }), /* @__PURE__ */ g(E, {
784
- value: G.unit,
785
- onValueChange: (e) => K({
786
- ...G,
804
+ }), /* @__PURE__ */ m(T, {
805
+ value: U.unit,
806
+ onValueChange: (e) => W({
807
+ ...U,
787
808
  unit: e
788
809
  }),
789
- children: [/* @__PURE__ */ h(k, {
810
+ children: [/* @__PURE__ */ p(O, {
790
811
  id: "editUnit",
791
- children: /* @__PURE__ */ h(A, {})
792
- }), /* @__PURE__ */ h(D, { children: M.map((e) => /* @__PURE__ */ h(O, {
812
+ children: /* @__PURE__ */ p(k, {})
813
+ }), /* @__PURE__ */ p(E, { children: Be.map((e) => /* @__PURE__ */ p(D, {
793
814
  value: e,
794
815
  children: a(e)
795
816
  }, e)) })]
@@ -797,103 +818,103 @@ function F() {
797
818
  })
798
819
  ]
799
820
  }),
800
- /* @__PURE__ */ g("div", {
821
+ /* @__PURE__ */ m("div", {
801
822
  className: "grid gap-2 sm:grid-cols-2",
802
- children: [/* @__PURE__ */ g("div", {
823
+ children: [/* @__PURE__ */ m("div", {
803
824
  className: "grid gap-1.5",
804
- children: [/* @__PURE__ */ h(b, {
825
+ children: [/* @__PURE__ */ p(v, {
805
826
  htmlFor: "editVolume",
806
827
  children: "Contracted volume"
807
- }), /* @__PURE__ */ h(y, {
828
+ }), /* @__PURE__ */ p(_, {
808
829
  id: "editVolume",
809
830
  type: "number",
810
831
  min: "0",
811
832
  step: "any",
812
- value: G.contractedVolume,
813
- onChange: (e) => K({
814
- ...G,
833
+ value: U.contractedVolume,
834
+ onChange: (e) => W({
835
+ ...U,
815
836
  contractedVolume: e.target.value
816
837
  }),
817
838
  placeholder: "500000"
818
839
  })]
819
- }), /* @__PURE__ */ g("div", {
840
+ }), /* @__PURE__ */ m("div", {
820
841
  className: "grid gap-1.5",
821
- children: [/* @__PURE__ */ h(b, {
842
+ children: [/* @__PURE__ */ p(v, {
822
843
  htmlFor: "editLocation",
823
844
  children: "Delivery location"
824
- }), /* @__PURE__ */ h(y, {
845
+ }), /* @__PURE__ */ p(_, {
825
846
  id: "editLocation",
826
- value: G.deliveryLocation,
827
- onChange: (e) => K({
828
- ...G,
847
+ value: U.deliveryLocation,
848
+ onChange: (e) => W({
849
+ ...U,
829
850
  deliveryLocation: e.target.value
830
851
  }),
831
852
  placeholder: "Rotterdam"
832
853
  })]
833
854
  })]
834
855
  }),
835
- /* @__PURE__ */ g("div", {
856
+ /* @__PURE__ */ m("div", {
836
857
  className: "grid gap-2 sm:grid-cols-2",
837
- children: [/* @__PURE__ */ g("div", {
858
+ children: [/* @__PURE__ */ m("div", {
838
859
  className: "grid gap-1.5",
839
- children: [/* @__PURE__ */ h(b, {
860
+ children: [/* @__PURE__ */ p(v, {
840
861
  htmlFor: "editStart",
841
862
  children: "Start date"
842
- }), /* @__PURE__ */ h(y, {
863
+ }), /* @__PURE__ */ p(_, {
843
864
  id: "editStart",
844
865
  type: "date",
845
- value: G.startDate,
846
- onChange: (e) => K({
847
- ...G,
866
+ value: U.startDate,
867
+ onChange: (e) => W({
868
+ ...U,
848
869
  startDate: e.target.value
849
870
  })
850
871
  })]
851
- }), /* @__PURE__ */ g("div", {
872
+ }), /* @__PURE__ */ m("div", {
852
873
  className: "grid gap-1.5",
853
- children: [/* @__PURE__ */ h(b, {
874
+ children: [/* @__PURE__ */ p(v, {
854
875
  htmlFor: "editEnd",
855
876
  children: "End date"
856
- }), /* @__PURE__ */ h(y, {
877
+ }), /* @__PURE__ */ p(_, {
857
878
  id: "editEnd",
858
879
  type: "date",
859
- value: G.endDate,
860
- onChange: (e) => K({
861
- ...G,
880
+ value: U.endDate,
881
+ onChange: (e) => W({
882
+ ...U,
862
883
  endDate: e.target.value
863
884
  })
864
885
  })]
865
886
  })]
866
887
  }),
867
- /* @__PURE__ */ g("div", {
888
+ /* @__PURE__ */ m("div", {
868
889
  className: "grid gap-1.5",
869
- children: [/* @__PURE__ */ h(b, {
890
+ children: [/* @__PURE__ */ p(v, {
870
891
  htmlFor: "editNotes",
871
892
  children: "Notes"
872
- }), /* @__PURE__ */ h(j, {
893
+ }), /* @__PURE__ */ p(A, {
873
894
  id: "editNotes",
874
895
  rows: 2,
875
- value: G.notes,
876
- onChange: (e) => K({
877
- ...G,
896
+ value: U.notes,
897
+ onChange: (e) => W({
898
+ ...U,
878
899
  notes: e.target.value
879
900
  }),
880
901
  placeholder: "Optional context about this contract."
881
902
  })]
882
903
  }),
883
- Z && /* @__PURE__ */ h("p", {
904
+ Y && /* @__PURE__ */ p("p", {
884
905
  className: "text-sm text-status-error-text",
885
- children: Z
906
+ children: Y
886
907
  })
887
908
  ]
888
- }), /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(_, {
909
+ }), /* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(h, {
889
910
  type: "button",
890
911
  variant: "outline",
891
- onClick: () => W(!1),
912
+ onClick: () => H(!1),
892
913
  children: "Cancel"
893
- }), /* @__PURE__ */ h(_, {
914
+ }), /* @__PURE__ */ p(h, {
894
915
  type: "submit",
895
- disabled: B.isPending,
896
- children: B.isPending ? "Saving…" : "Save changes"
916
+ disabled: L.isPending,
917
+ children: L.isPending ? "Saving…" : "Save changes"
897
918
  })] })]
898
919
  })] })
899
920
  })
@@ -901,6 +922,6 @@ function F() {
901
922
  });
902
923
  }
903
924
  //#endregion
904
- export { F as ContractDetailPage };
925
+ export { N as ContractDetailPage };
905
926
 
906
927
  //# sourceMappingURL=ContractDetailPage.js.map