@carlonicora/nextjs-jsonapi 3.3.9 → 3.4.0

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 (175) hide show
  1. package/dist/{BlockNoteEditor-BYMRWUVG.mjs → BlockNoteEditor-3D5D7YL7.mjs} +2 -2
  2. package/dist/{BlockNoteEditor-USRMFZGP.js → BlockNoteEditor-F6TGKMTW.js} +9 -9
  3. package/dist/{BlockNoteEditor-USRMFZGP.js.map → BlockNoteEditor-F6TGKMTW.js.map} +1 -1
  4. package/dist/billing/index.js +347 -347
  5. package/dist/billing/index.js.map +1 -1
  6. package/dist/billing/index.mjs +27 -27
  7. package/dist/billing/index.mjs.map +1 -1
  8. package/dist/{chunk-CFZW6GU4.mjs → chunk-G5LSXG5K.mjs} +2572 -2482
  9. package/dist/chunk-G5LSXG5K.mjs.map +1 -0
  10. package/dist/{chunk-5WFYQE22.js → chunk-KT4CTWCV.js} +825 -735
  11. package/dist/chunk-KT4CTWCV.js.map +1 -0
  12. package/dist/client/index.d.mts +5 -0
  13. package/dist/client/index.d.ts +5 -0
  14. package/dist/client/index.js +2 -2
  15. package/dist/client/index.mjs +1 -1
  16. package/dist/components/index.d.mts +12 -6
  17. package/dist/components/index.d.ts +12 -6
  18. package/dist/components/index.js +2 -2
  19. package/dist/components/index.mjs +1 -1
  20. package/dist/contexts/index.d.mts +13 -1
  21. package/dist/contexts/index.d.ts +13 -1
  22. package/dist/contexts/index.js +6 -2
  23. package/dist/contexts/index.js.map +1 -1
  24. package/dist/contexts/index.mjs +5 -1
  25. package/dist/features/help/index.js +35 -35
  26. package/dist/features/help/index.js.map +1 -1
  27. package/dist/features/help/index.mjs +6 -6
  28. package/dist/features/help/index.mjs.map +1 -1
  29. package/dist/features/tokenusage/index.js +135 -129
  30. package/dist/features/tokenusage/index.js.map +1 -1
  31. package/dist/features/tokenusage/index.mjs +74 -68
  32. package/dist/features/tokenusage/index.mjs.map +1 -1
  33. package/package.json +2 -2
  34. package/scripts/check-rtl-classes.mjs +60 -0
  35. package/scripts/check-rtl-classes.test.ts +25 -0
  36. package/src/components/TableCellAvatar.tsx +1 -1
  37. package/src/components/containers/PageContainer.tsx +1 -1
  38. package/src/components/containers/ReactMarkdownContainer.tsx +20 -4
  39. package/src/components/containers/RoundPageContainer.tsx +7 -7
  40. package/src/components/contents/AttributeElement.tsx +1 -1
  41. package/src/components/editors/BlockNoteDiffInlineContent.tsx +2 -2
  42. package/src/components/editors/BlockNoteEditorMentionHoverCard.tsx +1 -0
  43. package/src/components/forms/CommonDeleter.tsx +1 -1
  44. package/src/components/forms/CommonEditorButtons.tsx +1 -1
  45. package/src/components/forms/DatePickerPopover.tsx +2 -2
  46. package/src/components/forms/DateRangeSelector.tsx +2 -2
  47. package/src/components/forms/EditorSheet.tsx +18 -9
  48. package/src/components/forms/EntityMultiSelector.tsx +7 -7
  49. package/src/components/forms/EntitySelector.tsx +8 -8
  50. package/src/components/forms/FileUploader.tsx +1 -0
  51. package/src/components/forms/FormCheckbox.tsx +3 -3
  52. package/src/components/forms/FormDateTime.tsx +3 -3
  53. package/src/components/forms/FormFieldWrapper.tsx +1 -1
  54. package/src/components/forms/FormPlaceAutocomplete.tsx +2 -2
  55. package/src/components/forms/GdprConsentCheckbox.tsx +1 -1
  56. package/src/components/forms/MultiFileUploader.tsx +1 -1
  57. package/src/components/forms/PasswordInput.tsx +1 -1
  58. package/src/components/forms/__tests__/FormCheckbox.test.tsx +4 -4
  59. package/src/components/navigations/Header.tsx +2 -2
  60. package/src/components/navigations/PageSection.tsx +1 -1
  61. package/src/components/pages/PageContainerContentDetails.tsx +1 -1
  62. package/src/components/pages/PageContentContainer.tsx +5 -2
  63. package/src/components/tables/ContentListTable.tsx +4 -4
  64. package/src/components/tables/ContentTableSearch.tsx +5 -5
  65. package/src/contexts/DirectionContext.tsx +25 -0
  66. package/src/contexts/__tests__/DirectionContext.test.tsx +22 -0
  67. package/src/contexts/index.ts +1 -0
  68. package/src/features/ai-connection/components/lists/AiConnectionTypeCard.tsx +1 -1
  69. package/src/features/assistant/components/containers/AssistantPageContainer.tsx +1 -1
  70. package/src/features/assistant/components/parts/AssistantBlockNoteComposer.tsx +2 -2
  71. package/src/features/assistant/components/parts/AssistantComposer.tsx +2 -2
  72. package/src/features/assistant/components/parts/AssistantEmptyState.tsx +1 -1
  73. package/src/features/assistant/components/parts/AssistantSidebar.tsx +3 -3
  74. package/src/features/assistant-action/components/ApprovalActionCard.tsx +1 -1
  75. package/src/features/assistant-action/components/AssistantContainerWithApprovals.tsx +1 -1
  76. package/src/features/assistant-message/components/MessageItem.tsx +3 -3
  77. package/src/features/assistant-message/components/__tests__/MessageItem.spec.tsx +1 -0
  78. package/src/features/assistant-message/components/parts/MessageSourcesPanel.tsx +2 -2
  79. package/src/features/assistant-message/components/parts/RelevanceMeter.tsx +1 -1
  80. package/src/features/assistant-message/components/parts/tabs/SuggestedQuestionsTab.tsx +1 -1
  81. package/src/features/auth/components/buttons/GoogleSignInButton.tsx +1 -1
  82. package/src/features/auth/components/forms/Register.tsx +2 -2
  83. package/src/features/auth/components/two-factor/BackupCodesDialog.tsx +3 -3
  84. package/src/features/auth/utils/__tests__/clearClientStorage.spec.ts +4 -4
  85. package/src/features/billing/components/cards/BillingUsageSummaryCard.tsx +1 -1
  86. package/src/features/billing/components/cards/CustomerInfoCard.tsx +1 -1
  87. package/src/features/billing/components/cards/InvoicesSummaryCard.tsx +1 -1
  88. package/src/features/billing/components/cards/PaymentMethodSummaryCard.tsx +1 -1
  89. package/src/features/billing/components/cards/SubscriptionSummaryCard.tsx +1 -1
  90. package/src/features/billing/components/containers/BillingDashboardContainer.tsx +1 -1
  91. package/src/features/billing/stripe-customer/components/details/PaymentMethodCard.tsx +1 -1
  92. package/src/features/billing/stripe-invoice/components/details/InvoiceDetails.tsx +6 -6
  93. package/src/features/billing/stripe-invoice/components/lists/InvoicesList.tsx +2 -2
  94. package/src/features/billing/stripe-price/hooks/useStripePriceTableStructure.tsx +3 -3
  95. package/src/features/billing/stripe-product/hooks/useStripeProductTableStructure.tsx +2 -2
  96. package/src/features/billing/stripe-subscription/components/lists/SubscriptionsList.tsx +4 -4
  97. package/src/features/billing/stripe-subscription/components/widgets/PricingCard.tsx +2 -2
  98. package/src/features/billing/stripe-subscription/components/widgets/SubscriptionConfirmation.tsx +1 -1
  99. package/src/features/billing/stripe-subscription/components/wizards/WizardStepReview.tsx +2 -2
  100. package/src/features/billing/stripe-usage/components/lists/UsageHistoryTable.tsx +2 -2
  101. package/src/features/company/components/forms/CompanyDeleter.tsx +4 -4
  102. package/src/features/content/hooks/useContentTableStructure.tsx +1 -1
  103. package/src/features/feature/components/forms/FormFeatures.tsx +2 -2
  104. package/src/features/help/components/HelpAssistantSheet.tsx +3 -2
  105. package/src/features/help/components/HelpHint.tsx +2 -2
  106. package/src/features/help/components/HelpTOC.tsx +1 -1
  107. package/src/features/how-to/components/containers/HowToCommand.tsx +2 -2
  108. package/src/features/how-to/components/containers/HowToCommandViewer.tsx +5 -5
  109. package/src/features/how-to/components/forms/HowToEditor.tsx +3 -3
  110. package/src/features/how-to/components/forms/HowToSelector.tsx +5 -5
  111. package/src/features/notification/components/lists/NotificationsList.tsx +2 -2
  112. package/src/features/notification/components/modals/NotificationModal.tsx +1 -1
  113. package/src/features/oauth/components/OAuthClientCard.tsx +2 -2
  114. package/src/features/oauth/components/OAuthClientDetail.tsx +2 -2
  115. package/src/features/oauth/components/OAuthClientList.tsx +3 -3
  116. package/src/features/oauth/components/OAuthRedirectUriInput.tsx +1 -1
  117. package/src/features/oauth/components/OAuthScopeSelector.tsx +2 -2
  118. package/src/features/onboarding/components/OnboardingCard.tsx +1 -7
  119. package/src/features/rbac/components/RbacByRoleContainer.tsx +3 -3
  120. package/src/features/rbac/components/RbacContainer.tsx +3 -3
  121. package/src/features/referral/components/ReferralWidget.tsx +1 -0
  122. package/src/features/role/components/forms/FormRoles.tsx +1 -1
  123. package/src/features/role/components/forms/RemoveUserFromRole.tsx +1 -1
  124. package/src/features/role/components/forms/UserRoleAdd.tsx +1 -1
  125. package/src/features/tokenusage/components/TokenUsageBreakdownTable.tsx +9 -9
  126. package/src/features/tokenusage/components/TokenUsageRankedBar.tsx +8 -3
  127. package/src/features/tokenusage/components/TokenUsageTimelineChart.tsx +5 -1
  128. package/src/features/user/components/details/UserStandaloneDetails.tsx +1 -1
  129. package/src/features/user/components/forms/UserReactivator.tsx +2 -2
  130. package/src/features/user/components/forms/UserResentInvitationEmail.tsx +1 -1
  131. package/src/features/user/components/forms/UserSelector.tsx +7 -7
  132. package/src/features/user/components/lists/ContributorsList.tsx +1 -1
  133. package/src/features/user/components/lists/UserListInAdd.tsx +1 -1
  134. package/src/features/user/components/widgets/UserSearchPopover.tsx +5 -5
  135. package/src/features/user/hooks/useUserTableStructure.tsx +1 -1
  136. package/src/features/waitlist/components/forms/WaitlistQuestionnaireRenderer.tsx +1 -1
  137. package/src/features/waitlist/hooks/useWaitlistTableStructure.tsx +1 -1
  138. package/src/hooks/useCustomD3Graph.tsx +16 -0
  139. package/src/lib/__tests__/direction.test.ts +18 -0
  140. package/src/lib/direction.ts +8 -0
  141. package/src/shadcnui/custom/multi-select.tsx +6 -6
  142. package/src/shadcnui/custom/multiple-selector.tsx +6 -2
  143. package/src/shadcnui/ui/accordion.tsx +1 -1
  144. package/src/shadcnui/ui/alert-dialog.tsx +2 -1
  145. package/src/shadcnui/ui/alert.tsx +2 -2
  146. package/src/shadcnui/ui/avatar.tsx +1 -1
  147. package/src/shadcnui/ui/badge.tsx +1 -1
  148. package/src/shadcnui/ui/breadcrumb.tsx +1 -1
  149. package/src/shadcnui/ui/button.tsx +4 -4
  150. package/src/shadcnui/ui/calendar.tsx +9 -8
  151. package/src/shadcnui/ui/carousel.tsx +18 -11
  152. package/src/shadcnui/ui/combobox.tsx +3 -3
  153. package/src/shadcnui/ui/command.tsx +2 -2
  154. package/src/shadcnui/ui/context-menu.tsx +15 -11
  155. package/src/shadcnui/ui/dialog.tsx +2 -1
  156. package/src/shadcnui/ui/drawer.tsx +19 -3
  157. package/src/shadcnui/ui/dropdown-menu.tsx +12 -10
  158. package/src/shadcnui/ui/field.tsx +2 -2
  159. package/src/shadcnui/ui/input-group.tsx +3 -3
  160. package/src/shadcnui/ui/input-otp.tsx +2 -0
  161. package/src/shadcnui/ui/navigation-menu.tsx +2 -2
  162. package/src/shadcnui/ui/progress.tsx +1 -1
  163. package/src/shadcnui/ui/radio-group.tsx +1 -0
  164. package/src/shadcnui/ui/resizable.tsx +1 -0
  165. package/src/shadcnui/ui/scroll-area.tsx +1 -1
  166. package/src/shadcnui/ui/select.tsx +2 -2
  167. package/src/shadcnui/ui/sheet.tsx +11 -4
  168. package/src/shadcnui/ui/sidebar.tsx +37 -20
  169. package/src/shadcnui/ui/sonner.tsx +6 -1
  170. package/src/shadcnui/ui/switch.tsx +1 -1
  171. package/src/shadcnui/ui/table.tsx +2 -2
  172. package/src/shadcnui/ui/tabs.tsx +1 -1
  173. package/dist/chunk-5WFYQE22.js.map +0 -1
  174. package/dist/chunk-CFZW6GU4.mjs.map +0 -1
  175. /package/dist/{BlockNoteEditor-BYMRWUVG.mjs.map → BlockNoteEditor-3D5D7YL7.mjs.map} +0 -0
