@carlonicora/nextjs-jsonapi 3.3.5 → 3.3.6

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.
@@ -23,7 +23,7 @@ var _chunkYBZVWLPHjs = require('../../chunk-YBZVWLPH.js');
23
23
 
24
24
 
25
25
 
26
- var _chunkPXXVAY7Njs = require('../../chunk-PXXVAY7N.js');
26
+ var _chunk5WFYQE22js = require('../../chunk-5WFYQE22.js');
27
27
 
28
28
 
29
29
  var _chunkX2MQ3WHXjs = require('../../chunk-X2MQ3WHX.js');
@@ -75,29 +75,29 @@ var _lucidereact = require('lucide-react');
75
75
 
76
76
 
77
77
  function HelpAssistantSheet({ open, onOpenChange }) {
78
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.Sheet, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
79
- _chunkPXXVAY7Njs.SheetContent,
78
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Sheet, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
79
+ _chunk5WFYQE22js.SheetContent,
80
80
  {
81
81
  side: "right",
82
82
  className: "flex w-full flex-col data-[side=right]:sm:max-w-2xl data-[side=right]:lg:max-w-3xl",
83
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.AssistantProvider, { manageUrl: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HelpAssistantSheetBody, {}) })
83
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.AssistantProvider, { manageUrl: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HelpAssistantSheetBody, {}) })
84
84
  }
85
85
  ) });
86
86
  }
87
87
  _chunk7QVYU63Ejs.__name.call(void 0, HelpAssistantSheet, "HelpAssistantSheet");
88
88
  function HelpAssistantSheetBody() {
89
89
  const t = _nextintl.useTranslations.call(void 0, );
90
- const ctx = _chunkPXXVAY7Njs.useAssistantContext.call(void 0, );
90
+ const ctx = _chunk5WFYQE22js.useAssistantContext.call(void 0, );
91
91
  const showThread = !!ctx.assistant || ctx.sending || ctx.messages.length > 0;
92
92
  const send = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (content) => ctx.sendMessage(content, { howToMode: true }), "send");
93
93
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
94
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.SheetHeader, { children: [
95
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SheetTitle, { children: t("help.askAi.sheet.title") }),
96
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SheetDescription, { children: t("help.askAi.sheet.subtitle") })
94
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.SheetHeader, { children: [
95
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SheetTitle, { children: t("help.askAi.sheet.title") }),
96
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SheetDescription, { children: t("help.askAi.sheet.subtitle") })
97
97
  ] }),
98
- !showThread ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.AssistantEmptyState, { onSend: send }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
98
+ !showThread ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.AssistantEmptyState, { onSend: send }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
99
99
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
100
- _chunkPXXVAY7Njs.AssistantThread,
100
+ _chunk5WFYQE22js.AssistantThread,
101
101
  {
102
102
  messages: ctx.messages,
103
103
  sending: ctx.sending,
@@ -107,7 +107,7 @@ function HelpAssistantSheetBody() {
107
107
  onRetry: ctx.retrySend
108
108
  }
109
109
  ),
110
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.AssistantComposer, { onSend: send, disabled: ctx.sending })
110
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.AssistantComposer, { onSend: send, disabled: ctx.sending })
111
111
  ] })
112
112
  ] });
113
113
  }
@@ -117,20 +117,20 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpAssistantSheetBody, "HelpAssistantSheet
117
117
 
118
118
  function HelpAskAi() {
119
119
  const t = _nextintl.useTranslations.call(void 0, );
120
- const { currentUser } = _chunkPXXVAY7Njs.useCurrentUserContext.call(void 0, );
120
+ const { currentUser } = _chunk5WFYQE22js.useCurrentUserContext.call(void 0, );
121
121
  const [open, setOpen] = _react.useState.call(void 0, false);
122
122
  const disabled = !currentUser;
123
123
  if (disabled) {
124
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.Tooltip, { children: [
125
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.TooltipTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.Button, { variant: "outline", size: "sm", disabled: true }), children: [
124
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Tooltip, { children: [
125
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.TooltipTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Button, { variant: "outline", size: "sm", disabled: true }), children: [
126
126
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.SparklesIcon, { className: "h-4 w-4" }),
127
127
  t("help.askAi.button")
128
128
  ] }),
129
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TooltipContent, { children: t("help.askAi.loginTooltip") })
129
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TooltipContent, { children: t("help.askAi.loginTooltip") })
130
130
  ] });
