@carlonicora/nextjs-jsonapi 6.32.1 → 6.33.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.
- package/dist/{BlockNoteEditor-XIEMUQCO.mjs → BlockNoteEditor-DCVT7YHE.mjs} +4 -4
- package/dist/{BlockNoteEditor-RD3JNEV5.js → BlockNoteEditor-ZVK5MD34.js} +24 -24
- package/dist/{BlockNoteEditor-RD3JNEV5.js.map → BlockNoteEditor-ZVK5MD34.js.map} +1 -1
- package/dist/{BlockNoteViewer-RQBYHBQL.js → BlockNoteViewer-2KPGZSTJ.js} +3 -3
- package/dist/{BlockNoteViewer-RQBYHBQL.js.map → BlockNoteViewer-2KPGZSTJ.js.map} +1 -1
- package/dist/{BlockNoteViewer-NVSR67X5.mjs → BlockNoteViewer-XDAC6AL7.mjs} +2 -2
- package/dist/billing/index.js +477 -469
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +15 -7
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-5H25LM2Z.js → chunk-576XHOYH.js} +5 -5
- package/dist/{chunk-5H25LM2Z.js.map → chunk-576XHOYH.js.map} +1 -1
- package/dist/{chunk-NPGX2GJD.js → chunk-CI64OTRX.js} +98 -75
- package/dist/chunk-CI64OTRX.js.map +1 -0
- package/dist/{chunk-AEBZ67JJ.mjs → chunk-ETU3AW2X.mjs} +2 -2
- package/dist/{chunk-4JVLLBRS.mjs → chunk-GUNH3THR.mjs} +24 -1
- package/dist/chunk-GUNH3THR.mjs.map +1 -0
- package/dist/{chunk-SQNFYMYE.js → chunk-KH4Y4FU4.js} +1532 -1288
- package/dist/chunk-KH4Y4FU4.js.map +1 -0
- package/dist/{chunk-PNCO3HMJ.js → chunk-TCAOU6NH.js} +3 -3
- package/dist/{chunk-PNCO3HMJ.js.map → chunk-TCAOU6NH.js.map} +1 -1
- package/dist/{chunk-F25BVBEH.mjs → chunk-V4NPMUZ2.mjs} +2663 -2419
- package/dist/chunk-V4NPMUZ2.mjs.map +1 -0
- package/dist/{chunk-AMQFKCAX.mjs → chunk-WPFEPIKP.mjs} +2 -2
- package/dist/client/index.js +6 -4
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +5 -3
- package/dist/components/index.js +12 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +11 -3
- package/dist/components/tables/ContentListTable.d.ts +14 -0
- package/dist/components/tables/ContentListTable.d.ts.map +1 -1
- package/dist/components/tables/SortableHeader.d.ts +17 -0
- package/dist/components/tables/SortableHeader.d.ts.map +1 -0
- package/dist/components/tables/cells/cell.date.d.ts +4 -0
- package/dist/components/tables/cells/cell.date.d.ts.map +1 -1
- package/dist/components/tables/cells/cell.dateTime.d.ts +4 -0
- package/dist/components/tables/cells/cell.dateTime.d.ts.map +1 -1
- package/dist/components/tables/cells/cell.link.d.ts +4 -0
- package/dist/components/tables/cells/cell.link.d.ts.map +1 -1
- package/dist/components/tables/cells/cell.text.d.ts +4 -0
- package/dist/components/tables/cells/cell.text.d.ts.map +1 -1
- package/dist/components/tables/index.d.ts +2 -0
- package/dist/components/tables/index.d.ts.map +1 -1
- package/dist/components/tables/sorting.d.ts +24 -0
- package/dist/components/tables/sorting.d.ts.map +1 -0
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/email-automations/index.js +120 -115
- package/dist/email-automations/index.js.map +1 -1
- package/dist/email-automations/index.mjs +18 -13
- package/dist/email-automations/index.mjs.map +1 -1
- package/dist/features/analytics/index.js +114 -114
- package/dist/features/analytics/index.mjs +3 -3
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/billing/stripe-coupon/components/lists/CouponCodesList.d.ts.map +1 -1
- package/dist/features/billing/stripe-coupon/components/lists/CouponsList.d.ts.map +1 -1
- package/dist/features/billing/stripe-coupon/data/stripe-coupon-code.service.d.ts +2 -0
- package/dist/features/billing/stripe-coupon/data/stripe-coupon-code.service.d.ts.map +1 -1
- package/dist/features/billing/stripe-coupon/data/stripe-coupon.service.d.ts +1 -0
- package/dist/features/billing/stripe-coupon/data/stripe-coupon.service.d.ts.map +1 -1
- package/dist/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.d.ts.map +1 -1
- package/dist/features/billing/stripe-coupon/hooks/useStripeCouponTableStructure.d.ts.map +1 -1
- package/dist/features/billing/stripe-price/components/lists/PricesList.d.ts.map +1 -1
- package/dist/features/billing/stripe-price/data/stripe-price.service.d.ts +2 -0
- package/dist/features/billing/stripe-price/data/stripe-price.service.d.ts.map +1 -1
- package/dist/features/billing/stripe-price/hooks/useStripePriceTableStructure.d.ts.map +1 -1
- package/dist/features/billing/stripe-product/components/lists/ProductsList.d.ts.map +1 -1
- package/dist/features/billing/stripe-product/data/stripe-product.service.d.ts +2 -0
- package/dist/features/billing/stripe-product/data/stripe-product.service.d.ts.map +1 -1
- package/dist/features/billing/stripe-product/hooks/useStripeProductTableStructure.d.ts.map +1 -1
- package/dist/features/blog/components/admin/BlogPostsList.d.ts.map +1 -1
- package/dist/features/blog/data/BlogPostService.d.ts +1 -0
- package/dist/features/blog/data/BlogPostService.d.ts.map +1 -1
- package/dist/features/blog/index.js +134 -132
- package/dist/features/blog/index.js.map +1 -1
- package/dist/features/blog/index.mjs +8 -6
- package/dist/features/blog/index.mjs.map +1 -1
- package/dist/features/blog/server.js +7 -7
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/company/components/lists/CompaniesList.d.ts.map +1 -1
- package/dist/features/company/data/company.service.d.ts +1 -0
- package/dist/features/company/data/company.service.d.ts.map +1 -1
- package/dist/features/content/data/content.service.d.ts +3 -0
- package/dist/features/content/data/content.service.d.ts.map +1 -1
- package/dist/features/email-automation/components/lists/EmailAutomationRecipientsList.d.ts.map +1 -1
- package/dist/features/email-automation/components/lists/EmailAutomationsList.d.ts.map +1 -1
- package/dist/features/email-automation/data/EmailAutomationService.d.ts +3 -0
- package/dist/features/email-automation/data/EmailAutomationService.d.ts.map +1 -1
- package/dist/features/email-automation/hooks/useEmailAutomationTableStructure.d.ts.map +1 -1
- package/dist/features/email-blast/components/lists/EmailBlastsList.d.ts.map +1 -1
- package/dist/features/email-blast/data/EmailBlastService.d.ts +1 -0
- package/dist/features/email-blast/data/EmailBlastService.d.ts.map +1 -1
- package/dist/features/email-blast/hooks/useEmailBlastTableStructure.d.ts.map +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/how-to/components/lists/HowToList.d.ts.map +1 -1
- package/dist/features/how-to/data/HowToService.d.ts +2 -0
- package/dist/features/how-to/data/HowToService.d.ts.map +1 -1
- package/dist/features/notification/components/lists/NotificationsList.d.ts.map +1 -1
- package/dist/features/notification/data/notification.service.d.ts +2 -0
- package/dist/features/notification/data/notification.service.d.ts.map +1 -1
- package/dist/features/referral/components/containers/ReferralsAdminContainer.d.ts.map +1 -1
- package/dist/features/referral/data/ReferralAdminService.d.ts +1 -0
- package/dist/features/referral/data/ReferralAdminService.d.ts.map +1 -1
- package/dist/features/referral/hooks/useReferralAdminReferralTableStructure.d.ts.map +1 -1
- package/dist/features/role/components/lists/RolesList.d.ts.map +1 -1
- package/dist/features/role/components/lists/UserRolesList.d.ts.map +1 -1
- package/dist/features/role/data/role.service.d.ts +3 -0
- package/dist/features/role/data/role.service.d.ts.map +1 -1
- package/dist/features/tokenusage/index.js +114 -114
- package/dist/features/tokenusage/index.mjs +3 -3
- package/dist/features/user/components/lists/AdminUsersList.d.ts.map +1 -1
- package/dist/features/user/components/lists/CompanyUsersList.d.ts.map +1 -1
- package/dist/features/user/components/lists/PlatformUsersList.d.ts.map +1 -1
- package/dist/features/user/components/lists/RoleUsersList.d.ts.map +1 -1
- package/dist/features/user/components/lists/UsersListByContentIds.d.ts.map +1 -1
- package/dist/features/user/data/user.service.d.ts +11 -0
- package/dist/features/user/data/user.service.d.ts.map +1 -1
- package/dist/features/waitlist/components/lists/WaitlistList.d.ts.map +1 -1
- package/dist/features/waitlist/data/WaitlistService.d.ts +2 -0
- package/dist/features/waitlist/data/WaitlistService.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useDataListRetriever.d.ts +13 -0
- package/dist/hooks/useDataListRetriever.d.ts.map +1 -1
- package/dist/hooks/useListSortParam.d.ts +23 -0
- package/dist/hooks/useListSortParam.d.ts.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/dist/shadcnui/ui/calendar.d.ts +1 -1
- package/dist/shadcnui/ui/calendar.d.ts.map +1 -1
- package/messages/en.json +11 -0
- package/messages/it.json +11 -0
- package/package.json +1 -1
- package/src/components/tables/ContentListTable.tsx +108 -10
- package/src/components/tables/SortableHeader.tsx +43 -0
- package/src/components/tables/__tests__/ContentListTable.rendering.spec.tsx +1 -0
- package/src/components/tables/__tests__/ContentListTable.sort.spec.tsx +273 -0
- package/src/components/tables/__tests__/sorting.spec.ts +61 -0
- package/src/components/tables/cells/cell.date.tsx +10 -2
- package/src/components/tables/cells/cell.dateTime.tsx +10 -2
- package/src/components/tables/cells/cell.link.tsx +6 -1
- package/src/components/tables/cells/cell.text.tsx +11 -2
- package/src/components/tables/index.ts +2 -0
- package/src/components/tables/sorting.ts +41 -0
- package/src/features/billing/stripe-coupon/components/lists/CouponCodesList.tsx +2 -0
- package/src/features/billing/stripe-coupon/components/lists/CouponsList.tsx +2 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon-code.service.ts +4 -0
- package/src/features/billing/stripe-coupon/data/stripe-coupon.service.ts +7 -1
- package/src/features/billing/stripe-coupon/hooks/__tests__/useStripeCouponCodeTableStructure.sort.spec.tsx +30 -0
- package/src/features/billing/stripe-coupon/hooks/__tests__/useStripeCouponTableStructure.sort.spec.tsx +33 -0
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.tsx +5 -4
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponTableStructure.tsx +7 -4
- package/src/features/billing/stripe-price/components/lists/PricesList.tsx +2 -0
- package/src/features/billing/stripe-price/data/stripe-price.service.ts +4 -0
- package/src/features/billing/stripe-price/hooks/__tests__/useStripePriceTableStructure.sort.spec.tsx +29 -0
- package/src/features/billing/stripe-price/hooks/useStripePriceTableStructure.tsx +8 -5
- package/src/features/billing/stripe-product/components/lists/ProductsList.tsx +2 -0
- package/src/features/billing/stripe-product/data/stripe-product.service.ts +4 -0
- package/src/features/billing/stripe-product/hooks/__tests__/useStripeProductTableStructure.sort.spec.tsx +29 -0
- package/src/features/billing/stripe-product/hooks/useStripeProductTableStructure.tsx +3 -2
- package/src/features/blog/components/admin/BlogPostsList.tsx +2 -0
- package/src/features/blog/data/BlogPostService.ts +3 -1
- package/src/features/blog/hooks/__tests__/useBlogPostTableStructure.sort.spec.tsx +19 -0
- package/src/features/blog/hooks/useBlogPostTableStructure.tsx +2 -2
- package/src/features/company/components/lists/CompaniesList.tsx +2 -0
- package/src/features/company/data/company.service.ts +3 -1
- package/src/features/company/hooks/__tests__/useCompanyTableStructure.sort.spec.tsx +19 -0
- package/src/features/company/hooks/useCompanyTableStructure.tsx +1 -1
- package/src/features/content/data/content.service.ts +12 -1
- package/src/features/content/hooks/__tests__/useContentTableStructure.sort.spec.tsx +21 -0
- package/src/features/content/hooks/useContentTableStructure.tsx +1 -1
- package/src/features/email-automation/components/lists/EmailAutomationRecipientsList.tsx +2 -0
- package/src/features/email-automation/components/lists/EmailAutomationsList.tsx +2 -0
- package/src/features/email-automation/data/EmailAutomationService.ts +9 -1
- package/src/features/email-automation/hooks/__tests__/useEmailAutomationEnrollmentTableStructure.sort.spec.tsx +21 -0
- package/src/features/email-automation/hooks/__tests__/useEmailAutomationTableStructure.sort.spec.tsx +29 -0
- package/src/features/email-automation/hooks/useEmailAutomationEnrollmentTableStructure.tsx +4 -4
- package/src/features/email-automation/hooks/useEmailAutomationTableStructure.tsx +5 -4
- package/src/features/email-blast/components/lists/EmailBlastsList.tsx +2 -0
- package/src/features/email-blast/data/EmailBlastService.ts +5 -1
- package/src/features/email-blast/hooks/__tests__/useEmailBlastTableStructure.sort.spec.tsx +29 -0
- package/src/features/email-blast/hooks/useEmailBlastTableStructure.tsx +16 -8
- package/src/features/how-to/components/lists/HowToList.tsx +2 -0
- package/src/features/how-to/data/HowToService.ts +4 -0
- package/src/features/how-to/hooks/__tests__/useHowToTableStructure.sort.spec.tsx +18 -0
- package/src/features/how-to/hooks/useHowToTableStructure.tsx +1 -1
- package/src/features/notification/components/lists/NotificationsList.tsx +2 -0
- package/src/features/notification/data/notification.service.ts +4 -0
- package/src/features/notification/hooks/__tests__/useNotificationTableStructure.sort.spec.tsx +19 -0
- package/src/features/notification/hooks/useNotificationTableStructure.tsx +1 -1
- package/src/features/referral/components/containers/ReferralsAdminContainer.tsx +4 -2
- package/src/features/referral/data/ReferralAdminService.ts +6 -1
- package/src/features/referral/hooks/__tests__/useReferralAdminReferralTableStructure.sort.spec.tsx +35 -0
- package/src/features/referral/hooks/useReferralAdminReferralTableStructure.tsx +10 -5
- package/src/features/role/components/lists/RolesList.tsx +2 -0
- package/src/features/role/components/lists/UserRolesList.tsx +2 -0
- package/src/features/role/data/role.service.ts +7 -1
- package/src/features/role/hooks/__tests__/useRoleTableStructure.sort.spec.tsx +16 -0
- package/src/features/role/hooks/useRoleTableStructure.tsx +2 -2
- package/src/features/user/components/lists/AdminUsersList.tsx +2 -0
- package/src/features/user/components/lists/CompanyUsersList.tsx +4 -0
- package/src/features/user/components/lists/PlatformUsersList.tsx +2 -0
- package/src/features/user/components/lists/RoleUsersList.tsx +2 -0
- package/src/features/user/components/lists/UsersListByContentIds.tsx +2 -0
- package/src/features/user/data/user.service.ts +28 -1
- package/src/features/user/hooks/__tests__/useUserTableStructure.sort.spec.tsx +16 -0
- package/src/features/user/hooks/useUserTableStructure.tsx +2 -2
- package/src/features/waitlist/components/lists/WaitlistList.tsx +2 -0
- package/src/features/waitlist/data/WaitlistService.ts +4 -0
- package/src/features/waitlist/hooks/__tests__/useWaitlistTableStructure.sort.spec.tsx +17 -0
- package/src/features/waitlist/hooks/useWaitlistTableStructure.tsx +3 -3
- package/src/hooks/__tests__/useDataListRetriever.sort.spec.tsx +114 -0
- package/src/hooks/__tests__/useListSortParam.spec.tsx +91 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useDataListRetriever.ts +44 -4
- package/src/hooks/useListSortParam.ts +53 -0
- package/src/shadcnui/ui/__tests__/calendar.spec.tsx +222 -0
- package/src/shadcnui/ui/calendar.tsx +28 -1
- package/dist/chunk-4JVLLBRS.mjs.map +0 -1
- package/dist/chunk-F25BVBEH.mjs.map +0 -1
- package/dist/chunk-NPGX2GJD.js.map +0 -1
- package/dist/chunk-SQNFYMYE.js.map +0 -1
- /package/dist/{BlockNoteEditor-XIEMUQCO.mjs.map → BlockNoteEditor-DCVT7YHE.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-NVSR67X5.mjs.map → BlockNoteViewer-XDAC6AL7.mjs.map} +0 -0
- /package/dist/{chunk-AEBZ67JJ.mjs.map → chunk-ETU3AW2X.mjs.map} +0 -0
- /package/dist/{chunk-AMQFKCAX.mjs.map → chunk-WPFEPIKP.mjs.map} +0 -0
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _chunkKH4Y4FU4js = require('../../chunk-KH4Y4FU4.js');
|
|
43
43
|
require('../../chunk-SYMI4IDW.js');
|
|
44
44
|
require('../../chunk-3EPNHTMH.js');
|
|
45
|
-
require('../../chunk-
|
|
45
|
+
require('../../chunk-TCAOU6NH.js');
|
|
46
46
|
require('../../chunk-G4JR3SFV.js');
|
|
47
47
|
|
|
48
48
|
|
|
@@ -59,7 +59,7 @@ require('../../chunk-G4JR3SFV.js');
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
var
|
|
62
|
+
var _chunkCI64OTRXjs = require('../../chunk-CI64OTRX.js');
|
|
63
63
|
require('../../chunk-HROKKUBQ.js');
|
|
64
64
|
require('../../chunk-DGN3PR2F.js');
|
|
65
65
|
|
|
@@ -92,7 +92,7 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
92
92
|
};
|
|
93
93
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
94
94
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "max-md:w-full max-md:[&_#date]:w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
95
|
-
|
|
95
|
+
_chunkKH4Y4FU4js.DateRangeSelector,
|
|
96
96
|
{
|
|
97
97
|
onDateChange: (range) => {
|
|
98
98
|
if (!_optionalChain([range, 'optionalAccess', _ => _.from]) || !_optionalChain([range, 'optionalAccess', _2 => _2.to])) return;
|
|
@@ -127,16 +127,16 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
127
127
|
}
|
|
128
128
|
),
|
|
129
129
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
130
|
-
|
|
130
|
+
_chunkKH4Y4FU4js.Select,
|
|
131
131
|
{
|
|
132
132
|
items: companyItems,
|
|
133
133
|
value: _nullishCoalesce(companyId, () => ( ALL_COMPANIES)),
|
|
134
134
|
onValueChange: (value) => onChange({ companyId: !value || value === ALL_COMPANIES ? void 0 : value }),
|
|
135
135
|
children: [
|
|
136
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
137
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
138
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
139
|
-
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
136
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
|
|
137
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.SelectContent, { children: [
|
|
138
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
|
|
139
|
+
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectItem, { value: company.id, children: company.label }, company.id))
|
|
140
140
|
] })
|
|
141
141
|
]
|
|
142
142
|
}
|
|
@@ -159,13 +159,13 @@ function Segmented({
|
|
|
159
159
|
children: options.map((option) => {
|
|
160
160
|
const selected = option.value === value;
|
|
161
161
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
162
|
-
|
|
162
|
+
_chunkKH4Y4FU4js.Button,
|
|
163
163
|
{
|
|
164
164
|
type: "button",
|
|
165
165
|
size: "sm",
|
|
166
166
|
variant: selected ? "default" : "ghost",
|
|
167
167
|
"aria-pressed": selected,
|
|
168
|
-
className:
|
|
168
|
+
className: _chunkCI64OTRXjs.cn.call(void 0, !selected && "text-muted-foreground"),
|
|
169
169
|
onClick: () => onSelect(option.value),
|
|
170
170
|
children: option.label
|
|
171
171
|
},
|
|
@@ -185,7 +185,7 @@ function withFilters(endpoint, filters) {
|
|
|
185
185
|
return endpoint;
|
|
186
186
|
}
|
|
187
187
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters, "withFilters");
|
|
188
|
-
var TokenUsageAdminService = class extends
|
|
188
|
+
var TokenUsageAdminService = class extends _chunkCI64OTRXjs.AbstractService {
|
|
189
189
|
static {
|
|
190
190
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageAdminService");
|
|
191
191
|
}
|
|
@@ -351,7 +351,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
351
351
|
error
|
|
352
352
|
]
|
|
353
353
|
);
|
|
354
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
354
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
|
|
355
355
|
}, "TokenUsageAdminProvider");
|
|
356
356
|
var useTokenUsageAdmin = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
357
357
|
const ctx = _react.useContext.call(void 0, TokenUsageAdminContext);
|
|
@@ -372,7 +372,7 @@ var _lucidereact = require('lucide-react');
|
|
|
372
372
|
var ZERO = { cost: 0, credits: 0, tokensIn: 0, tokensOut: 0, cached: 0, calls: 0 };
|
|
373
373
|
function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
374
374
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
375
|
-
const { decimal, metricValue: formatValue, currency, percent } =
|
|
375
|
+
const { decimal, metricValue: formatValue, currency, percent } = _chunkKH4Y4FU4js.useUsageFormatters.call(void 0, );
|
|
376
376
|
const rowFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (scope, window) => _nullishCoalesce(summary.find((r) => r.scope === scope && r.window === window), () => ( ZERO)), "rowFor");
|
|
377
377
|
const customerCurrent = rowFor("customer", "current");
|
|
378
378
|
const customerPrevious = rowFor("customer", "previous");
|
|
@@ -381,16 +381,16 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
381
381
|
const totalCurrent = rowFor("total", "current");
|
|
382
382
|
const totalPrevious = rowFor("total", "previous");
|
|
383
383
|
const averagePerCall = totalCurrent.calls ? totalCurrent.cost / totalCurrent.calls : 0;
|
|
384
|
-
const cacheHit =
|
|
384
|
+
const cacheHit = _chunkKH4Y4FU4js.cacheHitPercentage.call(void 0, totalCurrent.cached, totalCurrent.tokensIn);
|
|
385
385
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
386
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
386
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkCI64OTRXjs.cn.call(void 0, "grid gap-3", singleCustomerMode ? "sm:grid-cols-1" : "sm:grid-cols-2"), children: [
|
|
387
387
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
388
388
|
LeadTile,
|
|
389
389
|
{
|
|
390
390
|
testId: "tile-customer",
|
|
391
391
|
label: t("token_usage.admin.customer_spend"),
|
|
392
|
-
value: formatValue(
|
|
393
|
-
delta:
|
|
392
|
+
value: formatValue(_chunkKH4Y4FU4js.metricValue.call(void 0, customerCurrent, metric), metric),
|
|
393
|
+
delta: _chunkKH4Y4FU4js.percentageDelta.call(void 0, _chunkKH4Y4FU4js.metricValue.call(void 0, customerCurrent, metric), _chunkKH4Y4FU4js.metricValue.call(void 0, customerPrevious, metric)),
|
|
394
394
|
previousLabel: t("token_usage.admin.vs_previous"),
|
|
395
395
|
decimal
|
|
396
396
|
}
|
|
@@ -400,8 +400,8 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
400
400
|
{
|
|
401
401
|
testId: "tile-platform",
|
|
402
402
|
label: t("token_usage.admin.platform_spend"),
|
|
403
|
-
value: formatValue(
|
|
404
|
-
delta:
|
|
403
|
+
value: formatValue(_chunkKH4Y4FU4js.metricValue.call(void 0, platformCurrent, metric), metric),
|
|
404
|
+
delta: _chunkKH4Y4FU4js.percentageDelta.call(void 0, _chunkKH4Y4FU4js.metricValue.call(void 0, platformCurrent, metric), _chunkKH4Y4FU4js.metricValue.call(void 0, platformPrevious, metric)),
|
|
405
405
|
previousLabel: t("token_usage.admin.vs_previous"),
|
|
406
406
|
decimal
|
|
407
407
|
}
|
|
@@ -413,8 +413,8 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
413
413
|
{
|
|
414
414
|
testId: "tile-total",
|
|
415
415
|
label: t("token_usage.admin.total_cost"),
|
|
416
|
-
value: formatValue(
|
|
417
|
-
delta:
|
|
416
|
+
value: formatValue(_chunkKH4Y4FU4js.metricValue.call(void 0, totalCurrent, metric), metric),
|
|
417
|
+
delta: _chunkKH4Y4FU4js.percentageDelta.call(void 0, _chunkKH4Y4FU4js.metricValue.call(void 0, totalCurrent, metric), _chunkKH4Y4FU4js.metricValue.call(void 0, totalPrevious, metric)),
|
|
418
418
|
decimal
|
|
419
419
|
}
|
|
420
420
|
),
|
|
@@ -448,7 +448,7 @@ function LeadTile({
|
|
|
448
448
|
previousLabel,
|
|
449
449
|
decimal
|
|
450
450
|
}) {
|
|
451
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
451
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.CardContent, { className: "grid gap-1", children: [
|
|
452
452
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
453
453
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: value }),
|
|
454
454
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
@@ -465,7 +465,7 @@ function SupportingTile({
|
|
|
465
465
|
delta,
|
|
466
466
|
decimal
|
|
467
467
|
}) {
|
|
468
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
468
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.CardContent, { className: "grid gap-1", children: [
|
|
469
469
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
470
470
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-2", children: [
|
|
471
471
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: value }),
|
|
@@ -488,7 +488,7 @@ function Delta({
|
|
|
488
488
|
"span",
|
|
489
489
|
{
|
|
490
490
|
"data-testid": testId,
|
|
491
|
-
className:
|
|
491
|
+
className: _chunkCI64OTRXjs.cn.call(void 0,
|
|
492
492
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
493
493
|
increased ? "text-success" : "text-destructive"
|
|
494
494
|
),
|
|
@@ -509,10 +509,10 @@ _chunk7QVYU63Ejs.__name.call(void 0, Delta, "Delta");
|
|
|
509
509
|
|
|
510
510
|
function TokenUsageBreakdownTable({ rows, metric }) {
|
|
511
511
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
512
|
-
const { decimal, metricValue: formatValue, percent, compare } =
|
|
512
|
+
const { decimal, metricValue: formatValue, percent, compare } = _chunkKH4Y4FU4js.useUsageFormatters.call(void 0, );
|
|
513
513
|
const [sort, setSort] = _react.useState.call(void 0, void 0);
|
|
514
514
|
const showActiveUsers = rows.some((row) => row.activeUsers !== void 0);
|
|
515
|
-
const total = _react.useMemo.call(void 0, () => rows.reduce((sum, row) => sum +
|
|
515
|
+
const total = _react.useMemo.call(void 0, () => rows.reduce((sum, row) => sum + _chunkKH4Y4FU4js.metricValue.call(void 0, row, metric), 0), [rows, metric]);
|
|
516
516
|
const sortValue = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (row, key) => {
|
|
517
517
|
switch (key) {
|
|
518
518
|
case "label":
|
|
@@ -522,9 +522,9 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
522
522
|
case "activeUsers":
|
|
523
523
|
return _nullishCoalesce(row.activeUsers, () => ( 0));
|
|
524
524
|
case "cacheHit":
|
|
525
|
-
return
|
|
525
|
+
return _chunkKH4Y4FU4js.cacheHitPercentage.call(void 0, row.cached, row.tokensIn);
|
|
526
526
|
case "share":
|
|
527
|
-
return
|
|
527
|
+
return _chunkKH4Y4FU4js.metricValue.call(void 0, row, metric);
|
|
528
528
|
default:
|
|
529
529
|
return row[key];
|
|
530
530
|
}
|
|
@@ -562,13 +562,13 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
562
562
|
// The package's <Table> wraps itself in an `overflow-x-clip` container, which
|
|
563
563
|
// would swallow the overflow before this scroller ever saw it — hence the
|
|
564
564
|
// child override. Wide metric tables must scroll, never widen the page.
|
|
565
|
-
/* @__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,
|
|
566
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
565
|
+
/* @__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, _chunkKH4Y4FU4js.Table, { children: [
|
|
566
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableHead, { className: _chunkCI64OTRXjs.cn.call(void 0, column.numeric && "text-end"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
567
567
|
"button",
|
|
568
568
|
{
|
|
569
569
|
type: "button",
|
|
570
570
|
onClick: () => toggleSort(column.key),
|
|
571
|
-
className:
|
|
571
|
+
className: _chunkCI64OTRXjs.cn.call(void 0,
|
|
572
572
|
"hover:text-primary inline-flex items-center gap-1 text-xs font-medium",
|
|
573
573
|
column.numeric && "flex-row-reverse"
|
|
574
574
|
),
|
|
@@ -578,20 +578,20 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
578
578
|
]
|
|
579
579
|
}
|
|
580
580
|
) }, column.key)) }) }),
|
|
581
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
582
|
-
const value =
|
|
581
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableBody, { children: sortedRows.map((row) => {
|
|
582
|
+
const value = _chunkKH4Y4FU4js.metricValue.call(void 0, row, metric);
|
|
583
583
|
const share = total > 0 ? value / total * 100 : 0;
|
|
584
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
585
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
586
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
587
|
-
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
588
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
589
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
590
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
591
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
592
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
593
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
594
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
584
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
|
|
585
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
|
|
586
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
|
|
587
|
+
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableCell, { className: "text-end text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
|
|
588
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.calls, 0) }),
|
|
589
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
|
|
590
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
|
|
591
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableCell, { className: "text-end text-xs tabular-nums", children: percent(_chunkKH4Y4FU4js.cacheHitPercentage.call(void 0, row.cached, row.tokensIn)) }),
|
|
592
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
|
|
593
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
|
|
594
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TableCell, { className: "text-end text-xs tabular-nums", children: percent(share) })
|
|
595
595
|
] }, row.id);
|
|
596
596
|
}) })
|
|
597
597
|
] }) })
|
|
@@ -625,7 +625,7 @@ var operationDescription = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0,
|
|
|
625
625
|
|
|
626
626
|
function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes = false }) {
|
|
627
627
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
628
|
-
const { metricValue: formatValue, percent } =
|
|
628
|
+
const { metricValue: formatValue, percent } = _chunkKH4Y4FU4js.useUsageFormatters.call(void 0, );
|
|
629
629
|
const renderLabel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (row) => {
|
|
630
630
|
if (row.id === "other") return t("token_usage.admin.other");
|
|
631
631
|
if (!labelsAreOperationTypes) return row.label;
|
|
@@ -647,9 +647,9 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
647
647
|
const label = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground truncate text-xs", children: renderLabel(row) });
|
|
648
648
|
const description = renderDescription(row);
|
|
649
649
|
if (!description) return label;
|
|
650
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
650
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Tooltip, { children: [
|
|
651
651
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
652
|
-
|
|
652
|
+
_chunkKH4Y4FU4js.TooltipTrigger,
|
|
653
653
|
{
|
|
654
654
|
"data-testid": `ranked-description-${row.id}`,
|
|
655
655
|
className: "min-w-0 cursor-help justify-self-start truncate",
|
|
@@ -657,19 +657,19 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
657
657
|
children: label
|
|
658
658
|
}
|
|
659
659
|
),
|
|
660
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
660
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.TooltipContent, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs", children: description }) })
|
|
661
661
|
] });
|
|
662
662
|
}, "renderLabelCell");
|
|
663
663
|
if (rows.length === 0) {
|
|
664
664
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground py-6 text-center text-sm", children: emptyLabel });
|
|
665
665
|
}
|
|
666
|
-
const values = rows.map((row) =>
|
|
666
|
+
const values = rows.map((row) => _chunkKH4Y4FU4js.metricValue.call(void 0, row, metric));
|
|
667
667
|
const total = values.reduce((sum, value) => sum + value, 0);
|
|
668
668
|
const max = Math.max(...values, 0);
|
|
669
669
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid gap-0.5", children: rows.map((row, index) => {
|
|
670
670
|
const value = values[index];
|
|
671
671
|
const isOther = row.id === "other";
|
|
672
|
-
const step = isOther ?
|
|
672
|
+
const step = isOther ? _chunkKH4Y4FU4js.SEQUENTIAL_RAMP.length - 1 : Math.min(index, _chunkKH4Y4FU4js.SEQUENTIAL_RAMP.length - 1);
|
|
673
673
|
const width = max > 0 ? value / max * 100 : 0;
|
|
674
674
|
const share = total > 0 ? value / total * 100 : 0;
|
|
675
675
|
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: [
|
|
@@ -681,7 +681,7 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
681
681
|
"data-testid": `ranked-fill-${row.id}`,
|
|
682
682
|
"data-ramp-step": String(step),
|
|
683
683
|
className: "h-full rounded-r-[4px]",
|
|
684
|
-
style: { width: `${width}%`, backgroundColor:
|
|
684
|
+
style: { width: `${width}%`, backgroundColor: _chunkKH4Y4FU4js.SEQUENTIAL_RAMP[step] }
|
|
685
685
|
}
|
|
686
686
|
) })
|
|
687
687
|
] }),
|
|
@@ -731,7 +731,7 @@ var inferGranularity = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (buc
|
|
|
731
731
|
}, "inferGranularity");
|
|
732
732
|
function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
733
733
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
734
|
-
const { compact, bucketDate, metricValue: formatValue } =
|
|
734
|
+
const { compact, bucketDate, metricValue: formatValue } = _chunkKH4Y4FU4js.useUsageFormatters.call(void 0, );
|
|
735
735
|
const { resolvedTheme } = _nextthemes.useTheme.call(void 0, );
|
|
736
736
|
const mode = resolvedTheme === "dark" ? "dark" : "light";
|
|
737
737
|
const { chartData, seriesKeys } = _react.useMemo.call(void 0, () => {
|
|
@@ -739,8 +739,8 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
739
739
|
const totals = /* @__PURE__ */ new Map();
|
|
740
740
|
for (const row of rows) totals.set(row.series, (_nullishCoalesce(totals.get(row.series), () => ( 0))) + metricValue2(row, metric));
|
|
741
741
|
const ranked = [...totals.entries()].sort((a, b) => b[1] - a[1]).map(([series]) => series);
|
|
742
|
-
const named = ranked.slice(0,
|
|
743
|
-
const folded = new Set(ranked.slice(
|
|
742
|
+
const named = ranked.slice(0, _chunkKH4Y4FU4js.CATEGORICAL_CEILING);
|
|
743
|
+
const folded = new Set(ranked.slice(_chunkKH4Y4FU4js.CATEGORICAL_CEILING));
|
|
744
744
|
const keys = folded.size > 0 ? [...named, OTHER_SERIES] : named;
|
|
745
745
|
const byBucket = /* @__PURE__ */ new Map();
|
|
746
746
|
for (const row of rows) {
|
|
@@ -780,7 +780,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
780
780
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: className ? `text-muted-foreground text-sm ${className}` : "text-muted-foreground text-sm", children: t.has(key) ? t(key) : "No data in the selected period" });
|
|
781
781
|
}
|
|
782
782
|
const granularity = inferGranularity(chartData.map((entry) => entry.bucket));
|
|
783
|
-
const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ?
|
|
783
|
+
const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ? _chunkKH4Y4FU4js.OTHER_COLOR : _chunkKH4Y4FU4js.seriesColor.call(void 0, index, mode), "seriesColorFor");
|
|
784
784
|
return (
|
|
785
785
|
// The chart is a coordinate system, not prose: recharts lays the axes and the
|
|
786
786
|
// stacked bars out left-to-right, so the whole chart stays an LTR island even
|
|
@@ -789,7 +789,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
789
789
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, dir: "ltr", children: [
|
|
790
790
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-data", children: JSON.stringify(chartData) }),
|
|
791
791
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-series", children: JSON.stringify(seriesKeys) }),
|
|
792
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
792
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.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: [
|
|
793
793
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _recharts.CartesianGrid, { vertical: false }),
|
|
794
794
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
795
795
|
_recharts.XAxis,
|
|
@@ -813,10 +813,10 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
813
813
|
}
|
|
814
814
|
),
|
|
815
815
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
816
|
-
|
|
816
|
+
_chunkKH4Y4FU4js.ChartTooltip,
|
|
817
817
|
{
|
|
818
818
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
819
|
-
|
|
819
|
+
_chunkKH4Y4FU4js.ChartTooltipContent,
|
|
820
820
|
{
|
|
821
821
|
labelFormatter: (value) => bucketDate(String(value), granularity),
|
|
822
822
|
valueFormatter: (value) => formatValue(Number(value), metric),
|
|
@@ -825,7 +825,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
825
825
|
)
|
|
826
826
|
}
|
|
827
827
|
),
|
|
828
|
-
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
828
|
+
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.ChartLegendContent, {}) }) : null,
|
|
829
829
|
seriesKeys.map((series, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
830
830
|
_recharts.Bar,
|
|
831
831
|
{
|
|
@@ -877,19 +877,19 @@ function TokenUsageAdminContainer() {
|
|
|
877
877
|
[t]
|
|
878
878
|
);
|
|
879
879
|
if (error) {
|
|
880
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
880
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.RoundPageContainer, { module: _chunkZ6T2575Ajs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
881
881
|
}
|
|
882
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
882
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.RoundPageContainer, { module: _chunkZ6T2575Ajs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true });
|
|
883
883
|
const emptyLabel = t("token_usage.admin.no_data");
|
|
884
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
884
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.RoundPageContainer, { module: _chunkZ6T2575Ajs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
|
|
885
885
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminTiles, { summary, metric: filters.metric, singleCustomerMode: hidePlatform }),
|
|
886
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
887
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
888
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
889
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
886
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Card, { children: [
|
|
887
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.CardHeader, { children: [
|
|
888
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
|
|
889
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
890
890
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.admin.stack_by") }),
|
|
891
891
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
892
|
-
|
|
892
|
+
_chunkKH4Y4FU4js.Select,
|
|
893
893
|
{
|
|
894
894
|
items: stackByItems,
|
|
895
895
|
value: filters.stackBy,
|
|
@@ -897,29 +897,29 @@ function TokenUsageAdminContainer() {
|
|
|
897
897
|
if (value) setFilters({ stackBy: value });
|
|
898
898
|
},
|
|
899
899
|
children: [
|
|
900
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
901
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
900
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectValue, {}) }),
|
|
901
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SelectItem, { value, children: stackByItems[value] }, value)) })
|
|
902
902
|
]
|
|
903
903
|
}
|
|
904
904
|
)
|
|
905
905
|
] }) })
|
|
906
906
|
] }),
|
|
907
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
907
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
|
|
908
908
|
] }),
|
|
909
909
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
910
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
911
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
912
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
910
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Card, { children: [
|
|
911
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardTitle, { children: t("token_usage.admin.by_company") }) }),
|
|
912
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
|
|
913
913
|
] }),
|
|
914
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
915
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
916
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
914
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Card, { children: [
|
|
915
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardTitle, { children: t("token_usage.admin.by_user") }) }),
|
|
916
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
|
|
917
917
|
] })
|
|
918
918
|
] }),
|
|
919
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
920
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
921
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
922
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
919
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkCI64OTRXjs.cn.call(void 0, "grid gap-4", !hidePlatform && "md:grid-cols-2"), children: [
|
|
920
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Card, { children: [
|
|
921
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
|
|
922
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
923
923
|
TokenUsageRankedBar,
|
|
924
924
|
{
|
|
925
925
|
rows: byCustomerOperation,
|
|
@@ -929,9 +929,9 @@ function TokenUsageAdminContainer() {
|
|
|
929
929
|
}
|
|
930
930
|
) })
|
|
931
931
|
] }),
|
|
932
|
-
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
933
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
934
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
932
|
+
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Card, { children: [
|
|
933
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
|
|
934
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
935
935
|
TokenUsageRankedBar,
|
|
936
936
|
{
|
|
937
937
|
rows: byOperation,
|
|
@@ -942,9 +942,9 @@ function TokenUsageAdminContainer() {
|
|
|
942
942
|
) })
|
|
943
943
|
] })
|
|
944
944
|
] }),
|
|
945
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
946
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
947
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
945
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Card, { children: [
|
|
946
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardTitle, { children: t("token_usage.admin.detail") }) }),
|
|
947
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
|
|
948
948
|
] })
|
|
949
949
|
] }) });
|
|
950
950
|
}
|
|
@@ -957,7 +957,7 @@ function withFilters2(endpoint, filters) {
|
|
|
957
957
|
return endpoint;
|
|
958
958
|
}
|
|
959
959
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters2, "withFilters");
|
|
960
|
-
var TokenUsageReportService = class extends
|
|
960
|
+
var TokenUsageReportService = class extends _chunkCI64OTRXjs.AbstractService {
|
|
961
961
|
static {
|
|
962
962
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageReportService");
|
|
963
963
|
}
|
|
@@ -1065,7 +1065,7 @@ var TOKEN_USAGE_REPORT_I18N_KEYS = [
|
|
|
1065
1065
|
|
|
1066
1066
|
function TokenUsageReportFilterBar({ onChange }) {
|
|
1067
1067
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-help": "tokenusage.filters", className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1068
|
-
|
|
1068
|
+
_chunkKH4Y4FU4js.DateRangeSelector,
|
|
1069
1069
|
{
|
|
1070
1070
|
onDateChange: (range) => {
|
|
1071
1071
|
if (!_optionalChain([range, 'optionalAccess', _5 => _5.from]) || !_optionalChain([range, 'optionalAccess', _6 => _6.to])) return;
|
|
@@ -1098,7 +1098,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1098
1098
|
pageUrl = TOKEN_USAGE_REPORT_PAGE_URL
|
|
1099
1099
|
}) => {
|
|
1100
1100
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1101
|
-
const generateUrl =
|
|
1101
|
+
const generateUrl = _chunkKH4Y4FU4js.usePageUrlGenerator.call(void 0, );
|
|
1102
1102
|
const [filters, setFilterState] = _react.useState.call(void 0, () => {
|
|
1103
1103
|
const range = defaultRange2();
|
|
1104
1104
|
return { from: _nullishCoalesce(initialFrom, () => ( range.from)), to: _nullishCoalesce(initialTo, () => ( range.to)) };
|
|
@@ -1162,7 +1162,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1162
1162
|
() => ({ summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error }),
|
|
1163
1163
|
[summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error]
|
|
1164
1164
|
);
|
|
1165
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1165
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
|
|
1166
1166
|
}, "TokenUsageReportProvider");
|
|
1167
1167
|
var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
1168
1168
|
const ctx = _react.useContext.call(void 0, TokenUsageReportContext);
|
|
@@ -1182,7 +1182,7 @@ var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (
|
|
|
1182
1182
|
var ZERO2 = { cost: 0, credits: 0, tokensIn: 0, tokensOut: 0, cached: 0, calls: 0 };
|
|
1183
1183
|
function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
1184
1184
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1185
|
-
const { decimal, metricValue: formatValue } =
|
|
1185
|
+
const { decimal, metricValue: formatValue } = _chunkKH4Y4FU4js.useUsageFormatters.call(void 0, );
|
|
1186
1186
|
const rowFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (window) => _nullishCoalesce(summary.find((row) => row.window === window), () => ( ZERO2)), "rowFor");
|
|
1187
1187
|
const current = rowFor("current");
|
|
1188
1188
|
const previous = rowFor("previous");
|
|
@@ -1190,15 +1190,15 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1190
1190
|
const monthlyColor = monthlyPercentage > 75 ? "text-success" : monthlyPercentage >= 5 ? "text-warning" : "text-destructive";
|
|
1191
1191
|
const whole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => decimal(Math.max(0, Math.floor(value)), 0), "whole");
|
|
1192
1192
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
1193
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1193
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.CardContent, { className: "grid gap-1", children: [
|
|
1194
1194
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.used_in_period") }),
|
|
1195
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(
|
|
1195
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(_chunkKH4Y4FU4js.metricValue.call(void 0, current, metric), metric) }),
|
|
1196
1196
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
1197
1197
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1198
1198
|
Delta2,
|
|
1199
1199
|
{
|
|
1200
1200
|
testId: "tile-used-delta",
|
|
1201
|
-
delta:
|
|
1201
|
+
delta: _chunkKH4Y4FU4js.percentageDelta.call(void 0, _chunkKH4Y4FU4js.metricValue.call(void 0, current, metric), _chunkKH4Y4FU4js.metricValue.call(void 0, previous, metric)),
|
|
1202
1202
|
decimal
|
|
1203
1203
|
}
|
|
1204
1204
|
),
|
|
@@ -1206,21 +1206,21 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1206
1206
|
] })
|
|
1207
1207
|
] }) }),
|
|
1208
1208
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3 sm:grid-cols-3", children: [
|
|
1209
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1209
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.CardContent, { className: "grid gap-1", children: [
|
|
1210
1210
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.monthly_left") }),
|
|
1211
1211
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-baseline gap-1", children: [
|
|
1212
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className:
|
|
1212
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className: _chunkCI64OTRXjs.cn.call(void 0, "text-sm font-medium tabular-nums", monthlyColor), children: whole(balances.availableMonthlyCredits) }),
|
|
1213
1213
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-muted-foreground text-xs tabular-nums", children: [
|
|
1214
1214
|
"/ ",
|
|
1215
1215
|
whole(balances.monthlyCredits)
|
|
1216
1216
|
] })
|
|
1217
1217
|
] })
|
|
1218
1218
|
] }) }),
|
|
1219
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1219
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.CardContent, { className: "grid gap-1", children: [
|
|
1220
1220
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.extra_credits") }),
|
|
1221
1221
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: whole(balances.availableExtraCredits) })
|
|
1222
1222
|
] }) }),
|
|
1223
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1223
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.CardContent, { className: "grid gap-1", children: [
|
|
1224
1224
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.calls") }),
|
|
1225
1225
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: decimal(current.calls, 0) })
|
|
1226
1226
|
] }) })
|
|
@@ -1242,7 +1242,7 @@ function Delta2({
|
|
|
1242
1242
|
"span",
|
|
1243
1243
|
{
|
|
1244
1244
|
"data-testid": testId,
|
|
1245
|
-
className:
|
|
1245
|
+
className: _chunkCI64OTRXjs.cn.call(void 0,
|
|
1246
1246
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
1247
1247
|
increased ? "text-warning" : "text-success"
|
|
1248
1248
|
),
|
|
@@ -1262,21 +1262,21 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1262
1262
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1263
1263
|
const { summary, timeline, byOperation, byTarget, isLoading, error, targetPanelTitleKey } = useTokenUsageReport();
|
|
1264
1264
|
if (error) {
|
|
1265
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1265
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
1266
1266
|
}
|
|
1267
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1267
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.RoundPageContainer, { fullWidth: true, forceHeader: true });
|
|
1268
1268
|
const emptyLabel = t("token_usage.report.no_data");
|
|
1269
1269
|
const targetTitle = targetPanelTitleKey && byTarget.length > 0 ? t(targetPanelTitleKey) : void 0;
|
|
1270
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1270
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
|
|
1271
1271
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportTiles, { summary, metric: "credits", balances }),
|
|
1272
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1273
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1274
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1272
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Card, { children: [
|
|
1273
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
|
|
1274
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
|
|
1275
1275
|
] }),
|
|
1276
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
1277
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1278
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1279
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1276
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkCI64OTRXjs.cn.call(void 0, "grid gap-4", targetTitle && "md:grid-cols-2"), children: [
|
|
1277
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Card, { children: [
|
|
1278
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardTitle, { children: t("token_usage.report.by_operation") }) }),
|
|
1279
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1280
1280
|
TokenUsageRankedBar,
|
|
1281
1281
|
{
|
|
1282
1282
|
rows: byOperation,
|
|
@@ -1286,9 +1286,9 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1286
1286
|
}
|
|
1287
1287
|
) })
|
|
1288
1288
|
] }),
|
|
1289
|
-
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1290
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1291
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1289
|
+
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkKH4Y4FU4js.Card, { children: [
|
|
1290
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardTitle, { children: targetTitle }) }),
|
|
1291
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKH4Y4FU4js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
|
|
1292
1292
|
] })
|
|
1293
1293
|
] })
|
|
1294
1294
|
] }) });
|
|
@@ -1328,5 +1328,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, TokenUsageReportContainer, "TokenUsageRepor
|
|
|
1328
1328
|
|
|
1329
1329
|
|
|
1330
1330
|
|
|
1331
|
-
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TOKEN_USAGE_REPORT_I18N_KEYS = TOKEN_USAGE_REPORT_I18N_KEYS; exports.TokenUsageAdminBreakdown =
|
|
1331
|
+
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TOKEN_USAGE_REPORT_I18N_KEYS = TOKEN_USAGE_REPORT_I18N_KEYS; exports.TokenUsageAdminBreakdown = _chunkCI64OTRXjs.TokenUsageAdminBreakdown; exports.TokenUsageAdminBreakdownModule = _chunkCI64OTRXjs.TokenUsageAdminBreakdownModule; exports.TokenUsageAdminContainer = TokenUsageAdminContainer; exports.TokenUsageAdminFilterBar = TokenUsageAdminFilterBar; exports.TokenUsageAdminProvider = TokenUsageAdminProvider; exports.TokenUsageAdminService = TokenUsageAdminService; exports.TokenUsageAdminSummary = _chunkCI64OTRXjs.TokenUsageAdminSummary; exports.TokenUsageAdminSummaryModule = _chunkCI64OTRXjs.TokenUsageAdminSummaryModule; exports.TokenUsageAdminTiles = TokenUsageAdminTiles; exports.TokenUsageAdminTimeline = _chunkCI64OTRXjs.TokenUsageAdminTimeline; exports.TokenUsageAdminTimelineModule = _chunkCI64OTRXjs.TokenUsageAdminTimelineModule; exports.TokenUsageBreakdownTable = TokenUsageBreakdownTable; exports.TokenUsageRankedBar = TokenUsageRankedBar; exports.TokenUsageReportBreakdown = _chunkCI64OTRXjs.TokenUsageReportBreakdown; exports.TokenUsageReportContainer = TokenUsageReportContainer; exports.TokenUsageReportFilterBar = TokenUsageReportFilterBar; exports.TokenUsageReportProvider = TokenUsageReportProvider; exports.TokenUsageReportService = TokenUsageReportService; exports.TokenUsageReportSummary = _chunkCI64OTRXjs.TokenUsageReportSummary; exports.TokenUsageReportTiles = TokenUsageReportTiles; exports.TokenUsageReportTimeline = _chunkCI64OTRXjs.TokenUsageReportTimeline; exports.TokenUsageTimelineChart = TokenUsageTimelineChart; exports.configureTokenUsage = _chunkCI64OTRXjs.configureTokenUsage; exports.createUsageFormatters = _chunkKH4Y4FU4js.createUsageFormatters; exports.getTokenUsageCurrency = _chunkCI64OTRXjs.getTokenUsageCurrency; exports.seriesColor = _chunkKH4Y4FU4js.seriesColor; exports.seriesTheme = _chunkKH4Y4FU4js.seriesTheme; exports.tokenUsageModules = _chunkCI64OTRXjs.tokenUsageModules; exports.useTokenUsageAdmin = useTokenUsageAdmin; exports.useTokenUsageReport = useTokenUsageReport; exports.useUsageFormatters = _chunkKH4Y4FU4js.useUsageFormatters;
|
|
1332
1332
|
//# sourceMappingURL=index.js.map
|