@@ -26,7 +26,7 @@
26
26
 
27
27
 
28
28
 
29
- var _chunk5WFYQE22js = require('../../chunk-5WFYQE22.js');
29
+ var _chunkKT4CTWCVjs = require('../../chunk-KT4CTWCV.js');
30
30
  require('../../chunk-X2MQ3WHX.js');
31
31
 
32
32
 
@@ -70,7 +70,7 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
70
70
  };
71
71
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
72
72
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
73
- _chunk5WFYQE22js.DateRangeSelector,
73
+ _chunkKT4CTWCVjs.DateRangeSelector,
74
74
  {
75
75
  onDateChange: (range) => {
76
76
  if (!_optionalChain([range, 'optionalAccess', _ => _.from]) || !_optionalChain([range, 'optionalAccess', _2 => _2.to])) return;
@@ -105,16 +105,16 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
105
105
  }
106
106
  ),
107
107
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
108
- _chunk5WFYQE22js.Select,
108
+ _chunkKT4CTWCVjs.Select,
109
109
  {
110
110
  items: companyItems,
111
111
  value: _nullishCoalesce(companyId, () => ( ALL_COMPANIES)),
112
112
  onValueChange: (value) => onChange({ companyId: !value || value === ALL_COMPANIES ? void 0 : value }),
113
113
  children: [
114
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
115
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.SelectContent, { children: [
116
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
117
- companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectItem, { value: company.id, children: company.label }, company.id))
114
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
115
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.SelectContent, { children: [
116
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
117
+ companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.SelectItem, { value: company.id, children: company.label }, company.id))
118
118
  ] })