131
131
  }
132
132
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
133
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
133
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
134
134
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.SparklesIcon, { className: "h-4 w-4" }),
135
135
  t("help.askAi.button")
136
136
  ] }),
@@ -143,7 +143,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpAskAi, "HelpAskAi");
143
143
 
144
144
  function HelpHeader() {
145
145
  const t = _nextintl.useTranslations.call(void 0, );
146
- const { currentUser } = _chunkPXXVAY7Njs.useCurrentUserContext.call(void 0, );
146
+ const { currentUser } = _chunk5WFYQE22js.useCurrentUserContext.call(void 0, );
147
147
  const { brand } = useHelp();
148
148
  const logo = _optionalChain([brand, 'optionalAccess', _ => _.logo]);
149
149
  const label = _nullishCoalesce(_optionalChain([brand, 'optionalAccess', _2 => _2.label]), () => ( "Help"));
@@ -159,7 +159,7 @@ function HelpHeader() {
159
159
  ] }),
160
160
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
161
161
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HelpAskAi, {}),
162
- currentUser ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _link2.default, { href: appHref, className: _chunkPXXVAY7Njs.buttonVariants.call(void 0, { variant: "outline", size: "sm" }), children: t("help.header.openApp") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _link2.default, { href: "/login", className: _chunkPXXVAY7Njs.buttonVariants.call(void 0, { variant: "outline", size: "sm" }), children: t("help.header.login") })
162
+ currentUser ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _link2.default, { href: appHref, className: _chunk5WFYQE22js.buttonVariants.call(void 0, { variant: "outline", size: "sm" }), children: t("help.header.openApp") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _link2.default, { href: "/login", className: _chunk5WFYQE22js.buttonVariants.call(void 0, { variant: "outline", size: "sm" }), children: t("help.header.login") })
163
163
  ] })
164
164
  ] });
165
165
  }
@@ -201,7 +201,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, useHelpFilter, "useHelpFilter");
201
201
 
