@carlonicora/nextjs-jsonapi 6.10.1 → 6.11.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/{AbstractApiData-XLhBP5Tl.d.mts → AbstractApiData-CKy8tbde.d.mts} +6 -0
- package/dist/{AbstractApiData-DtitRWPz.d.ts → AbstractApiData-rgvs0cdY.d.ts} +6 -0
- package/dist/{BlockNoteEditor-GK3DRTOP.mjs → BlockNoteEditor-5WM5DX3J.mjs} +4 -4
- package/dist/{BlockNoteEditor-YOKJOVV3.js → BlockNoteEditor-GY5R25YI.js} +19 -19
- package/dist/{BlockNoteEditor-YOKJOVV3.js.map → BlockNoteEditor-GY5R25YI.js.map} +1 -1
- package/dist/{BlockNoteViewer-EKAWVLIR.js → BlockNoteViewer-FLUHEXE6.js} +3 -3
- package/dist/{BlockNoteViewer-EKAWVLIR.js.map → BlockNoteViewer-FLUHEXE6.js.map} +1 -1
- package/dist/{BlockNoteViewer-RWRI3QO2.mjs → BlockNoteViewer-UCA3LV3N.mjs} +2 -2
- package/dist/billing/index.js +491 -491
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-THZAK7S3.mjs → chunk-3PRLRCMF.mjs} +1281 -603
- package/dist/chunk-3PRLRCMF.mjs.map +1 -0
- package/dist/{chunk-AWLTSKMM.mjs → chunk-6RLATJ2L.mjs} +2 -2
- package/dist/{chunk-6HFRXEF5.mjs → chunk-BGLOFZ3K.mjs} +296 -6
- package/dist/chunk-BGLOFZ3K.mjs.map +1 -0
- package/dist/{chunk-KRQRJA4J.js → chunk-FNPXCYHO.js} +8 -8
- package/dist/{chunk-KRQRJA4J.js.map → chunk-FNPXCYHO.js.map} +1 -1
- package/dist/{chunk-4UFMLTL2.js → chunk-MP3DV2I5.js} +1647 -969
- package/dist/chunk-MP3DV2I5.js.map +1 -0
- package/dist/{chunk-RNZ3IK5J.js → chunk-OHJSI6L2.js} +4 -4
- package/dist/{chunk-RNZ3IK5J.js.map → chunk-OHJSI6L2.js.map} +1 -1
- package/dist/{chunk-SQTXJPRE.js → chunk-YGEOX2XX.js} +297 -7
- package/dist/chunk-YGEOX2XX.js.map +1 -0
- package/dist/{chunk-DPAM7BCE.mjs → chunk-YP6W4AB5.mjs} +2 -2
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +68 -30
- package/dist/components/index.d.ts +68 -30
- package/dist/components/index.js +10 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +9 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +160 -4
- package/dist/core/index.d.ts +160 -4
- package/dist/core/index.js +14 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +13 -1
- package/dist/email-automations/index.js +93 -93
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.d.mts +1 -1
- package/dist/features/analytics/index.d.ts +1 -1
- package/dist/features/analytics/index.js +120 -122
- package/dist/features/analytics/index.js.map +1 -1
- package/dist/features/analytics/index.mjs +7 -9
- package/dist/features/analytics/index.mjs.map +1 -1
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/blog/index.js +150 -150
- package/dist/features/blog/index.mjs +3 -3
- package/dist/features/blog/server.js +16 -16
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.d.mts +1 -1
- package/dist/features/tokenusage/index.d.ts +1 -1
- package/dist/features/tokenusage/index.js +126 -128
- package/dist/features/tokenusage/index.js.map +1 -1
- package/dist/features/tokenusage/index.mjs +14 -16
- package/dist/features/tokenusage/index.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -2
- package/dist/{HandbookSectionInterface-BPgqqwgw.d.mts → referral-admin.interface-C87ApGMR.d.mts} +42 -2
- package/dist/{HandbookSectionInterface-_51oA3om.d.ts → referral-admin.interface-CMwl5NiV.d.ts} +42 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/messages/en.json +78 -1
- package/messages/it.json +78 -1
- package/package.json +1 -1
- package/src/core/abstracts/AbstractApiData.ts +14 -3
- package/src/core/abstracts/__tests__/readIncludedWithMeta.spec.ts +103 -0
- package/src/core/index.ts +2 -0
- package/src/core/registry/ModuleRegistry.ts +5 -0
- package/src/features/referral/__tests__/referral-admin-models.spec.ts +122 -0
- package/src/features/referral/__tests__/referral-admin-service.spec.ts +70 -0
- package/src/features/referral/__tests__/referral-code-capture.spec.tsx +105 -0
- package/src/features/referral/__tests__/referral-invite-errors.spec.tsx +82 -0
- package/src/features/referral/__tests__/referral-visit-service.spec.ts +47 -0
- package/src/features/referral/__tests__/referrals-admin-container.spec.tsx +230 -0
- package/src/features/referral/components/ReferralCodeCapture.tsx +3 -0
- package/src/features/referral/components/ReferralDialog.tsx +9 -13
- package/src/features/referral/components/ReferralWidget.tsx +75 -45
- package/src/features/referral/components/ReferralsAdminFunnel.tsx +74 -0
- package/src/features/referral/components/ReferralsAdminTiles.tsx +128 -0
- package/src/features/referral/components/containers/ReferralsAdminContainer.tsx +205 -0
- package/src/features/referral/components/index.ts +3 -0
- package/src/features/referral/data/ReferralAdminReferral.ts +65 -0
- package/src/features/referral/data/ReferralAdminReferrer.ts +65 -0
- package/src/features/referral/data/ReferralAdminService.ts +51 -0
- package/src/features/referral/data/ReferralAdminSummary.ts +60 -0
- package/src/features/referral/data/ReferralService.ts +20 -0
- package/src/features/referral/data/ReferralVisit.ts +23 -0
- package/src/features/referral/data/index.ts +5 -0
- package/src/features/referral/hooks/index.ts +2 -0
- package/src/features/referral/hooks/useReferralAdminReferralTableStructure.tsx +127 -0
- package/src/features/referral/hooks/useReferralAdminReferrerTableStructure.tsx +229 -0
- package/src/features/referral/hooks/useReferralInvite.ts +2 -0
- package/src/features/referral/index.ts +1 -0
- package/src/features/referral/interfaces/index.ts +1 -0
- package/src/features/referral/interfaces/referral-admin.interface.ts +45 -0
- package/src/features/referral/referral-admin.modules.ts +32 -0
- package/dist/chunk-3TNGKMJU.mjs +0 -115
- package/dist/chunk-3TNGKMJU.mjs.map +0 -1
- package/dist/chunk-4UFMLTL2.js.map +0 -1
- package/dist/chunk-6HFRXEF5.mjs.map +0 -1
- package/dist/chunk-G3YKDIAL.js +0 -115
- package/dist/chunk-G3YKDIAL.js.map +0 -1
- package/dist/chunk-SQTXJPRE.js.map +0 -1
- package/dist/chunk-THZAK7S3.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-GK3DRTOP.mjs.map → BlockNoteEditor-5WM5DX3J.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-RWRI3QO2.mjs.map → BlockNoteViewer-UCA3LV3N.mjs.map} +0 -0
- /package/dist/{chunk-AWLTSKMM.mjs.map → chunk-6RLATJ2L.mjs.map} +0 -0
- /package/dist/{chunk-DPAM7BCE.mjs.map → chunk-YP6W4AB5.mjs.map} +0 -0
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var _chunkG3YKDIALjs = require('../../chunk-G3YKDIAL.js');
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
|
|
@@ -40,9 +39,8 @@ var _chunkG3YKDIALjs = require('../../chunk-G3YKDIAL.js');
|
|
|
40
39
|
|
|
41
40
|
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
require('../../chunk-KRQRJA4J.js');
|
|
42
|
+
var _chunkMP3DV2I5js = require('../../chunk-MP3DV2I5.js');
|
|
43
|
+
require('../../chunk-FNPXCYHO.js');
|
|
46
44
|
require('../../chunk-G4JR3SFV.js');
|
|
47
45
|
|
|
48
46
|
|
|
@@ -61,7 +59,7 @@ require('../../chunk-G4JR3SFV.js');
|
|
|
61
59
|
|
|
62
60
|
|
|
63
61
|
|
|
64
|
-
var
|
|
62
|
+
var _chunkYGEOX2XXjs = require('../../chunk-YGEOX2XX.js');
|
|
65
63
|
require('../../chunk-GHE4VT2R.js');
|
|
66
64
|
require('../../chunk-LXKSUWAV.js');
|
|
67
65
|
require('../../chunk-JTPRJNT2.js');
|
|
@@ -86,7 +84,7 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
86
84
|
};
|
|
87
85
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
88
86
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "max-md:w-full max-md:[&_#date]:w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
89
|
-
|
|
87
|
+
_chunkMP3DV2I5js.DateRangeSelector,
|
|
90
88
|
{
|
|
91
89
|
onDateChange: (range) => {
|
|
92
90
|
if (!_optionalChain([range, 'optionalAccess', _ => _.from]) || !_optionalChain([range, 'optionalAccess', _2 => _2.to])) return;
|
|
@@ -121,16 +119,16 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
|
|
|
121
119
|
}
|
|
122
120
|
),
|
|
123
121
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
124
|
-
|
|
122
|
+
_chunkMP3DV2I5js.Select,
|
|
125
123
|
{
|
|
126
124
|
items: companyItems,
|
|
127
125
|
value: _nullishCoalesce(companyId, () => ( ALL_COMPANIES)),
|
|
128
126
|
onValueChange: (value) => onChange({ companyId: !value || value === ALL_COMPANIES ? void 0 : value }),
|
|
129
127
|
children: [
|
|
130
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
131
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
132
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
133
|
-
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
128
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
|
|
129
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.SelectContent, { children: [
|
|
130
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
|
|
131
|
+
companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectItem, { value: company.id, children: company.label }, company.id))
|
|
134
132
|
] })
|
|
135
133
|
]
|
|
136
134
|
}
|
|
@@ -153,13 +151,13 @@ function Segmented({
|
|
|
153
151
|
children: options.map((option) => {
|
|
154
152
|
const selected = option.value === value;
|
|
155
153
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
156
|
-
|
|
154
|
+
_chunkMP3DV2I5js.Button,
|
|
157
155
|
{
|
|
158
156
|
type: "button",
|
|
159
157
|
size: "sm",
|
|
160
158
|
variant: selected ? "default" : "ghost",
|
|
161
159
|
"aria-pressed": selected,
|
|
162
|
-
className:
|
|
160
|
+
className: _chunkYGEOX2XXjs.cn.call(void 0, !selected && "text-muted-foreground"),
|
|
163
161
|
onClick: () => onSelect(option.value),
|
|
164
162
|
children: option.label
|
|
165
163
|
},
|
|
@@ -179,36 +177,36 @@ function withFilters(endpoint, filters) {
|
|
|
179
177
|
return endpoint;
|
|
180
178
|
}
|
|
181
179
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters, "withFilters");
|
|
182
|
-
var TokenUsageAdminService = class extends
|
|
180
|
+
var TokenUsageAdminService = class extends _chunkYGEOX2XXjs.AbstractService {
|
|
183
181
|
static {
|
|
184
182
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageAdminService");
|
|
185
183
|
}
|
|
186
184
|
/** Six rows: {customer, platform, total} × {current, previous}. */
|
|
187
185
|
static async getSummary(filters) {
|
|
188
|
-
const endpoint = withFilters(new (0,
|
|
186
|
+
const endpoint = withFilters(new (0, _chunkYGEOX2XXjs.EndpointCreator)({ endpoint: _chunkYGEOX2XXjs.Modules.TokenUsageAdminSummary }), filters);
|
|
189
187
|
return this.callApi({
|
|
190
|
-
type:
|
|
188
|
+
type: _chunkYGEOX2XXjs.Modules.TokenUsageAdminSummary,
|
|
191
189
|
method: "GET" /* GET */,
|
|
192
190
|
endpoint: endpoint.generate()
|
|
193
191
|
});
|
|
194
192
|
}
|
|
195
193
|
static async getTimeline(params) {
|
|
196
|
-
const endpoint = withFilters(new (0,
|
|
194
|
+
const endpoint = withFilters(new (0, _chunkYGEOX2XXjs.EndpointCreator)({ endpoint: _chunkYGEOX2XXjs.Modules.TokenUsageAdminTimeline }), params);
|
|
197
195
|
endpoint.addAdditionalParam("granularity", params.granularity);
|
|
198
196
|
endpoint.addAdditionalParam("stackBy", params.stackBy);
|
|
199
197
|
return this.callApi({
|
|
200
|
-
type:
|
|
198
|
+
type: _chunkYGEOX2XXjs.Modules.TokenUsageAdminTimeline,
|
|
201
199
|
method: "GET" /* GET */,
|
|
202
200
|
endpoint: endpoint.generate()
|
|
203
201
|
});
|
|
204
202
|
}
|
|
205
203
|
static async getBreakdown(params) {
|
|
206
|
-
const endpoint = withFilters(new (0,
|
|
204
|
+
const endpoint = withFilters(new (0, _chunkYGEOX2XXjs.EndpointCreator)({ endpoint: _chunkYGEOX2XXjs.Modules.TokenUsageAdminBreakdown }), params);
|
|
207
205
|
endpoint.addAdditionalParam("dimension", params.dimension);
|
|
208
206
|
endpoint.addAdditionalParam("scope", params.scope);
|
|
209
207
|
if (params.limit !== void 0) endpoint.addAdditionalParam("limit", String(params.limit));
|
|
210
208
|
return this.callApi({
|
|
211
|
-
type:
|
|
209
|
+
type: _chunkYGEOX2XXjs.Modules.TokenUsageAdminBreakdown,
|
|
212
210
|
method: "GET" /* GET */,
|
|
213
211
|
endpoint: endpoint.generate()
|
|
214
212
|
});
|
|
@@ -345,7 +343,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
345
343
|
error
|
|
346
344
|
]
|
|
347
345
|
);
|
|
348
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
346
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
|
|
349
347
|
}, "TokenUsageAdminProvider");
|
|
350
348
|
var useTokenUsageAdmin = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
351
349
|
const ctx = _react.useContext.call(void 0, TokenUsageAdminContext);
|
|
@@ -366,7 +364,7 @@ var _lucidereact = require('lucide-react');
|
|
|
366
364
|
var ZERO = { cost: 0, credits: 0, tokensIn: 0, tokensOut: 0, cached: 0, calls: 0 };
|
|
367
365
|
function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
368
366
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
369
|
-
const { decimal, metricValue: formatValue, currency, percent } =
|
|
367
|
+
const { decimal, metricValue: formatValue, currency, percent } = _chunkMP3DV2I5js.useUsageFormatters.call(void 0, );
|
|
370
368
|
const rowFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (scope, window) => _nullishCoalesce(summary.find((r) => r.scope === scope && r.window === window), () => ( ZERO)), "rowFor");
|
|
371
369
|
const customerCurrent = rowFor("customer", "current");
|
|
372
370
|
const customerPrevious = rowFor("customer", "previous");
|
|
@@ -375,16 +373,16 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
375
373
|
const totalCurrent = rowFor("total", "current");
|
|
376
374
|
const totalPrevious = rowFor("total", "previous");
|
|
377
375
|
const averagePerCall = totalCurrent.calls ? totalCurrent.cost / totalCurrent.calls : 0;
|
|
378
|
-
const cacheHit =
|
|
376
|
+
const cacheHit = _chunkMP3DV2I5js.cacheHitPercentage.call(void 0, totalCurrent.cached, totalCurrent.tokensIn);
|
|
379
377
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
380
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
378
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkYGEOX2XXjs.cn.call(void 0, "grid gap-3", singleCustomerMode ? "sm:grid-cols-1" : "sm:grid-cols-2"), children: [
|
|
381
379
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
382
380
|
LeadTile,
|
|
383
381
|
{
|
|
384
382
|
testId: "tile-customer",
|
|
385
383
|
label: t("token_usage.admin.customer_spend"),
|
|
386
|
-
value: formatValue(
|
|
387
|
-
delta:
|
|
384
|
+
value: formatValue(_chunkMP3DV2I5js.metricValue.call(void 0, customerCurrent, metric), metric),
|
|
385
|
+
delta: _chunkMP3DV2I5js.percentageDelta.call(void 0, _chunkMP3DV2I5js.metricValue.call(void 0, customerCurrent, metric), _chunkMP3DV2I5js.metricValue.call(void 0, customerPrevious, metric)),
|
|
388
386
|
previousLabel: t("token_usage.admin.vs_previous"),
|
|
389
387
|
decimal
|
|
390
388
|
}
|
|
@@ -394,8 +392,8 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
394
392
|
{
|
|
395
393
|
testId: "tile-platform",
|
|
396
394
|
label: t("token_usage.admin.platform_spend"),
|
|
397
|
-
value: formatValue(
|
|
398
|
-
delta:
|
|
395
|
+
value: formatValue(_chunkMP3DV2I5js.metricValue.call(void 0, platformCurrent, metric), metric),
|
|
396
|
+
delta: _chunkMP3DV2I5js.percentageDelta.call(void 0, _chunkMP3DV2I5js.metricValue.call(void 0, platformCurrent, metric), _chunkMP3DV2I5js.metricValue.call(void 0, platformPrevious, metric)),
|
|
399
397
|
previousLabel: t("token_usage.admin.vs_previous"),
|
|
400
398
|
decimal
|
|
401
399
|
}
|
|
@@ -407,8 +405,8 @@ function TokenUsageAdminTiles({ summary, metric, singleCustomerMode }) {
|
|
|
407
405
|
{
|
|
408
406
|
testId: "tile-total",
|
|
409
407
|
label: t("token_usage.admin.total_cost"),
|
|
410
|
-
value: formatValue(
|
|
411
|
-
delta:
|
|
408
|
+
value: formatValue(_chunkMP3DV2I5js.metricValue.call(void 0, totalCurrent, metric), metric),
|
|
409
|
+
delta: _chunkMP3DV2I5js.percentageDelta.call(void 0, _chunkMP3DV2I5js.metricValue.call(void 0, totalCurrent, metric), _chunkMP3DV2I5js.metricValue.call(void 0, totalPrevious, metric)),
|
|
412
410
|
decimal
|
|
413
411
|
}
|
|
414
412
|
),
|
|
@@ -442,7 +440,7 @@ function LeadTile({
|
|
|
442
440
|
previousLabel,
|
|
443
441
|
decimal
|
|
444
442
|
}) {
|
|
445
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
443
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.CardContent, { className: "grid gap-1", children: [
|
|
446
444
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
447
445
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: value }),
|
|
448
446
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
@@ -459,7 +457,7 @@ function SupportingTile({
|
|
|
459
457
|
delta,
|
|
460
458
|
decimal
|
|
461
459
|
}) {
|
|
462
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
460
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.CardContent, { className: "grid gap-1", children: [
|
|
463
461
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
|
|
464
462
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-2", children: [
|
|
465
463
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: value }),
|
|
@@ -482,7 +480,7 @@ function Delta({
|
|
|
482
480
|
"span",
|
|
483
481
|
{
|
|
484
482
|
"data-testid": testId,
|
|
485
|
-
className:
|
|
483
|
+
className: _chunkYGEOX2XXjs.cn.call(void 0,
|
|
486
484
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
487
485
|
increased ? "text-success" : "text-destructive"
|
|
488
486
|
),
|
|
@@ -503,10 +501,10 @@ _chunk7QVYU63Ejs.__name.call(void 0, Delta, "Delta");
|
|
|
503
501
|
|
|
504
502
|
function TokenUsageBreakdownTable({ rows, metric }) {
|
|
505
503
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
506
|
-
const { decimal, metricValue: formatValue, percent, compare } =
|
|
504
|
+
const { decimal, metricValue: formatValue, percent, compare } = _chunkMP3DV2I5js.useUsageFormatters.call(void 0, );
|
|
507
505
|
const [sort, setSort] = _react.useState.call(void 0, void 0);
|
|
508
506
|
const showActiveUsers = rows.some((row) => row.activeUsers !== void 0);
|
|
509
|
-
const total = _react.useMemo.call(void 0, () => rows.reduce((sum, row) => sum +
|
|
507
|
+
const total = _react.useMemo.call(void 0, () => rows.reduce((sum, row) => sum + _chunkMP3DV2I5js.metricValue.call(void 0, row, metric), 0), [rows, metric]);
|
|
510
508
|
const sortValue = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (row, key) => {
|
|
511
509
|
switch (key) {
|
|
512
510
|
case "label":
|
|
@@ -516,9 +514,9 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
516
514
|
case "activeUsers":
|
|
517
515
|
return _nullishCoalesce(row.activeUsers, () => ( 0));
|
|
518
516
|
case "cacheHit":
|
|
519
|
-
return
|
|
517
|
+
return _chunkMP3DV2I5js.cacheHitPercentage.call(void 0, row.cached, row.tokensIn);
|
|
520
518
|
case "share":
|
|
521
|
-
return
|
|
519
|
+
return _chunkMP3DV2I5js.metricValue.call(void 0, row, metric);
|
|
522
520
|
default:
|
|
523
521
|
return row[key];
|
|
524
522
|
}
|
|
@@ -556,13 +554,13 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
556
554
|
// The package's <Table> wraps itself in an `overflow-x-clip` container, which
|
|
557
555
|
// would swallow the overflow before this scroller ever saw it — hence the
|
|
558
556
|
// child override. Wide metric tables must scroll, never widen the page.
|
|
559
|
-
/* @__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,
|
|
560
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
557
|
+
/* @__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, _chunkMP3DV2I5js.Table, { children: [
|
|
558
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableHead, { className: _chunkYGEOX2XXjs.cn.call(void 0, column.numeric && "text-end"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
561
559
|
"button",
|
|
562
560
|
{
|
|
563
561
|
type: "button",
|
|
564
562
|
onClick: () => toggleSort(column.key),
|
|
565
|
-
className:
|
|
563
|
+
className: _chunkYGEOX2XXjs.cn.call(void 0,
|
|
566
564
|
"hover:text-primary inline-flex items-center gap-1 text-xs font-medium",
|
|
567
565
|
column.numeric && "flex-row-reverse"
|
|
568
566
|
),
|
|
@@ -572,20 +570,20 @@ function TokenUsageBreakdownTable({ rows, metric }) {
|
|
|
572
570
|
]
|
|
573
571
|
}
|
|
574
572
|
) }, column.key)) }) }),
|
|
575
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
576
|
-
const value =
|
|
573
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableBody, { children: sortedRows.map((row) => {
|
|
574
|
+
const value = _chunkMP3DV2I5js.metricValue.call(void 0, row, metric);
|
|
577
575
|
const share = total > 0 ? value / total * 100 : 0;
|
|
578
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
579
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
580
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
581
|
-
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
582
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
583
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
584
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
585
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
586
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
587
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
588
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
576
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
|
|
577
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
|
|
578
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
|
|
579
|
+
showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableCell, { className: "text-end text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
|
|
580
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.calls, 0) }),
|
|
581
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
|
|
582
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableCell, { className: "text-end text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
|
|
583
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableCell, { className: "text-end text-xs tabular-nums", children: percent(_chunkMP3DV2I5js.cacheHitPercentage.call(void 0, row.cached, row.tokensIn)) }),
|
|
584
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
|
|
585
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableCell, { className: "text-end text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
|
|
586
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TableCell, { className: "text-end text-xs tabular-nums", children: percent(share) })
|
|
589
587
|
] }, row.id);
|
|
590
588
|
}) })
|
|
591
589
|
] }) })
|
|
@@ -619,7 +617,7 @@ var operationDescription = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0,
|
|
|
619
617
|
|
|
620
618
|
function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes = false }) {
|
|
621
619
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
622
|
-
const { metricValue: formatValue, percent } =
|
|
620
|
+
const { metricValue: formatValue, percent } = _chunkMP3DV2I5js.useUsageFormatters.call(void 0, );
|
|
623
621
|
const renderLabel = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (row) => {
|
|
624
622
|
if (row.id === "other") return t("token_usage.admin.other");
|
|
625
623
|
if (!labelsAreOperationTypes) return row.label;
|
|
@@ -641,9 +639,9 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
641
639
|
const label = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground truncate text-xs", children: renderLabel(row) });
|
|
642
640
|
const description = renderDescription(row);
|
|
643
641
|
if (!description) return label;
|
|
644
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
642
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Tooltip, { children: [
|
|
645
643
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
646
|
-
|
|
644
|
+
_chunkMP3DV2I5js.TooltipTrigger,
|
|
647
645
|
{
|
|
648
646
|
"data-testid": `ranked-description-${row.id}`,
|
|
649
647
|
className: "min-w-0 cursor-help justify-self-start truncate",
|
|
@@ -651,19 +649,19 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
651
649
|
children: label
|
|
652
650
|
}
|
|
653
651
|
),
|
|
654
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
652
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.TooltipContent, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs", children: description }) })
|
|
655
653
|
] });
|
|
656
654
|
}, "renderLabelCell");
|
|
657
655
|
if (rows.length === 0) {
|
|
658
656
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground py-6 text-center text-sm", children: emptyLabel });
|
|
659
657
|
}
|
|
660
|
-
const values = rows.map((row) =>
|
|
658
|
+
const values = rows.map((row) => _chunkMP3DV2I5js.metricValue.call(void 0, row, metric));
|
|
661
659
|
const total = values.reduce((sum, value) => sum + value, 0);
|
|
662
660
|
const max = Math.max(...values, 0);
|
|
663
661
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "grid gap-0.5", children: rows.map((row, index) => {
|
|
664
662
|
const value = values[index];
|
|
665
663
|
const isOther = row.id === "other";
|
|
666
|
-
const step = isOther ?
|
|
664
|
+
const step = isOther ? _chunkMP3DV2I5js.SEQUENTIAL_RAMP.length - 1 : Math.min(index, _chunkMP3DV2I5js.SEQUENTIAL_RAMP.length - 1);
|
|
667
665
|
const width = max > 0 ? value / max * 100 : 0;
|
|
668
666
|
const share = total > 0 ? value / total * 100 : 0;
|
|
669
667
|
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: [
|
|
@@ -675,7 +673,7 @@ function TokenUsageRankedBar({ rows, metric, emptyLabel, labelsAreOperationTypes
|
|
|
675
673
|
"data-testid": `ranked-fill-${row.id}`,
|
|
676
674
|
"data-ramp-step": String(step),
|
|
677
675
|
className: "h-full rounded-r-[4px]",
|
|
678
|
-
style: { width: `${width}%`, backgroundColor:
|
|
676
|
+
style: { width: `${width}%`, backgroundColor: _chunkMP3DV2I5js.SEQUENTIAL_RAMP[step] }
|
|
679
677
|
}
|
|
680
678
|
) })
|
|
681
679
|
] }),
|
|
@@ -725,7 +723,7 @@ var inferGranularity = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (buc
|
|
|
725
723
|
}, "inferGranularity");
|
|
726
724
|
function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
727
725
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
728
|
-
const { compact, bucketDate, metricValue: formatValue } =
|
|
726
|
+
const { compact, bucketDate, metricValue: formatValue } = _chunkMP3DV2I5js.useUsageFormatters.call(void 0, );
|
|
729
727
|
const { resolvedTheme } = _nextthemes.useTheme.call(void 0, );
|
|
730
728
|
const mode = resolvedTheme === "dark" ? "dark" : "light";
|
|
731
729
|
const { chartData, seriesKeys } = _react.useMemo.call(void 0, () => {
|
|
@@ -733,8 +731,8 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
733
731
|
const totals = /* @__PURE__ */ new Map();
|
|
734
732
|
for (const row of rows) totals.set(row.series, (_nullishCoalesce(totals.get(row.series), () => ( 0))) + metricValue2(row, metric));
|
|
735
733
|
const ranked = [...totals.entries()].sort((a, b) => b[1] - a[1]).map(([series]) => series);
|
|
736
|
-
const named = ranked.slice(0,
|
|
737
|
-
const folded = new Set(ranked.slice(
|
|
734
|
+
const named = ranked.slice(0, _chunkMP3DV2I5js.CATEGORICAL_CEILING);
|
|
735
|
+
const folded = new Set(ranked.slice(_chunkMP3DV2I5js.CATEGORICAL_CEILING));
|
|
738
736
|
const keys = folded.size > 0 ? [...named, OTHER_SERIES] : named;
|
|
739
737
|
const byBucket = /* @__PURE__ */ new Map();
|
|
740
738
|
for (const row of rows) {
|
|
@@ -774,7 +772,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
774
772
|
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" });
|
|
775
773
|
}
|
|
776
774
|
const granularity = inferGranularity(chartData.map((entry) => entry.bucket));
|
|
777
|
-
const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ?
|
|
775
|
+
const seriesColorFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (series, index) => series === OTHER_SERIES ? _chunkMP3DV2I5js.OTHER_COLOR : _chunkMP3DV2I5js.seriesColor.call(void 0, index, mode), "seriesColorFor");
|
|
778
776
|
return (
|
|
779
777
|
// The chart is a coordinate system, not prose: recharts lays the axes and the
|
|
780
778
|
// stacked bars out left-to-right, so the whole chart stays an LTR island even
|
|
@@ -783,7 +781,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
783
781
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, dir: "ltr", children: [
|
|
784
782
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-data", children: JSON.stringify(chartData) }),
|
|
785
783
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-series", children: JSON.stringify(seriesKeys) }),
|
|
786
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
784
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.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: [
|
|
787
785
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _recharts.CartesianGrid, { vertical: false }),
|
|
788
786
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
789
787
|
_recharts.XAxis,
|
|
@@ -807,10 +805,10 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
807
805
|
}
|
|
808
806
|
),
|
|
809
807
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
810
|
-
|
|
808
|
+
_chunkMP3DV2I5js.ChartTooltip,
|
|
811
809
|
{
|
|
812
810
|
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
813
|
-
|
|
811
|
+
_chunkMP3DV2I5js.ChartTooltipContent,
|
|
814
812
|
{
|
|
815
813
|
labelFormatter: (value) => bucketDate(String(value), granularity),
|
|
816
814
|
valueFormatter: (value) => formatValue(Number(value), metric),
|
|
@@ -819,7 +817,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
|
|
|
819
817
|
)
|
|
820
818
|
}
|
|
821
819
|
),
|
|
822
|
-
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
820
|
+
seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.ChartLegendContent, {}) }) : null,
|
|
823
821
|
seriesKeys.map((series, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
824
822
|
_recharts.Bar,
|
|
825
823
|
{
|
|
@@ -871,19 +869,19 @@ function TokenUsageAdminContainer() {
|
|
|
871
869
|
[t]
|
|
872
870
|
);
|
|
873
871
|
if (error) {
|
|
874
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
872
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.RoundPageContainer, { module: _chunkYGEOX2XXjs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
875
873
|
}
|
|
876
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
874
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.RoundPageContainer, { module: _chunkYGEOX2XXjs.Modules.TokenUsageAdminSummary, fullWidth: true, forceHeader: true });
|
|
877
875
|
const emptyLabel = t("token_usage.admin.no_data");
|
|
878
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
876
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.RoundPageContainer, { module: _chunkYGEOX2XXjs.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: [
|
|
879
877
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminTiles, { summary, metric: filters.metric, singleCustomerMode: hidePlatform }),
|
|
880
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
881
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
882
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
883
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
878
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Card, { children: [
|
|
879
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.CardHeader, { children: [
|
|
880
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
|
|
881
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
884
882
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.admin.stack_by") }),
|
|
885
883
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
886
|
-
|
|
884
|
+
_chunkMP3DV2I5js.Select,
|
|
887
885
|
{
|
|
888
886
|
items: stackByItems,
|
|
889
887
|
value: filters.stackBy,
|
|
@@ -891,29 +889,29 @@ function TokenUsageAdminContainer() {
|
|
|
891
889
|
if (value) setFilters({ stackBy: value });
|
|
892
890
|
},
|
|
893
891
|
children: [
|
|
894
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
895
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
892
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectValue, {}) }),
|
|
893
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SelectItem, { value, children: stackByItems[value] }, value)) })
|
|
896
894
|
]
|
|
897
895
|
}
|
|
898
896
|
)
|
|
899
897
|
] }) })
|
|
900
898
|
] }),
|
|
901
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
899
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
|
|
902
900
|
] }),
|
|
903
901
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
904
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
905
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
906
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
902
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Card, { children: [
|
|
903
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardTitle, { children: t("token_usage.admin.by_company") }) }),
|
|
904
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
|
|
907
905
|
] }),
|
|
908
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
909
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
910
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
906
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Card, { children: [
|
|
907
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardTitle, { children: t("token_usage.admin.by_user") }) }),
|
|
908
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
|
|
911
909
|
] })
|
|
912
910
|
] }),
|
|
913
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
914
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
915
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
916
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
911
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkYGEOX2XXjs.cn.call(void 0, "grid gap-4", !hidePlatform && "md:grid-cols-2"), children: [
|
|
912
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Card, { children: [
|
|
913
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
|
|
914
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
917
915
|
TokenUsageRankedBar,
|
|
918
916
|
{
|
|
919
917
|
rows: byCustomerOperation,
|
|
@@ -923,9 +921,9 @@ function TokenUsageAdminContainer() {
|
|
|
923
921
|
}
|
|
924
922
|
) })
|
|
925
923
|
] }),
|
|
926
|
-
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
927
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
928
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
924
|
+
!hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Card, { children: [
|
|
925
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
|
|
926
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
929
927
|
TokenUsageRankedBar,
|
|
930
928
|
{
|
|
931
929
|
rows: byOperation,
|
|
@@ -936,9 +934,9 @@ function TokenUsageAdminContainer() {
|
|
|
936
934
|
) })
|
|
937
935
|
] })
|
|
938
936
|
] }),
|
|
939
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
940
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
941
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
937
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Card, { children: [
|
|
938
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardTitle, { children: t("token_usage.admin.detail") }) }),
|
|
939
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
|
|
942
940
|
] })
|
|
943
941
|
] }) });
|
|
944
942
|
}
|
|
@@ -951,36 +949,36 @@ function withFilters2(endpoint, filters) {
|
|
|
951
949
|
return endpoint;
|
|
952
950
|
}
|
|
953
951
|
_chunk7QVYU63Ejs.__name.call(void 0, withFilters2, "withFilters");
|
|
954
|
-
var TokenUsageReportService = class extends
|
|
952
|
+
var TokenUsageReportService = class extends _chunkYGEOX2XXjs.AbstractService {
|
|
955
953
|
static {
|
|
956
954
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "TokenUsageReportService");
|
|
957
955
|
}
|
|
958
956
|
/** Two rows: window "current" and "previous". */
|
|
959
957
|
static async getSummary(filters) {
|
|
960
|
-
const endpoint = withFilters2(new (0,
|
|
958
|
+
const endpoint = withFilters2(new (0, _chunkYGEOX2XXjs.EndpointCreator)({ endpoint: _chunkYGEOX2XXjs.Modules.TokenUsageReportSummary }), filters);
|
|
961
959
|
return this.callApi({
|
|
962
|
-
type:
|
|
960
|
+
type: _chunkYGEOX2XXjs.Modules.TokenUsageReportSummary,
|
|
963
961
|
method: "GET" /* GET */,
|
|
964
962
|
endpoint: endpoint.generate()
|
|
965
963
|
});
|
|
966
964
|
}
|
|
967
965
|
static async getTimeline(params) {
|
|
968
|
-
const endpoint = withFilters2(new (0,
|
|
966
|
+
const endpoint = withFilters2(new (0, _chunkYGEOX2XXjs.EndpointCreator)({ endpoint: _chunkYGEOX2XXjs.Modules.TokenUsageReportTimeline }), params);
|
|
969
967
|
endpoint.addAdditionalParam("granularity", params.granularity);
|
|
970
968
|
return this.callApi({
|
|
971
|
-
type:
|
|
969
|
+
type: _chunkYGEOX2XXjs.Modules.TokenUsageReportTimeline,
|
|
972
970
|
method: "GET" /* GET */,
|
|
973
971
|
endpoint: endpoint.generate()
|
|
974
972
|
});
|
|
975
973
|
}
|
|
976
974
|
static async getBreakdown(params) {
|
|
977
|
-
const endpoint = withFilters2(new (0,
|
|
975
|
+
const endpoint = withFilters2(new (0, _chunkYGEOX2XXjs.EndpointCreator)({ endpoint: _chunkYGEOX2XXjs.Modules.TokenUsageReportBreakdown }), params);
|
|
978
976
|
endpoint.addAdditionalParam("dimension", params.dimension);
|
|
979
977
|
if (params.targetLabel) endpoint.addAdditionalParam("targetLabel", params.targetLabel);
|
|
980
978
|
endpoint.addAdditionalParam("metric", params.metric);
|
|
981
979
|
if (params.limit !== void 0) endpoint.addAdditionalParam("limit", String(params.limit));
|
|
982
980
|
return this.callApi({
|
|
983
|
-
type:
|
|
981
|
+
type: _chunkYGEOX2XXjs.Modules.TokenUsageReportBreakdown,
|
|
984
982
|
method: "GET" /* GET */,
|
|
985
983
|
endpoint: endpoint.generate()
|
|
986
984
|
});
|
|
@@ -1059,7 +1057,7 @@ var TOKEN_USAGE_REPORT_I18N_KEYS = [
|
|
|
1059
1057
|
|
|
1060
1058
|
function TokenUsageReportFilterBar({ onChange }) {
|
|
1061
1059
|
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,
|
|
1062
|
-
|
|
1060
|
+
_chunkMP3DV2I5js.DateRangeSelector,
|
|
1063
1061
|
{
|
|
1064
1062
|
onDateChange: (range) => {
|
|
1065
1063
|
if (!_optionalChain([range, 'optionalAccess', _5 => _5.from]) || !_optionalChain([range, 'optionalAccess', _6 => _6.to])) return;
|
|
@@ -1092,7 +1090,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1092
1090
|
pageUrl = TOKEN_USAGE_REPORT_PAGE_URL
|
|
1093
1091
|
}) => {
|
|
1094
1092
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1095
|
-
const generateUrl =
|
|
1093
|
+
const generateUrl = _chunkMP3DV2I5js.usePageUrlGenerator.call(void 0, );
|
|
1096
1094
|
const [filters, setFilterState] = _react.useState.call(void 0, () => {
|
|
1097
1095
|
const range = defaultRange2();
|
|
1098
1096
|
return { from: _nullishCoalesce(initialFrom, () => ( range.from)), to: _nullishCoalesce(initialTo, () => ( range.to)) };
|
|
@@ -1156,7 +1154,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
|
|
|
1156
1154
|
() => ({ summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error }),
|
|
1157
1155
|
[summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error]
|
|
1158
1156
|
);
|
|
1159
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1157
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
|
|
1160
1158
|
}, "TokenUsageReportProvider");
|
|
1161
1159
|
var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
|
|
1162
1160
|
const ctx = _react.useContext.call(void 0, TokenUsageReportContext);
|
|
@@ -1176,7 +1174,7 @@ var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (
|
|
|
1176
1174
|
var ZERO2 = { cost: 0, credits: 0, tokensIn: 0, tokensOut: 0, cached: 0, calls: 0 };
|
|
1177
1175
|
function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
1178
1176
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1179
|
-
const { decimal, metricValue: formatValue } =
|
|
1177
|
+
const { decimal, metricValue: formatValue } = _chunkMP3DV2I5js.useUsageFormatters.call(void 0, );
|
|
1180
1178
|
const rowFor = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (window) => _nullishCoalesce(summary.find((row) => row.window === window), () => ( ZERO2)), "rowFor");
|
|
1181
1179
|
const current = rowFor("current");
|
|
1182
1180
|
const previous = rowFor("previous");
|
|
@@ -1184,15 +1182,15 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1184
1182
|
const monthlyColor = monthlyPercentage > 75 ? "text-success" : monthlyPercentage >= 5 ? "text-warning" : "text-destructive";
|
|
1185
1183
|
const whole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => decimal(Math.max(0, Math.floor(value)), 0), "whole");
|
|
1186
1184
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
|
|
1187
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1185
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.CardContent, { className: "grid gap-1", children: [
|
|
1188
1186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.used_in_period") }),
|
|
1189
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(
|
|
1187
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(_chunkMP3DV2I5js.metricValue.call(void 0, current, metric), metric) }),
|
|
1190
1188
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
|
|
1191
1189
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1192
1190
|
Delta2,
|
|
1193
1191
|
{
|
|
1194
1192
|
testId: "tile-used-delta",
|
|
1195
|
-
delta:
|
|
1193
|
+
delta: _chunkMP3DV2I5js.percentageDelta.call(void 0, _chunkMP3DV2I5js.metricValue.call(void 0, current, metric), _chunkMP3DV2I5js.metricValue.call(void 0, previous, metric)),
|
|
1196
1194
|
decimal
|
|
1197
1195
|
}
|
|
1198
1196
|
),
|
|
@@ -1200,21 +1198,21 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
|
|
|
1200
1198
|
] })
|
|
1201
1199
|
] }) }),
|
|
1202
1200
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3 sm:grid-cols-3", children: [
|
|
1203
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1201
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.CardContent, { className: "grid gap-1", children: [
|
|
1204
1202
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.monthly_left") }),
|
|
1205
1203
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-baseline gap-1", children: [
|
|
1206
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className:
|
|
1204
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className: _chunkYGEOX2XXjs.cn.call(void 0, "text-sm font-medium tabular-nums", monthlyColor), children: whole(balances.availableMonthlyCredits) }),
|
|
1207
1205
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-muted-foreground text-xs tabular-nums", children: [
|
|
1208
1206
|
"/ ",
|
|
1209
1207
|
whole(balances.monthlyCredits)
|
|
1210
1208
|
] })
|
|
1211
1209
|
] })
|
|
1212
1210
|
] }) }),
|
|
1213
|
-
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1211
|
+
balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.CardContent, { className: "grid gap-1", children: [
|
|
1214
1212
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.extra_credits") }),
|
|
1215
1213
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: whole(balances.availableExtraCredits) })
|
|
1216
1214
|
] }) }),
|
|
1217
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1215
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.CardContent, { className: "grid gap-1", children: [
|
|
1218
1216
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.calls") }),
|
|
1219
1217
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: decimal(current.calls, 0) })
|
|
1220
1218
|
] }) })
|
|
@@ -1236,7 +1234,7 @@ function Delta2({
|
|
|
1236
1234
|
"span",
|
|
1237
1235
|
{
|
|
1238
1236
|
"data-testid": testId,
|
|
1239
|
-
className:
|
|
1237
|
+
className: _chunkYGEOX2XXjs.cn.call(void 0,
|
|
1240
1238
|
"inline-flex items-center gap-0.5 text-xs tabular-nums",
|
|
1241
1239
|
increased ? "text-warning" : "text-success"
|
|
1242
1240
|
),
|
|
@@ -1256,21 +1254,21 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1256
1254
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
1257
1255
|
const { summary, timeline, byOperation, byTarget, isLoading, error, targetPanelTitleKey } = useTokenUsageReport();
|
|
1258
1256
|
if (error) {
|
|
1259
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1257
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
|
|
1260
1258
|
}
|
|
1261
|
-
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1259
|
+
if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.RoundPageContainer, { fullWidth: true, forceHeader: true });
|
|
1262
1260
|
const emptyLabel = t("token_usage.report.no_data");
|
|
1263
1261
|
const targetTitle = targetPanelTitleKey && byTarget.length > 0 ? t(targetPanelTitleKey) : void 0;
|
|
1264
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1262
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
|
|
1265
1263
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportTiles, { summary, metric: "credits", balances }),
|
|
1266
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1267
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1268
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1264
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Card, { children: [
|
|
1265
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
|
|
1266
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
|
|
1269
1267
|
] }),
|
|
1270
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
1271
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1272
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1273
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1268
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkYGEOX2XXjs.cn.call(void 0, "grid gap-4", targetTitle && "md:grid-cols-2"), children: [
|
|
1269
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Card, { children: [
|
|
1270
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardTitle, { children: t("token_usage.report.by_operation") }) }),
|
|
1271
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1274
1272
|
TokenUsageRankedBar,
|
|
1275
1273
|
{
|
|
1276
1274
|
rows: byOperation,
|
|
@@ -1280,9 +1278,9 @@ function TokenUsageReportContainer({ balances = null }) {
|
|
|
1280
1278
|
}
|
|
1281
1279
|
) })
|
|
1282
1280
|
] }),
|
|
1283
|
-
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1284
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1285
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1281
|
+
targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkMP3DV2I5js.Card, { children: [
|
|
1282
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardTitle, { children: targetTitle }) }),
|
|
1283
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMP3DV2I5js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
|
|
1286
1284
|
] })
|
|
1287
1285
|
] })
|
|
1288
1286
|
] }) });
|
|
@@ -1322,5 +1320,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, TokenUsageReportContainer, "TokenUsageRepor
|
|
|
1322
1320
|
|
|
1323
1321
|
|
|
1324
1322
|
|
|
1325
|
-
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TOKEN_USAGE_REPORT_I18N_KEYS = TOKEN_USAGE_REPORT_I18N_KEYS; exports.TokenUsageAdminBreakdown =
|
|
1323
|
+
exports.TOKEN_USAGE_ADMIN_I18N_KEYS = TOKEN_USAGE_ADMIN_I18N_KEYS; exports.TOKEN_USAGE_REPORT_I18N_KEYS = TOKEN_USAGE_REPORT_I18N_KEYS; exports.TokenUsageAdminBreakdown = _chunkYGEOX2XXjs.TokenUsageAdminBreakdown; exports.TokenUsageAdminBreakdownModule = _chunkYGEOX2XXjs.TokenUsageAdminBreakdownModule; exports.TokenUsageAdminContainer = TokenUsageAdminContainer; exports.TokenUsageAdminFilterBar = TokenUsageAdminFilterBar; exports.TokenUsageAdminProvider = TokenUsageAdminProvider; exports.TokenUsageAdminService = TokenUsageAdminService; exports.TokenUsageAdminSummary = _chunkYGEOX2XXjs.TokenUsageAdminSummary; exports.TokenUsageAdminSummaryModule = _chunkYGEOX2XXjs.TokenUsageAdminSummaryModule; exports.TokenUsageAdminTiles = TokenUsageAdminTiles; exports.TokenUsageAdminTimeline = _chunkYGEOX2XXjs.TokenUsageAdminTimeline; exports.TokenUsageAdminTimelineModule = _chunkYGEOX2XXjs.TokenUsageAdminTimelineModule; exports.TokenUsageBreakdownTable = TokenUsageBreakdownTable; exports.TokenUsageRankedBar = TokenUsageRankedBar; exports.TokenUsageReportBreakdown = _chunkYGEOX2XXjs.TokenUsageReportBreakdown; exports.TokenUsageReportContainer = TokenUsageReportContainer; exports.TokenUsageReportFilterBar = TokenUsageReportFilterBar; exports.TokenUsageReportProvider = TokenUsageReportProvider; exports.TokenUsageReportService = TokenUsageReportService; exports.TokenUsageReportSummary = _chunkYGEOX2XXjs.TokenUsageReportSummary; exports.TokenUsageReportTiles = TokenUsageReportTiles; exports.TokenUsageReportTimeline = _chunkYGEOX2XXjs.TokenUsageReportTimeline; exports.TokenUsageTimelineChart = TokenUsageTimelineChart; exports.configureTokenUsage = _chunkYGEOX2XXjs.configureTokenUsage; exports.createUsageFormatters = _chunkMP3DV2I5js.createUsageFormatters; exports.getTokenUsageCurrency = _chunkYGEOX2XXjs.getTokenUsageCurrency; exports.seriesColor = _chunkMP3DV2I5js.seriesColor; exports.seriesTheme = _chunkMP3DV2I5js.seriesTheme; exports.tokenUsageModules = _chunkYGEOX2XXjs.tokenUsageModules; exports.useTokenUsageAdmin = useTokenUsageAdmin; exports.useTokenUsageReport = useTokenUsageReport; exports.useUsageFormatters = _chunkMP3DV2I5js.useUsageFormatters;
|
|
1326
1324
|
//# sourceMappingURL=index.js.map
|