119
119
  ]
120
120
  }
@@ -137,7 +137,7 @@ function Segmented({
137
137
  children: options.map((option) => {
138
138
  const selected = option.value === value;
139
139
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
140
- _chunk5WFYQE22js.Button,
140
+ _chunkKT4CTWCVjs.Button,
141
141
  {
142
142
  type: "button",
143
143
  size: "sm",
@@ -219,7 +219,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
219
219
  pageUrl = TOKEN_USAGE_ADMIN_PAGE_URL
220
220
  }) => {
221
221
  const t = _nextintl.useTranslations.call(void 0, );
222
- const generateUrl = _chunk5WFYQE22js.usePageUrlGenerator.call(void 0, );
222
+ const generateUrl = _chunkKT4CTWCVjs.usePageUrlGenerator.call(void 0, );
223
223
  const [filters, setFilterState] = _react.useState.call(void 0, () => {
224
224
  const range = defaultRange();
225
225
  return {
@@ -337,7 +337,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
337
337
  error
338
338
  ]
339
339
  );
340
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
340
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
341
341
  }, "TokenUsageAdminProvider");
342
342
  var useTokenUsageAdmin = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
343
343
  const ctx = _react.useContext.call(void 0, TokenUsageAdminContext);
@@ -497,7 +497,7 @@ function LeadTile({
497
497
  previousLabel,
498
498
  decimal
499
499
  }) {
500
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardContent, { className: "grid gap-1", children: [
500
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.CardContent, { className: "grid gap-1", children: [
501
501
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
502
502
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: value }),
503
503
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
@@ -514,7 +514,7 @@ function SupportingTile({
514
514
  delta,
515
515
  decimal
516
516
  }) {
517
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardContent, { className: "grid gap-1", children: [
517
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.CardContent, { className: "grid gap-1", children: [
518
518
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
519
519
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-2", children: [
520
520
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: value }),
@@ -611,8 +611,8 @@ function TokenUsageBreakdownTable({ rows, metric }) {
611
611
  // The package's <Table> wraps itself in an `overflow-x-clip` container, which
612
612
  // would swallow the overflow before this scroller ever saw it — hence the
613
613
  // child override. Wide metric tables must scroll, never widen the page.
614
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-x-auto [&_[data-slot=table-container]]:overflow-x-visible", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Table, { children: [
615
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableHead, { className: _chunk6T6QB6K2js.cn.call(void 0, column.numeric && "text-right"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
614
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-x-auto [&_[data-slot=table-container]]:overflow-x-visible", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.Table, { children: [
615
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableHead, { className: _chunk6T6QB6K2js.cn.call(void 0, column.numeric && "text-end"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
616
616
  "button",
617
617
  {
618
618
  type: "button",
@@ -627,20 +627,20 @@ function TokenUsageBreakdownTable({ rows, metric }) {
627
627
  ]
628
628
  }
629
629
  ) }, column.key)) }) }),
630
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableBody, { children: sortedRows.map((row) => {
630
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableBody, { children: sortedRows.map((row) => {
631
631
  const value = metricValue(row, metric);
632
632
  const share = total > 0 ? value / total * 100 : 0;
633
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
634
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
635
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
636
- showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
637
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.calls, 0) }),
638
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
639
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
640
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: percent(cacheHitPercentage(row.cached, row.tokensIn)) }),
641
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
642
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
643
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: percent(share) })
633
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
634
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
635
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
636
+ showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableCell, { className: "text-end text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
637
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.calls, 0) }),
638
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
639
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
640
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableCell, { className: "text-end text-xs tabular-nums", children: percent(cacheHitPercentage(row.cached, row.tokensIn)) }),
641
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
642
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
643
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.TableCell, { className: "text-end text-xs tabular-nums", children: percent(share) })
644
644
  ] }, row.id);