202
202
  function HelpSideNav() {
203
203
  const t = _nextintl.useTranslations.call(void 0, );
204
- const generateUrl = _chunkPXXVAY7Njs.usePageUrlGenerator.call(void 0, );
204
+ const generateUrl = _chunk5WFYQE22js.usePageUrlGenerator.call(void 0, );
205
205
  const pathname = _navigation.usePathname.call(void 0, );
206
206
  const [articles, setArticles] = _react.useState.call(void 0, []);
207
207
  _react.useEffect.call(void 0, () => {
@@ -282,7 +282,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpSideNav, "HelpSideNav");
282
282
  function HelpArticleBody(props) {
283
283
  const t = _nextintl.useTranslations.call(void 0, );
284
284
  const format = _nextintl.useFormatter.call(void 0, );
285
- const generateUrl = _chunkPXXVAY7Njs.usePageUrlGenerator.call(void 0, );
285
+ const generateUrl = _chunk5WFYQE22js.usePageUrlGenerator.call(void 0, );
286
286
  const { howToType, title, summary, updatedAt, prev, next, children } = props;
287
287
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "article", { className: "prose dark:prose-invert max-w-none", children: [
288
288
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "nav", { className: "text-muted-foreground mb-2 text-xs", children: [
@@ -339,7 +339,7 @@ function HelpTOC({ headings }) {
339
339
  }, [headings]);
340
340
  if (headings.length === 0) return null;
341
341
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "nav", { "aria-label": t("help.toc.title"), className: "hidden lg:block", children: [
342
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.MicroLabel, { className: "mb-2", children: t("help.toc.title") }),
342
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.MicroLabel, { className: "mb-2", children: t("help.toc.title") }),
343
343
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "space-y-1 text-sm", children: headings.map((h) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { style: { paddingLeft: `${(h.depth - 2) * 0.75}rem` }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
344
344
  "a",
345
345
  {
@@ -360,7 +360,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpTOC, "HelpTOC");
360
360
 
361
361
  function HelpHint({ contextKey }) {
362
362
  const t = _nextintl.useTranslations.call(void 0, );
363
- const generateUrl = _chunkPXXVAY7Njs.usePageUrlGenerator.call(void 0, );
363
+ const generateUrl = _chunk5WFYQE22js.usePageUrlGenerator.call(void 0, );
364
364
  const [open, setOpen] = _react.useState.call(void 0, false);
365
365
  const [picked, setPicked] = _react.useState.call(void 0, null);
366
366
  const [articles, setArticles] = _react.useState.call(void 0, []);
@@ -378,7 +378,7 @@ function HelpHint({ contextKey }) {
378
378
  if (matches.length === 0) return null;
379
379
  const active = _nullishCoalesce(picked, () => ( (matches.length === 1 ? matches[0] : null)));
380
380
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
381
- _chunkPXXVAY7Njs.Sheet,
381
+ _chunk5WFYQE22js.Sheet,
382
382
  {
383
383
  open,
384
384
  onOpenChange: (o) => {
@@ -386,11 +386,11 @@ function HelpHint({ contextKey }) {
386
386
  if (!o) setPicked(null);
387
387
  },
388
388
  children: [
389
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SheetTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.Button, { variant: "ghost", size: "icon-sm", "aria-label": t("help.hint.trigger") }), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.HelpCircleIcon, { className: "h-4 w-4" }) }),
390
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.SheetContent, { side: "right", className: "w-full max-w-md sm:max-w-lg", children: [
391
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.SheetHeader, { children: [
392
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SheetTitle, { children: active ? active.name : t("help.hint.pickArticle") }),
393
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SheetDescription, { children: _nullishCoalesce(_optionalChain([active, 'optionalAccess', _4 => _4.summary]), () => ( "")) })
389
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SheetTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Button, { variant: "ghost", size: "icon-sm", "aria-label": t("help.hint.trigger") }), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.HelpCircleIcon, { className: "h-4 w-4" }) }),
390
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.SheetContent, { side: "right", className: "w-full max-w-md sm:max-w-lg", children: [
391
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.SheetHeader, { children: [
392
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SheetTitle, { children: active ? active.name : t("help.hint.pickArticle") }),
393
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SheetDescription, { children: _nullishCoalesce(_optionalChain([active, 'optionalAccess', _4 => _4.summary]), () => ( "")) })
394
394
  ] }),
395
395
  active ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mt-4 space-y-3", children: [
396
396
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-sm", children: active.summary }),
@@ -422,7 +422,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpHint, "HelpHint");
422
422
 
423
423
  function HelpSearchResultRow({ result, onSelect }) {
424
424
  const t = _nextintl.useTranslations.call(void 0, );
425
- const generateUrl = _chunkPXXVAY7Njs.usePageUrlGenerator.call(void 0, );
425
+ const generateUrl = _chunk5WFYQE22js.usePageUrlGenerator.call(void 0, );
426
426
  const [article, setArticle] = _react.useState.call(void 0, null);
427
427
  _react.useEffect.call(void 0, () => {
428
428
  let active = true;
@@ -433,7 +433,7 @@ function HelpSearchResultRow({ result, onSelect }) {
433
433
  }, [result.id]);
434
434
  if (!article) {
435
435
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
436
- _chunkPXXVAY7Njs.CommandItem,
436
+ _chunk5WFYQE22js.CommandItem,
437
437
  {
438
438
  value: result.id,
439
439
  disabled: true,
@@ -442,7 +442,7 @@ function HelpSearchResultRow({ result, onSelect }) {
442
442
  }
443
443
  );
444
444
  }
445
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CommandItem, { value: result.id, onSelect, className: "cursor-pointer p-0", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
445
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CommandItem, { value: result.id, onSelect, className: "cursor-pointer p-0", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
446
446
  _link2.default,
447
447
  {
448
448
  href: generateUrl({ page: `/help/${article.howToType}/${article.slug}` }),
@@ -23,7 +23,7 @@ import {
23
23
  useAssistantContext,
24
24
  useCurrentUserContext,
25
25
  usePageUrlGenerator
26
- } from "../../chunk-JBTGGZ3K.mjs";
26
+ } from "../../chunk-CFZW6GU4.mjs";
27
27
  import {
28
28
  _getStaticHelpContent
29
29
  } from "../../chunk-RZDY4CIF.mjs";
@@ -26,7 +26,7 @@
26
26
 
27
27
 
28
28
 
29
- var _chunkPXXVAY7Njs = require('../../chunk-PXXVAY7N.js');
29
+ var _chunk5WFYQE22js = require('../../chunk-5WFYQE22.js');
30
30
  require('../../chunk-X2MQ3WHX.js');
31
31
 
32
32
 
@@ -70,7 +70,7 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
70
70
  };
71
71
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: [
72
72
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
73
- _chunkPXXVAY7Njs.DateRangeSelector,
73
+ _chunk5WFYQE22js.DateRangeSelector,
74
74
  {
75
75
  onDateChange: (range) => {
76
76
  if (!_optionalChain([range, 'optionalAccess', _ => _.from]) || !_optionalChain([range, 'optionalAccess', _2 => _2.to])) return;
@@ -105,16 +105,16 @@ function TokenUsageAdminFilterBar({ granularity, companyId, metric, companies, o
105
105
  }
106
106
  ),
107
107
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
108
- _chunkPXXVAY7Njs.Select,
108
+ _chunk5WFYQE22js.Select,
109
109
  {
110
110
  items: companyItems,
111
111
  value: _nullishCoalesce(companyId, () => ( ALL_COMPANIES)),
112
112
  onValueChange: (value) => onChange({ companyId: !value || value === ALL_COMPANIES ? void 0 : value }),
113
113
  children: [
114
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
115
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.SelectContent, { children: [
116
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
117
- companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SelectItem, { value: company.id, children: company.label }, company.id))
114
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectTrigger, { className: "w-56", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectValue, { placeholder: t("token_usage.admin.all_companies") }) }),
115
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.SelectContent, { children: [
116
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectItem, { value: ALL_COMPANIES, children: t("token_usage.admin.all_companies") }),
117
+ companies.map((company) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectItem, { value: company.id, children: company.label }, company.id))
118
118
  ] })
119
119
  ]
120
120
  }
@@ -137,7 +137,7 @@ function Segmented({
137
137
  children: options.map((option) => {
138
138
  const selected = option.value === value;
139
139
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
140
- _chunkPXXVAY7Njs.Button,
140
+ _chunk5WFYQE22js.Button,
141
141
  {
142
142
  type: "button",
143
143
  size: "sm",
@@ -219,7 +219,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
219
219
  pageUrl = TOKEN_USAGE_ADMIN_PAGE_URL
220
220
  }) => {
221
221
  const t = _nextintl.useTranslations.call(void 0, );
222
- const generateUrl = _chunkPXXVAY7Njs.usePageUrlGenerator.call(void 0, );
222
+ const generateUrl = _chunk5WFYQE22js.usePageUrlGenerator.call(void 0, );
223
223
  const [filters, setFilterState] = _react.useState.call(void 0, () => {
224
224
  const range = defaultRange();
225
225
  return {
@@ -337,7 +337,7 @@ var TokenUsageAdminProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
337
337
  error
338
338
  ]
339
339
  );
340
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
340
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminContext.Provider, { value: contextValue, children }) });
341
341
  }, "TokenUsageAdminProvider");
342
342
  var useTokenUsageAdmin = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
343
343
  const ctx = _react.useContext.call(void 0, TokenUsageAdminContext);
@@ -497,7 +497,7 @@ function LeadTile({
497
497
  previousLabel,
498
498
  decimal
499
499
  }) {
500
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.CardContent, { className: "grid gap-1", children: [
500
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardContent, { className: "grid gap-1", children: [
501
501
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
502
502
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: value }),
503
503
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
@@ -514,7 +514,7 @@ function SupportingTile({
514
514
  delta,
515
515
  decimal
516
516
  }) {
517
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.CardContent, { className: "grid gap-1", children: [
517
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { "data-testid": testId, size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardContent, { className: "grid gap-1", children: [
518
518
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: label }),
519
519
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-2", children: [
520
520
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: value }),
@@ -611,8 +611,8 @@ function TokenUsageBreakdownTable({ rows, metric }) {
611
611
  // The package's <Table> wraps itself in an `overflow-x-clip` container, which
612
612
  // would swallow the overflow before this scroller ever saw it — hence the
613
613
  // child override. Wide metric tables must scroll, never widen the page.
614
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-x-auto [&_[data-slot=table-container]]:overflow-x-visible", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.Table, { children: [
615
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableHead, { className: _chunk6T6QB6K2js.cn.call(void 0, column.numeric && "text-right"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
614
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "overflow-x-auto [&_[data-slot=table-container]]:overflow-x-visible", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Table, { children: [
615
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableRow, { children: columns.map((column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableHead, { className: _chunk6T6QB6K2js.cn.call(void 0, column.numeric && "text-right"), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
616
616
  "button",
617
617
  {
618
618
  type: "button",
@@ -627,20 +627,20 @@ function TokenUsageBreakdownTable({ rows, metric }) {
627
627
  ]
628
628
  }
629
629
  ) }, column.key)) }) }),
630
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableBody, { children: sortedRows.map((row) => {
630
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableBody, { children: sortedRows.map((row) => {
631
631
  const value = metricValue(row, metric);
632
632
  const share = total > 0 ? value / total * 100 : 0;
633
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
634
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
635
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
636
- showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableCell, { className: "text-right text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
637
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.calls, 0) }),
638
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
639
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
640
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableCell, { className: "text-right text-xs tabular-nums", children: percent(cacheHitPercentage(row.cached, row.tokensIn)) }),
641
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableCell, { className: "text-right text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
642
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableCell, { className: "text-right text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
643
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.TableCell, { className: "text-right text-xs tabular-nums", children: percent(share) })
633
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.TableRow, { "data-testid": `breakdown-row-${row.id}`, children: [
634
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-xs", children: row.id === "other" ? t("token_usage.admin.other") : row.label }),
635
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-muted-foreground text-xs", children: _nullishCoalesce(row.sublabel, () => ( "")) }),
636
+ showActiveUsers && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: row.activeUsers === void 0 ? "" : decimal(row.activeUsers, 0) }),
637
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.calls, 0) }),
638
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.tokensIn, 0) }),
639
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: decimal(row.tokensOut, 0) }),
640
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: percent(cacheHitPercentage(row.cached, row.tokensIn)) }),
641
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: formatValue(row.cost, "cost") }),
642
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: formatValue(row.credits, "credits") }),
643
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.TableCell, { className: "text-right text-xs tabular-nums", children: percent(share) })
644
644
  ] }, row.id);
