@getsoren/shared-module 2.67.0 → 2.69.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 (33) hide show
  1. package/README.md +15 -0
  2. package/dist/documentImport/index.d.ts +9 -0
  3. package/dist/documentImport/types.d.ts +127 -0
  4. package/dist/documentImport/utils/matching/matching.d.ts +144 -0
  5. package/dist/documentImport/utils/matching/matching.test.d.ts +1 -0
  6. package/dist/documentImport/utils/proposals/proposals.d.ts +10 -0
  7. package/dist/documentImport/utils/proposals/proposals.test.d.ts +1 -0
  8. package/dist/documentImport/utils/reading/reading.d.ts +26 -0
  9. package/dist/documentImport/utils/reading/reading.test.d.ts +1 -0
  10. package/dist/documentImport.js +202 -0
  11. package/dist/hourSheets/constants.d.ts +33 -0
  12. package/dist/hourSheets/index.d.ts +13 -0
  13. package/dist/hourSheets/types.d.ts +143 -0
  14. package/dist/hourSheets/utils/billingReferences/billingReferences.d.ts +35 -0
  15. package/dist/hourSheets/utils/billingReferences/billingReferences.test.d.ts +1 -0
  16. package/dist/hourSheets/utils/imputation/imputation.d.ts +44 -0
  17. package/dist/hourSheets/utils/imputation/imputation.test.d.ts +1 -0
  18. package/dist/hourSheets/utils/readCostCentres/readCostCentres.d.ts +42 -0
  19. package/dist/hourSheets/utils/readCostCentres/readCostCentres.test.d.ts +1 -0
  20. package/dist/hourSheets/utils/sheetBlocker/sheetBlocker.d.ts +53 -0
  21. package/dist/hourSheets/utils/sheetBlocker/sheetBlocker.test.d.ts +1 -0
  22. package/dist/hourSheets/utils/sheetDays/sheetDays.d.ts +68 -0
  23. package/dist/hourSheets/utils/sheetDays/sheetDays.test.d.ts +1 -0
  24. package/dist/hourSheets/utils/sheetLines/sheetLines.d.ts +103 -0
  25. package/dist/hourSheets/utils/sheetLines/sheetLines.test.d.ts +1 -0
  26. package/dist/hourSheets.js +58 -0
  27. package/dist/main.js +339 -375
  28. package/dist/operator-Cj1X_Zg5.js +41 -0
  29. package/dist/orval.js +1 -1
  30. package/dist/sheetLines-DzQEyJOO.js +123 -0
  31. package/dist/utils/operator/operator.d.ts +7 -0
  32. package/package.json +16 -1
  33. /package/dist/{orval-Bf_zcxLE.js → orval-BSFwOlVR.js} +0 -0
package/dist/main.js CHANGED
@@ -1,6 +1,7 @@
1
- import { t as e } from "./orval-Bf_zcxLE.js";
2
- import { Suspense as t, createContext as n, lazy as r, useCallback as i, useContext as a, useEffect as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
3
- import { jsx as d } from "react/jsx-runtime";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./operator-Cj1X_Zg5.js";
2
+ import { t as u } from "./orval-BSFwOlVR.js";
3
+ import { Suspense as d, createContext as f, lazy as p, useCallback as m, useContext as h, useEffect as g, useLayoutEffect as _, useMemo as v, useRef as y, useState as b } from "react";
4
+ import { jsx as x } from "react/jsx-runtime";
4
5
  import "dayjs/locale/ar";
5
6
  import "dayjs/locale/de";
6
7
  import "dayjs/locale/en";
@@ -9,7 +10,7 @@ import "dayjs/locale/fr";
9
10
  import "dayjs/locale/it";
10
11
  import "dayjs/locale/pt";
11
12
  //#region src/chat/ChatClient.ts
12
- var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), h(t)])) : e, g = (e) => Array.isArray(e) ? e.map(g) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e.replace(/[A-Z]/g, (e) => `_${e.toLowerCase()}`), g(t)])) : e, _ = class {
13
+ var S = 3e4, C = 1e3, w = 1e4, T = (e) => Array.isArray(e) ? e.map(T) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e.replace(/_([a-z])/g, (e, t) => t.toUpperCase()), T(t)])) : e, E = (e) => Array.isArray(e) ? e.map(E) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e.replace(/[A-Z]/g, (e) => `_${e.toLowerCase()}`), E(t)])) : e, ee = class {
13
14
  url;
14
15
  getToken;
15
16
  onEvent;
@@ -27,7 +28,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
27
28
  _connected = !1;
28
29
  _ready = !1;
29
30
  constructor(e) {
30
- this.url = e.url, this.getToken = e.getToken, this.onEvent = e.onEvent, this.onConnectionChange = e.onConnectionChange, this.shouldReconnect = e.reconnect ?? !0, this.maxReconnectAttempts = e.maxReconnectAttempts ?? Infinity, this.reconnectBaseDelay = e.reconnectBaseDelay ?? p, this.maxMessageBodyLength = e.maxMessageBodyLength ?? m;
31
+ this.url = e.url, this.getToken = e.getToken, this.onEvent = e.onEvent, this.onConnectionChange = e.onConnectionChange, this.shouldReconnect = e.reconnect ?? !0, this.maxReconnectAttempts = e.maxReconnectAttempts ?? Infinity, this.reconnectBaseDelay = e.reconnectBaseDelay ?? C, this.maxMessageBodyLength = e.maxMessageBodyLength ?? w;
31
32
  }
32
33
  get connected() {
33
34
  return this._connected;
@@ -44,7 +45,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
44
45
  this._connected = !0, this.reconnectAttempt = 0, this.onConnectionChange?.(!0), this.rejoinThreads(), this.flushPendingMessages();
45
46
  }, this.ws.onmessage = (e) => {
46
47
  try {
47
- let t = h(JSON.parse(e.data));
48
+ let t = T(JSON.parse(e.data));
48
49
  t.type === "ready" && (this._ready = !0), this.onEvent?.(t);
49
50
  } catch {}
50
51
  }, this.ws.onclose = () => {
@@ -92,7 +93,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
92
93
  this.pendingMessages.push(e);
93
94
  return;
94
95
  }
95
- this.ws.send(JSON.stringify(g(e)));
96
+ this.ws.send(JSON.stringify(E(e)));
96
97
  }
97
98
  flushPendingMessages() {
98
99
  let e = [...this.pendingMessages];
@@ -107,7 +108,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
107
108
  }