645
645
  }) })
646
646
  ] }) })
@@ -724,7 +724,7 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
724
724
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-x-3 gap-y-0.5 py-0.5", children: [
725
725
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid min-w-0 gap-0.5", children: [
726
726
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground truncate text-xs", children: renderLabel(row) }),
727
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-muted h-2 w-full overflow-hidden rounded-r-[4px]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
727
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-muted h-2 w-full overflow-hidden rounded-r-[4px]", dir: "ltr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
728
728
  "div",
729
729
  {
730
730
  "data-testid": `ranked-fill-${row.id}`,
@@ -734,12 +734,12 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
734
734
  }
735
735
  ) })
736
736
  ] }),
737
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": `ranked-value-${row.id}`, className: "text-right text-xs tabular-nums", children: formatValue(value, metric) }),
737
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": `ranked-value-${row.id}`, className: "text-end text-xs tabular-nums", children: formatValue(value, metric) }),
738
738
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
739
739
  "span",
740
740
  {
741
741
  "data-testid": `ranked-share-${row.id}`,
742
- className: "text-muted-foreground w-16 text-right text-xs tabular-nums",
742
+ className: "text-muted-foreground w-16 text-end text-xs tabular-nums",
743
743
  children: percent(share)
744
744
  }
745
745
  )