645
645
  }) })
646
646
  ] }) })
@@ -833,7 +833,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
833
833
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, children: [
834
834
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-data", children: JSON.stringify(chartData) }),
835
835
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", "data-testid": "timeline-series", children: JSON.stringify(seriesKeys) }),
836
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.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: [
836
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.ChartContainer, { config: chartConfig, className: "aspect-auto h-72 w-full", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _recharts.BarChart, { accessibilityLayer: true, data: chartData, margin: { top: 8, right: 8, bottom: 0, left: 0 }, children: [
837
837
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _recharts.CartesianGrid, { vertical: false }),
838
838
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
839
839
  _recharts.XAxis,
@@ -857,10 +857,10 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
857
857
  }
858
858
  ),
859
859
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
860
- _chunkPXXVAY7Njs.ChartTooltip,
860
+ _chunk5WFYQE22js.ChartTooltip,
861
861
  {
862
862
  content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
863
- _chunkPXXVAY7Njs.ChartTooltipContent,
863
+ _chunk5WFYQE22js.ChartTooltipContent,
864
864
  {
865
865
  labelFormatter: (value) => bucketDate(String(value), granularity),
866
866
  valueFormatter: (value) => formatValue(Number(value), metric),
@@ -869,7 +869,7 @@ function TokenUsageTimelineChart({ rows, metric, stackBy, className }) {
869
869
  )
870
870
  }
871
871
  ),
872
- seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.ChartLegendContent, {}) }) : null,
872
+ seriesKeys.length >= 2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.ChartLegend, { content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.ChartLegendContent, {}) }) : null,
873
873
  seriesKeys.map((series, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
874
874
  _recharts.Bar,
875
875
  {
@@ -920,19 +920,19 @@ function TokenUsageAdminContainer() {
920
920
  [t]
921
921
  );
922
922
  if (error) {
923
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
923
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
924
924
  }
925
- if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.RoundPageContainer, { fullWidth: true, forceHeader: true });
925
+ if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.RoundPageContainer, { fullWidth: true, forceHeader: true });
926
926
  const emptyLabel = t("token_usage.admin.no_data");
927
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
927
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
928
928
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageAdminTiles, { summary, metric: filters.metric, singleCustomerMode: hidePlatform }),
929
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.Card, { children: [
930
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.CardHeader, { children: [
931
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
932
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
929
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
930
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardHeader, { children: [
931
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.admin.usage_over_time") }),
932
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardAction, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
933
933
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.admin.stack_by") }),
934
934
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
935
- _chunkPXXVAY7Njs.Select,
935
+ _chunk5WFYQE22js.Select,
936
936
  {
937
937
  items: stackByItems,
938
938
  value: filters.stackBy,
@@ -940,29 +940,29 @@ function TokenUsageAdminContainer() {
940
940
  if (value) setFilters({ stackBy: value });
941
941
  },
942
942
  children: [
943
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SelectValue, {}) }),
944
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SelectItem, { value, children: stackByItems[value] }, value)) })
943
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectTrigger, { size: "sm", className: "w-36", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectValue, {}) }),
944
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectContent, { children: STACK_BY_VALUES.map((value) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SelectItem, { value, children: stackByItems[value] }, value)) })
945
945
  ]