108
109
  scheduleReconnect() {
109
110
  this.clearReconnectTimer();
110
- let e = Math.min(this.reconnectBaseDelay * 2 ** this.reconnectAttempt, f);
111
+ let e = Math.min(this.reconnectBaseDelay * 2 ** this.reconnectAttempt, S);
111
112
  this.reconnectAttempt++, this.reconnectTimer = setTimeout(() => {
112
113
  this.connect();
113
114
  }, e);
@@ -115,8 +116,8 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
115
116
  clearReconnectTimer() {
116
117
  this.reconnectTimer !== null && (clearTimeout(this.reconnectTimer), this.reconnectTimer = null);
117
118
  }
118
- }, v = ({ IMaskMixin: e, ...t }) => /* @__PURE__ */ d(c(() => e(({ TextField: e, ...t }) => /* @__PURE__ */ d(e, { ...t })), [e]), { ...t }), y = n({}), b = ({ children: e, apiURL: t, libraries: n, localStorageKeys: r }) => {
119
- let i = c(() => ({
119
+ }, D = ({ IMaskMixin: e, ...t }) => /* @__PURE__ */ x(v(() => e(({ TextField: e, ...t }) => /* @__PURE__ */ x(e, { ...t })), [e]), { ...t }), O = f({}), k = ({ children: e, apiURL: t, libraries: n, localStorageKeys: r }) => {
120
+ let i = v(() => ({
120
121
  apiURL: t,
121
122
  libraries: n,
122
123
  localStorageKeys: r
@@ -125,34 +126,34 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
125
126
  n,
126
127
  r
127
128
  ]);
128
- return /* @__PURE__ */ d(y.Provider, {
129
+ return /* @__PURE__ */ x(O.Provider, {
129
130
  value: i,
130
131
  children: e
131
132
  });
132
- }, x = 900 * 1e3, S = 60 * 1e3, C = 600 * 1e3, w = "auto-reload-on-new-version-timestamp", T = /<meta[^>]*name="version"[^>]*content="([^"]*)"/, E = (e) => {
133
+ }, A = 900 * 1e3, te = 60 * 1e3, ne = 600 * 1e3, j = "auto-reload-on-new-version-timestamp", M = /<meta[^>]*name="version"[^>]*content="([^"]*)"/, N = (e) => {
133
134
  try {
134
135
  return sessionStorage.getItem(e);
135
136
  } catch {
136
137
  return null;
137
138
  }
138
- }, D = (e, t) => {
139
+ }, P = (e, t) => {
139
140
  try {
140
141
  sessionStorage.setItem(e, t);
141
142
  } catch {}
142
- }, O = ({ version: e, checkInterval: t = x, children: n, ...r }) => {
143
- let { libraries: i } = a(y), s = r?.reactRouter || i?.reactRouter, c = l(!1), u = l(0);
144
- if (!s) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of AutoReloadOnNewVersion.");
145
- let { useLocation: f, Outlet: p } = s, { pathname: m } = f(), h = l(m);
146
- return o(() => {
143
+ }, re = ({ version: e, checkInterval: t = A, children: n, ...r }) => {
144
+ let { libraries: i } = h(O), a = r?.reactRouter || i?.reactRouter, o = y(!1), s = y(0);
145
+ if (!a) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of AutoReloadOnNewVersion.");
146
+ let { useLocation: c, Outlet: l } = a, { pathname: u } = c(), d = y(u);
147
+ return g(() => {
147
148
  if (!e || typeof window > "u") return;
148
149
  let n = async () => {
149
- if (!(c.current || Date.now() - u.current < S)) {
150
- u.current = Date.now();
150
+ if (!(o.current || Date.now() - s.current < te)) {
151
+ s.current = Date.now();
151
152
  try {
152
153
  let t = await fetch("/index.html", { cache: "no-store" });
153
154
  if (!t.ok) return;
154
- let n = (await t.text()).match(T)?.[1];
155
- n && n !== "%VERSION%" && n !== e && (c.current = !0);
155
+ let n = (await t.text()).match(M)?.[1];
156
+ n && n !== "%VERSION%" && n !== e && (o.current = !0);
156
157
  } catch {}
157
158
  }
158
159
  }, r = () => {
@@ -161,29 +162,29 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
161
162
  return document.addEventListener("visibilitychange", r), () => {
162
163
  clearInterval(i), document.removeEventListener("visibilitychange", r);
163
164
  };
164
- }, [e, t]), o(() => {
165
- if (m === h.current || (h.current = m, !c.current)) return;
166
- c.current = !1;
167
- let e = Number(E(w) || "0");
168
- Date.now() - e < C || (D(w, String(Date.now())), window.location.reload());
169
- }, [m]), n ?? /* @__PURE__ */ d(p, {});
170
- }, k = ({ data: e, ...t }) => {
171
- let { libraries: n } = a(y), r = t?.reactRouter || n?.reactRouter, i = t?.gtm || n?.gtm;
165
+ }, [e, t]), g(() => {
166
+ if (u === d.current || (d.current = u, !o.current)) return;
167
+ o.current = !1;
168
+ let e = Number(N(j) || "0");
169
+ Date.now() - e < ne || (P(j, String(Date.now())), window.location.reload());
170
+ }, [u]), n ?? /* @__PURE__ */ x(l, {});
171
+ }, ie = ({ data: e, ...t }) => {
172
+ let { libraries: n } = h(O), r = t?.reactRouter || n?.reactRouter, i = t?.gtm || n?.gtm;
172
173
  if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
173
174
  if (!i) throw Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
174
- let { useGoogleTagManager: s } = i, { useLocation: c, Outlet: l } = r, { pathname: u } = c(), { sendEvent: f } = s();
175
- return o(() => {
176
- f({
175
+ let { useGoogleTagManager: a } = i, { useLocation: o, Outlet: s } = r, { pathname: c } = o(), { sendEvent: l } = a();
176
+ return g(() => {
177
+ l({
177
178
  event: "pageView",
178
- pathname: u,
179
+ pathname: c,
179
180
  ...e
180
181
  });
181
182
  }, [
182
183
  e,
183
- u,
184
- f
185
- ]), /* @__PURE__ */ d(l, {});
186
- }, A = "[data-amp-track-feature]", j = [
184
+ c,
185
+ l
186
+ ]), /* @__PURE__ */ x(s, {});
187
+ }, ae = "[data-amp-track-feature]", oe = [
187
188
  "a",
188
189
  "button",
189
190
  "input",
@@ -195,97 +196,97 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
195
196
  "[contenteditable=\"true\" i]",
196
197
  "[data-amp-default-track]",
197
198
  ".amp-default-track"
198
- ], ee = { defaultMaskLevel: "medium" }, te = (e, t) => {
199
+ ], se = { defaultMaskLevel: "medium" }, ce = (e, t) => {
199
200
  if (e === !1) return !1;
200
201
  let n = e === !0 ? {} : e;
201
202
  return {
202
- cssSelectorAllowlist: [...t, A],
203
+ cssSelectorAllowlist: [...t, ae],
203
204
  ...n
204
205
  };
205
- }, ne = (e, t) => !t || e === !1 ? !1 : {
206
+ }, le = (e, t) => !t || e === !1 ? !1 : {
206
207
  deadClicks: !0,
207
208
  rageClicks: !0,
208
209
  ...e === !0 ? {} : e
209
- }, M = ({ apiKey: e, appVersion: t, sessionReplaySampleRate: n, serverZone: r, elementInteractions: i = !0, frustrationInteractions: c = !0, platform: d = "desktop", sessionReplayPrivacy: f = ee, userId: p, ...m }) => {
210
- let [h, g] = u(!!p), { libraries: _ } = a(y), v = m.amplitude || _?.amplitude, b = l({
210
+ }, ue = ({ apiKey: e, appVersion: t, sessionReplaySampleRate: n, serverZone: r, elementInteractions: i = !0, frustrationInteractions: a = !0, platform: o = "desktop", sessionReplayPrivacy: s = se, userId: c, ...l }) => {
211
+ let [u, d] = b(!!c), { libraries: f } = h(O), p = l.amplitude || f?.amplitude, m = y({
211
212
  elementInteractions: i,
212
- frustrationInteractions: c,
213
- sessionReplayPrivacy: f
214
- }), x = l(p);
215
- return p && !h && g(!0), s(() => {
216
- b.current = {
213
+ frustrationInteractions: a,
214
+ sessionReplayPrivacy: s
215
+ }), v = y(c);
216
+ return c && !u && d(!0), _(() => {
217
+ m.current = {
217
218
  elementInteractions: i,
218
- frustrationInteractions: c,
219
- sessionReplayPrivacy: f
220
- }, x.current = p;
221
- }), o(() => {
222
- let i = v?.analytics, a = v?.sessionReplayPlugin;
223
- if (!(e && i && h)) return;
224
- let { elementInteractions: o, frustrationInteractions: s, sessionReplayPrivacy: c } = b.current, l = x.current, u = !l, f = "platform-enrichment", p = te(o, i.Types?.DEFAULT_CSS_SELECTOR_ALLOWLIST ?? j);
225
- return i.init(e, l, {
219
+ frustrationInteractions: a,
220
+ sessionReplayPrivacy: s
221
+ }, v.current = c;
222
+ }), g(() => {
223
+ let i = p?.analytics, a = p?.sessionReplayPlugin;
224
+ if (!(e && i && u)) return;
225
+ let { elementInteractions: s, frustrationInteractions: c, sessionReplayPrivacy: l } = m.current, d = v.current, f = !d, h = "platform-enrichment", g = ce(s, i.Types?.DEFAULT_CSS_SELECTOR_ALLOWLIST ?? oe);
226
+ return i.init(e, d, {
226
227
  appVersion: t,
227
228
  autocapture: {
228
- elementInteractions: p,
229
- frustrationInteractions: ne(s, p !== !1),
229
+ elementInteractions: g,
230
+ frustrationInteractions: le(c, g !== !1),
230
231
  pageViews: { trackHistoryChanges: "pathOnly" }
231
232
  },
232
- optOut: u,
233
+ optOut: f,
233
234
  serverZone: r
234
- }), i.setOptOut(u), a && i.add(a({
235
- privacyConfig: c,
235
+ }), i.setOptOut(f), a && i.add(a({
236
+ privacyConfig: l,
236
237
  ...n === void 0 ? {} : { sampleRate: n }
237
238
  })), i.add({
238
239
  execute: async (e) => ({
239
240
  ...e,
240
241
  event_properties: {
241
242
  ...e.event_properties,
242
- platform: d
243
+ platform: o
243
244
  }
244
245
  }),
245
- name: f,
246
+ name: h,
246
247
  type: "enrichment"
247
248
  }), () => {
248
- a && i.remove("@amplitude/plugin-session-replay-browser"), i.remove(f), i.setOptOut(!0);
249
+ a && i.remove("@amplitude/plugin-session-replay-browser"), i.remove(h), i.setOptOut(!0);
249
250
  };
250
251
  }, [
251
252
  e,
252
- v,
253
+ p,
253
254
  t,
254
- d,
255
+ o,
255
256
  r,
256
257
  n,
257
- h
258
- ]), o(() => {
259
- let t = v?.analytics;
260
- if (e && t && h) {
261
- if (!p) {
258
+ u
259
+ ]), g(() => {
260
+ let t = p?.analytics;
261
+ if (e && t && u) {
262
+ if (!c) {
262
263
  t.setOptOut(!0);
263
264
  return;
264
265
  }
265
- t.setUserId(p), t.setOptOut(!1);
266
+ t.setUserId(c), t.setOptOut(!1);
266
267
  }
267
268
  }, [
268
269
  e,
269
- v,
270
- h,
271
- p
270
+ p,
271
+ u,
272
+ c
272
273
  ]), null;
273
- }, N = (() => {
274
+ }, F = (() => {
274
275
  try {
275
276
  return typeof global == "object" && global !== null && ("HermesInternal" in global || "__fbBatchedBridge" in global || "__metro" in global) || typeof window > "u" && typeof global < "u" ? !0 : typeof navigator < "u" && navigator.userAgent ? /react.native|ReactNative/i.test(navigator.userAgent) : !1;
276
277
  } catch {
277
278
  return !1;
278
279
  }
279
- })(), P = "user", F = ({ tokenTypeKey: e = "tokenType", tokenKey: t = "accessToken", postContentType: n = "application/json", ...r }) => {
280
- let { apiURL: i = r.apiURL, libraries: o, localStorageKeys: s } = a(y), c = r?.userLocalStorageKey || s?.user || P, l = r?.axios || o?.axios;
281
- if (!l) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
282
- if (!l?.defaults || N) return null;
280
+ })(), de = "user", fe = ({ tokenTypeKey: e = "tokenType", tokenKey: t = "accessToken", postContentType: n = "application/json", ...r }) => {
281
+ let { apiURL: i = r.apiURL, libraries: a, localStorageKeys: o } = h(O), s = r?.userLocalStorageKey || o?.user || de, c = r?.axios || a?.axios;
282
+ if (!c) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
283
+ if (!c?.defaults || F) return null;
283
284
  if (typeof window < "u" && window.localStorage) {
284
- let n = localStorage.getItem(c), r = n ? JSON.parse(n) : null, i = r?.[e] ? r[e] : null, a = r?.[t] ? r[t] : null, o = n ? `${i} ${a}` : null;
285
- o && (l.defaults.headers.common.Authorization = o);
285
+ let n = localStorage.getItem(s), r = n ? JSON.parse(n) : null, i = r?.[e] ? r[e] : null, a = r?.[t] ? r[t] : null, o = n ? `${i} ${a}` : null;
286
+ o && (c.defaults.headers.common.Authorization = o);
286
287
  }
287
- return l.defaults.baseURL = i, l.defaults.headers.post["Content-Type"] = n, null;
288
- }, re = [
288
+ return c.defaults.baseURL = i, c.defaults.headers.post["Content-Type"] = n, null;
289
+ }, pe = [
289
290
  "ar",
290
291
  "de",
291
292
  "en",
@@ -293,21 +294,21 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
293
294
  "fr",
294
295
  "it",
295
296
  "pt"
296
- ], ie = (e) => re.includes(e), ae = ({ language: e, ...t }) => {
297
- let { libraries: n } = a(y), r = t?.dayjs || n?.dayjs, i = t?.plugin || n?.dayjsPlugin;
297
+ ], me = (e) => pe.includes(e), he = ({ language: e, ...t }) => {
298
+ let { libraries: n } = h(O), r = t?.dayjs || n?.dayjs, i = t?.plugin || n?.dayjsPlugin;
298
299
  if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");
299
300
  r.extend(t.localizedFormat), i && i.forEach((e) => {
300
301
  e && r.extend(e);
301
302
  });
302
- let o = e || navigator.language?.slice(0, 2) || "en", s = ie(o) ? o : "en";
303
- return r.locale() !== s && r.locale(s), null;
304
- }, I = "hubspot-messages-iframe-container", L = "hs-show", R = "data-hs-hidden", oe = ({ hubId: e }) => (o(() => {
303
+ let a = e || navigator.language?.slice(0, 2) || "en", o = me(a) ? a : "en";
304
+ return r.locale() !== o && r.locale(o), null;
305
+ }, I = "hubspot-messages-iframe-container", L = "hs-show", R = "data-hs-hidden", ge = ({ hubId: e }) => (g(() => {
305
306
  if (!e) return;
306
307
  let t = document.createElement("script");
307
308
  return t.id = "hs-script-loader", t.src = `//js-eu1.hs-scripts.com/${e}.js`, t.async = !0, t.defer = !0, document.body.appendChild(t), () => {
308
309
  t.remove();
309
310
  };
310
- }, [e]), o(() => {
311
+ }, [e]), g(() => {
311
312
  let e = document.createElement("style");
312
313
  return e.textContent = `
313
314
  html[${R}] div#${I} { display: none !important; }
@@ -315,11 +316,11 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
315
316
  `, document.head.appendChild(e), document.documentElement.setAttribute(R, ""), () => {
316
317
  e.remove(), document.documentElement.removeAttribute(R);
317
318
  };
318
- }, []), null), se = ({ debug: e, resources: t, ...n }) => {
319
- let { libraries: r } = a(y), i = n?.i18 || r?.i18, { i18next: o, initReactI18next: s, languageDetector: c } = i || {};
320
- if (N) return null;
321
- if (!(i && o && c && s)) throw Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
322
- return o.isInitialized ? null : (o.use(c).use(s).init({
319
+ }, []), null), _e = ({ debug: e, resources: t, ...n }) => {
320
+ let { libraries: r } = h(O), i = n?.i18 || r?.i18, { i18next: a, initReactI18next: o, languageDetector: s } = i || {};
321
+ if (F) return null;
322
+ if (!(i && a && s && o)) throw Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
323
+ return a.isInitialized ? null : (a.use(s).use(o).init({
323
324
  debug: e,
324
325
  fallbackLng: "en",
325
326
  interpolation: { escapeValue: !1 },
@@ -331,20 +332,20 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
331
332
  resources: t,
332
333
  returnNull: !1
333
334
  }).then(() => {
334
- document.documentElement.lang !== o.resolvedLanguage && o.resolvedLanguage && document.documentElement.setAttribute("lang", o.resolvedLanguage);
335
- }), o.on("languageChanged", (e) => {
335
+ document.documentElement.lang !== a.resolvedLanguage && a.resolvedLanguage && document.documentElement.setAttribute("lang", a.resolvedLanguage);
336
+ }), a.on("languageChanged", (e) => {
336
337
  document.documentElement.setAttribute("lang", e);
337
338
  }), null);
338
- }, ce = { replay: "keep" }, le = (e) => e.tags?.replay === ce.replay, z = [/^https:\/\/(api|events)\.mapbox\.com\//], B = (e, t) => t.some((t) => typeof t == "string" ? e.includes(t) : t.test(e)), ue = ({ dsn: e, integrations: t, tracesSampleRate: n, tracePropagationTargets: r, ignoreErrors: i, ignoreRequestUrls: s, debug: c, environment: l, release: u, replaysSessionSampleRate: d = 0, replaysOnErrorSampleRate: f = 1, replayBeforeErrorSampling: p = le, ...m }) => {
339
- let { libraries: h } = a(y), g = m?.sentry || h?.sentry, _ = m?.reactRouter || h?.reactRouter;
340
- if (!g) throw Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
339
+ }, z = { replay: "keep" }, B = (e) => e.tags?.replay === z.replay, V = [/^https:\/\/(api|events)\.mapbox\.com\//], H = (e, t) => t.some((t) => typeof t == "string" ? e.includes(t) : t.test(e)), ve = ({ dsn: e, integrations: t, tracesSampleRate: n, tracePropagationTargets: r, ignoreErrors: i, ignoreRequestUrls: a, debug: o, environment: s, release: c, replaysSessionSampleRate: l = 0, replaysOnErrorSampleRate: u = 1, replayBeforeErrorSampling: d = B, ...f }) => {
340
+ let { libraries: p } = h(O), m = f?.sentry || p?.sentry, _ = f?.reactRouter || p?.reactRouter;
341
+ if (!m) throw Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
341
342
  if (!_) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
342
- if (g.isInitialized()) return null;
343
- let { createRoutesFromChildren: v, matchRoutes: b, useLocation: x, useNavigationType: S } = _, C = d > 0 || f > 0, w = [...s || [], ...z];
344
- return (c || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && g.init({
345
- debug: c,
343
+ if (m.isInitialized()) return null;
344
+ let { createRoutesFromChildren: v, matchRoutes: y, useLocation: b, useNavigationType: x } = _, S = l > 0 || u > 0, C = [...a || [], ...V];
345
+ return (o || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && m.init({
346
+ debug: o,
346
347
  dsn: e,
347
- environment: l || "production",
348
+ environment: s || "production",
348
349
  ignoreErrors: [
349
350
  ...i || [],
350
351
  /dynamically imported module/,
@@ -355,237 +356,237 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
355
356
  /vite:preloadError/
356
357
  ],
357
358
  integrations: [
358
- g.reactRouterV6BrowserTracingIntegration({
359
+ m.reactRouterV6BrowserTracingIntegration({
359
360
  createRoutesFromChildren: v,
360
- matchRoutes: b,
361
- shouldCreateSpanForRequest: (e) => !B(e, w),
362
- useEffect: o,
363
- useLocation: x,
364
- useNavigationType: S
361
+ matchRoutes: y,
362
+ shouldCreateSpanForRequest: (e) => !H(e, C),
363
+ useEffect: g,
364
+ useLocation: b,
365
+ useNavigationType: x
365
366
  }),
366
- ...C ? [g.replayIntegration({ beforeErrorSampling: p })] : [],
367
+ ...S ? [m.replayIntegration({ beforeErrorSampling: d })] : [],
367
368
  ...t || []
368
369
  ],
369
- release: u,
370
- replaysOnErrorSampleRate: f,
371
- replaysSessionSampleRate: d,
370
+ release: c,
371
+ replaysOnErrorSampleRate: u,
372
+ replaysSessionSampleRate: l,
372
373
  tracePropagationTargets: r,
373
374
  tracesSampleRate: n ?? 1
374
375
  }), null;
375
- }, V = /* @__PURE__ */ new WeakMap(), de = "user", fe = ({ Fallback: e, isLogged: n, loginPath: r = "/login", redirect401Path: i = "/login", ...s }) => {
376
- let { libraries: c, localStorageKeys: l } = a(y), f = s?.reactRouter || c?.reactRouter, p = s?.axios || c?.axios, m = s?.localStorageKey || l?.user || de;
377
- if (!f) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
378
- let [h, g] = u(null), { useLocation: _, Navigate: v, Outlet: b } = f, x = _(), S = typeof n == "function" ? n() : !!n, C = typeof S == "boolean" ? S : S?.isLogged;
379
- return o(() => {
380
- p && (V.has(p) || (V.set(p, !0), p.interceptors.response.use((e) => e, (e) => (typeof e == "object" && e && "response" in e && e.response && typeof e.response == "object" && "status" in e.response && e.response && typeof e.response == "object" && "status" in e.response && e?.response?.status === 401 && (typeof e == "object" && e && "config" in e && e.config && typeof e.config == "object" && "headers" in e.config && e.config.headers && typeof e.config.headers == "object" && "Authorization" in e.config.headers && e.config.headers.Authorization && (p.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(m)), g(i)), Promise.reject(e)))));
376
+ }, U = /* @__PURE__ */ new WeakMap(), ye = "user", be = ({ Fallback: e, isLogged: t, loginPath: n = "/login", redirect401Path: r = "/login", ...i }) => {
377
+ let { libraries: a, localStorageKeys: o } = h(O), s = i?.reactRouter || a?.reactRouter, c = i?.axios || a?.axios, l = i?.localStorageKey || o?.user || ye;
378
+ if (!s) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
379
+ let [u, f] = b(null), { useLocation: p, Navigate: m, Outlet: _ } = s, v = p(), y = typeof t == "function" ? t() : !!t, S = typeof y == "boolean" ? y : y?.isLogged;
380
+ return g(() => {
381
+ c && (U.has(c) || (U.set(c, !0), c.interceptors.response.use((e) => e, (e) => (typeof e == "object" && e && "response" in e && e.response && typeof e.response == "object" && "status" in e.response && e.response && typeof e.response == "object" && "status" in e.response && e?.response?.status === 401 && (typeof e == "object" && e && "config" in e && e.config && typeof e.config == "object" && "headers" in e.config && e.config.headers && typeof e.config.headers == "object" && "Authorization" in e.config.headers && e.config.headers.Authorization && (c.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(l)), f(r)), Promise.reject(e)))));
381
382
  }, [
382
- p,
383
- m,
384
- i
385
- ]), C && !h ? /* @__PURE__ */ d(t, {
383
+ c,
384
+ l,
385
+ r
386
+ ]), S && !u ? /* @__PURE__ */ x(d, {
386
387
  fallback: e,
387
- children: x.state?.from?.state && x.state?.from?.pathname === r ? /* @__PURE__ */ d(v, {
388
- to: x.state.from.state.from.pathname + x.state.from.state.from.search,
388
+ children: v.state?.from?.state && v.state?.from?.pathname === n ? /* @__PURE__ */ x(m, {
389
+ to: v.state.from.state.from.pathname + v.state.from.state.from.search,
389
390
  replace: !0
390
- }) : /* @__PURE__ */ d(b, {})
391
- }) : /* @__PURE__ */ d(v, {
392
- to: r + x.search,
393
- state: { from: x },
391
+ }) : /* @__PURE__ */ x(_, {})
392
+ }) : /* @__PURE__ */ x(m, {
393
+ to: n + v.search,
394
+ state: { from: v },
394
395
  replace: !0
395
396
  });
396
- }, H = /* @__PURE__ */ new Set(), pe = () => (o(() => {
397
+ }, W = /* @__PURE__ */ new Set(), xe = () => (g(() => {
397
398
  let e = Symbol();
398
- return H.add(e), document.documentElement.removeAttribute(R), () => {
399
- H.delete(e), H.size === 0 && document.documentElement.setAttribute(R, "");
399
+ return W.add(e), document.documentElement.removeAttribute(R), () => {
400
+ W.delete(e), W.size === 0 && document.documentElement.setAttribute(R, "");
400
401
  };
401
- }, []), null), me = "user", he = {
402
+ }, []), null), Se = "user", Ce = {
402
403
  client: "/v2/threads/ws",
403
404
  supplier: "/v1/threads/ws"
404
- }, ge = (e, t) => `${e.startsWith("https") ? "wss" : "ws"}://${e.replace(/^https?:\/\//, "")}${t}`, _e = (e) => {
405
+ }, we = (e, t) => `${e.startsWith("https") ? "wss" : "ws"}://${e.replace(/^https?:\/\//, "")}${t}`, Te = (e) => {
405
406
  try {
406
407
  let t = localStorage.getItem(e);
407
408
  return t ? JSON.parse(t)?.accessToken ?? null : null;
408
409
  } catch {
409
410
  return null;
410
411
  }
411
- }, U = n(null), ve = ({ children: e, token: t, url: n, wsPath: r, maxReconnectAttempts: s, reconnectBaseDelay: c, maxMessageBodyLength: f = 1e4, reconnect: p = !0, enabled: m = !0, context: h = "client" }) => {
412
- let [g, v] = u(!1), [b, x] = u(!1), [S, C] = u(0), [w, T] = u(m), E = m && w, { apiURL: D, localStorageKeys: O } = a(y), k = O?.user || me, A = l(null), j = l(/* @__PURE__ */ new Set());
413
- o(() => {
414
- if (!E) return;
415
- let e = r ?? he[h], i = n || (D ? ge(D, e) : null);
416
- if (!i) return;
417
- let a = () => t ?? _e(k), o = (e) => {
412
+ }, G = f(null), Ee = ({ children: e, token: t, url: n, wsPath: r, maxReconnectAttempts: i, reconnectBaseDelay: a, maxMessageBodyLength: o = 1e4, reconnect: s = !0, enabled: c = !0, context: l = "client" }) => {
413
+ let [u, d] = b(!1), [f, p] = b(!1), [_, v] = b(0), [S, C] = b(c), w = c && S, { apiURL: T, localStorageKeys: E } = h(O), D = E?.user || Se, k = y(null), A = y(/* @__PURE__ */ new Set());
414
+ g(() => {
415
+ if (!w) return;
416
+ let e = r ?? Ce[l], c = n || (T ? we(T, e) : null);
417
+ if (!c) return;
418
+ let u = () => t ?? Te(D), f = (e) => {
418
419
  switch (e.type) {
419
420
  case "ready":
420
- x(!0), C(e.unreadCount ?? 0);
421
+ p(!0), v(e.unreadCount ?? 0);
421
422
  break;
422
423
  }
423
- for (let t of j.current) t(e);
424
- }, l = setTimeout(() => {
425
- let e = new _({
426
- getToken: a,
427
- maxMessageBodyLength: f,
428
- maxReconnectAttempts: s,
424
+ for (let t of A.current) t(e);
425
+ }, m = setTimeout(() => {
426
+ let e = new ee({
427
+ getToken: u,
428
+ maxMessageBodyLength: o,
429
+ maxReconnectAttempts: i,
429
430
  onConnectionChange: (e) => {
430
- v(e), e || x(!1);
431
+ d(e), e || p(!1);
431
432
  },
432
- onEvent: o,
433
- reconnect: p,
434
- reconnectBaseDelay: c,
435
- url: i
433
+ onEvent: f,
434
+ reconnect: s,
435
+ reconnectBaseDelay: a,
436
+ url: c
436
437
  });
437
- A.current = e, e.connect();
438
+ k.current = e, e.connect();
438
439
  }, 0);
439
440
  return () => {
440
- clearTimeout(l), A.current?.disconnect(), A.current = null;
441
+ clearTimeout(m), k.current?.disconnect(), k.current = null;
441
442
  };
442
443
  }, [
443
- E,
444
+ w,
444
445
  n,
445
446
  r,
446
- h,
447
+ l,
447
448
  t,
448
- p,
449
- D,
450
- k,
451
- f,
452
449
  s,
453
- c
450
+ T,
451
+ D,
452
+ o,
453
+ i,
454
+ a
454
455
  ]);
455
- let ee = i((e) => {
456
- A.current?.joinThread(e);
457
- }, []), te = i((e) => {
458
- A.current?.leaveThread(e);
459
- }, []), ne = i((e, t) => {
460
- A.current?.sendMessage(e, t);
461
- }, []), M = i((e) => {
462
- A.current?.markRead(e);
463
- }, []), N = i((e, t) => {
464
- A.current?.listThreads(e, t);
465
- }, []), P = i((e = 1) => {
466
- C((t) => t + e);
467
- }, []), F = {
468
- decrementUnreadCount: i((e = 1) => {
469
- C((t) => Math.max(0, t - e));
456
+ let te = m((e) => {
457
+ k.current?.joinThread(e);
458
+ }, []), ne = m((e) => {
459
+ k.current?.leaveThread(e);
460
+ }, []), j = m((e, t) => {
461
+ k.current?.sendMessage(e, t);
462
+ }, []), M = m((e) => {
463
+ k.current?.markRead(e);
464
+ }, []), N = m((e, t) => {
465
+ k.current?.listThreads(e, t);
466
+ }, []), P = m((e = 1) => {
467
+ v((t) => t + e);
468
+ }, []), re = {
469
+ decrementUnreadCount: m((e = 1) => {
470
+ v((t) => Math.max(0, t - e));
470
471
  }, []),
471
- disconnect: i(() => {
472
- A.current?.disconnect(), A.current = null;
472
+ disconnect: m(() => {
473
+ k.current?.disconnect(), k.current = null;
473
474
  }, []),
474
475
  incrementUnreadCount: P,
475
- isConnected: g,
476
- isReady: b,
477
- joinThread: ee,
478
- leaveThread: te,
476
+ isConnected: u,
477
+ isReady: f,
478
+ joinThread: te,
479
+ leaveThread: ne,
479
480
  listThreads: N,
480
481
  markRead: M,
481
- sendMessage: ne,
482
- setEnabled: i((e) => {
483
- T(e);
482
+ sendMessage: j,
483
+ setEnabled: m((e) => {
484
+ C(e);
484
485
  }, []),
485
- subscribe: i((e) => (j.current.add(e), () => {
486
- j.current.delete(e);
486
+ subscribe: m((e) => (A.current.add(e), () => {
487
+ A.current.delete(e);
487
488
  }), []),
488
- unreadCount: S
489
+ unreadCount: _
489
490
  };
490
- return /* @__PURE__ */ d(U.Provider, {
491
- value: F,
491
+ return /* @__PURE__ */ x(G.Provider, {
492
+ value: re,
492
493
  children: e
493
494
  });
494
- }, ye = 3, be = new Set([
495
+ }, De = 3, Oe = new Set([
495
496
  400,
496
497
  401,
497
498
  403,
498
499
  404
499
- ]), xe = (e) => e?.response?.status, W = (e, t) => {
500
- let n = xe(t);
501
- return e < ye && !(n !== void 0 && be.has(n));
502
- }, Se = (e, t, n) => (Array.isArray(e) ? e.length : 0) + (typeof n == "number" ? n : 0), Ce = ({ children: e, defaultQueriesOptions: t, defaultMutationsOptions: n, ...r }) => {
503
- let { libraries: i } = a(y), o = r.QueryClient || i?.reactQuery?.QueryClient, s = r.QueryClientProvider || i?.reactQuery?.QueryClientProvider;
504
- if (!o) throw Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
505
- if (!s) throw Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
506
- let [c] = u(() => new o({ defaultOptions: {
500
+ ]), ke = (e) => e?.response?.status, K = (e, t) => {
501
+ let n = ke(t);
502
+ return e < De && !(n !== void 0 && Oe.has(n));
503
+ }, Ae = (e, t, n) => (Array.isArray(e) ? e.length : 0) + (typeof n == "number" ? n : 0), je = ({ children: e, defaultQueriesOptions: t, defaultMutationsOptions: n, ...r }) => {
504
+ let { libraries: i } = h(O), a = r.QueryClient || i?.reactQuery?.QueryClient, o = r.QueryClientProvider || i?.reactQuery?.QueryClientProvider;
505
+ if (!a) throw Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
506
+ if (!o) throw Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
507
+ let [s] = b(() => new a({ defaultOptions: {
507
508
  mutations: n,
508
509
  queries: {
509
- getNextPageParam: Se,
510
- retry: W,
510
+ getNextPageParam: Ae,
511
+ retry: K,
511
512
  ...t
512
513
  }
513
514
  } }));
514
- return /* @__PURE__ */ d(s, {
515
- client: c,
515
+ return /* @__PURE__ */ x(o, {
516
+ client: s,
516
517
  children: e
517
518
  });
518
- }, G = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), K = (e, t) => {
519
+ }, q = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), J = (e, t) => {
519
520
  let { fractionDigits: n = 0, metric: r = "km", spacingBetween: i = !0 } = t || {}, a = Number(e), o = i ? " " : "";
520
521
  return Number.isNaN(a) ? `0${o}${r}` : `${a.toFixed(n)}${o}${r}`;
521
- }, q = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((e) => e.length > 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" "), we = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, Te = ({ path: e, size: t, apiURL: n }) => {
522
+ }, Me = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((e) => e.length > 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" "), Ne = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, Pe = ({ path: e, size: t, apiURL: n }) => {
522
523
  if (!e) return "";
523
- let r = `${n}${we(e)}`, i = r.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
524
+ let r = `${n}${Ne(e)}`, i = r.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
524
525
  return typeof t == "number" && i ? `${r.replace("/files", `/thumbs/${t}`)}` : r;
525
- }, Ee = (e) => {
526
- let { apiURL: t, libraries: n } = a(y), r = e?.dayjs || n?.dayjs, o = i((e, n) => {
526
+ }, Fe = (e) => {
527
+ let { apiURL: t, libraries: n } = h(O), r = e?.dayjs || n?.dayjs, i = m((e, n) => {
527
528
  if (!t) throw Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");
528
- return typeof e == "string" && /^https?:\/\//.test(e) ? e : Te({
529
+ return typeof e == "string" && /^https?:\/\//.test(e) ? e : Pe({
529
530
  apiURL: t,
530
531
  path: e,
531
532
  size: n
532
533
  });
533
534
  }, [t]);
534
535
  return {
535
- dateAdapter: i((e, t) => {
536
+ dateAdapter: m((e, t) => {
536
537
  if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
537
- return G({
538
+ return q({
538
539
  date: e,
539
540
  format: t,
540
541
  library: r
541
542
  });
542
543
  }, [r]),
543
- distanceAdapter: K,
544
- filePathAdapter: o,
545
- worksiteNameAdapter: q
544
+ distanceAdapter: J,
545
+ filePathAdapter: i,
546
+ worksiteNameAdapter: Me
546
547
  };
547
- }, De = () => {
548
- let { libraries: e } = a(y), t = e?.amplitude?.analytics, n = i((e, n) => {
548
+ }, Ie = () => {
549
+ let { libraries: e } = h(O), t = e?.amplitude?.analytics, n = m((e, n) => {
549
550
  if (!t || (t.setUserId(e), !n)) return;
550
551
  let r = new t.Identify();
551
552
  Object.entries(n).forEach(([e, t]) => {
552
553
  r.set(e, t);
553
554
  }), t.identify(r);
554
- }, [t]), r = i((e, n, r) => {
555
+ }, [t]), r = m((e, n, r) => {
555
556
  if (!t || (t.setGroup(e, n), !r)) return;
556
557
  let i = new t.Identify();
557
558
  Object.entries(r).forEach(([e, t]) => {
558
559
  i.set(e, t);
559
560
  }), t.groupIdentify(e, n, i);
560
- }, [t]), o = i((e, n) => {
561
+ }, [t]), i = m((e, n) => {
561
562
  t && t.track(e, n);
562
563
  }, [t]);
563
564
  return {
564
565
  identify: n,
565
- reset: i(() => {
566
+ reset: m(() => {
566
567
  t && (t.setOptOut(!0), t.reset());
567
568
  }, [t]),
568
569
  setGroup: r,
569
- track: o
570
+ track: i
570
571
  };
571
- }, Oe = (e) => {
572
- let { libraries: t, localStorageKeys: n } = a(y), r = e?.axios || t?.axios, s = e?.localStorageKey || n?.user || "user";
572
+ }, Le = (e) => {
573
+ let { libraries: t, localStorageKeys: n } = h(O), r = e?.axios || t?.axios, i = e?.localStorageKey || n?.user || "user";
573
574
  if (!r) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
574
- let c = i(({ tokenType: e, accessToken: t }) => {
575
+ let a = m(({ tokenType: e, accessToken: t }) => {
575
576
  r.defaults.headers.common.Authorization = `${e} ${t}`;
576
- }, [r.defaults.headers.common]), l = i(() => {
577
+ }, [r.defaults.headers.common]), o = m(() => {
577
578
  r.defaults.headers.common.Authorization = null;
578
579
  }, [r.defaults.headers.common]);
579
- return o(() => {
580
- if (N) return;
580
+ return g(() => {
581
+ if (F) return;
581
582
  let e = ({ newValue: e, key: t }) => {
582
- if (t === s) try {
583
+ if (t === i) try {
583
584
  let { accessToken: t, tokenType: n } = JSON.parse(e ?? "null") ?? {};
584
585
  if (!t) {
585
- l();
586
+ o();
586
587
  return;
587
588
  }
588
- c({
589
+ a({
589
590
  accessToken: t,
590
591
  tokenType: n
591
592
  });
@@ -597,16 +598,16 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
597
598
  window.removeEventListener("storage", e);
598
599
  };
599
600
  }, [
600
- l,
601
- s,
602
- c
601
+ o,
602
+ i,
603
+ a
603
604
  ]), {
604
- clearAuthenticationToken: l,
605
- setAuthenticationToken: c
605
+ clearAuthenticationToken: o,
606
+ setAuthenticationToken: a
606
607
  };
607
- }, ke = "New message", Ae = (e, t) => {
608
+ }, Re = "New message", ze = (e, t) => {
608
609
  if (!("Notification" in window) || typeof Notification != "function" || Notification.permission !== "granted" || !document.hidden) return;
609
- let n = new Notification(t.title ?? ke, {
610
+ let n = new Notification(t.title ?? Re, {
610
611
  badge: t?.badge,
611
612
  body: t?.body || e.bodyPreview,
612
613
  data: t?.data,
@@ -621,16 +622,16 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
621
622
  let { onClick: r } = t;
622
623
  n.onclick = () => r(e);
623
624
  }
624
- }, je = (e) => {
625
- let t = a(U);
625
+ }, Be = (e) => {
626
+ let t = h(G);
626
627
  if (!t) throw Error("useChat must be used within ChatProvider");
627
- let { subscribe: n, setEnabled: r, ...i } = t, s = l(e);
628
- return s.current = e, o(() => {
628
+ let { subscribe: n, setEnabled: r, ...i } = t, a = y(e);
629
+ return a.current = e, g(() => {
629
630
  e?.enabled !== void 0 && r(e.enabled);
630
- }, [e?.enabled, r]), o(() => {
631
+ }, [e?.enabled, r]), g(() => {
631
632
  e?.browserNotification && e.browserNotification.enabled !== !1 && "Notification" in window && Notification.permission === "default" && typeof Notification.requestPermission == "function" && Notification.requestPermission();
632
- }, [e?.browserNotification]), o(() => n((e) => {
633
- let { browserNotification: t, onReady: n, onNewMessage: r, onNewMessageNotification: i, onPresence: a, onError: o, onJoinedThread: c, onLeftThread: l, onMarkedRead: u, onThreadArchived: d, onThreadsList: f } = s.current ?? {};
633
+ }, [e?.browserNotification]), g(() => n((e) => {
634
+ let { browserNotification: t, onReady: n, onNewMessage: r, onNewMessageNotification: i, onPresence: o, onError: s, onJoinedThread: c, onLeftThread: l, onMarkedRead: u, onThreadArchived: d, onThreadsList: f } = a.current ?? {};
634
635
  switch (e.type) {
635
636
  case "ready":
636
637
  n?.(e);
@@ -639,13 +640,13 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
639
640
  r?.(e);
640
641
  break;
641
642
  case "new_message_notification":
642
- i?.(e), t && t.enabled !== !1 && Ae(e, t);
643
+ i?.(e), t && t.enabled !== !1 && ze(e, t);
643
644
  break;
644
645
  case "presence":
645
- a?.(e);
646
+ o?.(e);
646
647
  break;
647
648
  case "error":
648
- o?.(e);
649
+ s?.(e);
649
650
  break;
650
651
  case "joined_thread":
651
652
  c?.(e);
@@ -664,73 +665,73 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
664
665
  break;
665
666
  }
666
667
  }), [n]), i;
667
- }, J = (e, t = "full") => {
668
+ }, Y = (e, t = "full") => {
668
669
  let n = e || navigator.language;
669
670
  return t === "short" ? n.split("-")[0] : n;
670
- }, Me = (e, t = "full") => {
671
- let [n, r] = u(() => J(e?.language, t));
672
- return o(() => {
673
- e && "isInitialized" in e && e.isInitialized && e.language && r(J(e.language, t));
671
+ }, Ve = (e, t = "full") => {
672
+ let [n, r] = b(() => Y(e?.language, t));
673
+ return g(() => {
674
+ e && "isInitialized" in e && e.isInitialized && e.language && r(Y(e.language, t));
674
675
  let n = (e) => {
675
- r(J(e, t));
676
+ r(Y(e, t));
676
677
  };
677
678
  return e?.on?.("languageChanged", n), () => {
678
679
  e?.off?.("languageChanged", n);
679
680
  };
680
681
  }, [e, t]), n;
681
- }, Ne = "tracktor.filter", Pe = {
682
+ }, He = "tracktor.filter", Ue = {
682
683
  getFilter: () => void 0,
683
684
  getFilters: () => ({}),
684
685
  handleFilter: () => () => {},
685
686
  setFilter: () => {}
686
- }, Fe = (e) => {
687
+ }, We = (e) => {
687
688
  try {
688
689
  return JSON.parse(e);
689
690
  } catch {
690
691
  return e;
691
692
  }
692
- }, Ie = (e, t, n) => `${n}_${e}=>${t}`, Le = (e) => e.reduce((e, t) => {
693
+ }, Ge = (e, t, n) => `${n}_${e}=>${t}`, Ke = (e) => e.reduce((e, t) => {
693
694
  let n = localStorage.getItem(t);
694
695
  if (n) try {
695
696
  let t = JSON.parse(n), r = Object.keys(t)?.[0];
696
697
  r && (e[r] = Object.values(t)?.[0]);
697
698
  } catch {}
698
699
  return e;
699
- }, {}), Re = (e) => {
700
- let { libraries: t, localStorageKeys: n } = a(y), r = e?.reactRouter || t?.reactRouter, { pathname: i } = r?.useLocation?.() ?? { pathname: "/" }, [o, s] = r?.useSearchParams?.() ?? [new URLSearchParams(), () => {}], [c, l] = u({}), d = n?.filter || Ne, f = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, p = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
701
- if (N) return Pe;
700
+ }, {}), qe = (e) => {
701
+ let { libraries: t, localStorageKeys: n } = h(O), r = e?.reactRouter || t?.reactRouter, { pathname: i } = r?.useLocation?.() ?? { pathname: "/" }, [a, o] = r?.useSearchParams?.() ?? [new URLSearchParams(), () => {}], [s, c] = b({}), l = n?.filter || He, u = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, d = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
702
+ if (F) return Ue;
702
703
  if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter.");
703
- let m = () => Object.keys(localStorage).filter((t) => t.startsWith(d) && t.endsWith(e?.pathname || i)), h = (t, n, r = !0) => {
704
- let a = Ie(t, e?.pathname || i, d);
704
+ let f = () => Object.keys(localStorage).filter((t) => t.startsWith(l) && t.endsWith(e?.pathname || i)), p = (t, n, r = !0) => {
705
+ let s = Ge(t, e?.pathname || i, l);
705
706
  if (!n || Array.isArray(n) && !n.length) {
706
- f ? (o.delete(t), s(o)) : l((e) => {
707
+ u ? (a.delete(t), o(a)) : c((e) => {
707
708
  let n = { ...e };
708
709
  return delete n[t], n;
709
- }), p && localStorage.removeItem(a);
710
+ }), d && localStorage.removeItem(s);
710
711
  return;
711
712
  }
712
- p && r && n && localStorage.setItem(a, JSON.stringify({
713
- ...o,
713
+ d && r && n && localStorage.setItem(s, JSON.stringify({
714
+ ...a,
714
715
  [t]: n
715
- })), f && n ? (o.set(t, JSON.stringify(n)), s(o)) : !f && n && l((e) => ({
716
+ })), u && n ? (a.set(t, JSON.stringify(n)), o(a)) : !u && n && c((e) => ({
716
717
  ...e,
717
718
  [t]: n
718
719
  }));
719
720
  };
720
721
  return {
721
722
  getFilter: (t, n) => {
722
- if (f) {
723
- let e = o.get(t);
724
- if (e) return Fe(e);
723
+ if (u) {
724
+ let e = a.get(t);
725
+ if (e) return We(e);
725
726
  } else {
726
- let e = c[t];
727
+ let e = s[t];
727
728
  if (e !== void 0) return e;
728
729
  }
729
- if (p) {
730
- let n = Ie(t, e?.pathname || i, d), r = localStorage.getItem(n);
730
+ if (d) {
731
+ let n = Ge(t, e?.pathname || i, l), r = localStorage.getItem(n);
731
732
  if (r) try {
732
733
  let e = JSON.parse(r)[t];
733
- return !f && e !== void 0 && l((n) => ({
734
+ return !u && e !== void 0 && c((n) => ({
734
735
  ...n,
735
736
  [t]: e
736
737
  })), e;
@@ -739,9 +740,9 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
739
740
  return n;
740
741
  },
741
742
  getFilters: () => {
742
- let e = p ? Le(m()) : {};
743
- if (f) {
744
- let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] = Fe(n), e), {});
743
+ let e = d ? Ke(f()) : {};
744
+ if (u) {
745
+ let t = Array.from(a.entries()).reduce((e, [t, n]) => (e[t] = We(n), e), {});
745
746
  return {
746
747
  ...e,
747
748
  ...t
@@ -749,56 +750,56 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
749
750
  }
750
751
  return {
751
752
  ...e,
752
- ...c
753
+ ...s
753
754
  };
754
755
  },
755
756
  handleFilter: (e, t) => (n, r) => {
756
757
  if (r || Array.isArray(r) && r.length === 0) {
757
758
  let n = t || "value";
758
- h(e, typeof r == "object" && n in r ? r[n || "value"] : r);
759
+ p(e, typeof r == "object" && n in r ? r[n || "value"] : r);
759
760
  return;
760
761
  }
761
- h(e, void 0);
762
+ p(e, void 0);
762
763
  },
763
- setFilter: h
764
+ setFilter: p
764
765
  };
765
- }, ze = () => document.getElementById(I), Be = () => {
766
- let [e, t] = u(() => !!window.HubSpotConversations);
767
- return o(() => {
766
+ }, Je = () => document.getElementById(I), Ye = () => {
767
+ let [e, t] = b(() => !!window.HubSpotConversations);
768
+ return g(() => {
768
769
  if (window.HubSpotConversations) {
769
770
  t(!0);
770
771
  return;
771
772
  }
772
773
  window.hsConversationsOnReady = [() => t(!0)];
773
- }, []), o(() => {
774
+ }, []), g(() => {
774
775
  e && window.HubSpotConversations?.on("widgetClosed", () => {
775
- ze()?.classList.remove(L);
776
+ Je()?.classList.remove(L);
776
777
  });
777
778
  }, [e]), {
778
779
  isAvailable: e,
779
- toggle: i(() => {
780
- let e = window.HubSpotConversations, t = ze();
780
+ toggle: m(() => {
781
+ let e = window.HubSpotConversations, t = Je();
781
782
  e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(L)) : (t.classList.add(L), e.widget.open()));
782
783
  }, [])
783
784
  };
784
- }, Ve = ({ data: e, fetchNextPage: t, isFetchingNextPage: n, isInitialLoading: r, isLoading: a, enabled: o = !0 }) => {
785
- let s = i(async (e) => {
786
- n || !o || await t({ pageParam: e?.pageParam || e.visibleRowsCount });
785
+ }, Xe = ({ data: e, fetchNextPage: t, isFetchingNextPage: n, isInitialLoading: r, isLoading: i, enabled: a = !0 }) => {
786
+ let o = m(async (e) => {
787
+ n || !a || await t({ pageParam: e?.pageParam || e.visibleRowsCount });
787
788
  }, [
788
- o,
789
+ a,
789
790
  t,
790
791
  n
791
- ]), l = c(() => {
792
+ ]), s = v(() => {
792
793
  if (e) return e.pages.reduce((e, t) => [...e, ...t], []);
793
794
  }, [e]);
794
795
  return {
795
- fetchNextPageOnRowsScrollEnd: s,
796
- isLoading: n || a,
796
+ fetchNextPageOnRowsScrollEnd: o,
797
+ isLoading: n || i,
797
798
  loadingVariant: r ? "skeleton" : "linear-progress",
798
- rows: l
799
+ rows: s
799
800
  };
800
- }, He = (e) => {
801
- let { libraries: t } = a(y), n = e?.i18 || t?.i18, r = e?.i18?.translateFunction || t?.i18?.translateFunction, o = n?.i18next?.t || r || ((e) => e), { unknownErrorTranslationKey: s = "error.unknownError" } = e || {}, c = o(s), l = i((e) => {
801
+ }, Ze = (e) => {
802
+ let { libraries: t } = h(O), n = e?.i18 || t?.i18, r = e?.i18?.translateFunction || t?.i18?.translateFunction, i = n?.i18next?.t || r || ((e) => e), { unknownErrorTranslationKey: a = "error.unknownError" } = e || {}, o = i(a), s = m((e) => {
802
803
  if (e && typeof e == "object" && "response" in e) {
803
804
  let { response: t } = e || {};
804
805
  if (t && typeof t == "object" && "reason" in t && t.reason) return String(t.reason);
@@ -812,78 +813,47 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
812
813
  }
813
814
  }
814
815
  }
815
- return e instanceof Error ? e.message : c;
816
- }, [c]);
816
+ return e instanceof Error ? e.message : o;
817
+ }, [o]);
817
818
  return {
818
- getErrorCode: i((e) => {
819
+ getErrorCode: m((e) => {
819
820
  let { response: t } = e || {};
820
821
  return t?.error_code ? String(t?.error_code) : t?.data?.error_code ? String(t?.data?.error_code) : t?.error_code ? String(t?.error_code) : t?.data?.error_code ? String(t.data.error_code) : "unknown_error_code";
821
822
  }, []),
822
- printError: l
823
- };
824
- }, Ue = String.raw`(?:chauffeur|conducteur|op[ée]rateur|machiniste|driver|operator)`, We = String.raw`(?:(?:avec|with|incl(?:\.|uding|us)?|y\s+compris)\s+|\+\s*)(?:(?:un|une|le|la|son|sa|an?|the|its)\s+)?`, Ge = String.raw`(?:\s+(?:inclus|compris|included))?`, Ke = String.raw`(?:(?:(?:à\s+la|par|per|by\s+the|tarif)\s+)?(jours?|journ[ée]es?|journalier|days?)|(?:(?:à\s+l['’]\s*|(?:par|per|by\s+the|tarif)\s+))?(heures?|horaire|hours?))`, qe = String.raw`(?:\s*[-–—,/·:]?\s*${Ke}|\s*\(\s*${Ke}\s*\))?`, Je = String.raw`(?:(?:location|rental|rented)\s+)?(?:${We}${Ue}${Ge}|${Ue}\s+(?:inclus|compris|included))${qe}`, Ye = new RegExp(String.raw`\s*[[(]\s*${Je}\s*[\])]`, "giu"), Xe = new RegExp(String.raw`(?:^|[\s,;:/|–—-])\s*${Je}\s*$`, "iu"), Ze = /[\s,;:/|–—-]+$/u, Qe = ([e]) => {
825
- let t = e.replace(/^[\s,;:/|–—-]+/u, "").trim(), n = (/^[[(]/u.test(t) ? t.slice(1, -1) : t).trim().replace(/\s+/g, " ");
826
- return n.charAt(0).toLocaleUpperCase() + n.slice(1);
827
- }, $e = (e) => e[1] || e[3] ? "days" : e[2] || e[4] ? "hours" : void 0, et = (e, { readDriver: t = !0 } = {}) => {
828
- if (typeof e != "string") return {
829
- label: "",
830
- withDriver: !1
831
- };
832
- if (!t) return {
833
- label: e.trim(),
834
- withDriver: !1
835
- };
836
- let n = e.normalize("NFC"), r = [...n.matchAll(Ye)], i = n.replace(Ye, ""), a = i.match(Xe), o = a ? i.slice(0, a.index) : i;
837
- if (o === n) return {
838
- label: e.trim(),
839
- withDriver: !1
840
- };
841
- let s = o.replace(Ze, "").replace(/\s{2,}/g, " ").trim(), c = [...r, ...a ? [a] : []], l = c.map($e).find(Boolean), u = Qe(c[0]);
842
- return s ? l ? {
843
- driverMention: u,
844
- driverUnit: l,
845
- label: s,
846
- withDriver: !0
847
- } : {
848
- driverMention: u,
849
- label: s,
850
- withDriver: !0
851
- } : {
852
- label: e.trim(),
853
- withDriver: !1
823
+ printError: s
854
824
  };
855
- }, tt = "chunk-reload-timestamp", Y = "chunk-reload", nt = 1e4, X = 2, rt = !1;
856
- if (!N && typeof window < "u") {
825
+ }, Qe = "chunk-reload-timestamp", X = "chunk-reload", $e = 1e4, Z = 2, et = !1;
826
+ if (!F && typeof window < "u") {
857
827
  try {
858
828
  let e = new URL(window.location.href);
859
- e.searchParams.has(Y) && (rt = !0, e.searchParams.delete(Y), window.history.replaceState(null, "", e.toString()));
829
+ e.searchParams.has(X) && (et = !0, e.searchParams.delete(X), window.history.replaceState(null, "", e.toString()));
860
830
  } catch {}
861
831
  window.addEventListener("vite:preloadError", (e) => {
862
832
  e.preventDefault();
863
833
  });
864
834
  }
865
- var it = (e) => {
835
+ var tt = (e) => {
866
836
  if (!(e instanceof Error)) return !1;
867
837
  let t = e.message.toLowerCase();
868
838
  return t.includes("dynamically imported module") || t.includes("importing a module script failed") || t.includes("loading chunk") || t.includes("loading css chunk") || t.includes("unable to preload css") || t.includes("failed to fetch") || t.includes("error loading dynamically imported module") || t.includes("load failed") || t.includes("without a valid default export") || e.name === "ChunkLoadError";
869
- }, at = /import\s*\(\s*(['"])((\w+:(\/?\/?))?[^\s,]+)\1/, ot = (e) => e.toString().match(at)?.[2] ?? null, st = (e) => {
839
+ }, nt = /import\s*\(\s*(['"])((\w+:(\/?\/?))?[^\s,]+)\1/, rt = (e) => e.toString().match(nt)?.[2] ?? null, it = (e) => {
870
840
  try {
871
841
  return sessionStorage.getItem(e);
872
842
  } catch {
873
843
  return null;
874
844
  }
875
- }, ct = (e, t) => {
845
+ }, at = (e, t) => {
876
846
  try {
877
847
  sessionStorage.setItem(e, t);
878
848
  } catch {}
879
- }, lt = (e) => Function("url", "return import(url)")(e), ut = async (e) => {
880
- for (let t = 0; t < X; t++) try {
881
- return await lt(`${e}?t=${Date.now()}`);
849
+ }, ot = (e) => Function("url", "return import(url)")(e), st = async (e) => {
850
+ for (let t = 0; t < Z; t++) try {
851
+ return await ot(`${e}?t=${Date.now()}`);
882
852
  } catch {
883
- t < X - 1 && await new Promise((e) => setTimeout(e, 500 * 2 ** t));
853
+ t < Z - 1 && await new Promise((e) => setTimeout(e, 500 * 2 ** t));
884
854
  }
885
- throw Error(`Failed to import ${e} after ${X} retries`);
886
- }, dt = async () => {
855
+ throw Error(`Failed to import ${e} after ${Z} retries`);
856
+ }, ct = async () => {
887
857
  try {
888
858
  if (typeof navigator < "u" && "serviceWorker" in navigator) {
889
859
  let e = await navigator.serviceWorker.getRegistrations();
@@ -894,34 +864,28 @@ var it = (e) => {
894
864
  await Promise.all(e.map((e) => caches.delete(e)));
895
865
  }
896
866
  } catch {}
897
- }, ft = async () => {
898
- await dt();
867
+ }, lt = async () => {
868
+ await ct();
899
869
  let e = new URL(window.location.href);
900
- e.searchParams.set(Y, String(Date.now())), window.location.replace(e.toString());
901
- }, pt = (e) => e != null && e.default !== void 0, mt = (e) => r(async () => {
870
+ e.searchParams.set(X, String(Date.now())), window.location.replace(e.toString());
871
+ }, Q = (e) => e != null && e.default !== void 0, ut = (e) => p(async () => {
902
872
  let t;
903
873
  try {
904
874
  let n = await e();
905
- if (pt(n)) return n;
875
+ if (Q(n)) return n;
906
876
  t = /* @__PURE__ */ Error("Module resolved without a valid default export");
907
877
  } catch (e) {
908
878
  t = e;
909
879
  }
910
- if (N || !it(t)) throw t;
911
- let n = ot(e);
880
+ if (F || !tt(t)) throw t;
881
+ let n = rt(e);
912
882
  if (n) try {
913
- let e = await ut(n);
914
- if (pt(e)) return e;
883
+ let e = await st(n);
884
+ if (Q(e)) return e;
915
885
  } catch {}
916
- let r = Number(st(tt) || "0");
917
- return Date.now() - r < nt || rt || (ct(tt, String(Date.now())), await ft()), { default: () => null };
918
- }), ht = "machine+operator", gt = "HOURS", _t = 8, vt = 24, yt = (e) => e?.withOperator ?? e?.type === ht, Z = (e = []) => e.find((e) => Q(e) || yt(e.article)), Q = ({ qtyUnit: e }) => e === gt, bt = ({ qtyUnit: e, quantity: t }) => Q({ qtyUnit: e }) ? 1 : t || 1, xt = (e) => {
919
- let t = Z(e?.items);
920
- return t && Q(t) && t.quantity ? t.quantity : void 0;
921
- }, St = (e) => {
922
- let t = Z(e?.items);
923
- return !!t && Q(t) && t.unitPrice == null;
924
- }, Ct = "Page Left", wt = 1800 * 1e3, Tt = 1e3, Et = (e, t = !0) => {
886
+ let r = Number(it(Qe) || "0");
887
+ return Date.now() - r < $e || et || (at(Qe, String(Date.now())), await lt()), { default: () => null };
888
+ }), dt = "Page Left", ft = 1800 * 1e3, pt = 1e3, mt = (e, t = !0) => {
925
889
  let n = 0, r = t ? e : null, i = !1, a = (e) => {
926
890
  r !== null && (n += Math.max(0, e - r), r = null);
927
891
  };
@@ -932,39 +896,39 @@ var it = (e) => {
932
896
  resume: (e) => {
933
897
  !i && r === null && (r = e);
934
898
  },
935
- stop: (e) => (i ||= (a(e), !0), Math.min(wt, Math.round(n)))
899
+ stop: (e) => (i ||= (a(e), !0), Math.min(ft, Math.round(n)))
936
900
  };
937
- }, Dt = (e, t) => t < 1e3 ? null : {
901
+ }, ht = (e, t) => t < 1e3 ? null : {
938
902
  duration_ms: Math.round(t),
939
903
  page_path: e
940
- }, Ot = (e) => {
904
+ }, gt = (e) => {
941
905
  if (typeof e != "object" || !e) return !1;
942
906
  let { exp: t, sub: n, entity_id: r, scope: i } = e;
943
907
  return typeof t == "number" && typeof n == "string" && typeof r == "number" && Array.isArray(i) && i.every((e) => typeof e == "string");
944
- }, kt = (e) => {
908
+ }, _t = (e) => {
945
909
  let t = e.replace(/-/g, "+").replace(/_/g, "/"), n = t + "=".repeat((4 - t.length % 4) % 4);
946
910
  return decodeURIComponent(Array.from(atob(n), (e) => `%${e.charCodeAt(0).toString(16).padStart(2, "0")}`).join(""));
947
- }, At = (e) => {
911
+ }, vt = (e) => {
948
912
  let t = e?.split(".")[1];
949
913
  if (!t) return null;
950
914
  try {
951
- let e = JSON.parse(kt(t));
952
- return Ot(e) ? e : null;
915
+ let e = JSON.parse(_t(t));
916
+ return gt(e) ? e : null;
953
917
  } catch {
954
918
  return null;
955
919
  }
956
- }, $ = (e) => btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""), jt = async (e, t) => {
920
+ }, $ = (e) => btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""), yt = async (e, t) => {
957
921
  let n = new TextEncoder(), r = await crypto.subtle.importKey("raw", n.encode(e), {
958
922
  hash: "SHA-256",
959
923
  name: "HMAC"
960
924
  }, !1, ["sign"]), i = await crypto.subtle.sign("HMAC", r, n.encode(t));
961
925
  return $(String.fromCharCode(...new Uint8Array(i)));
962
- }, Mt = async (e, t) => {
926
+ }, bt = async (e, t) => {
963
927
  let n = `${$(JSON.stringify({
964
928
  alg: "HS256",
965
929
  typ: "JWT"
966
930
  }))}.${$(JSON.stringify(e))}`;
967
- return `${n}.${await jt(t, n)}`;
931
+ return `${n}.${await yt(t, n)}`;
968
932
  };
969
933
  //#endregion
970
- export { A as AMPLITUDE_FEATURE_SELECTOR, O as AutoReloadOnNewVersion, _ as ChatClient, U as ChatContext, ve as ChatProvider, _t as DEFAULT_OPERATOR_HOURS_PER_DAY, k as GTMSendPageView, M as InitializeAmplitude, F as InitializeAxiosConfig, ae as InitializeDaysJSConfig, oe as InitializeHubSpot, se as InitializeI18nConfig, ue as InitializeSentryConfig, y as InjectDependenciesContext, b as InjectDependenciesProvider, vt as MAX_OPERATOR_HOURS_PER_DAY, v as MaskTextField, wt as PAGE_DURATION_CAP_MS, Tt as PAGE_DURATION_MIN_MS, Ct as PAGE_LEFT_EVENT, Ce as QueryProvider, fe as RequireAuth, z as SENTRY_IGNORED_REQUEST_URLS, ce as SENTRY_KEEP_REPLAY, re as SUPPORTED_LANGUAGE, pe as ShowHubSpotBubble, et as articleNameAdapter, Et as createVisibleStopwatch, G as dateAdapter, At as decodeToken, K as distanceAdapter, Mt as encodeToken, Z as findOperatorItem, J as getCurrentLanguage, xt as getOperatorHoursPerDay, e as getOrvalConfig, bt as getUnitCount, Q as isHourlyLine, yt as isOperatorArticle, St as isOperatorRateMissing, le as isReplayKeptForError, mt as lazyWithRetry, B as matchesRequestUrl, Dt as pageLeftProperties, W as shouldRetryQuery, Ee as useAdapter, De as useAmplitude, Oe as useAuth, je as useChat, Me as useCurrentLanguage, Re as useFilters, Be as useHubSpot, Ve as useInfiniteDataGrid, He as useResponseError, q as worksiteNameAdapter };
934
+ export { ae as AMPLITUDE_FEATURE_SELECTOR, re as AutoReloadOnNewVersion, ee as ChatClient, G as ChatContext, Ee as ChatProvider, c as DEFAULT_OPERATOR_HOURS_PER_DAY, ie as GTMSendPageView, ue as InitializeAmplitude, fe as InitializeAxiosConfig, he as InitializeDaysJSConfig, ge as InitializeHubSpot, _e as InitializeI18nConfig, ve as InitializeSentryConfig, O as InjectDependenciesContext, k as InjectDependenciesProvider, i as MAX_OPERATOR_HOURS_PER_DAY, D as MaskTextField, ft as PAGE_DURATION_CAP_MS, pt as PAGE_DURATION_MIN_MS, dt as PAGE_LEFT_EVENT, je as QueryProvider, be as RequireAuth, V as SENTRY_IGNORED_REQUEST_URLS, z as SENTRY_KEEP_REPLAY, pe as SUPPORTED_LANGUAGE, xe as ShowHubSpotBubble, l as articleNameAdapter, mt as createVisibleStopwatch, q as dateAdapter, vt as decodeToken, J as distanceAdapter, bt as encodeToken, o as findOperatorItem, Y as getCurrentLanguage, n as getOperatorHoursPerDay, u as getOrvalConfig, e as getUnitCount, a as isHourlyLine, s as isOperatorArticle, t as isOperatorRateMissing, r as isOrderedByTheHour, B as isReplayKeptForError, ut as lazyWithRetry, H as matchesRequestUrl, ht as pageLeftProperties, K as shouldRetryQuery, Fe as useAdapter, Ie as useAmplitude, Le as useAuth, Be as useChat, Ve as useCurrentLanguage, qe as useFilters, Ye as useHubSpot, Xe as useInfiniteDataGrid, Ze as useResponseError, Me as worksiteNameAdapter };