@@ -830,61 +830,67 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
830
830
  }
831
831
  const granularity = inferGranularity(chartData.map((entry) => entry.bucket));
832
832
  const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ? OTHER_COLOR : seriesColor(index, mode), "seriesColorFor");
833
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, children: [
834
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-data", children: JSON.stringify(chartData) }),
835
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-series", children: JSON.stringify(seriesKeys) }),
836
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.ChartContainer, { config: chartConfig, className: "aspect-auto h-72 w-full", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _recharts.BarChart, { accessibilityLayer: true, data: chartData, margin: { top: 8, right: 8, bottom: 0, left: 0 }, children: [
837
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _recharts.CartesianGrid, { vertical: false }),
838
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
839
- _recharts.XAxis,
840
- {
841
- dataKey: "bucket",
842
- tickLine: false,
843
- axisLine: false,
844
- tickMargin: 8,
845
- minTickGap: 16,
846
- tickFormatter: (value) => bucketDate(value, granularity)
847
- }
848
- ),
849
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
850
- _recharts.YAxis,
851
- {
852
- tickLine: false,
853
- axisLine: false,
854
- tickMargin: 8,
855
- width: 48,
856
- tickFormatter: (value) => compact(value)
857
- }
858
- ),
859
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
860
- _chunk5WFYQE22js.ChartTooltip,
861
- {
862
- content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
863
- _chunk5WFYQE22js.ChartTooltipContent,
864
- {
865
- labelFormatter: (value) => bucketDate(String(value), granularity),
866
- valueFormatter: (value) => formatValue(Number(value), metric),
867
- hideZeroValues: true
868
- }
869
- )
870
- }
871
- ),
872
- seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.ChartLegendContent, {}) }) : null,
873
- seriesKeys.map((series, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
874
- _recharts.Bar,
875
- {
876
- dataKey: series,
877
- stackId: "usage",
878
- maxBarSize: 28,
879
- fill: seriesColorFor(series, index),
880
- stroke: "var(--background)",
881
- strokeWidth: 2,
882
- radius: index === seriesKeys.length - 1 ? [4, 4, 0, 0] : 0
883
- },
884
- series
885
- ))
886
- ] }) })
887
- ] });
833
+ return (
834
+ // The chart is a coordinate system, not prose: recharts lays the axes and the
835
+ // stacked bars out left-to-right, so the whole chart stays an LTR island even
836
+ // under dir="rtl". Only the labels inside it are translated.
837
+ // rtl-ok: deliberate LTR island (chart)
838
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, dir: "ltr", children: [
839
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-data", children: JSON.stringify(chartData) }),
840
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-series", children: JSON.stringify(seriesKeys) }),
841
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.ChartContainer, { config: chartConfig, className: "aspect-auto h-72 w-full", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _recharts.BarChart, { accessibilityLayer: true, data: chartData, margin: { top: 8, right: 8, bottom: 0, left: 0 }, children: [
842
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _recharts.CartesianGrid, { vertical: false }),
843
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
844
+ _recharts.XAxis,
845
+ {
846
+ dataKey: "bucket",
847
+ tickLine: false,
848
+ axisLine: false,
849
+ tickMargin: 8,
850
+ minTickGap: 16,
851
+ tickFormatter: (value) => bucketDate(value, granularity)
852
+ }
853
+ ),
854
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
855
+ _recharts.YAxis,
856
+ {
857
+ tickLine: false,
858
+ axisLine: false,
859
+ tickMargin: 8,
860
+ width: 48,
861
+ tickFormatter: (value) => compact(value)
862
+ }
863
+ ),
864
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
865
+ _chunkKT4CTWCVjs.ChartTooltip,
866
+ {
867
+ content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
868
+ _chunkKT4CTWCVjs.ChartTooltipContent,
869
+ {
870
+ labelFormatter: (value) => bucketDate(String(value), granularity),
871
+ valueFormatter: (value) => formatValue(Number(value), metric),
872
+ hideZeroValues: true
873
+ }
874
+ )
875
+ }
876
+ ),
877
+ seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.ChartLegendContent, {}) }) : null,
878
+ seriesKeys.map((series, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
879
+ _recharts.Bar,
880
+ {
881
+ dataKey: series,
882
+ stackId: "usage",
883
+ maxBarSize: 28,
884
+ fill: seriesColorFor(series, index),
885
+ stroke: "var(--background)",
886
+ strokeWidth: 2,
887
+ radius: index === seriesKeys.length - 1 ? [4, 4, 0, 0] : 0
888
+ },
889
+ series
890
+ ))
891
+ ] }) })
892
+ ] })
893
+ );
888
894
  }