946
946
  }
947
947
  )
948
948
  ] }) })
949
949
  ] }),
950
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
950
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: filters.metric, stackBy: filters.stackBy }) })
951
951
  ] }),
952
952
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-4 md:grid-cols-2", children: [
953
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.Card, { children: [
954
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardTitle, { children: t("token_usage.admin.by_company") }) }),
955
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
953
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
954
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.admin.by_company") }) }),
955
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byCompany, metric: filters.metric, emptyLabel }) })
956
956
  ] }),
957
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.Card, { children: [
958
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardTitle, { children: t("token_usage.admin.by_user") }) }),
959
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
957
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
958
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.admin.by_user") }) }),
959
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byUser, metric: filters.metric, emptyLabel }) })
960
960
  ] })
961
961
  ] }),
962
962
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk6T6QB6K2js.cn.call(void 0, "grid gap-4", !hidePlatform && "md:grid-cols-2"), children: [
963
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.Card, { children: [
964
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
965
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
963
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
964
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.admin.customer_by_operation") }) }),
965
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
966
966
  TokenUsageRankedBar,
967
967
  {
968
968
  rows: byCustomerOperation,
@@ -972,9 +972,9 @@ function TokenUsageAdminContainer() {
972
972
  }
973
973
  ) })
974
974
  ] }),
