@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
@@ -2,14 +2,14 @@ import { ApiError as e } from "../types/api.js";
2
2
  import { coerceDisplayString as t } from "../lib/display-value.js";
3
3
  import { useAuthStore as n } from "../stores/auth.js";
4
4
  import { AGENT_FRAME_EVENT as r, AGENT_MESSAGE_CHANGED_EVENT as i, agentBus as a } from "../api/events.js";
5
- import { approveInvocation as o, cancelConversation as s, cancelInvocation as c, createConversation as l, listAvailableAgents as ee, listConversations as u, loadConversationInvocations as d, loadConversationTurns as f, loadHistory as p, rejectInvocation as te, sendElicitResponse as ne, sendMessage as m } from "../api/agents.js";
5
+ import { approveInvocation as o, cancelConversation as s, cancelInvocation as c, createConversation as l, listAvailableAgents as u, listConversations as ee, loadConversationInvocations as d, loadConversationTurns as f, loadHistory as p, rejectInvocation as te, sendElicitResponse as ne, sendMessage as m } from "../api/agents.js";
6
6
  import { useCallback as h, useEffect as g, useRef as _, useState as v } from "react";
7
7
  //#region src/hooks/useAgentConversation.ts
8
8
  var y = { streaming: !1 }, b = "declarion.agents.conversation_id";
9
9
  function x(e) {
10
10
  if (e) return `${b}:${e}`;
11
11
  }