889
895
  _chunk7QVYU63Ejs.__name.call(void 0, TokenUsageTimelineChart, "TokenUsageTimelineChart");
890
896
 
@@ -920,19 +926,19 @@ function TokenUsageAdminContainer() {
920
926
  [t]
921
927
  );
922
928
  if (error) {
923
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
929
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
924
930
  }
925
- if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.RoundPageContainer, { fullWidth: true, forceHeader: true });
931
+ if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.RoundPageContainer, { fullWidth: true, forceHeader: true });
926
932
  const emptyLabel = t("token_usage.admin.no_data");
927
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
933
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
928
934
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminTiles, { summary, metric: filters.metric, singleCustomerMode: hidePlatform }),
929
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
930
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardHeader, { children: [
931
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
932
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
935
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.Card, { children: [
936
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.CardHeader, { children: [
937
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
938
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
933
939
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.admin.stack_by") }),
934
940
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
935
- _chunk5WFYQE22js.Select,
941
+ _chunkKT4CTWCVjs.Select,
936
942
  {
937
943
  items: stackByItems,
938
944
  value: filters.stackBy,
@@ -940,29 +946,29 @@ function TokenUsageAdminContainer() {
940
946
  if (value) setFilters({ stackBy: value });
941
947
  },
942
948
  children: [
943
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectValue, {}) }),
944
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectItem, { value, children: stackByItems[value] }, value)) })
949
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.SelectValue, {}) }),
950
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.SelectItem, { value, children: stackByItems[value] }, value)) })
945
951
  ]