975
- !hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.Card, { children: [
976
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
977
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
975
+ !hidePlatform && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
976
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.admin.platform_by_operation") }) }),
977
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
978
978
  TokenUsageRankedBar,
979
979
  {
980
980
  rows: byOperation,
@@ -985,9 +985,9 @@ function TokenUsageAdminContainer() {
985
985
  ) })
986
986
  ] })
987
987
  ] }),
988
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.Card, { children: [
989
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardTitle, { children: t("token_usage.admin.detail") }) }),
990
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
988
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
989
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.admin.detail") }) }),
990
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageBreakdownTable, { rows: byCompany, metric: filters.metric }) })
991
991
  ] })
992
992
  ] }) });
993
993
  }
@@ -1108,7 +1108,7 @@ var TOKEN_USAGE_REPORT_I18N_KEYS = [
1108
1108
 
1109
1109
  function TokenUsageReportFilterBar({ onChange }) {
1110
1110
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1111
- _chunkPXXVAY7Njs.DateRangeSelector,
1111
+ _chunk5WFYQE22js.DateRangeSelector,
1112
1112
  {
1113
1113
  onDateChange: (range) => {
1114
1114
  if (!_optionalChain([range, 'optionalAccess', _10 => _10.from]) || !_optionalChain([range, 'optionalAccess', _11 => _11.to])) return;
@@ -1141,7 +1141,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
1141
1141
  pageUrl = TOKEN_USAGE_REPORT_PAGE_URL
1142
1142
  }) => {
1143
1143
  const t = _nextintl.useTranslations.call(void 0, );
1144
- const generateUrl = _chunkPXXVAY7Njs.usePageUrlGenerator.call(void 0, );
1144
+ const generateUrl = _chunk5WFYQE22js.usePageUrlGenerator.call(void 0, );
1145
1145
  const [filters, setFilterState] = _react.useState.call(void 0, () => {
1146
1146
  const range = defaultRange2();
1147
1147
  return { from: _nullishCoalesce(initialFrom, () => ( range.from)), to: _nullishCoalesce(initialTo, () => ( range.to)) };
@@ -1205,7 +1205,7 @@ var TokenUsageReportProvider = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void
1205
1205
  () => ({ summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error }),
1206
1206
  [summary, timeline, byOperation, byTarget, targetPanelTitleKey, filters, setFilters, isLoading, error]
1207
1207
  );
1208
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
1208
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportContext.Provider, { value: contextValue, children }) });
1209
1209
  }, "TokenUsageReportProvider");
