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