946
952
  }
947
953
  )
948
954
  ] }) })
949
955
  ] }),
950
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
956
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
951
957
  ] }),
952
958
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-4 md:grid-cols-2", children: [
953
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
954
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.admin.by_company") }) }),
955
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
959
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.Card, { children: [
960
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardTitle, { children: t("token_usage.admin.by_company") }) }),
961
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
956
962
  ] }),
957
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
958
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.admin.by_user") }) }),
959
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
963
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.Card, { children: [
964
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardTitle, { children: t("token_usage.admin.by_user") }) }),
965
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
960
966
  ] })
961
967
  ] }),
962
968
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk6T6QB6K2js.cn.call(void 0, "grid gap-4", !hidePlatform && "md:grid-cols-2"), children: [
963
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
964
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
965
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
969
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.Card, { children: [
970
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
971
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
966
972
  TokenUsageRankedBar,
967
973
  {
968
974
  rows: byCustomerOperation,
@@ -972,9 +978,9 @@ function TokenUsageAdminContainer() {
972
978
  }
973
979
  ) })
974
980
  ] }),
975
- !hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
976
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
977
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
981
+ !hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.Card, { children: [
982
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
983
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
978
984
  TokenUsageRankedBar,
979
985
  {
980
986
  rows: byOperation,
@@ -985,9 +991,9 @@ function TokenUsageAdminContainer() {
985
991
  ) })
986
992
  ] })
987
993
  ] }),
988
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
989
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.admin.detail") }) }),
990
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
994
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.Card, { children: [
995
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardTitle, { children: t("token_usage.admin.detail") }) }),
996
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
991
997
  ] })
992
998
  ] }) });
993
999
  }
@@ -1108,7 +1114,7 @@ var TOKEN_USAGE_REPORT_I18N_KEYS = [
1108
1114
 
1109
1115
  function TokenUsageReportFilterBar({ onChange }) {
1110
1116
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1111
- _chunk5WFYQE22js.DateRangeSelector,
1117
+ _chunkKT4CTWCVjs.DateRangeSelector,
1112
1118
  {
1113
1119
  onDateChange: (range) => {
1114
1120
  if (!_optionalChain([range, 'optionalAccess', _10 => _10.from]) || !_optionalChain([range, 'optionalAccess', _11 => _11.to])) return;
@@ -1141,7 +1147,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
1141
1147
  pageUrl = TOKEN_USAGE_REPORT_PAGE_URL
1142
1148
  }) => {
1143
1149
  const t = _nextintl.useTranslations.call(void 0, );
1144
- const generateUrl = _chunk5WFYQE22js.usePageUrlGenerator.call(void 0, );
1150
+ const generateUrl = _chunkKT4CTWCVjs.usePageUrlGenerator.call(void 0, );
1145
1151
  const [filters, setFilterState] = _react.useState.call(void 0, () => {
1146
1152
  const range = defaultRange2();
1147
1153
  return { from: _nullishCoalesce(initialFrom, () => ( range.from)), to: _nullishCoalesce(initialTo, () => ( range.to)) };
@@ -1205,7 +1211,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
1205
1211
  () => ({ summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error }),
1206
1212
  [summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error]
1207
1213
  );
1208
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
1214
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
1209
1215
  }, "TokenUsageReportProvider");
1210
1216
  var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
1211
1217
  const ctx = _react.useContext.call(void 0, TokenUsageReportContext);
@@ -1233,7 +1239,7 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
1233
1239
  const monthlyColor = monthlyPercentage > 75 ? "text-success" : monthlyPercentage >= 5 ? "text-warning" : "text-destructive";
1234
1240
  const whole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => decimal(Math.max(0, Math.floor(value)), 0), "whole");
1235
1241
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
1236
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardContent, { className: "grid gap-1", children: [
1242
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.CardContent, { className: "grid gap-1", children: [
1237
1243
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.used_in_period") }),
1238
1244
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(metricValue(current, metric), metric) }),
1239
1245
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
@@ -1249,7 +1255,7 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
1249
1255
  ] })