1210
1210
  var useTokenUsageReport = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => {
1211
1211
  const ctx = _react.useContext.call(void 0, TokenUsageReportContext);
@@ -1233,7 +1233,7 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
1233
1233
  const monthlyColor = monthlyPercentage > 75 ? "text-success" : monthlyPercentage >= 5 ? "text-warning" : "text-destructive";
1234
1234
  const whole = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (value) => decimal(Math.max(0, Math.floor(value)), 0), "whole");
1235
1235
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3", children: [
1236
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.CardContent, { className: "grid gap-1", children: [
1236
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { "data-testid": "tile-used", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardContent, { className: "grid gap-1", children: [
1237
1237
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.used_in_period") }),
1238
1238
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-primary text-xl font-semibold tabular-nums", children: formatValue(metricValue(current, metric), metric) }),
1239
1239
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1", children: [
@@ -1249,7 +1249,7 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
1249
1249
  ] })
1250
1250
  ] }) }),
1251
1251
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-3 sm:grid-cols-3", children: [
1252
- balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.CardContent, { className: "grid gap-1", children: [
1252
+ balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { "data-testid": "tile-monthly", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardContent, { className: "grid gap-1", children: [
1253
1253
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.monthly_left") }),
1254
1254
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-baseline gap-1", children: [
1255
1255
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "tile-monthly-value", className: _chunk6T6QB6K2js.cn.call(void 0, "text-sm font-medium tabular-nums", monthlyColor), children: whole(balances.availableMonthlyCredits) }),
@@ -1259,11 +1259,11 @@ function TokenUsageReportTiles({ summary, metric, balances }) {
1259
1259
  ] })
1260
1260
  ] })
