@declarion/react 0.106.0 → 0.110.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist-lib/api/agents.js +9 -7
  2. package/dist-lib/api/audience.js +12 -0
  3. package/dist-lib/api/auth.js +1 -1
  4. package/dist-lib/api/client.js +101 -93
  5. package/dist-lib/api/schema.js +31 -31
  6. package/dist-lib/components/agents/AgentChatPanel.impl.js +362 -301
  7. package/dist-lib/components/agents/ChatAttachments.js +154 -0
  8. package/dist-lib/components/agents/transcript-runs.js +1 -1
  9. package/dist-lib/components/chrome/AssociationTabs.js +89 -75
  10. package/dist-lib/components/detail-layout/AssociatedBlock.js +243 -235
  11. package/dist-lib/components/detail-layout/ChildrenCards.js +57 -55
  12. package/dist-lib/components/detail-layout/ChildrenList.js +45 -43
  13. package/dist-lib/components/detail-layout/ChildrenTable.js +93 -91
  14. package/dist-lib/components/detail-layout/ChildrenTimeline.js +160 -155
  15. package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +127 -121
  16. package/dist-lib/components/fields/RefCombobox.js +53 -48
  17. package/dist-lib/components/fields/index.js +1 -0
  18. package/dist-lib/components/file-widgets/DocumentCard.js +1 -1
  19. package/dist-lib/components/file-widgets/FileList.js +1 -1
  20. package/dist-lib/components/file-widgets/Grid.js +1 -1
  21. package/dist-lib/components/file-widgets/upload.js +64 -61
  22. package/dist-lib/components/file-widgets/useFileSelection.js +152 -0
  23. package/dist-lib/components/pages/SmartDetailPage.impl.js +506 -482
  24. package/dist-lib/components/pages/SmartRecordListPage.impl.js +335 -300
  25. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +112 -109
  26. package/dist-lib/components/params/ParamsBlock.js +18 -15
  27. package/dist-lib/components/params/param-editors.js +60 -54
  28. package/dist-lib/components/primitives/RetryButton.js +14 -0
  29. package/dist-lib/components/primitives/StatTile.js +42 -34
  30. package/dist-lib/hooks/useAgentConversation.js +122 -109
  31. package/dist-lib/hooks/useAuth.js +4 -1
  32. package/dist-lib/hooks/useParams.js +54 -52
  33. package/dist-lib/hooks/useSchema.js +25 -30
  34. package/dist-lib/hooks/useTimelineData.js +26 -24
  35. package/dist-lib/index.d.ts +90 -6
  36. package/dist-lib/index.js +95 -93
  37. package/dist-lib/lib/read-display-state.js +19 -0
  38. package/dist-lib/stores/auth.js +35 -34
  39. package/dist-lib/test/seed-schema.js +4 -3
  40. package/dist-lib/testing.d.ts +1 -1
  41. package/dist-lib/types/fieldType.js +1 -1
  42. package/dist-lib/{useResponsiveMode-ECv1AEhv.d.ts → useResponsiveMode-C4MeAgoS.d.ts} +3 -1
  43. package/package.json +1 -1
@@ -6,15 +6,17 @@ async function n() {
6
6
  }
7
7
  async function r(t) {
8
8
  return {
9
- id: (await e("agent.start_conversation", { ...t.agent_id ? { agent_id: t.agent_id } : {} })).conversation_id,
9
+ id: (await e("agents.start_conversation", { ...t.agent_id ? { agent_id: t.agent_id } : {} })).conversation_id,
10
10
  status: "active"
11
11
  };
12
12
  }
