@tracktor/shared-module 2.31.0 → 2.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1,26 +1,26 @@
1
- import ie from "axios";
2
- import ve, { useMemo as ne, createContext as ge, useContext as k, useEffect as L, useState as D, Suspense as Ee, useRef as ee, useCallback as O } from "react";
3
- const qe = (e, t) => {
4
- const n = ie.CancelToken.source(), o = ie({
1
+ import le from "axios";
2
+ import _e, { useMemo as ae, createContext as ve, useContext as k, useEffect as x, useState as F, Suspense as Re, useRef as re, useCallback as A } from "react";
3
+ const Xe = (e, t) => {
4
+ const r = le.CancelToken.source(), o = le({
5
5
  ...e,
6
6
  ...t,
7
- cancelToken: n.token
7
+ cancelToken: r.token
8
8
  }).then(({ data: s }) => s);
9
9
  return o.cancel = () => {
10
- n.cancel("Query was cancelled");
10
+ r.cancel("Query was cancelled");
11
11
  }, o;
12
- }, we = 3e4, ce = 1e3, te = (e) => Array.isArray(e) ? e.map(te) : e !== null && typeof e == "object" ? Object.fromEntries(
13
- Object.entries(e).map(([t, n]) => [
12
+ }, be = 3e4, ue = 1e3, ne = (e) => Array.isArray(e) ? e.map(ne) : e !== null && typeof e == "object" ? Object.fromEntries(
13
+ Object.entries(e).map(([t, r]) => [
14
14
  t.replace(/_([a-z])/g, (o, s) => s.toUpperCase()),
15
- te(n)
15
+ ne(r)
16
16
  ])
17
- ) : e, re = (e) => Array.isArray(e) ? e.map(re) : e !== null && typeof e == "object" ? Object.fromEntries(
18
- Object.entries(e).map(([t, n]) => [
17
+ ) : e, oe = (e) => Array.isArray(e) ? e.map(oe) : e !== null && typeof e == "object" ? Object.fromEntries(
18
+ Object.entries(e).map(([t, r]) => [
19
19
  t.replace(/[A-Z]/g, (o) => `_${o.toLowerCase()}`),
20
- re(n)
20
+ oe(r)
21
21
  ])
22
22
  ) : e;
23
- class _e {
23
+ class Se {
24
24
  url;
25
25
  getToken;
26
26
  onEvent;
@@ -50,12 +50,12 @@ class _e {
50
50
  if (!t)
51
51
  return;
52
52
  this.intentionalClose = !1;
53
- const n = this.url.includes("?") ? "&" : "?", o = `${this.url}${n}token=${t}`;
53
+ const r = this.url.includes("?") ? "&" : "?", o = `${this.url}${r}token=${t}`;
54
54
  this.ws = new WebSocket(o), this.ws.onopen = () => {
55
55
  this._connected = !0, this.reconnectAttempt = 0, this.onConnectionChange?.(!0), this.rejoinThreads(), this.flushPendingMessages();
56
56
  }, this.ws.onmessage = (s) => {
57
57
  try {
58
- const a = JSON.parse(s.data), c = te(a);
58
+ const a = JSON.parse(s.data), c = ne(a);
59
59
  c.type === "ready" && (this._ready = !0), this.onEvent?.(c);
60
60
  } catch {
61
61
  }
@@ -73,29 +73,29 @@ class _e {
73
73
  leaveThread(t) {
74
74
  this.joinedThreads.delete(t), this.send({ threadId: t, type: "leave_thread" });
75
75
  }
76
- sendMessage(t, n) {
77
- if (n.length > ce)
78
- throw new Error(`Message body exceeds maximum length of ${ce} characters`);
79
- this.send({ body: n, threadId: t, type: "send_message" });
76
+ sendMessage(t, r) {
77
+ if (r.length > ue)
78
+ throw new Error(`Message body exceeds maximum length of ${ue} characters`);
79
+ this.send({ body: r, threadId: t, type: "send_message" });
80
80
  }
81
81
  markRead(t) {
82
82
  this.send({ threadId: t, type: "mark_read" });
83
83
  }
84
- listThreads(t, n) {
85
- this.send({ limit: t, offset: n, type: "list_threads" });
84
+ listThreads(t, r) {
85
+ this.send({ limit: t, offset: r, type: "list_threads" });
86
86
  }
87
87
  send(t) {
88
88
  if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
89
89
  this.pendingMessages.push(t);
90
90
  return;
91
91
  }
92
- this.ws.send(JSON.stringify(re(t)));
92
+ this.ws.send(JSON.stringify(oe(t)));
93
93
  }
94
94
  flushPendingMessages() {
95
95
  const t = [...this.pendingMessages];
96
96
  this.pendingMessages = [];
97
- for (const n of t)
98
- this.send(n);
97
+ for (const r of t)
98
+ this.send(r);
99
99
  }
100
100
  rejoinThreads() {
101
101
  for (const t of this.joinedThreads)
@@ -103,7 +103,7 @@ class _e {
103
103
  }
104
104
  scheduleReconnect() {
105
105
  this.clearReconnectTimer();
106
- const t = Math.min(this.reconnectBaseDelay * 2 ** this.reconnectAttempt, we);
106
+ const t = Math.min(this.reconnectBaseDelay * 2 ** this.reconnectAttempt, be);
107
107
  this.reconnectAttempt++, this.reconnectTimer = setTimeout(() => {
108
108
  this.connect();
109
109
  }, t);
@@ -112,13 +112,13 @@ class _e {
112
112
  this.reconnectTimer !== null && (clearTimeout(this.reconnectTimer), this.reconnectTimer = null);
113
113
  }
114
114
  }
115
- var J = { exports: {} }, U = {};
116
- var le;
117
- function Re() {
118
- if (le) return U;
119
- le = 1;
115
+ var G = { exports: {} }, M = {};
116
+ var de;
117
+ function Te() {
118
+ if (de) return M;
119
+ de = 1;
120
120
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
121
- function n(o, s, a) {
121
+ function r(o, s, a) {
122
122
  var c = null;
123
123
  if (a !== void 0 && (c = "" + a), s.key !== void 0 && (c = "" + s.key), "key" in s) {
124
124
  a = {};
@@ -133,170 +133,170 @@ function Re() {
133
133
  props: a
134
134
  };
135
135
  }
136
- return U.Fragment = t, U.jsx = n, U.jsxs = n, U;
136
+ return M.Fragment = t, M.jsx = r, M.jsxs = r, M;
137
137
  }
138
138
  var z = {};
139
- var ue;
140
- function Te() {
141
- return ue || (ue = 1, process.env.NODE_ENV !== "production" && (function() {
142
- function e(r) {
143
- if (r == null) return null;
144
- if (typeof r == "function")
145
- return r.$$typeof === w ? null : r.displayName || r.name || null;
146
- if (typeof r == "string") return r;
147
- switch (r) {
148
- case _:
139
+ var fe;
140
+ function Ce() {
141
+ return fe || (fe = 1, process.env.NODE_ENV !== "production" && (function() {
142
+ function e(n) {
143
+ if (n == null) return null;
144
+ if (typeof n == "function")
145
+ return n.$$typeof === X ? null : n.displayName || n.name || null;
146
+ if (typeof n == "string") return n;
147
+ switch (n) {
148
+ case E:
149
149
  return "Fragment";
150
150
  case d:
151
151
  return "Profiler";
152
152
  case h:
153
153
  return "StrictMode";
154
- case x:
154
+ case I:
155
155
  return "Suspense";
156
- case K:
157
- return "SuspenseList";
158
156
  case B:
157
+ return "SuspenseList";
158
+ case q:
159
159
  return "Activity";
160
160
  }
161
- if (typeof r == "object")
162
- switch (typeof r.tag == "number" && console.error(
161
+ if (typeof n == "object")
162
+ switch (typeof n.tag == "number" && console.error(
163
163
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
164
- ), r.$$typeof) {
165
- case A:
164
+ ), n.$$typeof) {
165
+ case C:
166
166
  return "Portal";
167
- case E:
168
- return r.displayName || "Context";
169
- case b:
170
- return (r._context.displayName || "Context") + ".Consumer";
167
+ case _:
168
+ return n.displayName || "Context";
171
169
  case S:
172
- var p = r.render;
173
- return r = r.displayName, r || (r = p.displayName || p.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
174
- case q:
175
- return p = r.displayName || null, p !== null ? p : e(r.type) || "Memo";
170
+ return (n._context.displayName || "Context") + ".Consumer";
171
+ case T:
172
+ var p = n.render;
173
+ return n = n.displayName, n || (n = p.displayName || p.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
174
+ case K:
175
+ return p = n.displayName || null, p !== null ? p : e(n.type) || "Memo";
176
176
  case Y:
177
- p = r._payload, r = r._init;
177
+ p = n._payload, n = n._init;
178
178
  try {
179
- return e(r(p));
179
+ return e(n(p));
180
180
  } catch {
181
181
  }
182
182
  }
183
183
  return null;
184
184
  }
185
- function t(r) {
186
- return "" + r;
185
+ function t(n) {
186
+ return "" + n;
187
187
  }
188
- function n(r) {
188
+ function r(n) {
189
189
  try {
190
- t(r);
190
+ t(n);
191
191
  var p = !1;
192
192
  } catch {
193
193
  p = !0;
194
194
  }
195
195
  if (p) {
196
196
  p = console;
197
- var v = p.error, R = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
198
- return v.call(
197
+ var w = p.error, R = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
198
+ return w.call(
199
199
  p,
200
200
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
201
201
  R
202
- ), t(r);
202
+ ), t(n);
203
203
  }
204
204
  }
205
- function o(r) {
206
- if (r === _) return "<>";
207
- if (typeof r == "object" && r !== null && r.$$typeof === Y)
205
+ function o(n) {
206
+ if (n === E) return "<>";
207
+ if (typeof n == "object" && n !== null && n.$$typeof === Y)
208
208
  return "<...>";
209
209
  try {
210
- var p = e(r);
210
+ var p = e(n);
211
211
  return p ? "<" + p + ">" : "<...>";
212
212
  } catch {
213
213
  return "<...>";
214
214
  }
215
215
  }
216
216
  function s() {
217
- var r = C.A;
218
- return r === null ? null : r.getOwner();
217
+ var n = v.A;
218
+ return n === null ? null : n.getOwner();
219
219
  }
220
220
  function a() {
221
221
  return Error("react-stack-top-frame");
222
222
  }
223
- function c(r) {
224
- if (V.call(r, "key")) {
225
- var p = Object.getOwnPropertyDescriptor(r, "key").get;
223
+ function c(n) {
224
+ if (P.call(n, "key")) {
225
+ var p = Object.getOwnPropertyDescriptor(n, "key").get;
226
226
  if (p && p.isReactWarning) return !1;
227
227
  }
228
- return r.key !== void 0;
228
+ return n.key !== void 0;
229
229
  }
230
- function l(r, p) {
231
- function v() {
232
- N || (N = !0, console.error(
230
+ function l(n, p) {
231
+ function w() {
232
+ Q || (Q = !0, console.error(
233
233
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
234
234
  p
235
235
  ));
236
236
  }
237
- v.isReactWarning = !0, Object.defineProperty(r, "key", {
238
- get: v,
237
+ w.isReactWarning = !0, Object.defineProperty(n, "key", {
238
+ get: w,
239
239
  configurable: !0
240
240
  });
241
241
  }
242
242
  function u() {
243
- var r = e(this.type);
244
- return $[r] || ($[r] = !0, console.error(
243
+ var n = e(this.type);
244
+ return L[n] || (L[n] = !0, console.error(
245
245
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
246
- )), r = this.props.ref, r !== void 0 ? r : null;
246
+ )), n = this.props.ref, n !== void 0 ? n : null;
247
247
  }
248
- function f(r, p, v, R, Q, X) {
249
- var T = v.ref;
250
- return r = {
248
+ function f(n, p, w, R, J, ee) {
249
+ var b = w.ref;
250
+ return n = {
251
251
  $$typeof: j,
252
- type: r,
252
+ type: n,
253
253
  key: p,
254
- props: v,
254
+ props: w,
255
255
  _owner: R
256
- }, (T !== void 0 ? T : null) !== null ? Object.defineProperty(r, "ref", {
256
+ }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(n, "ref", {
257
257
  enumerable: !1,
258
258
  get: u
259
- }) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
259
+ }) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
260
260
  configurable: !1,
261
261
  enumerable: !1,
262
262
  writable: !0,
263
263
  value: 0
264
- }), Object.defineProperty(r, "_debugInfo", {
264
+ }), Object.defineProperty(n, "_debugInfo", {
265
265
  configurable: !1,
266
266
  enumerable: !1,
267
267
  writable: !0,
268
268
  value: null
269
- }), Object.defineProperty(r, "_debugStack", {
269
+ }), Object.defineProperty(n, "_debugStack", {
270
270
  configurable: !1,
271
271
  enumerable: !1,
272
272
  writable: !0,
273
- value: Q
274
- }), Object.defineProperty(r, "_debugTask", {
273
+ value: J
274
+ }), Object.defineProperty(n, "_debugTask", {
275
275
  configurable: !1,
276
276
  enumerable: !1,
277
277
  writable: !0,
278
- value: X
279
- }), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
278
+ value: ee
279
+ }), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
280
280
  }
281
- function i(r, p, v, R, Q, X) {
282
- var T = p.children;
283
- if (T !== void 0)
281
+ function i(n, p, w, R, J, ee) {
282
+ var b = p.children;
283
+ if (b !== void 0)
284
284
  if (R)
285
- if (H(T)) {
286
- for (R = 0; R < T.length; R++)
287
- g(T[R]);
288
- Object.freeze && Object.freeze(T);
285
+ if (Z(b)) {
286
+ for (R = 0; R < b.length; R++)
287
+ g(b[R]);
288
+ Object.freeze && Object.freeze(b);
289
289
  } else
290
290
  console.error(
291
291
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
292
292
  );
293
- else g(T);
294
- if (V.call(p, "key")) {
295
- T = e(r);
296
- var F = Object.keys(p).filter(function(ye) {
297
- return ye !== "key";
293
+ else g(b);
294
+ if (P.call(p, "key")) {
295
+ b = e(n);
296
+ var D = Object.keys(p).filter(function(Ee) {
297
+ return Ee !== "key";
298
298
  });
299
- R = 0 < F.length ? "{key: someKey, " + F.join(": ..., ") + ": ...}" : "{key: someKey}", ae[T + R] || (F = 0 < F.length ? "{" + F.join(": ..., ") + ": ...}" : "{}", console.error(
299
+ R = 0 < D.length ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}", ce[b + R] || (D = 0 < D.length ? "{" + D.join(": ..., ") + ": ...}" : "{}", console.error(
300
300
  `A props object containing a "key" prop is being spread into JSX:
301
301
  let props = %s;
302
302
  <%s {...props} />
@@ -304,93 +304,93 @@ React keys must be passed directly to JSX without using spread:
304
304
  let props = %s;
305
305
  <%s key={someKey} {...props} />`,
306
306
  R,
307
- T,
308
- F,
309
- T
310
- ), ae[T + R] = !0);
307
+ b,
308
+ D,
309
+ b
310
+ ), ce[b + R] = !0);
311
311
  }
312
- if (T = null, v !== void 0 && (n(v), T = "" + v), c(p) && (n(p.key), T = "" + p.key), "key" in p) {
313
- v = {};
314
- for (var Z in p)
315
- Z !== "key" && (v[Z] = p[Z]);
316
- } else v = p;
317
- return T && l(
318
- v,
319
- typeof r == "function" ? r.displayName || r.name || "Unknown" : r
312
+ if (b = null, w !== void 0 && (r(w), b = "" + w), c(p) && (r(p.key), b = "" + p.key), "key" in p) {
313
+ w = {};
314
+ for (var te in p)
315
+ te !== "key" && (w[te] = p[te]);
316
+ } else w = p;
317
+ return b && l(
318
+ w,
319
+ typeof n == "function" ? n.displayName || n.name || "Unknown" : n
320
320
  ), f(
321
- r,
322
- T,
323
- v,
321
+ n,
322
+ b,
323
+ w,
324
324
  s(),
325
- Q,
326
- X
325
+ J,
326
+ ee
327
327
  );
328
328
  }
329
- function g(r) {
330
- m(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === Y && (r._payload.status === "fulfilled" ? m(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
329
+ function g(n) {
330
+ m(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === Y && (n._payload.status === "fulfilled" ? m(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
331
331
  }
332
- function m(r) {
333
- return typeof r == "object" && r !== null && r.$$typeof === j;
332
+ function m(n) {
333
+ return typeof n == "object" && n !== null && n.$$typeof === j;
334
334
  }
335
- var y = ve, j = /* @__PURE__ */ Symbol.for("react.transitional.element"), A = /* @__PURE__ */ Symbol.for("react.portal"), _ = /* @__PURE__ */ Symbol.for("react.fragment"), h = /* @__PURE__ */ Symbol.for("react.strict_mode"), d = /* @__PURE__ */ Symbol.for("react.profiler"), b = /* @__PURE__ */ Symbol.for("react.consumer"), E = /* @__PURE__ */ Symbol.for("react.context"), S = /* @__PURE__ */ Symbol.for("react.forward_ref"), x = /* @__PURE__ */ Symbol.for("react.suspense"), K = /* @__PURE__ */ Symbol.for("react.suspense_list"), q = /* @__PURE__ */ Symbol.for("react.memo"), Y = /* @__PURE__ */ Symbol.for("react.lazy"), B = /* @__PURE__ */ Symbol.for("react.activity"), w = /* @__PURE__ */ Symbol.for("react.client.reference"), C = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, H = Array.isArray, M = console.createTask ? console.createTask : function() {
335
+ var y = _e, j = /* @__PURE__ */ Symbol.for("react.transitional.element"), C = /* @__PURE__ */ Symbol.for("react.portal"), E = /* @__PURE__ */ Symbol.for("react.fragment"), h = /* @__PURE__ */ Symbol.for("react.strict_mode"), d = /* @__PURE__ */ Symbol.for("react.profiler"), S = /* @__PURE__ */ Symbol.for("react.consumer"), _ = /* @__PURE__ */ Symbol.for("react.context"), T = /* @__PURE__ */ Symbol.for("react.forward_ref"), I = /* @__PURE__ */ Symbol.for("react.suspense"), B = /* @__PURE__ */ Symbol.for("react.suspense_list"), K = /* @__PURE__ */ Symbol.for("react.memo"), Y = /* @__PURE__ */ Symbol.for("react.lazy"), q = /* @__PURE__ */ Symbol.for("react.activity"), X = /* @__PURE__ */ Symbol.for("react.client.reference"), v = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, P = Object.prototype.hasOwnProperty, Z = Array.isArray, U = console.createTask ? console.createTask : function() {
336
336
  return null;
337
337
  };
338
338
  y = {
339
- react_stack_bottom_frame: function(r) {
340
- return r();
339
+ react_stack_bottom_frame: function(n) {
340
+ return n();
341
341
  }
342
342
  };
343
- var N, $ = {}, oe = y.react_stack_bottom_frame.bind(
343
+ var Q, L = {}, $ = y.react_stack_bottom_frame.bind(
344
344
  y,
345
345
  a
346
- )(), se = M(o(a)), ae = {};
347
- z.Fragment = _, z.jsx = function(r, p, v) {
348
- var R = 1e4 > C.recentlyCreatedOwnerStacks++;
346
+ )(), ie = U(o(a)), ce = {};
347
+ z.Fragment = E, z.jsx = function(n, p, w) {
348
+ var R = 1e4 > v.recentlyCreatedOwnerStacks++;
349
349
  return i(
350
- r,
350
+ n,
351
351
  p,
352
- v,
352
+ w,
353
353
  !1,
354
- R ? Error("react-stack-top-frame") : oe,
355
- R ? M(o(r)) : se
354
+ R ? Error("react-stack-top-frame") : $,
355
+ R ? U(o(n)) : ie
356
356
  );
357
- }, z.jsxs = function(r, p, v) {
358
- var R = 1e4 > C.recentlyCreatedOwnerStacks++;
357
+ }, z.jsxs = function(n, p, w) {
358
+ var R = 1e4 > v.recentlyCreatedOwnerStacks++;
359
359
  return i(
360
- r,
360
+ n,
361
361
  p,
362
- v,
362
+ w,
363
363
  !0,
364
- R ? Error("react-stack-top-frame") : oe,
365
- R ? M(o(r)) : se
364
+ R ? Error("react-stack-top-frame") : $,
365
+ R ? U(o(n)) : ie
366
366
  );
367
367
  };
368
368
  })()), z;
369
369
  }
370
- var de;
371
- function be() {
372
- return de || (de = 1, process.env.NODE_ENV === "production" ? J.exports = Re() : J.exports = Te()), J.exports;
370
+ var pe;
371
+ function Ae() {
372
+ return pe || (pe = 1, process.env.NODE_ENV === "production" ? G.exports = Te() : G.exports = Ce()), G.exports;
373
373
  }
374
- var I = be();
375
- const Be = ({ IMaskMixin: e, ...t }) => {
376
- const n = ne(
374
+ var N = Ae();
375
+ const Ze = ({ IMaskMixin: e, ...t }) => {
376
+ const r = ae(
377
377
  // eslint-disable-next-line react/jsx-props-no-spreading
378
- () => e(({ TextField: o, ...s }) => /* @__PURE__ */ I.jsx(o, { ...s })),
378
+ () => e(({ TextField: o, ...s }) => /* @__PURE__ */ N.jsx(o, { ...s })),
379
379
  [e]
380
380
  );
381
- return /* @__PURE__ */ I.jsx(n, { ...t });
382
- }, P = ge({}), He = ({ children: e, apiURL: t, libraries: n, localStorageKeys: o }) => {
383
- const s = ne(
381
+ return /* @__PURE__ */ N.jsx(r, { ...t });
382
+ }, O = ve({}), et = ({ children: e, apiURL: t, libraries: r, localStorageKeys: o }) => {
383
+ const s = ae(
384
384
  () => ({
385
385
  apiURL: t,
386
- libraries: n,
386
+ libraries: r,
387
387
  localStorageKeys: o
388
388
  }),
389
- [t, n, o]
389
+ [t, r, o]
390
390
  );
391
- return /* @__PURE__ */ I.jsx(P.Provider, { value: s, children: e });
392
- }, Xe = ({ data: e, ...t }) => {
393
- const { libraries: n } = k(P), o = t?.reactRouter || n?.reactRouter, s = t?.gtm || n?.gtm;
391
+ return /* @__PURE__ */ N.jsx(O.Provider, { value: s, children: e });
392
+ }, tt = ({ data: e, ...t }) => {
393
+ const { libraries: r } = k(O), o = t?.reactRouter || r?.reactRouter, s = t?.gtm || r?.gtm;
394
394
  if (!o)
395
395
  throw new Error(
396
396
  "React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView."
@@ -398,14 +398,14 @@ const Be = ({ IMaskMixin: e, ...t }) => {
398
398
  if (!s)
399
399
  throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
400
400
  const { useGoogleTagManager: a } = s, { useLocation: c, Outlet: l } = o, { pathname: u } = c(), { sendEvent: f } = a();
401
- return L(() => {
401
+ return x(() => {
402
402
  f({
403
403
  event: "pageView",
404
404
  pathname: u,
405
405
  ...e
406
406
  });
407
- }, [e, u, f]), /* @__PURE__ */ I.jsx(l, {});
408
- }, W = (() => {
407
+ }, [e, u, f]), /* @__PURE__ */ N.jsx(l, {});
408
+ }, V = (() => {
409
409
  try {
410
410
  return typeof global == "object" && global !== null && ("HermesInternal" in global || // Hermes JS engine
411
411
  "__fbBatchedBridge" in global || // RN Bridge
@@ -413,29 +413,29 @@ const Be = ({ IMaskMixin: e, ...t }) => {
413
413
  } catch {
414
414
  return !1;
415
415
  }
416
- })(), Se = "user", Ze = ({
416
+ })(), je = "user", rt = ({
417
417
  tokenTypeKey: e = "tokenType",
418
418
  tokenKey: t = "accessToken",
419
- postContentType: n = "application/json",
419
+ postContentType: r = "application/json",
420
420
  ...o
421
421
  }) => {
422
- const { apiURL: s = o.apiURL, libraries: a, localStorageKeys: c } = k(P), l = o?.userLocalStorageKey || c?.user || Se, u = o?.axios || a?.axios;
422
+ const { apiURL: s = o.apiURL, libraries: a, localStorageKeys: c } = k(O), l = o?.userLocalStorageKey || c?.user || je, u = o?.axios || a?.axios;
423
423
  if (!u)
424
424
  throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
425
- if (!u?.defaults || W)
425
+ if (!u?.defaults || V)
426
426
  return null;
427
427
  if (typeof window < "u" && window.localStorage) {
428
428
  const f = localStorage.getItem(l), i = f ? JSON.parse(f) : null, g = i?.[e] ? i[e] : null, m = i?.[t] ? i[t] : null, y = f ? `${g} ${m}` : null;
429
429
  y && (u.defaults.headers.common.Authorization = y);
430
430
  }
431
- return u.defaults.baseURL = s, u.defaults.headers.post["Content-Type"] = n, null;
432
- }, et = ({ language: e, ...t }) => {
433
- const { libraries: n } = k(P), o = t?.dayjs || n?.dayjs, s = t?.plugin || n?.dayjsPlugin;
431
+ return u.defaults.baseURL = s, u.defaults.headers.post["Content-Type"] = r, null;
432
+ }, nt = ({ language: e, ...t }) => {
433
+ const { libraries: r } = k(O), o = t?.dayjs || r?.dayjs, s = t?.plugin || r?.dayjsPlugin;
434
434
  if (!o)
435
435
  throw new Error(
436
436
  "Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig."
437
437
  );
438
- return L(() => {
438
+ return x(() => {
439
439
  (async () => {
440
440
  const c = e || navigator.language?.slice(0, 2) || "en";
441
441
  s && s.forEach((l) => {
@@ -443,9 +443,21 @@ const Be = ({ IMaskMixin: e, ...t }) => {
443
443
  }), await import("dayjs/locale/en"), await import("dayjs/locale/fr"), o.locale(c);
444
444
  })().then();
445
445
  }, [o, s, e]), null;
446
- }, tt = ({ debug: e, resources: t, ...n }) => {
447
- const { libraries: o } = k(P), s = n?.i18 || o?.i18, { i18next: a, initReactI18next: c, languageDetector: l } = s || {};
448
- if (W)
446
+ }, se = "hubspot-messages-iframe-container", W = "hs-show", ot = ({ hubId: e }) => (x(() => {
447
+ if (!e)
448
+ return;
449
+ const t = document.createElement("style");
450
+ t.textContent = `
451
+ div#${se} { display: none !important; }
452
+ div#${se}.${W} { display: initial !important; }
453
+ `, document.head.appendChild(t);
454
+ const r = document.createElement("script");
455
+ return r.id = "hs-script-loader", r.src = `//js-eu1.hs-scripts.com/${e}.js`, r.async = !0, r.defer = !0, document.body.appendChild(r), () => {
456
+ t.remove(), r.remove();
457
+ };
458
+ }, [e]), null), st = ({ debug: e, resources: t, ...r }) => {
459
+ const { libraries: o } = k(O), s = r?.i18 || o?.i18, { i18next: a, initReactI18next: c, languageDetector: l } = s || {};
460
+ if (V)
449
461
  return null;
450
462
  if (!s)
451
463
  throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
@@ -467,10 +479,10 @@ const Be = ({ IMaskMixin: e, ...t }) => {
467
479
  }), a.on("languageChanged", (u) => {
468
480
  document.documentElement.setAttribute("lang", u);
469
481
  })), null;
470
- }, rt = ({
482
+ }, at = ({
471
483
  dsn: e,
472
484
  integrations: t,
473
- tracesSampleRate: n,
485
+ tracesSampleRate: r,
474
486
  replaysSessionSampleRate: o,
475
487
  replaysOnErrorSampleRate: s,
476
488
  tracePropagationTargets: a,
@@ -480,14 +492,14 @@ const Be = ({ IMaskMixin: e, ...t }) => {
480
492
  release: f,
481
493
  ...i
482
494
  }) => {
483
- const { libraries: g } = k(P), m = i?.sentry || g?.sentry, y = i?.reactRouter || g?.reactRouter;
495
+ const { libraries: g } = k(O), m = i?.sentry || g?.sentry, y = i?.reactRouter || g?.reactRouter;
484
496
  if (!m)
485
497
  throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
486
498
  if (!y)
487
499
  throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
488
500
  if (m.isInitialized())
489
501
  return null;
490
- const { createRoutesFromChildren: j, matchRoutes: A, useLocation: _, useNavigationType: h } = y;
502
+ const { createRoutesFromChildren: j, matchRoutes: C, useLocation: E, useNavigationType: h } = y;
491
503
  return (l || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && m.init({
492
504
  debug: l,
493
505
  dsn: e,
@@ -504,9 +516,9 @@ const Be = ({ IMaskMixin: e, ...t }) => {
504
516
  integrations: [
505
517
  m.reactRouterV6BrowserTracingIntegration({
506
518
  createRoutesFromChildren: j,
507
- matchRoutes: A,
508
- useEffect: L,
509
- useLocation: _,
519
+ matchRoutes: C,
520
+ useEffect: x,
521
+ useLocation: E,
510
522
  useNavigationType: h
511
523
  }),
512
524
  ...t || []
@@ -515,10 +527,10 @@ const Be = ({ IMaskMixin: e, ...t }) => {
515
527
  replaysOnErrorSampleRate: s || 1,
516
528
  replaysSessionSampleRate: o || 0.1,
517
529
  tracePropagationTargets: a,
518
- tracesSampleRate: n || 1
530
+ tracesSampleRate: r || 1
519
531
  }), null;
520
- }, nt = () => (L(() => {
521
- if (W)
532
+ }, it = () => (x(() => {
533
+ if (V)
522
534
  return;
523
535
  const e = (t) => {
524
536
  try {
@@ -529,47 +541,47 @@ const Be = ({ IMaskMixin: e, ...t }) => {
529
541
  return window.addEventListener("vite:preloadError", e), () => {
530
542
  window.removeEventListener("vite:preloadError", e);
531
543
  };
532
- }, []), null), fe = /* @__PURE__ */ new WeakMap(), Ae = "user", ot = ({ Fallback: e, isLogged: t, loginPath: n = "/login", redirect401Path: o = "/login", ...s }) => {
533
- const { libraries: a, localStorageKeys: c } = k(P), l = s?.reactRouter || a?.reactRouter, u = s?.axios || a?.axios, f = s?.localStorageKey || c?.user || Ae;
544
+ }, []), null), he = /* @__PURE__ */ new WeakMap(), Pe = "user", ct = ({ Fallback: e, isLogged: t, loginPath: r = "/login", redirect401Path: o = "/login", ...s }) => {
545
+ const { libraries: a, localStorageKeys: c } = k(O), l = s?.reactRouter || a?.reactRouter, u = s?.axios || a?.axios, f = s?.localStorageKey || c?.user || Pe;
534
546
  if (!l)
535
547
  throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
536
- const [i, g] = D(null), { useLocation: m, Navigate: y, Outlet: j } = l, A = m(), _ = typeof t == "function" ? t() : !!t, h = typeof _ == "boolean" ? _ : _?.isLogged;
537
- return L(() => {
538
- fe.has(u) || (fe.set(u, !0), u.interceptors.response.use(
548
+ const [i, g] = F(null), { useLocation: m, Navigate: y, Outlet: j } = l, C = m(), E = typeof t == "function" ? t() : !!t, h = typeof E == "boolean" ? E : E?.isLogged;
549
+ return x(() => {
550
+ he.has(u) || (he.set(u, !0), u.interceptors.response.use(
539
551
  (d) => d,
540
552
  (d) => (typeof d == "object" && d && "response" in d && d.response && typeof d.response == "object" && "status" in d.response && d.response && typeof d.response == "object" && "status" in d.response && d?.response?.status === 401 && (typeof d == "object" && d && "config" in d && d.config && typeof d.config == "object" && "headers" in d.config && d.config.headers && typeof d.config.headers == "object" && "Authorization" in d.config.headers && d.config.headers.Authorization && (u.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(f)), g(o)), Promise.reject(d))
541
553
  ));
542
- }, [u, f, o]), h && !i ? /* @__PURE__ */ I.jsx(Ee, { fallback: e, children: A.state?.from?.state && A.state?.from?.pathname === n ? /* @__PURE__ */ I.jsx(y, { to: A.state.from.state.from.pathname + A.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ I.jsx(j, {}) }) : /* @__PURE__ */ I.jsx(y, { to: n + A.search, state: { from: A }, replace: !0 });
543
- }, Ce = (e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase(), je = (e) => {
554
+ }, [u, f, o]), h && !i ? /* @__PURE__ */ N.jsx(Re, { fallback: e, children: C.state?.from?.state && C.state?.from?.pathname === r ? /* @__PURE__ */ N.jsx(y, { to: C.state.from.state.from.pathname + C.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ N.jsx(j, {}) }) : /* @__PURE__ */ N.jsx(y, { to: r + C.search, state: { from: C }, replace: !0 });
555
+ }, ke = (e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase(), Oe = (e) => {
544
556
  const t = e.split(/[/\\]/).pop() || "";
545
557
  return t.substring(0, t.lastIndexOf("."));
546
- }, ke = (e) => {
558
+ }, xe = (e) => {
547
559
  const o = e.split("/").filter((s) => s.length > 0).map((s) => s.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((u) => u.charAt(0).toUpperCase() + u.slice(1)).join("")).join("");
548
560
  return o.charAt(0).toLowerCase() + o.slice(1);
549
- }, Pe = (e) => (e.split("/").pop() || e).replace(/\.json$/, "").replace(/^openapi\./, ""), Oe = (e, t, n, o) => {
550
- const s = ke(t), a = Ce(n), c = `${s}${a}`;
561
+ }, Ie = (e) => (e.split("/").pop() || e).replace(/\.json$/, "").replace(/^openapi\./, ""), Ne = (e, t, r, o) => {
562
+ const s = xe(t), a = ke(r), c = `${s}${a}`;
551
563
  return e && typeof e == "object" && "operationId" in e && o?.includes(String(e.operationId)) ? `${c}AsQuery` : c;
552
- }, xe = (e, t) => {
553
- const n = {};
564
+ }, Le = (e, t) => {
565
+ const r = {};
554
566
  return e?.forEach((o) => {
555
- n[o] = {
567
+ r[o] = {
556
568
  query: {
557
569
  useInfinite: !0,
558
570
  useInfiniteQueryParam: "offset",
559
571
  useQuery: !0
560
572
  }
561
573
  };
562
- }), t?.filter((o) => !n[o]).forEach((o) => {
563
- n[o] = {
574
+ }), t?.filter((o) => !r[o]).forEach((o) => {
575
+ r[o] = {
564
576
  query: {
565
577
  useQuery: !0
566
578
  }
567
579
  };
568
- }), Object.keys(n).length ? n : void 0;
569
- }, st = (e) => (Array.isArray(e) ? e : [e]).reduce((n, o) => {
570
- const { output: s, useInfiniteIds: a, useQueryIds: c, input: l = "./openapi.json", customAxiosInstancePath: u, overrideApiName: f } = o || {}, i = f || Pe(l), g = u || "./node_modules/@tracktor/shared-module/dist/axiosCustomInstance.ts";
580
+ }), Object.keys(r).length ? r : void 0;
581
+ }, lt = (e) => (Array.isArray(e) ? e : [e]).reduce((r, o) => {
582
+ const { output: s, useInfiniteIds: a, useQueryIds: c, input: l = "./openapi.json", customAxiosInstancePath: u, overrideApiName: f } = o || {}, i = f || Ie(l), g = u || "./node_modules/@tracktor/shared-module/dist/axiosCustomInstance.ts";
571
583
  return {
572
- ...n,
584
+ ...r,
573
585
  [i]: {
574
586
  input: l,
575
587
  output: {
@@ -578,7 +590,7 @@ const Be = ({ IMaskMixin: e, ...t }) => {
578
590
  mode: "tags-split",
579
591
  override: {
580
592
  ...(a?.length || c?.length) && {
581
- operations: xe(a, c)
593
+ operations: Le(a, c)
582
594
  },
583
595
  header: (m) => [
584
596
  "Generated by orval 🍺",
@@ -586,10 +598,10 @@ const Be = ({ IMaskMixin: e, ...t }) => {
586
598
  ...m.description ? [m.description] : []
587
599
  ],
588
600
  mutator: {
589
- name: je(g),
601
+ name: Oe(g),
590
602
  path: g
591
603
  },
592
- operationName: (m, y, j) => Oe(m, y, j, c),
604
+ operationName: (m, y, j) => Ne(m, y, j, c),
593
605
  query: {
594
606
  useQuery: !0
595
607
  }
@@ -600,104 +612,107 @@ const Be = ({ IMaskMixin: e, ...t }) => {
600
612
  }
601
613
  }
602
614
  };
603
- }, {}), Ie = "user", Ne = {
615
+ }, {}), $e = "user", Fe = {
604
616
  client: "/v2/threads/ws",
605
617
  supplier: "/v1/threads/ws"
606
- }, Le = (e, t) => {
607
- const n = e.startsWith("https") ? "wss" : "ws", o = e.replace(/^https?:\/\//, "");
608
- return `${n}://${o}${t}`;
609
- }, $e = (e) => {
618
+ }, De = (e, t) => {
619
+ const r = e.startsWith("https") ? "wss" : "ws", o = e.replace(/^https?:\/\//, "");
620
+ return `${r}://${o}${t}`;
621
+ }, Ye = (e) => {
610
622
  try {
611
623
  const t = localStorage.getItem(e);
612
624
  return t ? JSON.parse(t)?.accessToken ?? null : null;
613
625
  } catch {
614
626
  return null;
615
627
  }
616
- }, me = ge(null), at = ({
628
+ }, we = ve(null), ut = ({
617
629
  children: e,
618
630
  token: t,
619
- url: n,
631
+ url: r,
620
632
  wsPath: o,
621
633
  reconnect: s = !0,
622
634
  enabled: a = !0,
623
635
  context: c = "client"
624
636
  }) => {
625
- const [l, u] = D(!1), [f, i] = D(!1), [g, m] = D(0), { apiURL: y, localStorageKeys: j } = k(P), A = j?.user || Ie, _ = ee(null), h = ee(/* @__PURE__ */ new Set());
626
- L(() => {
637
+ const [l, u] = F(!1), [f, i] = F(!1), [g, m] = F(0), { apiURL: y, localStorageKeys: j } = k(O), C = j?.user || $e, E = re(null), h = re(/* @__PURE__ */ new Set());
638
+ x(() => {
627
639
  if (!a)
628
640
  return;
629
- const w = o ?? Ne[c], C = n || (y ? Le(y, w) : null);
630
- if (!C)
641
+ const v = o ?? Fe[c], P = r || (y ? De(y, v) : null);
642
+ if (!P)
631
643
  return;
632
- const V = () => t ?? $e(A), H = (N) => {
633
- N.type === "ready" && (i(!0), m(N.unreadCount ?? 0));
644
+ const Z = () => t ?? Ye(C), U = (L) => {
645
+ L.type === "ready" && (i(!0), m(L.unreadCount ?? 0));
634
646
  for (const $ of h.current)
635
- $(N);
636
- }, M = setTimeout(() => {
637
- const N = new _e({
638
- getToken: V,
647
+ $(L);
648
+ }, Q = setTimeout(() => {
649
+ const L = new Se({
650
+ getToken: Z,
639
651
  onConnectionChange: ($) => {
640
652
  u($), $ || i(!1);
641
653
  },
642
- onEvent: H,
654
+ onEvent: U,
643
655
  reconnect: s,
644
- url: C
656
+ url: P
645
657
  });
646
- _.current = N, N.connect();
658
+ E.current = L, L.connect();
647
659
  }, 0);
648
660
  return () => {
649
- clearTimeout(M), _.current?.disconnect(), _.current = null;
661
+ clearTimeout(Q), E.current?.disconnect(), E.current = null;
650
662
  };
651
- }, [a, n, o, c, t, s, y, A]);
652
- const d = O((w) => {
653
- _.current?.joinThread(w);
654
- }, []), b = O((w) => {
655
- _.current?.leaveThread(w);
656
- }, []), E = O((w, C) => {
657
- _.current?.sendMessage(w, C);
658
- }, []), S = O((w) => {
659
- _.current?.markRead(w);
660
- }, []), x = O((w, C) => {
661
- _.current?.listThreads(w, C);
662
- }, []), K = O((w = 1) => {
663
- m((C) => C + w);
664
- }, []), q = O((w = 1) => {
665
- m((C) => Math.max(0, C - w));
666
- }, []), Y = O((w) => (h.current.add(w), () => {
667
- h.current.delete(w);
668
- }), []), B = {
669
- decrementUnreadCount: q,
670
- incrementUnreadCount: K,
663
+ }, [a, r, o, c, t, s, y, C]);
664
+ const d = A((v) => {
665
+ E.current?.joinThread(v);
666
+ }, []), S = A((v) => {
667
+ E.current?.leaveThread(v);
668
+ }, []), _ = A((v, P) => {
669
+ E.current?.sendMessage(v, P);
670
+ }, []), T = A((v) => {
671
+ E.current?.markRead(v);
672
+ }, []), I = A((v, P) => {
673
+ E.current?.listThreads(v, P);
674
+ }, []), B = A((v = 1) => {
675
+ m((P) => P + v);
676
+ }, []), K = A((v = 1) => {
677
+ m((P) => Math.max(0, P - v));
678
+ }, []), Y = A(() => {
679
+ E.current?.disconnect(), E.current = null;
680
+ }, []), q = A((v) => (h.current.add(v), () => {
681
+ h.current.delete(v);
682
+ }), []), X = {
683
+ decrementUnreadCount: K,
684
+ disconnect: Y,
685
+ incrementUnreadCount: B,
671
686
  isConnected: l,
672
687
  isReady: f,
673
688
  joinThread: d,
674
- leaveThread: b,
675
- listThreads: x,
676
- markRead: S,
677
- sendMessage: E,
678
- subscribe: Y,
689
+ leaveThread: S,
690
+ listThreads: I,
691
+ markRead: T,
692
+ sendMessage: _,
693
+ subscribe: q,
679
694
  unreadCount: g
680
695
  };
681
- return /* @__PURE__ */ I.jsx(me.Provider, { value: B, children: e });
682
- }, Fe = (e) => e && typeof e == "function", De = (e) => e && typeof e == "function", it = ({
696
+ return /* @__PURE__ */ N.jsx(we.Provider, { value: X, children: e });
697
+ }, Ue = (e) => e && typeof e == "function", Me = (e) => e && typeof e == "function", dt = ({
683
698
  children: e,
684
699
  defaultQueriesOptions: t,
685
- defaultMutationsOptions: n,
700
+ defaultMutationsOptions: r,
686
701
  ...o
687
702
  }) => {
688
- const { libraries: s } = k(P), a = o?.QueryClient || s?.reactQuery?.QueryClient, c = o?.QueryClientProvider || s?.reactQuery?.QueryClientProvider;
703
+ const { libraries: s } = k(O), a = o?.QueryClient || s?.reactQuery?.QueryClient, c = o?.QueryClientProvider || s?.reactQuery?.QueryClientProvider;
689
704
  if (!a)
690
705
  throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
691
706
  if (!c)
692
707
  throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
693
- if (!Fe(c))
708
+ if (!Ue(c))
694
709
  throw new Error("Provided QueryClientProvider dependencies are not valid.");
695
- if (!De(a))
710
+ if (!Me(a))
696
711
  throw new Error("Provided QueryClient dependencies are not valid.");
697
712
  const l = new a({
698
713
  defaultOptions: {
699
714
  mutations: {
700
- ...n
715
+ ...r
701
716
  },
702
717
  queries: {
703
718
  getNextPageParam: (u, f, i) => u.length + (i || 0),
@@ -707,46 +722,46 @@ const Be = ({ IMaskMixin: e, ...t }) => {
707
722
  }
708
723
  }
709
724
  });
710
- return /* @__PURE__ */ I.jsx(c, { client: l, children: e });
711
- }, Ye = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), Me = (e, t) => {
712
- const { fractionDigits: n = 0, metric: o = "km", spacingBetween: s = !0 } = t || {}, a = Number(e), c = s ? " " : "";
713
- return Number.isNaN(a) ? `0${c}${o}` : `${a.toFixed(n)}${c}${o}`;
714
- }, Ue = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((n) => n.length > 0 ? n.charAt(0).toUpperCase() + n.slice(1) : n).join(" "), ze = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, We = ({ path: e, size: t, apiURL: n }) => {
725
+ return /* @__PURE__ */ N.jsx(c, { client: l, children: e });
726
+ }, ze = ({ library: e, date: t, format: r = "ll" }) => e(t).format(r), We = (e, t) => {
727
+ const { fractionDigits: r = 0, metric: o = "km", spacingBetween: s = !0 } = t || {}, a = Number(e), c = s ? " " : "";
728
+ return Number.isNaN(a) ? `0${c}${o}` : `${a.toFixed(r)}${c}${o}`;
729
+ }, Ve = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((r) => r.length > 0 ? r.charAt(0).toUpperCase() + r.slice(1) : r).join(" "), Qe = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, Je = ({ path: e, size: t, apiURL: r }) => {
715
730
  if (!e)
716
731
  return "";
717
- const o = ze(e), s = `${n}${o}`, a = s.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
732
+ const o = Qe(e), s = `${r}${o}`, a = s.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
718
733
  return typeof t == "number" && a ? `${s.replace("/files", `/thumbs/${t}`)}` : s;
719
- }, ct = (e) => {
720
- const { apiURL: t, libraries: n } = k(P), o = e?.dayjs || n?.dayjs;
734
+ }, ft = (e) => {
735
+ const { apiURL: t, libraries: r } = k(O), o = e?.dayjs || r?.dayjs;
721
736
  return {
722
737
  dateAdapter: (c, l) => {
723
738
  if (!o)
724
739
  throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
725
- return Ye({
740
+ return ze({
726
741
  date: c,
727
742
  format: l,
728
743
  library: o
729
744
  });
730
745
  },
731
- distanceAdapter: Me,
746
+ distanceAdapter: We,
732
747
  filePathAdapter: (c, l) => {
733
748
  if (!t)
734
749
  throw new Error(
735
750
  "API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter."
736
751
  );
737
- return typeof c == "string" && /^https?:\/\//.test(c) ? c : We({
752
+ return typeof c == "string" && /^https?:\/\//.test(c) ? c : Je({
738
753
  apiURL: t,
739
754
  path: c,
740
755
  size: l
741
756
  });
742
757
  },
743
- worksiteNameAdapter: Ue
758
+ worksiteNameAdapter: Ve
744
759
  };
745
- }, lt = (e) => {
746
- const { libraries: t, localStorageKeys: n } = k(P), o = e?.axios || t?.axios, s = e?.localStorageKey || n?.user || "user";
760
+ }, pt = (e) => {
761
+ const { libraries: t, localStorageKeys: r } = k(O), o = e?.axios || t?.axios, s = e?.localStorageKey || r?.user || "user";
747
762
  if (!o)
748
763
  throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
749
- const a = O(
764
+ const a = A(
750
765
  ({ tokenType: l, accessToken: u }) => {
751
766
  o.defaults.headers.common.Authorization = `${l} ${u}`;
752
767
  },
@@ -754,8 +769,8 @@ const Be = ({ IMaskMixin: e, ...t }) => {
754
769
  ), c = () => {
755
770
  o.defaults.headers.common.Authorization = null;
756
771
  };
757
- return L(() => {
758
- if (W)
772
+ return x(() => {
773
+ if (V)
759
774
  return;
760
775
  const l = ({ newValue: u, key: f }) => {
761
776
  if (f === s && u)
@@ -773,12 +788,12 @@ const Be = ({ IMaskMixin: e, ...t }) => {
773
788
  clearAuthenticationToken: c,
774
789
  setAuthenticationToken: a
775
790
  };
776
- }, ut = (e) => {
777
- const t = k(me);
791
+ }, ht = (e) => {
792
+ const t = k(we);
778
793
  if (!t)
779
794
  throw new Error("useChat must be used within ChatProvider");
780
- const { subscribe: n, ...o } = t, s = ee(e);
781
- return s.current = e, L(() => n((a) => {
795
+ const { subscribe: r, ...o } = t, s = re(e);
796
+ return s.current = e, x(() => r((a) => {
782
797
  const {
783
798
  onReady: c,
784
799
  onNewMessage: l,
@@ -789,7 +804,7 @@ const Be = ({ IMaskMixin: e, ...t }) => {
789
804
  onLeftThread: m,
790
805
  onMarkedRead: y,
791
806
  onThreadArchived: j,
792
- onThreadsList: A
807
+ onThreadsList: C
793
808
  } = s.current ?? {};
794
809
  switch (a.type) {
795
810
  case "ready":
@@ -820,25 +835,25 @@ const Be = ({ IMaskMixin: e, ...t }) => {
820
835
  j?.(a);
821
836
  break;
822
837
  case "threads_list":
823
- A?.(a);
838
+ C?.(a);
824
839
  break;
825
840
  }
826
- }), [n]), o;
827
- }, G = (e, t) => t === "short" ? e.split("-")[0] : e, dt = (e, t = "full") => {
828
- const [n, o] = D(() => {
841
+ }), [r]), o;
842
+ }, H = (e, t) => t === "short" ? e.split("-")[0] : e, gt = (e, t = "full") => {
843
+ const [r, o] = F(() => {
829
844
  const s = e?.language || navigator.language;
830
- return e && "isInitialized" in e && e.isInitialized, G(s, t);
845
+ return e && "isInitialized" in e && e.isInitialized, H(s, t);
831
846
  });
832
- return L(() => {
833
- e && "isInitialized" in e && e.isInitialized && e.language && o(G(e.language, t));
847
+ return x(() => {
848
+ e && "isInitialized" in e && e.isInitialized && e.language && o(H(e.language, t));
834
849
  const s = (a) => {
835
- o(G(a, t));
850
+ o(H(a, t));
836
851
  };
837
852
  return e?.on?.("languageChanged", s), () => {
838
853
  e?.off?.("languageChanged", s);
839
854
  };
840
- }, [e, t]), n;
841
- }, Ve = "tracktor.filter", Qe = {
855
+ }, [e, t]), r;
856
+ }, Ge = "tracktor.filter", He = {
842
857
  getFilter: () => {
843
858
  },
844
859
  getFilters: () => ({}),
@@ -846,14 +861,14 @@ const Be = ({ IMaskMixin: e, ...t }) => {
846
861
  },
847
862
  setFilter: () => {
848
863
  }
849
- }, pe = (e) => {
864
+ }, ge = (e) => {
850
865
  try {
851
866
  return JSON.parse(e);
852
867
  } catch {
853
868
  return e;
854
869
  }
855
- }, he = (e, t, n) => `${n}_${e}=>${t}`, Je = (e) => e.reduce((t, n) => {
856
- const o = localStorage.getItem(n);
870
+ }, me = (e, t, r) => `${r}_${e}=>${t}`, Be = (e) => e.reduce((t, r) => {
871
+ const o = localStorage.getItem(r);
857
872
  if (o)
858
873
  try {
859
874
  const s = JSON.parse(o), a = Object.keys(s)?.[0];
@@ -861,54 +876,54 @@ const Be = ({ IMaskMixin: e, ...t }) => {
861
876
  } catch {
862
877
  }
863
878
  return t;
864
- }, {}), ft = (e) => {
865
- const { libraries: t, localStorageKeys: n } = k(P), o = e?.reactRouter || t?.reactRouter, { pathname: s } = o?.useLocation?.() ?? { pathname: "/" }, [a, c] = o?.useSearchParams?.() ?? [new URLSearchParams(), () => {
866
- }], [l, u] = D({}), f = n?.filter || Ve, i = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, g = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
867
- if (W)
868
- return Qe;
879
+ }, {}), mt = (e) => {
880
+ const { libraries: t, localStorageKeys: r } = k(O), o = e?.reactRouter || t?.reactRouter, { pathname: s } = o?.useLocation?.() ?? { pathname: "/" }, [a, c] = o?.useSearchParams?.() ?? [new URLSearchParams(), () => {
881
+ }], [l, u] = F({}), f = r?.filter || Ge, i = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, g = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
882
+ if (V)
883
+ return He;
869
884
  if (!o)
870
885
  throw new Error(
871
886
  "React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter."
872
887
  );
873
888
  const m = () => Object.keys(localStorage).filter(
874
889
  (h) => h.startsWith(f) && h.endsWith(e?.pathname || s)
875
- ), y = (h, d, b = !0) => {
876
- const E = he(h, e?.pathname || s, f);
890
+ ), y = (h, d, S = !0) => {
891
+ const _ = me(h, e?.pathname || s, f);
877
892
  if (!d || Array.isArray(d) && !d.length) {
878
- i ? (a.delete(h), c(a)) : u((S) => {
879
- const x = { ...S };
880
- return delete x[h], x;
881
- }), g && localStorage.removeItem(E);
893
+ i ? (a.delete(h), c(a)) : u((T) => {
894
+ const I = { ...T };
895
+ return delete I[h], I;
896
+ }), g && localStorage.removeItem(_);
882
897
  return;
883
898
  }
884
- g && b && d && localStorage.setItem(E, JSON.stringify({ ...a, [h]: d })), i && d ? (a.set(h, JSON.stringify(d)), c(a)) : !i && d && u((S) => ({ ...S, [h]: d }));
899
+ g && S && d && localStorage.setItem(_, JSON.stringify({ ...a, [h]: d })), i && d ? (a.set(h, JSON.stringify(d)), c(a)) : !i && d && u((T) => ({ ...T, [h]: d }));
885
900
  };
886
901
  return {
887
902
  getFilter: (h, d) => {
888
903
  if (i) {
889
- const b = a.get(h);
890
- if (b)
891
- return pe(b);
904
+ const S = a.get(h);
905
+ if (S)
906
+ return ge(S);
892
907
  } else {
893
- const b = l[h];
894
- if (b !== void 0)
895
- return b;
908
+ const S = l[h];
909
+ if (S !== void 0)
910
+ return S;
896
911
  }
897
912
  if (g) {
898
- const b = he(h, e?.pathname || s, f), E = localStorage.getItem(b);
899
- if (E)
913
+ const S = me(h, e?.pathname || s, f), _ = localStorage.getItem(S);
914
+ if (_)
900
915
  try {
901
- const S = JSON.parse(E)[h];
902
- return !i && S !== void 0 && u((x) => ({ ...x, [h]: S })), S;
916
+ const T = JSON.parse(_)[h];
917
+ return !i && T !== void 0 && u((I) => ({ ...I, [h]: T })), T;
903
918
  } catch {
904
919
  }
905
920
  }
906
921
  return d;
907
922
  },
908
923
  getFilters: () => {
909
- const h = g ? Je(m()) : {};
924
+ const h = g ? Be(m()) : {};
910
925
  if (i) {
911
- const d = Array.from(a.entries()).reduce((b, [E, S]) => (b[E] = pe(S), b), {});
926
+ const d = Array.from(a.entries()).reduce((S, [_, T]) => (S[_] = ge(T), S), {});
912
927
  return {
913
928
  ...h,
914
929
  ...d
@@ -919,41 +934,59 @@ const Be = ({ IMaskMixin: e, ...t }) => {
919
934
  ...l
920
935
  };
921
936
  },
922
- handleFilter: (h, d) => (b, E) => {
923
- if (E || Array.isArray(E) && E.length === 0) {
924
- const S = d || "value", x = typeof E == "object" && S in E ? E[S] : E;
925
- y(h, x);
937
+ handleFilter: (h, d) => (S, _) => {
938
+ if (_ || Array.isArray(_) && _.length === 0) {
939
+ const T = d || "value", I = typeof _ == "object" && T in _ ? _[T] : _;
940
+ y(h, I);
926
941
  return;
927
942
  }
928
943
  y(h, void 0);
929
944
  },
930
945
  setFilter: y
931
946
  };
932
- }, pt = ({
947
+ }, ye = () => document.getElementById(se), yt = () => {
948
+ const [e, t] = F(() => !!window.HubSpotConversations);
949
+ x(() => {
950
+ if (window.HubSpotConversations) {
951
+ t(!0);
952
+ return;
953
+ }
954
+ window.hsConversationsOnReady = [() => t(!0)];
955
+ }, []), x(() => {
956
+ e && window.HubSpotConversations?.on("widgetClosed", () => {
957
+ ye()?.classList.remove(W);
958
+ });
959
+ }, [e]);
960
+ const r = A(() => {
961
+ const o = window.HubSpotConversations, s = ye();
962
+ o && s && (s.classList.contains(W) ? (o.widget.close(), s.classList.remove(W)) : (s.classList.add(W), o.widget.open()));
963
+ }, []);
964
+ return { isAvailable: e, toggle: r };
965
+ }, vt = ({
933
966
  data: e,
934
967
  fetchNextPage: t,
935
- isFetchingNextPage: n,
968
+ isFetchingNextPage: r,
936
969
  isInitialLoading: o,
937
970
  isLoading: s,
938
971
  enabled: a = !0
939
972
  }) => {
940
- const c = O(
973
+ const c = A(
941
974
  async (u) => {
942
- n || !a || await t({ pageParam: u?.pageParam || u.visibleRowsCount });
975
+ r || !a || await t({ pageParam: u?.pageParam || u.visibleRowsCount });
943
976
  },
944
- [a, t, n]
945
- ), l = ne(() => {
977
+ [a, t, r]
978
+ ), l = ae(() => {
946
979
  if (e)
947
980
  return e.pages.reduce((u, f) => [...u, ...f], []);
948
981
  }, [e]);
949
982
  return {
950
983
  fetchNextPageOnRowsScrollEnd: c,
951
- isLoading: n || s,
984
+ isLoading: r || s,
952
985
  loadingVariant: o ? "skeleton" : "linear-progress",
953
986
  rows: l
954
987
  };
955
- }, ht = (e) => {
956
- const { libraries: t } = k(P), n = e?.i18 || t?.i18, o = e?.i18?.translateFunction || t?.i18?.translateFunction, s = n?.i18next?.t || o || ((f) => f), { unknownErrorTranslationKey: a = "error.unknownError" } = e || {}, c = s(a), l = O(
988
+ }, wt = (e) => {
989
+ const { libraries: t } = k(O), r = e?.i18 || t?.i18, o = e?.i18?.translateFunction || t?.i18?.translateFunction, s = r?.i18next?.t || o || ((f) => f), { unknownErrorTranslationKey: a = "error.unknownError" } = e || {}, c = s(a), l = A(
957
990
  (f) => {
958
991
  if (f && typeof f == "object" && "response" in f) {
959
992
  const { response: i } = f || {};
@@ -976,36 +1009,38 @@ const Be = ({ IMaskMixin: e, ...t }) => {
976
1009
  },
977
1010
  [c]
978
1011
  );
979
- return { getErrorCode: O((f) => {
1012
+ return { getErrorCode: A((f) => {
980
1013
  const { response: i } = f || {};
981
1014
  return i?.error_code ? String(i?.error_code) : i?.data?.error_code ? String(i?.data?.error_code) : i?.error_code ? String(i?.error_code) : i?.data?.error_code ? String(i.data.error_code) : "unknown_error_code";
982
1015
  }, []), printError: l };
983
1016
  };
984
1017
  export {
985
- _e as ChatClient,
986
- me as ChatContext,
987
- at as ChatProvider,
988
- Xe as GTMSendPageView,
989
- Ze as InitializeAxiosConfig,
990
- et as InitializeDaysJSConfig,
991
- tt as InitializeI18nConfig,
992
- rt as InitializeSentryConfig,
993
- P as InjectDependenciesContext,
994
- He as InjectDependenciesProvider,
995
- Be as MaskTextField,
996
- nt as PreloadErrorHandler,
997
- it as QueryClientProviderWithConfig,
998
- ot as RequireAuth,
999
- qe as axiosCustomInstance,
1000
- Ye as dateAdapter,
1001
- Me as distanceAdapter,
1002
- st as getOrvalConfig,
1003
- ct as useAdapter,
1004
- lt as useAuth,
1005
- ut as useChat,
1006
- dt as useCurrentLanguage,
1007
- ft as useFilters,
1008
- pt as useInfiniteDataGrid,
1009
- ht as useResponseError,
1010
- Ue as worksiteNameAdapter
1018
+ Se as ChatClient,
1019
+ we as ChatContext,
1020
+ ut as ChatProvider,
1021
+ tt as GTMSendPageView,
1022
+ rt as InitializeAxiosConfig,
1023
+ nt as InitializeDaysJSConfig,
1024
+ ot as InitializeHubSpot,
1025
+ st as InitializeI18nConfig,
1026
+ at as InitializeSentryConfig,
1027
+ O as InjectDependenciesContext,
1028
+ et as InjectDependenciesProvider,
1029
+ Ze as MaskTextField,
1030
+ it as PreloadErrorHandler,
1031
+ dt as QueryClientProviderWithConfig,
1032
+ ct as RequireAuth,
1033
+ Xe as axiosCustomInstance,
1034
+ ze as dateAdapter,
1035
+ We as distanceAdapter,
1036
+ lt as getOrvalConfig,
1037
+ ft as useAdapter,
1038
+ pt as useAuth,
1039
+ ht as useChat,
1040
+ gt as useCurrentLanguage,
1041
+ mt as useFilters,
1042
+ yt as useHubSpot,
1043
+ vt as useInfiniteDataGrid,
1044
+ wt as useResponseError,
1045
+ Ve as worksiteNameAdapter
1011
1046
  };