1261
1261
  ] }) }),
1262
- balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.CardContent, { className: "grid gap-1", children: [
1262
+ balances && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { "data-testid": "tile-extra", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardContent, { className: "grid gap-1", children: [
1263
1263
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.extra_credits") }),
1264
1264
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: whole(balances.availableExtraCredits) })
1265
1265
  ] }) }),
1266
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.CardContent, { className: "grid gap-1", children: [
1266
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { "data-testid": "tile-calls", size: "sm", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.CardContent, { className: "grid gap-1", children: [
1267
1267
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: t("token_usage.report.calls") }),
1268
1268
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-medium tabular-nums", children: decimal(current.calls, 0) })
1269
1269
  ] }) })
@@ -1305,21 +1305,21 @@ function TokenUsageReportContainer({ balances = null }) {
1305
1305
  const t = _nextintl.useTranslations.call(void 0, );
1306
1306
  const { summary, timeline, byOperation, byTarget, isLoading, error, targetPanelTitleKey } = useTokenUsageReport();
1307
1307
  if (error) {
1308
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
1308
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "p-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.Card, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-destructive text-xs/relaxed", children: error }) }) }) }) });
1309
1309
  }
1310
- if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.RoundPageContainer, { fullWidth: true, forceHeader: true });
1310
+ if (isLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.RoundPageContainer, { fullWidth: true, forceHeader: true });
1311
1311
  const emptyLabel = t("token_usage.report.no_data");
1312
1312
  const targetTitle = targetPanelTitleKey && byTarget.length > 0 ? t(targetPanelTitleKey) : void 0;
1313
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
1313
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.RoundPageContainer, { fullWidth: true, forceHeader: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-4 p-4", children: [
1314
1314
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageReportTiles, { summary, metric: "credits", balances }),
1315
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.Card, { children: [
1316
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
1317
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
1315
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
1316
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.report.usage_over_time") }) }),
1317
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageTimelineChart, { rows: timeline, metric: "credits", stackBy: "type" }) })
1318
1318
  ] }),
1319
1319
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk6T6QB6K2js.cn.call(void 0, "grid gap-4", targetTitle && "md:grid-cols-2"), children: [
1320
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.Card, { children: [
1321
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardTitle, { children: t("token_usage.report.by_operation") }) }),
1322
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1320
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
1321
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: t("token_usage.report.by_operation") }) }),
1322
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1323
1323
  TokenUsageRankedBar,
1324
1324
  {
1325
1325
  rows: byOperation,
@@ -1329,9 +1329,9 @@ function TokenUsageReportContainer({ balances = null }) {
1329
1329
  }
1330
1330
  ) })
1331
1331
  ] }),
1332
- targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkPXXVAY7Njs.Card, { children: [
1333
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardTitle, { children: targetTitle }) }),
1334
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPXXVAY7Njs.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
1332
+ targetTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk5WFYQE22js.Card, { children: [
1333
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardHeader, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardTitle, { children: targetTitle }) }),
1334
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5WFYQE22js.CardContent, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenUsageRankedBar, { rows: byTarget, metric: "credits", emptyLabel }) })
1335
1335
  ] })
1336
1336
  ] })
1337
1337
  ] }) });
@@ -26,7 +26,7 @@ import {
26
26
  TableHeader,
27
27
  TableRow,
28
28
  usePageUrlGenerator
29
- } from "../../chunk-JBTGGZ3K.mjs";
29
+ } from "../../chunk-CFZW6GU4.mjs";
30
30
  import "../../chunk-RZDY4CIF.mjs";
31
31
  import {
32
32
  AbstractService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carlonicora/nextjs-jsonapi",
3
- "version": "3.3.5",
3
+ "version": "3.3.6",
4
4
  "description": "Next.js JSON:API client with server/client support and caching",
5
5
  "author": "Carlo Nicora",
6
6
  "license": "GPL-3.0-or-later",