12
- function S(e) {
12
+ function re(e) {
13
13
  if (typeof window > "u") return;
14
14
  let t = x(e);
15
15
  if (t) try {
@@ -18,17 +18,17 @@ function S(e) {
18
18
  return;
19
19
  }
20
20
  }
21
- function C(e, t) {
21
+ function S(e, t) {
22
22
  if (typeof window > "u") return;
23
23
  let n = x(e);
24
24
  if (n) try {
25
25
  t ? window.localStorage.setItem(n, t) : window.localStorage.removeItem(n);
26
26
  } catch {}
27
27
  }
28
- function w(t) {
28
+ function C(t) {
29
29
  return !(t instanceof e) || t.code !== "entity.foreign_key_violation" ? !1 : t.ext("constraint") === "agent_messages_tenant_conv_fk";
30
30
  }
31
- function T(e, t) {
31
+ function w(e, t) {
32
32
  return {
33
33
  id: e,
34
34
  conversation_id: t,
@@ -39,14 +39,14 @@ function T(e, t) {
39
39
  streaming: !0
40
40
  };
41
41
  }
42
- function E(e, t) {
42
+ function T(e, t) {
43
43
  let n = !1, r = e.map((e) => e.role !== "assistant" || !e.streaming || e.id === t ? e : (n = !0, {
44
44
  ...e,
45
45
  streaming: !1
46
46
  }));
47
47
  return n ? r : e;
48
48
  }
49
- function D(e, t) {
49
+ function E(e, t) {
50
50
  let n = !1, r = [];
51
51
  for (let i of e) i.id !== t || i.role !== "assistant" ? r.push(i) : (n = !0, i.content.length !== 0 && (i.streaming ? r.push({
52
52
  ...i,
@@ -54,19 +54,19 @@ function D(e, t) {
54
54
  }) : r.push(i)));
55
55
  return n ? r : e;
56
56
  }
57
- function O(e) {
57
+ function D(e) {
58
58
  let t = e;
59
- for (let n of e) n.role === "assistant" && n.streaming && (t = D(t, n.id));
59
+ for (let n of e) n.role === "assistant" && n.streaming && (t = E(t, n.id));
60
60
  return t;
61
61
  }
62
- function k(e, t, n, r) {
62
+ function O(e, t, n, r) {
63
63
  let i = !1, a = e.map((e) => e.id === n ? (i = !0, r(e)) : e);
64
- return i ? a : [...e, r(T(n, t))];
64
+ return i ? a : [...e, r(w(n, t))];
65
65
  }
66
- function A(e, t, n, r) {
66
+ function k(e, t, n, r) {
67
67
  if (!r) return e;
68
68
  let i = e.find((e) => e.id === n);
69
- return i && !i.streaming ? e : k(E(e, n), t, n, (e) => {
69
+ return i && !i.streaming ? e : O(T(e, n), t, n, (e) => {
70
70
  let t = [...e.content], n = t[t.length - 1];
71
71
  return n?.type === "text" ? t[t.length - 1] = {
72
72
  ...n,
@@ -81,9 +81,9 @@ function A(e, t, n, r) {
81
81
  };
82
82
  });
83
83
  }
84
- function j(e, t, n, r, i, a) {
84
+ function A(e, t, n, r, i, a) {
85
85
  let o = e.find((e) => e.id === n);
86
- return o && !o.streaming ? e : k(E(e, n), t, n, (e) => r && e.content.some((e) => e.type === "tool_use" && e.id === r) ? e.streaming ? e : {
86
+ return o && !o.streaming ? e : O(T(e, n), t, n, (e) => r && e.content.some((e) => e.type === "tool_use" && e.id === r) ? e.streaming ? e : {
87
87
  ...e,
88
88
  streaming: !0
89
89
  } : {
@@ -97,7 +97,7 @@ function j(e, t, n, r, i, a) {
97
97
  }]
98
98
  });
99
99
  }
100
- function re(e, t) {
100
+ function ie(e, t) {
101
101
  let n = e.map((e) => e.streaming ? {
102
102
  ...e,
103
103
  streaming: !1
@@ -114,68 +114,71 @@ function re(e, t) {
114
114
  }
115
115
  return n;
116
116
  }
117
- function M(e) {
117
+ function j(e) {
118
118
  let t = e.payload?.message_id;
119
119
  return typeof t == "string" && t ? t : void 0;
120
120
  }
121
- function N(e) {
122
- let b = n.getState().activeTenant?.id, [x, T] = v(e ?? S(b)), N = h((e) => {
123
- C(b, e), T(e);
124
- }, [b]), [P, F] = v([]), [I, L] = v(y), [R, z] = v([]), [B, V] = v([]), [H, U] = v([]), [W, G] = v([]), [K, q] = v(), J = _(/* @__PURE__ */ new Set()), Y = _(0);
121
+ function M(e) {
122
+ let b = n.getState().activeTenant?.id, [x, w] = v(e ?? re(b)), M = h((e) => {
123
+ S(b, e), w(e);
124
+ }, [b]), [ae, N] = v([]), [P, F] = v(y), [I, L] = v([]), [R, z] = v([]), [B, V] = v([]), [H, U] = v([]), [W, G] = v(), K = _(/* @__PURE__ */ new Set()), q = _(0), J = _(null), oe = (e) => (J.current?.fingerprint !== e && (J.current = {
125
+ key: crypto.randomUUID(),
126
+ fingerprint: e
127
+ }), J.current.key);
125
128
  g(() => {
126
129
  if (!x) {
127
- F([]), L(y), z([]), V([]);
130
+ N([]), F(y), L([]), z([]);
128
131
  return;
129
132
  }
130
- if (J.current.has(x)) {
131
- J.current.delete(x);
133
+ if (K.current.has(x)) {
134
+ K.current.delete(x);
132
135
  return;
133
136
  }
134
- let e = !1;
137
+ let e = !1, t = ++q.current;
135
138
  return Promise.all([
136
139
  p(x),
137
140
  f(x),
138
141
  d(x)
139
- ]).then(([t, n, r]) => {
140
- if (e) return;
141
- let i = t.map((e) => e.streaming ? {
142
+ ]).then(([n, r, i]) => {
143
+ if (e || t !== q.current) return;
144
+ let a = n.map((e) => e.streaming ? {
142
145
  ...e,
143
146
  streaming: !1
144
147
  } : e);
145
- F(i), z(n), V(r);
148
+ N(a), L(r), z(i);
146
149
  }, (t) => {
147
- e || t?.status === 404 && (N(void 0), F([]));
150
+ e || t?.status === 404 && (M(void 0), N([]));
148
151
  }), () => {
149
152
  e = !0;
150
153
  };
151
- }, [x, N]);
152
- let X = _(x);
154
+ }, [x, M]);
155
+ let Y = _(x);
153
156
  g(() => {
154
- X.current = x;
157
+ Y.current = x;
155
158
  }, [x]);
156
- let Z = _(!1), Q = _(null), $ = h((e) => {
157
- if (Z.current) {
158
- Q.current = e;
159
+ let X = _(!1), Z = _(null), Q = h((e) => {
160
+ if (X.current) {
161
+ Z.current = e;
159
162
  return;
160
163
  }
161
- Z.current = !0;
162
- let t = ++Y.current;
164
+ X.current = !0;
165
+ let t = ++q.current;
163
166
  Promise.all([
164
167
  p(e),
165
168
  f(e),
166
169
  d(e)
167
170
  ]).then(([n, r, i]) => {
168
- e === X.current && t === Y.current && (F((e) => re(n, e)), z(r), V(i));
171
+ e === Y.current && t === q.current && (N((e) => ie(n, e)), L(r), z(i));
169
172
  }, () => {}).finally(() => {
170
- Z.current = !1;
171
- let e = Q.current;
172
- Q.current = null, e && $(e);
173
+ X.current = !1;
174
+ let e = Z.current;
175
+ Z.current = null, e && Q(e);
173
176
  });
174
177
  }, []);
175
178
  g(() => {
176
179
  let e = (e) => {
177
180
  let { convId: t, kind: r, turnId: i, payload: a } = e.detail;
178
- t === X.current && n(t, {
181
+ t === Y.current && n(t, {
179
182
  kind: r,
180
183
  turnId: i,
181
184
  payload: a
@@ -185,102 +188,112 @@ function N(e) {
185
188
  let n = (e, n) => {
186
189
  switch (n.kind) {
187
190
  case "turn.started":
188
- L((e) => ({
191
+ F((e) => ({
189
192
  ...e,
190
193
  streaming: !0
191
- })), F((e) => E(e));
194
+ })), N((e) => T(e));
192
195
  break;
193
196
  case "assistant.message.created": {
194
197
  let t = typeof n.payload?.message_id == "string" ? n.payload.message_id : "";
195
198
  if (!t) break;
196
- F((n) => k(E(n, t), e, t, (e) => ({
199
+ N((n) => O(T(n, t), e, t, (e) => ({
197
200
  ...e,
198
201
  streaming: !0
199
202
  })));
200
203
  break;
201
204
  }
202
205
  case "text.delta": {
203
- let r = t(n.payload?.text), i = M(n);
206
+ let r = t(n.payload?.text), i = j(n);
204
207
  if (!i || !r) break;
205
- F((t) => A(t, e, i, r));
208
+ N((t) => k(t, e, i, r));
206
209
  break;
207
210
  }
208
211
  case "elicit.pending":
209
- $(e);
212
+ Q(e);
210
213
  break;
211
214
  case "tool.pending":
212
- $(e);
215
+ Q(e);
213
216
  break;
214
217
  case "tool.proposed": {
215
- let t = M(n), r = typeof n.payload?.tool == "string" ? n.payload.tool : "", i = n.payload?.params ?? {}, a = typeof n.payload?.tool_use_id == "string" ? n.payload.tool_use_id : "";
218
+ let t = j(n), r = typeof n.payload?.tool == "string" ? n.payload.tool : "", i = n.payload?.params ?? {}, a = typeof n.payload?.tool_use_id == "string" ? n.payload.tool_use_id : "";
216
219
  if (!t || !r) break;
217
- F((n) => j(n, e, t, a, r, i));
220
+ N((n) => A(n, e, t, a, r, i));
218
221
  break;
219
222
  }
220
223
  case "tool.result":
221
224
  case "tool.failed":
222
225
  case "tool.canceled":
223
- $(e);
226
+ Q(e);
224
227
  break;
225
228
  case "turn.finished": {
226
- L(y);
227
- let e = M(n);
228
- e && F((t) => D(t, e));
229
+ F(y);
230
+ let e = j(n);
231
+ e && N((t) => E(t, e));
229
232
  break;
230
233
  }
231
- case "error": F((e) => O(e)), L((e) => ({
234
+ case "error": N((e) => D(e)), F((e) => ({
232
235
  ...e,
233
236
  streaming: !1
234
237
  }));
235
238
  }
236
239
  }, o = () => {
237
- let e = X.current;
238
- e && $(e);
240
+ let e = Y.current;
241
+ e && Q(e);
239
242
  };
240
243
  return a.addEventListener(i, o), () => {
241
244
  a.removeEventListener(r, e), a.removeEventListener(i, o);
242
245
  };
243
- }, [$]);
244
- let ie = h(async (e, t) => {
245
- let n = x;
246
- n || (n = (await l({ agent_id: K })).id, J.current.add(n), X.current = n, N(n));
247
- let r;
246
+ }, [Q]);
247
+ let $ = h(async (e, t, n = []) => {
248
+ let r = n.map((e) => e.id), i = x;
249
+ i || (i = (await l({ agent_id: W })).id, K.current.add(i), Y.current = i, M(i));
250
+ let a, o = (n) => m(e, n, t, r, oe(JSON.stringify([
251
+ n,
252
+ e,
253
+ t ?? null,
254
+ r
255
+ ])));
248
256
  try {
249
- r = await m(e, n, t);
250
- } catch (i) {
251
- if (!w(i)) throw i;
252
- n = (await l({ agent_id: K })).id, J.current.add(n), X.current = n, N(n), r = await m(e, n, t);
257
+ a = await o(i);
258
+ } catch (e) {
259
+ if (!C(e)) throw e;
260
+ i = (await l({ agent_id: W })).id, K.current.add(i), Y.current = i, M(i), a = await o(i);
253
261
  }
254
- F((t) => t.some((e) => e.id === r.id) ? t : [...t, {
255
- ...r,
256
- content: [{
262
+ J.current = null, N((t) => {
263
+ if (t.some((e) => e.id === a.id)) return t;
264
+ let r = e ? [{
257
265
  type: "text",
258
266
  text: e
259
- }]
260
- }]);
267
+ }] : [];
268
+ return [...t, {
269
+ ...a,
270
+ content: r,
271
+ attachments: n
272
+ }];
273
+ });
261
274
  }, [
262
275
  x,
263
- N,
264
- K
265
- ]), ae = h(async (e, t) => {
266
- await o(e, t), x && $(x);
267
- }, [x, $]), oe = h(async (e, t) => {
268
- await te(e, t), x && $(x);
269
- }, [x, $]), se = h(async (e, t) => {
270
- x && (await ne(x, e, t), $(x));
271
- }, [x, $]), ce = h(async (e) => {
272
- x && (await c(e), $(x));
273
- }, [x, $]), le = h(async () => {
276
+ M,
277
+ W
278
+ ]), se = h(async (e, t) => {
279
+ await o(e, t), x && Q(x);
280
+ }, [x, Q]), ce = h(async (e, t) => {
281
+ await te(e, t), x && Q(x);
282
+ }, [x, Q]), le = h(async (e, t) => {
283
+ x && (await ne(x, e, t), Q(x));
284
+ }, [x, Q]), ue = h(async (e) => {
285
+ x && (await c(e), Q(x));
286
+ }, [x, Q]), de = h(async () => {
274
287
  x && await s(x);
275
- }, [x]), ue = h(async () => {
276
- U(await u());
277
- }, []), de = h(() => {
278
- N(void 0), F([]), L(y);
279
- }, [N]);
288
+ }, [x]), fe = h(async () => {
289
+ V(await ee());
290
+ }, []), pe = h(() => {
291
+ M(void 0), N([]), F(y);
292
+ }, [M]);
280
293
  return g(() => {
281
294
  let e = !0;
282
- return ee().then((t) => {
283
- e && (G(t), q((e) => e ?? t.find((e) => e.is_default)?.id));
295
+ return u().then((t) => {
296
+ e && (U(t), G((e) => e ?? t.find((e) => e.is_default)?.id));
284
297
  }).catch((e) => {
285
298
  console.warn("agents.list_available failed; the agent picker is unavailable", e);
286
299
  }), () => {
@@ -288,24 +301,24 @@ function N(e) {
288
301
  };
289
302
  }, []), {
290
303
  conversationId: x,
291
- messages: P,
292
- turn: I,
293
- turns: R,
294
- invocations: B,
295
- conversations: H,
296
- send: ie,
297
- approve: ae,
298
- reject: oe,
299
- submitInput: se,
300
- cancelInput: ce,
301
- cancel: le,
302
- refreshConversations: ue,
303
- startNew: de,
304
- agents: W,
305
- selectedAgentId: K,
306
- selectAgent: q,
307
- setConversationId: N
304
+ messages: ae,
305
+ turn: P,
306
+ turns: I,
307
+ invocations: R,
308
+ conversations: B,
309
+ send: $,
310
+ approve: se,
311
+ reject: ce,
312
+ submitInput: le,
313
+ cancelInput: ue,
314
+ cancel: de,
315
+ refreshConversations: fe,
316
+ startNew: pe,
317
+ agents: H,
318
+ selectedAgentId: W,
319
+ selectAgent: G,
320
+ setConversationId: M
308
321
  };
309
322
  }
310
323
  //#endregion
311
- export { N as useAgentConversation };
324
+ export { M as useAgentConversation };
@@ -51,7 +51,10 @@ function g() {
51
51
  confirmSignup: D.mutate,
52
52
  switchTenant: O.mutate,
53
53
  logout: async () => {
54
- await x(), C.removeQueries({ predicate: (e) => !h.has(e.queryKey[0]) }), C.getMutationCache().clear(), d.getState().clear(), S("/login");
54
+ let e = x();
55
+ C.removeQueries({ predicate: (e) => !h.has(e.queryKey[0]) }), C.getMutationCache().clear(), d.getState().clear(), S("/login"), await e.catch((e) => {
56
+ c.error(o(w, e));
57
+ });
55
58
  },
56
59
  isLoginPending: T.isPending,
57
60
  isSignupPending: E.isPending,
@@ -4,120 +4,122 @@ import { fetchAllParams as n, fetchParam as r, fetchPublicParams as i } from "..
4
4
  import { executeAction as a, getEntity as o } from "../api/data.js";
5
5
  import { failureTitle as s } from "../lib/failure.js";
6
6
  import { useText as c } from "./useText.js";
7
- import { useCallback as l, useMemo as u, useState as d } from "react";
8
- import { useQuery as f, useQueryClient as p } from "@tanstack/react-query";
7
+ import { readDisplayState as l } from "../lib/read-display-state.js";
8
+ import { useCallback as u, useMemo as d, useState as f } from "react";
9
+ import { useQuery as p, useQueryClient as m } from "@tanstack/react-query";
9
10
  //#region src/hooks/useParams.ts
10
- var m = "$params";
11
- function h(e, t) {
11
+ var h = "$params";
12
+ function g(e, t) {
12
13
  return [
13
14
  "params-carrier-detail",
14
15
  e,
15
16
  t
16
17
  ];
17
18
  }
18
- async function g(e, { carrierEntityCode: n, rowId: r }, i) {
19
- let s = h(n, r), c = (await e.fetchQuery({
19
+ async function _(e, { carrierEntityCode: n, rowId: r }, i) {
20
+ let s = g(n, r), c = (await e.fetchQuery({
20
21
  queryKey: s,
21
22
  queryFn: () => o(n, r),
22
23
  staleTime: 0
23
- }))?.data?.[m];
24
- if (!Array.isArray(c)) throw Error(`${n} ${r} carries no ${m}`);
24
+ }))?.data?.[h];
25
+ if (!Array.isArray(c)) throw Error(`${n} ${r} carries no ${h}`);
25
26
  await a(`${n}.__update`, {
26
27
  object_ids: [r],
27
28
  entity: n,
28
- fields: { [m]: i(c) }
29
+ fields: { [h]: i(c) }
29
30
  }), await e.invalidateQueries({ queryKey: ["params-all"] }), await e.invalidateQueries({ queryKey: ["params"] }), await e.invalidateQueries({ queryKey: s }), await t(e);
30
31
  }
31
- function _({ carrierEntityCode: e, rowId: t, enabled: n = !0, writeOneByOne: r = !1 }) {
32
- let i = p(), _ = c("errors"), [v, y] = d(null), b = f({
33
- queryKey: h(e, t),
32
+ function v({ carrierEntityCode: e, rowId: t, enabled: n = !0, writeOneByOne: r = !1 }) {
33
+ let i = m(), v = c("errors"), [y, b] = f(null), x = p({
34
+ queryKey: g(e, t),
34
35
  queryFn: () => o(e, t),
35
36
  enabled: n && !!t,
36
37
  staleTime: 3e4
37
- }), x = b.data?.data, S = !!x && !("$params" in x), C = u(() => Array.isArray(x?.$params) ? x[m] : [], [x]), w = u(() => new Map(C.map((e) => [e.param_code, e])), [C]), T = l(async (n) => {
38
- y(null);
38
+ }), S = x.data?.data, C = l(x), w = S ? !(h in S) : C.error !== null, T = d(() => Array.isArray(S?.$params) ? S[h] : [], [S]), E = d(() => new Map(T.map((e) => [e.param_code, e])), [T]), D = u(async (n) => {
39
+ b(null);
39
40
  try {
40
- return await g(i, {
41
+ return await _(i, {
41
42
  carrierEntityCode: e,
42
43
  rowId: t
43
44
  }, n), !0;
44
45
  } catch (e) {
45
- return y(s(_, e)), !1;
46
+ return b(s(v, e)), !1;
46
47
  }
47
48
  }, [
48
49
  e,
49
50
  t,
50
51
  i,
51
- _
52
- ]), E = l(async (n, r) => {
53
- y(null);
52
+ v
53
+ ]), O = u(async (n, r) => {
54
+ b(null);
54
55
  try {
55
56
  return await a("params.set", {
56
57
  code: n,
57
58
  value: r,
58
59
  entity: e,
59
60
  object_id: t
60
- }), await i.invalidateQueries({ queryKey: ["params-all"] }), await i.invalidateQueries({ queryKey: ["params"] }), await i.invalidateQueries({ queryKey: h(e, t) }), !0;
61
+ }), await i.invalidateQueries({ queryKey: ["params-all"] }), await i.invalidateQueries({ queryKey: ["params"] }), await i.invalidateQueries({ queryKey: g(e, t) }), !0;
61
62
  } catch (e) {
62
- return y(s(_, e)), !1;
63
+ return b(s(v, e)), !1;
63
64
  }
64
65
  }, [
65
66
  e,
66
67
  t,
67
68
  i,
68
- _
69
- ]), D = l((e, t) => r ? E(e.code, t) : T((n) => [...n.filter((t) => t.param_code !== e.code), {
69
+ v
70
+ ]), k = u((e, t) => r ? O(e.code, t) : D((n) => [...n.filter((t) => t.param_code !== e.code), {
70
71
  param_code: e.code,
71
72
  value: t
72
73
  }]), [
73
74
  r,
74
- E,
75
- T
76
- ]), O = l((e) => r ? E(e.code, null) : T((t) => t.filter((t) => t.param_code !== e.code)), [
75
+ O,
76
+ D
77
+ ]), A = u((e) => r ? O(e.code, null) : D((t) => t.filter((t) => t.param_code !== e.code)), [
77
78
  r,
78
- E,
79
- T
80
- ]), k = l(() => y(null), []);
79
+ O,
80
+ D
81
+ ]), j = u(() => b(null), []);
81
82
  return {
82
- overrides: C,
83
- overrideByCode: w,
84
- missingParams: S,
85
- isLoading: b.isLoading,
86
- error: v,
87
- clearError: k,
88
- save: D,
89
- reset: O
83
+ overrides: T,
84
+ overrideByCode: E,
85
+ missingParams: w,
86
+ isLoading: C.loading,
87
+ retry: C.retry,
88
+ error: y,
89
+ clearError: j,
90
+ save: k,
91
+ reset: A
90
92
  };
91
93
  }
92
- function v(e) {
93
- return f({
94
+ function y(e) {
95
+ return p({
94
96
  queryKey: ["params-all", e ?? "full"],
95
97
  queryFn: () => n(e),
96
98
  staleTime: 3e4
97
99
  });
98
100
  }
99
- var y = ["params-public"];
100
- function b() {
101
- return f({
102
- queryKey: y,
101
+ var b = ["params-public"];
102
+ function x() {
103
+ return p({
104
+ queryKey: b,
103
105
  queryFn: i,
104
106
  staleTime: 3e5
105
107
  });
106
108
  }
107
- function x(e, t = {}) {
109
+ function S(e, t = {}) {
108
110
  let n = t.enabled ?? !0, i = t.isSessionProbe ?? !1;
109
- return f({
111
+ return p({
110
112
  queryKey: ["params", e],
111
113
  queryFn: () => r(e, { isSessionProbe: i }),
112
114
  enabled: !!e && n,
113
115
  staleTime: 6e4
114
116
  });
115
117
  }
116
- function S(t) {
117
- let n = e((e) => e.isAuthenticated), r = e((e) => e.sessionPresumed), i = b(), a = x(t, {
118
+ function C(t) {
119
+ let n = e((e) => e.isAuthenticated), r = e((e) => e.sessionPresumed), i = x(), a = S(t, {
118
120
  enabled: n || r,
119
121
  isSessionProbe: !n
120
- }), o = C(i.data?.parameters, t);
122
+ }), o = w(i.data?.parameters, t);
121
123
  if (n && a.data?.found) return {
122
124
  value: a.data.value,
123
125
  found: !0,
@@ -134,11 +136,11 @@ function S(t) {
134
136
  error: a.error ?? i.error ?? null
135
137
  };
136
138
  }
137
- function C(e, t) {
139
+ function w(e, t) {
138
140
  return e?.find((e) => e.code === t);
139
141
  }
140
- function w(t, n) {
141
- let i = e((e) => e.isAuthenticated), a = f({
142
+ function T(t, n) {
143
+ let i = e((e) => e.isAuthenticated), a = p({
142
144
  queryKey: ["params", t],
143
145
  queryFn: () => r(t),
144
146
  enabled: !!t && i,
@@ -153,4 +155,4 @@ function w(t, n) {
153
155
  };
154
156
  }
155
157
  //#endregion
156
- export { m as PARAMS_KEY, y as PUBLIC_PARAMS_QUERY_KEY, v as useAllParams, _ as useCarrierParamOverrides, S as useEffectiveParam, w as useParam, b as usePublicParams, x as useResolvedParam, g as writeCarrierParams };
158
+ export { h as PARAMS_KEY, b as PUBLIC_PARAMS_QUERY_KEY, y as useAllParams, v as useCarrierParamOverrides, C as useEffectiveParam, T as useParam, x as usePublicParams, S as useResolvedParam, _ as writeCarrierParams };