1250
1256
  ] }) }),
1251
1257
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3 sm:grid-cols-3", children: [
1252
- balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardContent, { className: "grid gap-1", children: [
1258
+ balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.CardContent, { className: "grid gap-1", children: [
1253
1259
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.monthly_left") }),
1254
1260
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-baseline gap-1", children: [
1255
1261
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className: _chunk6T6QB6K2js.cn.call(void 0, "text-sm font-medium tabular-nums", monthlyColor), children: whole(balances.availableMonthlyCredits) }),
@@ -1259,11 +1265,11 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
1259
1265
  ] })
1260
1266
  ] })
1261
1267
  ] }) }),
1262
- balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardContent, { className: "grid gap-1", children: [
1268
+ balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.CardContent, { className: "grid gap-1", children: [
1263
1269
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.extra_credits") }),
1264
1270
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: whole(balances.availableExtraCredits) })
1265
1271
  ] }) }),
1266
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardContent, { className: "grid gap-1", children: [
1272
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.CardContent, { className: "grid gap-1", children: [
1267
1273
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.calls") }),
1268
1274
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: decimal(current.calls, 0) })
1269
1275
  ] }) })
@@ -1305,21 +1311,21 @@ function TokenUsageReportContainer({ balances = null }) {
1305
1311
  const t = _nextintl.useTranslations.call(void 0, );
1306
1312
  const { summary, timeline, byOperation, byTarget, isLoading, error, targetPanelTitleKey } = useTokenUsageReport();
1307
1313
  if (error) {
1308
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
1314
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
1309
1315
  }
1310
- if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.RoundPageContainer, { fullWidth: true, forceHeader: true });
1316
+ if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.RoundPageContainer, { fullWidth: true, forceHeader: true });
1311
1317
  const emptyLabel = t("token_usage.report.no_data");
1312
1318
  const targetTitle = targetPanelTitleKey && byTarget.length > 0 ? t(targetPanelTitleKey) : void 0;
1313
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
1319
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
1314
1320
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportTiles, { summary, metric: "credits", balances }),
1315
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
1316
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
1317
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
1321
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.Card, { children: [
1322
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
1323
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
1318
1324
  ] }),
1319
1325
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk6T6QB6K2js.cn.call(void 0, "grid gap-4", targetTitle && "md:grid-cols-2"), children: [
1320
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
1321
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.report.by_operation") }) }),
1322
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1326
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.Card, { children: [
1327
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardTitle, { children: t("token_usage.report.by_operation") }) }),
1328
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1323
1329
  TokenUsageRankedBar,
1324
1330
  {
1325
1331
  rows: byOperation,
@@ -1329,9 +1335,9 @@ function TokenUsageReportContainer({ balances = null }) {
1329
1335
  }
1330
1336
  ) })
1331
1337
  ] }),
1332
- targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
1333
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: targetTitle }) }),
1334
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
1338
+ targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKT4CTWCVjs.Card, { children: [
1339
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardTitle, { children: targetTitle }) }),
1340
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKT4CTWCVjs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
1335
1341
  ] })
1336
1342
  ] })
1337
1343
  ] }) });