13
- async function i(t, n, r) {
13
+ async function i(t, n, r, i, a) {
14
14
  return {
15
- id: (await e("agent.send_message", {
15
+ id: (await e("agents.send_message", {
16
16
  conversation_id: n,
17
- text: t,
17
+ idempotency_key: a,
18
+ ...t ? { text: t } : {},
19
+ ...i?.length ? { attachments: i } : {},
18
20
  ...r ? { context: r } : {}
19
21
  })).message_id,
20
22
  conversation_id: n,
@@ -22,7 +24,7 @@ async function i(t, n, r) {
22
24
  };
23
25
  }
24
26
  async function a(t, n) {
25
- await e("agent.answer_question", {
27
+ await e("agents.answer_question", {
26
28
  invocation_id: t,
27
29
  answer: n
28
30
  });
@@ -43,10 +45,10 @@ async function c(e, t) {
43
45
  });
44
46
  }
45
47
  async function l(t) {
46
- await e("agent.cancel_question", { invocation_id: t });
48
+ await e("agents.cancel_question", { invocation_id: t });
47
49
  }
48
50
  async function u(t) {
49
- await e("agent.cancel_conversation", { conversation_id: t });
51
+ await e("agents.cancel_conversation", { conversation_id: t });
50
52
  }
51
53
  async function d() {
52
54
  let e = await t("agent_conversation", {
@@ -0,0 +1,12 @@
1
+ //#region src/api/audience.ts
2
+ function e(e) {
3
+ if (!e.isLoading) return !e.isAuthenticated || !e.user ? null : {
4
+ user_id: e.user.id,
5
+ tenant_id: e.activeTenant?.id ?? ""
6
+ };
7
+ }
8
+ function t(e, t) {
9
+ return e === t || e !== null && t !== null && e.user_id === t.user_id && e.tenant_id === t.tenant_id;
10
+ }
11
+ //#endregion
12
+ export { t as sameAudience, e as sessionCaller };
@@ -43,7 +43,7 @@ async function u(n) {
43
43
  return t(r.expires_at), r;
44
44
  }
45
45
  async function d() {
46
- await e("auth.logout");
46
+ await e("auth.logout", {}, { keepalive: !0 });
47
47
  }
48
48
  async function f(t) {
49
49
  return (await e("auth.list_identity_providers", t ? { tenant_code: t } : {})).providers;
@@ -4,9 +4,10 @@ import { awaitEmbedToken as a, clearEmbedToken as o, getEmbedToken as s, isEmbed
4
4
  import { observe as l } from "../lib/versionTracker.js";
5
5
  import { REFRESH_TIMEOUT_MS as u, requestTimeoutMs as d } from "./request-bounds.js";
6
6
  import { clearAccessExpiry as f, recordAccessExpiry as p } from "./access-expiry.js";
7
+ import { sameAudience as m } from "./audience.js";
7
8
  //#region src/api/client.ts
8
- var m = (e) => JSON.stringify(e ?? {}), h = null, g = "declarion.auth.refresh.result", _ = "declarion.auth.refresh";
9
- function v(e = () => window.localStorage.getItem(g)) {
9
+ var h = (e) => JSON.stringify(e ?? {}), g = null, _ = "declarion.auth.refresh.result", v = "declarion.auth.refresh";
10
+ function y(e = () => window.localStorage.getItem(_)) {
10
11
  try {
11
12
  let t = JSON.parse(e() ?? "null");
12
13
  return typeof t?.ok == "boolean" && typeof t.updated_at == "number" ? t : null;
@@ -14,9 +15,9 @@ function v(e = () => window.localStorage.getItem(g)) {
14
15
  return null;
15
16
  }
16
17
  }
17
- function y(e) {
18
+ function b(e) {
18
19
  try {
19
- window.localStorage.setItem(g, JSON.stringify({
20
+ window.localStorage.setItem(_, JSON.stringify({
20
21
  updated_at: Date.now(),
21
22
  ...e
22
23
  }));
@@ -24,57 +25,57 @@ function y(e) {
24
25
  return;
25
26
  }
26
27
  }
27
- function b(e) {
28
- return e.ok ? (e.access_expires_at && T(e.access_expires_at), null) : new S(e.status ?? 401);
28
+ function x(e) {
29
+ return e.ok ? (e.access_expires_at && E(e.access_expires_at), null) : new C(e.status ?? 401);
29
30
  }
30
- async function x() {
31
+ async function S() {
31
32
  let e = navigator.locks;
32
33
  if (!e) {
33
- await A();
34
+ await j();
34
35
  return;
35
36
  }
36
37
  let t = Date.now();
37
- await e.request(_, { mode: "exclusive" }, async () => {
38
- let e = v();
38
+ await e.request(v, { mode: "exclusive" }, async () => {
39
+ let e = y();
39
40
  if (e && e.updated_at >= t) {
40
- let t = b(e);
41
+ let t = x(e);
41
42
  if (t) throw t;
42
43
  } else try {
43
- y({
44
+ b({
44
45
  ok: !0,
45
- access_expires_at: await A()
46
+ access_expires_at: await j()
46
47
  });
47
48
  } catch (e) {
48
- throw e instanceof S && y({
49
+ throw e instanceof C && b({
49
50
  ok: !1,
50
51
  status: e.status
51
52
  }), e;
52
53
  }
53
54
  });
54
55
  }
55
- var S = class extends Error {
56
+ var C = class extends Error {
56
57
  status;
57
58
  constructor(e) {
58
59
  super(`refresh failed terminally (${e})`), this.status = e, this.name = "RefreshDeadError";
59
60
  }
60
- }, C = null;
61
- function w() {
62
- return C ??= import("./session-renewal.js").catch((e) => {
63
- throw C = null, e;
64
- }), C;
61
+ }, w = null;
62
+ function T() {
63
+ return w ??= import("./session-renewal.js").catch((e) => {
64
+ throw w = null, e;
65
+ }), w;
65
66
  }
66
- function T(e) {
67
- return j = null, c() || p(e), typeof window > "u" ? Promise.resolve() : w().then((t) => t.scheduleRenewal(e), () => void 0);
67
+ function E(e) {
68
+ return M = null, c() || p(e), typeof window > "u" ? Promise.resolve() : T().then((t) => t.scheduleRenewal(e), () => void 0);
68
69
  }
69
- function E() {
70
- f(), C?.then((e) => e.cancelRenewal());
70
+ function D() {
71
+ f(), w?.then((e) => e.cancelRenewal());
71
72
  }
72
73
  typeof window < "u" && window.addEventListener("storage", (e) => {
73
- if (e.key !== g || c()) return;
74
- let t = v(() => e.newValue);
75
- t?.ok && t.access_expires_at && T(t.access_expires_at);
74
+ if (e.key !== _ || c()) return;
75
+ let t = y(() => e.newValue);
76
+ t?.ok && t.access_expires_at && E(t.access_expires_at);
76
77
  });
77
- async function D(e, n, r) {
78
+ async function O(e, n, r) {
78
79
  let i = new AbortController(), a = setTimeout(() => i.abort(), r);
79
80
  try {
80
81
  return await fetch(e, {
@@ -87,108 +88,114 @@ async function D(e, n, r) {
87
88
  clearTimeout(a);
88
89
  }
89
90
  }
90
- async function O(e) {
91
+ async function k(e) {
91
92
  try {
92
93
  return (await e.json())?.result?.expires_at;
93
94
  } catch {
94
95
  return;
95
96
  }
96
97
  }
97
- function k() {
98
- return D("/api/actions/auth.refresh", {
98
+ function A() {
99
+ return O("/api/actions/auth.refresh", {
99
100
  method: "POST",
100
101
  credentials: "include",
101
102
  headers: { "Content-Type": "application/json" },
102
- body: m({})
103
+ body: h({})
103
104
  }, u);
104
105
  }
105
- async function A() {
106
- let t = await k();
106
+ async function j() {
107
+ let t = await A();
107
108
  if (t.status === 429) {
108
109
  let e = parseInt(t.headers.get("Retry-After") || "1", 10);
109
- await r(t), await new Promise((t) => setTimeout(t, e * 1e3)), t = await k();
110
+ await r(t), await new Promise((t) => setTimeout(t, e * 1e3)), t = await A();
110
111
  }
111
112
  if (t.status >= 500) {
112
113
  let n = await r(t);
113
114
  throw new e(t.status, n.body, n.raw);
114
115
  }
115
- if (!t.ok) throw await r(t), new S(t.status);
116
- let n = await O(t);
117
- return T(n), n;
116
+ if (!t.ok) throw await r(t), new C(t.status);
117
+ let n = await k(t);
118
+ return E(n), n;
118
119
  }
119
- var j = null;
120
- function M(n) {
120
+ var M = null, N = /* @__PURE__ */ new Set(["auth.token_refresh_needed", "auth.unauthorized"]);
121
+ function P(n) {
121
122
  return n instanceof t || n instanceof e;
122
123
  }
123
- async function N() {
124
- if (j !== null) throw new S(j);
125
- return h || (h = x().catch((e) => {
126
- throw e instanceof S && (j = e.status), e;
124
+ async function F() {
125
+ if (M !== null) throw new C(M);
126
+ return g || (g = S().catch((e) => {
127
+ throw e instanceof C && (M = e.status), e;
127
128
  }).finally(() => {
128
- h = null;
129
- }), h);
129
+ g = null;
130
+ }), g);
130
131
  }
131
- var P = () => {
132
+ var I = () => {
132
133
  if (typeof window > "u") return;
133
134
  let { pathname: e } = window.location;
134
135
  e.startsWith("/login") || e.startsWith("/signup") || e === "/reset" || e === "/forgot" || e === "/2fa" || (window.location.href = i());
135
136
  };
136
- function F(e) {
137
- let t = P;
138
- return P = e, t;
137
+ function L(e) {
138
+ let t = I;
139
+ return I = e, t;
139
140
  }
140
- function I() {
141
- return P;
141
+ function R() {
142
+ return I;
142
143
  }
143
- var L = ({ status: e, code: t, message: n }) => {
144
+ var z = ({ status: e, code: t, message: n }) => {
144
145
  console.error(`[API ${e}] ${t}: ${n}`);
145
146
  };
146
- function R(e, t, n, r) {
147
+ function B(e, t, n, r) {
147
148
  let i = new Headers(e);
148
149
  return !i.has("Content-Type") && t && i.set("Content-Type", "application/json"), n.setAccept && !i.has("Accept") && i.set("Accept", "*/*"), r && i.set("Authorization", `Bearer ${r}`), i;
149
150
  }
150
- var z = null, B = 0;
151
- function V(e) {
152
- e || B++, z = e || null;
151
+ var V = null, H;
152
+ function U(e) {
153
+ H = e, V && e !== void 0 && !m(V.reader, e) && (V = null);
153
154
  }
154
- function H() {
155
- return B;
155
+ function W(e, t) {
156
+ (H === void 0 || m(e, H)) && (V = t ? {
157
+ language: t,
158
+ reader: e
159
+ } : null);
156
160
  }
157
- function U(e, t) {
158
- e === B && (z = t || null);
161
+ function G(e) {
162
+ V = e ? {
163
+ language: e,
164
+ reader: H ?? null
165
+ } : null;
159
166
  }
160
- function W() {
161
- return z;
167
+ function K() {
168
+ return V?.language ?? null;
162
169
  }
163
- function G(e) {
164
- return !z || !e.startsWith("/api/") || /[?&]language=/.test(e) ? e : `${e}${e.includes("?") ? "&" : "?"}language=${encodeURIComponent(z)}`;
170
+ function q(e) {
171
+ let t = K();
172
+ return !t || !e.startsWith("/api/") || /[?&]language=/.test(e) ? e : `${e}${e.includes("?") ? "&" : "?"}language=${encodeURIComponent(t)}`;
165
173
  }
166
- async function K(t, i, u, f) {
167
- let p = G(t), m = c(), h = m ? "omit" : "include", g = R(i.headers, !!i.body, u, m ? s() : null), _ = d(t, i), v = await D(p, {
174
+ async function J(t, i, u, f) {
175
+ let p = q(t), m = c(), h = m ? "omit" : "include", g = B(i.headers, !!i.body, u, m ? s() : null), _ = d(t, i), v = await O(p, {
168
176
  ...i,
169
177
  headers: g,
170
178
  credentials: h
171
179
  }, _);
172
180
  if (l(v.headers), !v.ok) {
173
181
  let { raw: t, body: s } = await r(v), c = n(s.type), l = s.title ?? "";
174
- if (v.status === 401 && (c === "auth.token_refresh_needed" || c === "auth.unauthorized")) try {
182
+ if (v.status === 401 && N.has(c)) try {
175
183
  let t = null;
176
- m ? (o(), t = await a()) : await N();
177
- let n = R(i.headers, !!i.body, u, t), s = await D(p, {
184
+ m ? (o(), t = await a()) : await F();
185
+ let s = B(i.headers, !!i.body, u, t), c = await O(p, {
178
186
  ...i,
179
- headers: n,
187
+ headers: s,
180
188
  credentials: h
181
189
  }, _);
182
- if (!s.ok) {
183
- s.status === 401 && !u.isSessionProbe && P();
184
- let t = await r(s);
185
- throw new e(s.status, t.body, t.raw);
190
+ if (!c.ok) {
191
+ let t = await r(c);
192
+ throw !m && c.status === 401 && N.has(n(t.body.type)) && (M = 401), c.status === 401 && !u.isSessionProbe && I(), new e(c.status, t.body, t.raw);
186
193
  }
187
- return f(s);
194
+ return f(c);
188
195
  } catch (n) {
189
- throw M(n) ? n : (u.isSessionProbe || P(), new e(401, s, t));
196
+ throw P(n) ? n : (u.isSessionProbe || I(), new e(401, s, t));
190
197
  }
191
- throw v.status === 401 && !u.isSessionProbe && P(), L({
198
+ throw v.status === 401 && !u.isSessionProbe && I(), z({
192
199
  status: v.status,
193
200
  code: c,
194
201
  message: l
@@ -196,29 +203,29 @@ async function K(t, i, u, f) {
196
203
  }
197
204
  return f(v);
198
205
  }
199
- function q(e) {
206
+ function Y(e) {
200
207
  return e.status === 204 ? Promise.resolve(void 0) : e.json();
201
208
  }
202
- async function J(e, t = {}, { isSessionProbe: n = !1 } = {}) {
203
- return K(e, t, {
209
+ async function X(e, t = {}, { isSessionProbe: n = !1 } = {}) {
210
+ return J(e, t, {
204
211
  setAccept: !1,
205
212
  isSessionProbe: n
206
- }, q);
213
+ }, Y);
207
214
  }
208
- async function Y(e) {
215
+ async function Z(e) {
209
216
  return {
210
217
  blob: await e.blob(),
211
- filename: Z(e.headers),
218
+ filename: $(e.headers),
212
219
  headers: e.headers
213
220
  };
214
221
  }
215
- async function X(e, t = {}) {
216
- return K(e, t, {
222
+ async function Q(e, t = {}) {
223
+ return J(e, t, {
217
224
  setAccept: !0,
218
225
  isSessionProbe: !1
219
- }, Y);
226
+ }, Z);
220
227
  }
221
- function Z(e) {
228
+ function $(e) {
222
229
  let t = e.get("Content-Disposition");
223
230
  if (!t) return "";
224
231
  let n = t.match(/filename\*\s*=\s*([^']*)'([^']*)'([^;]+)/i);
@@ -228,14 +235,15 @@ function Z(e) {
228
235
  let r = t.match(/filename\s*=\s*("([^"]+)"|([^;]+))/i);
229
236
  return r ? (r[2] ?? r[3] ?? "").trim() : "";
230
237
  }
231
- async function Q(e, t = {}, { isSessionProbe: n = !1 } = {}) {
232
- return (await K(`/api/actions/${encodeURIComponent(e)}`, {
238
+ async function ee(e, t = {}, { isSessionProbe: n = !1, keepalive: r = !1 } = {}) {
239
+ return (await J(`/api/actions/${encodeURIComponent(e)}`, {
233
240
  method: "POST",
234
- body: m(t)
241
+ body: h(t),
242
+ keepalive: r
235
243
  }, {
236
244
  setAccept: !1,
237
245
  isSessionProbe: n
238
- }, q)).result;
246
+ }, Y)).result;
239
247
  }
240
248
  //#endregion
241
- export { S as RefreshDeadError, J as apiFetch, X as apiFetchBlob, Q as callHandler, E as cancelProactiveRefresh, W as currentPublishedLanguage, H as currentReader, N as ensureRefresh, I as getPersistentAuthFailureHandler, M as isTransientFailure, Z as parseContentDispositionFilename, V as publishLanguage, U as publishLanguageFor, T as scheduleProactiveRefresh, F as setPersistentAuthFailureHandler, G as withPublishedLanguage };
249
+ export { C as RefreshDeadError, X as apiFetch, Q as apiFetchBlob, ee as callHandler, D as cancelProactiveRefresh, K as currentPublishedLanguage, F as ensureRefresh, R as getPersistentAuthFailureHandler, P as isTransientFailure, $ as parseContentDispositionFilename, G as publishLanguage, W as publishLanguageFor, E as scheduleProactiveRefresh, U as setLanguageReader, L as setPersistentAuthFailureHandler, q as withPublishedLanguage };
@@ -1,71 +1,71 @@
1
1
  import { recordActionTimeouts as e } from "./request-bounds.js";
2
- import { apiFetch as t, currentReader as n, publishLanguageFor as r } from "./client.js";
3
- import { OrderedMap as i } from "../types/ordmap.js";
2
+ import { apiFetch as t, publishLanguageFor as n } from "./client.js";
3
+ import { OrderedMap as r } from "../types/ordmap.js";
4
4
  //#region src/api/schema.ts
5
- function a(e) {
5
+ function i(e) {
6
6
  return {
7
7
  ...e,
8
- params: e.params ? i.fromWire(e.params) : void 0
8
+ params: e.params ? r.fromWire(e.params) : void 0
9
9
  };
10
10
  }
11
- function o(e) {
11
+ function a(e) {
12
12
  return {
13
13
  ...e,
14
- resolved_params: e.resolved_params ? i.fromWire(e.resolved_params) : void 0
14
+ resolved_params: e.resolved_params ? r.fromWire(e.resolved_params) : void 0
15
15
  };
16
16
  }
17
- function s(e) {
17
+ function o(e) {
18
18
  let t = {};
19
- if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] = a(r);
19
+ if (e.handlers) for (let [n, r] of Object.entries(e.handlers)) t[n] = i(r);
20
20
  let n = {};
21
- if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] = o(r);
21
+ if (e.actions) for (let [t, r] of Object.entries(e.actions)) n[t] = a(r);
22
22
  return {
23
23
  ...e,
24
- fields: i.fromWire(e.fields),
25
- files: e.files ? i.fromWire(e.files) : void 0,
26
- variants: e.variants ? i.fromWire(e.variants) : void 0,
24
+ fields: r.fromWire(e.fields),
25
+ files: e.files ? r.fromWire(e.files) : void 0,
26
+ variants: e.variants ? r.fromWire(e.variants) : void 0,
27
27
  handlers: e.handlers ? t : void 0,
28
28
  actions: e.actions ? n : void 0
29
29
  };
30
30
  }
31
- function c(e) {
31
+ function s(e) {
32
32
  let t = {};
33
- if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] = s(r);
33
+ if (e.entities) for (let [n, r] of Object.entries(e.entities)) t[n] = o(r);
34
34
  let n = {};
35
- if (e.structures) for (let [t, r] of Object.entries(e.structures)) n[t] = {
36
- ...r,
37
- fields: i.fromWire(r.fields)
35
+ if (e.structures) for (let [t, i] of Object.entries(e.structures)) n[t] = {
36
+ ...i,
37
+ fields: r.fromWire(i.fields)
38
38
  };
39
- let r = {};
40
- if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) r[t] = a(n);
39
+ let s = {};
40
+ if (e.handlers) for (let [t, n] of Object.entries(e.handlers)) s[t] = i(n);
41
41
  let c = {};
42
- if (e.actions) for (let [t, n] of Object.entries(e.actions)) c[t] = o(n);
42
+ if (e.actions) for (let [t, n] of Object.entries(e.actions)) c[t] = a(n);
43
43
  let l = { ...e.screens };
44
44
  for (let [e, t] of Object.entries(l)) {
45
45
  let n = t;
46
46
  l[e] = {
47
47
  ...t,
48
- variants: n.variants ? i.fromWire(n.variants) : void 0
48
+ variants: n.variants ? r.fromWire(n.variants) : void 0
49
49
  };
50
50
  }
51
51
  return {
52
52
  ...e,
53
53
  entities: t,
54
54
  structures: n,
55
- handlers: r,
55
+ handlers: s,
56
56
  actions: c,
57
57
  screens: l
58
58
  };
59
59
  }
60
- async function l() {
61
- let i = performance.now(), a = n(), { audience: o, ...s } = await t("/api/schema", { cache: "no-cache" });
62
- if (o === void 0) throw Error("/api/schema answered without its audience");
63
- let l = c(s);
64
- return r(a, l.language), e(l), {
65
- schema: l,
66
- audience: o,
67
- requestedAt: i
60
+ async function c() {
61
+ let r = performance.now(), { audience: i, ...a } = await t("/api/schema", { cache: "no-cache" });
62
+ if (i === void 0) throw Error("/api/schema answered without its audience");
63
+ let o = s(a);
64
+ return n(i, o.language), e(o), {
65
+ schema: o,
66
+ audience: i,
67
+ requestedAt: r
68
68
  };
69
69
  }
70
70
  //#endregion
71
- export { l as fetchSchema };
71
+ export { c as fetchSchema };