@getsoren/shared-module 2.63.2 → 2.64.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/README.md
CHANGED
|
@@ -211,8 +211,9 @@ input: "./openapi.json"
|
|
|
211
211
|
| resolveOrvalInput | Standalone schema target resolution (local file → local → upstream) |
|
|
212
212
|
|
|
213
213
|
## Utils function
|
|
214
|
-
| Module | Description
|
|
215
|
-
|
|
216
|
-
|
|
|
217
|
-
|
|
|
218
|
-
|
|
|
214
|
+
| Module | Description |
|
|
215
|
+
|---------------------|-----------------------------------------------------------------------------|
|
|
216
|
+
| articleNameAdapter | Split an article's name from its mention of the driver, for a tag to say it |
|
|
217
|
+
| dateAdapter | Adapt given date |
|
|
218
|
+
| distanceAdapter | Adapt given distance |
|
|
219
|
+
| worksiteNameAdapter | Adapt worksite name |
|
package/dist/main.d.ts
CHANGED
|
@@ -47,6 +47,8 @@ export { default as useInfiniteDataGrid } from './hooks/useInfiniteDataGrid';
|
|
|
47
47
|
export * from './hooks/useResponseError/useResponseError';
|
|
48
48
|
export { default as useResponseError } from './hooks/useResponseError/useResponseError';
|
|
49
49
|
export { default as getOrvalConfig } from './orval/orval';
|
|
50
|
+
export * from './utils/adapter/articleNameAdapter/articleNameAdapter';
|
|
51
|
+
export { default as articleNameAdapter } from './utils/adapter/articleNameAdapter/articleNameAdapter';
|
|
50
52
|
export { default as dateAdapter } from './utils/adapter/dateAdapter';
|
|
51
53
|
export { default as distanceAdapter } from './utils/adapter/distanceAdapter';
|
|
52
54
|
export { default as worksiteNameAdapter } from './utils/adapter/worksiteNameAdapter/worksiteNameAdapter';
|
package/dist/main.js
CHANGED
|
@@ -129,17 +129,17 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
129
129
|
value: i,
|
|
130
130
|
children: e
|
|
131
131
|
});
|
|
132
|
-
}, x = 900 * 1e3, S = 60 * 1e3, C = 600 * 1e3, w = "auto-reload-on-new-version-timestamp",
|
|
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
133
|
try {
|
|
134
134
|
return sessionStorage.getItem(e);
|
|
135
135
|
} catch {
|
|
136
136
|
return null;
|
|
137
137
|
}
|
|
138
|
-
},
|
|
138
|
+
}, D = (e, t) => {
|
|
139
139
|
try {
|
|
140
140
|
sessionStorage.setItem(e, t);
|
|
141
141
|
} catch {}
|
|
142
|
-
},
|
|
142
|
+
}, O = ({ version: e, checkInterval: t = x, children: n, ...r }) => {
|
|
143
143
|
let { libraries: i } = a(y), s = r?.reactRouter || i?.reactRouter, c = l(!1), u = l(0);
|
|
144
144
|
if (!s) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of AutoReloadOnNewVersion.");
|
|
145
145
|
let { useLocation: f, Outlet: p } = s, { pathname: m } = f(), h = l(m);
|
|
@@ -151,7 +151,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
151
151
|
try {
|
|
152
152
|
let t = await fetch("/index.html", { cache: "no-store" });
|
|
153
153
|
if (!t.ok) return;
|
|
154
|
-
let n = (await t.text()).match(
|
|
154
|
+
let n = (await t.text()).match(T)?.[1];
|
|
155
155
|
n && n !== "%VERSION%" && n !== e && (c.current = !0);
|
|
156
156
|
} catch {}
|
|
157
157
|
}
|
|
@@ -164,10 +164,10 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
164
164
|
}, [e, t]), o(() => {
|
|
165
165
|
if (m === h.current || (h.current = m, !c.current)) return;
|
|
166
166
|
c.current = !1;
|
|
167
|
-
let e = Number(
|
|
168
|
-
Date.now() - e < C || (
|
|
167
|
+
let e = Number(E(w) || "0");
|
|
168
|
+
Date.now() - e < C || (D(w, String(Date.now())), window.location.reload());
|
|
169
169
|
}, [m]), n ?? /* @__PURE__ */ d(p, {});
|
|
170
|
-
},
|
|
170
|
+
}, k = ({ data: e, ...t }) => {
|
|
171
171
|
let { libraries: n } = a(y), r = t?.reactRouter || n?.reactRouter, i = t?.gtm || n?.gtm;
|
|
172
172
|
if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
|
|
173
173
|
if (!i) throw Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
|
|
@@ -183,7 +183,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
183
183
|
u,
|
|
184
184
|
f
|
|
185
185
|
]), /* @__PURE__ */ d(l, {});
|
|
186
|
-
},
|
|
186
|
+
}, A = "[data-amp-track-feature]", j = [
|
|
187
187
|
"a",
|
|
188
188
|
"button",
|
|
189
189
|
"input",
|
|
@@ -195,18 +195,18 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
195
195
|
"[contenteditable=\"true\" i]",
|
|
196
196
|
"[data-amp-default-track]",
|
|
197
197
|
".amp-default-track"
|
|
198
|
-
],
|
|
198
|
+
], ee = { defaultMaskLevel: "medium" }, te = (e, t) => {
|
|
199
199
|
if (e === !1) return !1;
|
|
200
200
|
let n = e === !0 ? {} : e;
|
|
201
201
|
return {
|
|
202
|
-
cssSelectorAllowlist: [...t,
|
|
202
|
+
cssSelectorAllowlist: [...t, A],
|
|
203
203
|
...n
|
|
204
204
|
};
|
|
205
205
|
}, M = (e, t) => !t || e === !1 ? !1 : {
|
|
206
206
|
deadClicks: !0,
|
|
207
207
|
rageClicks: !0,
|
|
208
208
|
...e === !0 ? {} : e
|
|
209
|
-
}, N = ({ apiKey: e, appVersion: t, sessionReplaySampleRate: n, serverZone: r, elementInteractions: i = !0, frustrationInteractions: c = !0, platform: d = "desktop", sessionReplayPrivacy: f =
|
|
209
|
+
}, N = ({ apiKey: e, appVersion: t, sessionReplaySampleRate: n, serverZone: r, elementInteractions: i = !0, frustrationInteractions: c = !0, platform: d = "desktop", sessionReplayPrivacy: f = ee, userId: p, ...m }) => {
|
|
210
210
|
let [h, g] = u(!!p), { libraries: _ } = a(y), v = m.amplitude || _?.amplitude, b = l({
|
|
211
211
|
elementInteractions: i,
|
|
212
212
|
frustrationInteractions: c,
|
|
@@ -221,7 +221,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
221
221
|
}), o(() => {
|
|
222
222
|
let i = v?.analytics, a = v?.sessionReplayPlugin;
|
|
223
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 =
|
|
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
225
|
return i.init(e, l, {
|
|
226
226
|
appVersion: t,
|
|
227
227
|
autocapture: {
|
|
@@ -285,7 +285,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
285
285
|
o && (l.defaults.headers.common.Authorization = o);
|
|
286
286
|
}
|
|
287
287
|
return l.defaults.baseURL = i, l.defaults.headers.post["Content-Type"] = n, null;
|
|
288
|
-
},
|
|
288
|
+
}, F = [
|
|
289
289
|
"ar",
|
|
290
290
|
"de",
|
|
291
291
|
"en",
|
|
@@ -293,15 +293,15 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
293
293
|
"fr",
|
|
294
294
|
"it",
|
|
295
295
|
"pt"
|
|
296
|
-
],
|
|
296
|
+
], ie = (e) => F.includes(e), ae = ({ language: e, ...t }) => {
|
|
297
297
|
let { libraries: n } = a(y), r = t?.dayjs || n?.dayjs, i = t?.plugin || n?.dayjsPlugin;
|
|
298
298
|
if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");
|
|
299
299
|
r.extend(t.localizedFormat), i && i.forEach((e) => {
|
|
300
300
|
e && r.extend(e);
|
|
301
301
|
});
|
|
302
|
-
let o = e || navigator.language?.slice(0, 2) || "en", s =
|
|
302
|
+
let o = e || navigator.language?.slice(0, 2) || "en", s = ie(o) ? o : "en";
|
|
303
303
|
return r.locale() !== s && r.locale(s), null;
|
|
304
|
-
},
|
|
304
|
+
}, I = "hubspot-messages-iframe-container", L = "hs-show", R = "data-hs-hidden", oe = ({ hubId: e }) => (o(() => {
|
|
305
305
|
if (!e) return;
|
|
306
306
|
let t = document.createElement("script");
|
|
307
307
|
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), () => {
|
|
@@ -310,12 +310,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
310
310
|
}, [e]), o(() => {
|
|
311
311
|
let e = document.createElement("style");
|
|
312
312
|
return e.textContent = `
|
|
313
|
-
html[${
|
|
314
|
-
html[${
|
|
315
|
-
`, document.head.appendChild(e), document.documentElement.setAttribute(
|
|
316
|
-
e.remove(), document.documentElement.removeAttribute(
|
|
313
|
+
html[${R}] div#${I} { display: none !important; }
|
|
314
|
+
html[${R}] div#${I}.${L} { display: initial !important; }
|
|
315
|
+
`, document.head.appendChild(e), document.documentElement.setAttribute(R, ""), () => {
|
|
316
|
+
e.remove(), document.documentElement.removeAttribute(R);
|
|
317
317
|
};
|
|
318
|
-
}, []), null),
|
|
318
|
+
}, []), null), se = ({ debug: e, resources: t, ...n }) => {
|
|
319
319
|
let { libraries: r } = a(y), i = n?.i18 || r?.i18, { i18next: o, initReactI18next: s, languageDetector: c } = i || {};
|
|
320
320
|
if (P) return null;
|
|
321
321
|
if (!(i && o && c && s)) throw Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
@@ -335,12 +335,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
335
335
|
}), o.on("languageChanged", (e) => {
|
|
336
336
|
document.documentElement.setAttribute("lang", e);
|
|
337
337
|
}), null);
|
|
338
|
-
},
|
|
338
|
+
}, 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)), ce = ({ 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 = B, ...m }) => {
|
|
339
339
|
let { libraries: h } = a(y), g = m?.sentry || h?.sentry, _ = m?.reactRouter || h?.reactRouter;
|
|
340
340
|
if (!g) throw Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
341
341
|
if (!_) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
342
342
|
if (g.isInitialized()) return null;
|
|
343
|
-
let { createRoutesFromChildren: v, matchRoutes: b, useLocation: x, useNavigationType: S } = _, C = d > 0 || f > 0, w = [...s || [], ...
|
|
343
|
+
let { createRoutesFromChildren: v, matchRoutes: b, useLocation: x, useNavigationType: S } = _, C = d > 0 || f > 0, w = [...s || [], ...V];
|
|
344
344
|
return (c || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && g.init({
|
|
345
345
|
debug: c,
|
|
346
346
|
dsn: e,
|
|
@@ -358,7 +358,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
358
358
|
g.reactRouterV6BrowserTracingIntegration({
|
|
359
359
|
createRoutesFromChildren: v,
|
|
360
360
|
matchRoutes: b,
|
|
361
|
-
shouldCreateSpanForRequest: (e) => !
|
|
361
|
+
shouldCreateSpanForRequest: (e) => !H(e, w),
|
|
362
362
|
useEffect: o,
|
|
363
363
|
useLocation: x,
|
|
364
364
|
useNavigationType: S
|
|
@@ -372,12 +372,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
372
372
|
tracePropagationTargets: r,
|
|
373
373
|
tracesSampleRate: n ?? 1
|
|
374
374
|
}), null;
|
|
375
|
-
},
|
|
376
|
-
let { libraries: c, localStorageKeys: l } = a(y), f = s?.reactRouter || c?.reactRouter, p = s?.axios || c?.axios, m = s?.localStorageKey || l?.user ||
|
|
375
|
+
}, U = /* @__PURE__ */ new WeakMap(), le = "user", ue = ({ 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 || le;
|
|
377
377
|
if (!f) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
378
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
379
|
return o(() => {
|
|
380
|
-
p && (
|
|
380
|
+
p && (U.has(p) || (U.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)))));
|
|
381
381
|
}, [
|
|
382
382
|
p,
|
|
383
383
|
m,
|
|
@@ -393,34 +393,34 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
393
393
|
state: { from: x },
|
|
394
394
|
replace: !0
|
|
395
395
|
});
|
|
396
|
-
},
|
|
396
|
+
}, W = /* @__PURE__ */ new Set(), de = () => (o(() => {
|
|
397
397
|
let e = Symbol();
|
|
398
|
-
return
|
|
399
|
-
|
|
398
|
+
return W.add(e), document.documentElement.removeAttribute(R), () => {
|
|
399
|
+
W.delete(e), W.size === 0 && document.documentElement.setAttribute(R, "");
|
|
400
400
|
};
|
|
401
|
-
}, []), null),
|
|
401
|
+
}, []), null), fe = "user", pe = {
|
|
402
402
|
client: "/v2/threads/ws",
|
|
403
403
|
supplier: "/v1/threads/ws"
|
|
404
|
-
},
|
|
404
|
+
}, me = (e, t) => `${e.startsWith("https") ? "wss" : "ws"}://${e.replace(/^https?:\/\//, "")}${t}`, he = (e) => {
|
|
405
405
|
try {
|
|
406
406
|
let t = localStorage.getItem(e);
|
|
407
407
|
return t ? JSON.parse(t)?.accessToken ?? null : null;
|
|
408
408
|
} catch {
|
|
409
409
|
return null;
|
|
410
410
|
}
|
|
411
|
-
},
|
|
412
|
-
let [g, v] = u(!1), [b, x] = u(!1), [S, C] = u(0), [w,
|
|
411
|
+
}, G = n(null), ge = ({ 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 || fe, A = l(null), j = l(/* @__PURE__ */ new Set());
|
|
413
413
|
o(() => {
|
|
414
|
-
if (!
|
|
415
|
-
let e = r ??
|
|
414
|
+
if (!E) return;
|
|
415
|
+
let e = r ?? pe[h], i = n || (D ? me(D, e) : null);
|
|
416
416
|
if (!i) return;
|
|
417
|
-
let a = () => t ??
|
|
417
|
+
let a = () => t ?? he(k), o = (e) => {
|
|
418
418
|
switch (e.type) {
|
|
419
419
|
case "ready":
|
|
420
420
|
x(!0), C(e.unreadCount ?? 0);
|
|
421
421
|
break;
|
|
422
422
|
}
|
|
423
|
-
for (let t of
|
|
423
|
+
for (let t of j.current) t(e);
|
|
424
424
|
}, l = setTimeout(() => {
|
|
425
425
|
let e = new _({
|
|
426
426
|
getToken: a,
|
|
@@ -434,34 +434,34 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
434
434
|
reconnectBaseDelay: c,
|
|
435
435
|
url: i
|
|
436
436
|
});
|
|
437
|
-
|
|
437
|
+
A.current = e, e.connect();
|
|
438
438
|
}, 0);
|
|
439
439
|
return () => {
|
|
440
|
-
clearTimeout(l),
|
|
440
|
+
clearTimeout(l), A.current?.disconnect(), A.current = null;
|
|
441
441
|
};
|
|
442
442
|
}, [
|
|
443
|
-
|
|
443
|
+
E,
|
|
444
444
|
n,
|
|
445
445
|
r,
|
|
446
446
|
h,
|
|
447
447
|
t,
|
|
448
448
|
p,
|
|
449
|
-
|
|
450
|
-
|
|
449
|
+
D,
|
|
450
|
+
k,
|
|
451
451
|
f,
|
|
452
452
|
s,
|
|
453
453
|
c
|
|
454
454
|
]);
|
|
455
|
-
let
|
|
456
|
-
|
|
457
|
-
}, []),
|
|
458
|
-
|
|
455
|
+
let ee = i((e) => {
|
|
456
|
+
A.current?.joinThread(e);
|
|
457
|
+
}, []), te = i((e) => {
|
|
458
|
+
A.current?.leaveThread(e);
|
|
459
459
|
}, []), M = i((e, t) => {
|
|
460
|
-
|
|
460
|
+
A.current?.sendMessage(e, t);
|
|
461
461
|
}, []), N = i((e) => {
|
|
462
|
-
|
|
462
|
+
A.current?.markRead(e);
|
|
463
463
|
}, []), P = i((e, t) => {
|
|
464
|
-
|
|
464
|
+
A.current?.listThreads(e, t);
|
|
465
465
|
}, []), ne = i((e = 1) => {
|
|
466
466
|
C((t) => t + e);
|
|
467
467
|
}, []), re = {
|
|
@@ -469,45 +469,45 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
469
469
|
C((t) => Math.max(0, t - e));
|
|
470
470
|
}, []),
|
|
471
471
|
disconnect: i(() => {
|
|
472
|
-
|
|
472
|
+
A.current?.disconnect(), A.current = null;
|
|
473
473
|
}, []),
|
|
474
474
|
incrementUnreadCount: ne,
|
|
475
475
|
isConnected: g,
|
|
476
476
|
isReady: b,
|
|
477
|
-
joinThread:
|
|
478
|
-
leaveThread:
|
|
477
|
+
joinThread: ee,
|
|
478
|
+
leaveThread: te,
|
|
479
479
|
listThreads: P,
|
|
480
480
|
markRead: N,
|
|
481
481
|
sendMessage: M,
|
|
482
482
|
setEnabled: i((e) => {
|
|
483
|
-
|
|
483
|
+
T(e);
|
|
484
484
|
}, []),
|
|
485
|
-
subscribe: i((e) => (
|
|
486
|
-
|
|
485
|
+
subscribe: i((e) => (j.current.add(e), () => {
|
|
486
|
+
j.current.delete(e);
|
|
487
487
|
}), []),
|
|
488
488
|
unreadCount: S
|
|
489
489
|
};
|
|
490
|
-
return /* @__PURE__ */ d(
|
|
490
|
+
return /* @__PURE__ */ d(G.Provider, {
|
|
491
491
|
value: re,
|
|
492
492
|
children: e
|
|
493
493
|
});
|
|
494
|
-
},
|
|
494
|
+
}, _e = 3, ve = new Set([
|
|
495
495
|
400,
|
|
496
496
|
401,
|
|
497
497
|
403,
|
|
498
498
|
404
|
|
499
|
-
]),
|
|
500
|
-
let n =
|
|
501
|
-
return e <
|
|
502
|
-
},
|
|
499
|
+
]), ye = (e) => e?.response?.status, K = (e, t) => {
|
|
500
|
+
let n = ye(t);
|
|
501
|
+
return e < _e && !(n !== void 0 && ve.has(n));
|
|
502
|
+
}, be = (e, t, n) => (Array.isArray(e) ? e.length : 0) + (typeof n == "number" ? n : 0), xe = ({ children: e, defaultQueriesOptions: t, defaultMutationsOptions: n, ...r }) => {
|
|
503
503
|
let { libraries: i } = a(y), o = r.QueryClient || i?.reactQuery?.QueryClient, s = r.QueryClientProvider || i?.reactQuery?.QueryClientProvider;
|
|
504
504
|
if (!o) throw Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
505
505
|
if (!s) throw Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
506
506
|
let [c] = u(() => new o({ defaultOptions: {
|
|
507
507
|
mutations: n,
|
|
508
508
|
queries: {
|
|
509
|
-
getNextPageParam:
|
|
510
|
-
retry:
|
|
509
|
+
getNextPageParam: be,
|
|
510
|
+
retry: K,
|
|
511
511
|
...t
|
|
512
512
|
}
|
|
513
513
|
} }));
|
|
@@ -515,17 +515,17 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
515
515
|
client: c,
|
|
516
516
|
children: e
|
|
517
517
|
});
|
|
518
|
-
},
|
|
518
|
+
}, q = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), J = (e, t) => {
|
|
519
519
|
let { fractionDigits: n = 0, metric: r = "km", spacingBetween: i = !0 } = t || {}, a = Number(e), o = i ? " " : "";
|
|
520
520
|
return Number.isNaN(a) ? `0${o}${r}` : `${a.toFixed(n)}${o}${r}`;
|
|
521
|
-
},
|
|
521
|
+
}, Y = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((e) => e.length > 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" "), Se = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, Ce = ({ path: e, size: t, apiURL: n }) => {
|
|
522
522
|
if (!e) return "";
|
|
523
|
-
let r = `${n}${
|
|
523
|
+
let r = `${n}${Se(e)}`, i = r.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
|
|
524
524
|
return typeof t == "number" && i ? `${r.replace("/files", `/thumbs/${t}`)}` : r;
|
|
525
|
-
},
|
|
525
|
+
}, we = (e) => {
|
|
526
526
|
let { apiURL: t, libraries: n } = a(y), r = e?.dayjs || n?.dayjs, o = i((e, n) => {
|
|
527
527
|
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 :
|
|
528
|
+
return typeof e == "string" && /^https?:\/\//.test(e) ? e : Ce({
|
|
529
529
|
apiURL: t,
|
|
530
530
|
path: e,
|
|
531
531
|
size: n
|
|
@@ -534,17 +534,17 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
534
534
|
return {
|
|
535
535
|
dateAdapter: i((e, t) => {
|
|
536
536
|
if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
537
|
-
return
|
|
537
|
+
return q({
|
|
538
538
|
date: e,
|
|
539
539
|
format: t,
|
|
540
540
|
library: r
|
|
541
541
|
});
|
|
542
542
|
}, [r]),
|
|
543
|
-
distanceAdapter:
|
|
543
|
+
distanceAdapter: J,
|
|
544
544
|
filePathAdapter: o,
|
|
545
|
-
worksiteNameAdapter:
|
|
545
|
+
worksiteNameAdapter: Y
|
|
546
546
|
};
|
|
547
|
-
},
|
|
547
|
+
}, Te = () => {
|
|
548
548
|
let { libraries: e } = a(y), t = e?.amplitude?.analytics, n = i((e, n) => {
|
|
549
549
|
if (!t || (t.setUserId(e), !n)) return;
|
|
550
550
|
let r = new t.Identify();
|
|
@@ -568,7 +568,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
568
568
|
setGroup: r,
|
|
569
569
|
track: o
|
|
570
570
|
};
|
|
571
|
-
},
|
|
571
|
+
}, Ee = (e) => {
|
|
572
572
|
let { libraries: t, localStorageKeys: n } = a(y), r = e?.axios || t?.axios, s = e?.localStorageKey || n?.user || "user";
|
|
573
573
|
if (!r) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
|
|
574
574
|
let c = i(({ tokenType: e, accessToken: t }) => {
|
|
@@ -604,9 +604,9 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
604
604
|
clearAuthenticationToken: l,
|
|
605
605
|
setAuthenticationToken: c
|
|
606
606
|
};
|
|
607
|
-
},
|
|
607
|
+
}, De = "New message", Oe = (e, t) => {
|
|
608
608
|
if (!("Notification" in window) || typeof Notification != "function" || Notification.permission !== "granted" || !document.hidden) return;
|
|
609
|
-
let n = new Notification(t.title ??
|
|
609
|
+
let n = new Notification(t.title ?? De, {
|
|
610
610
|
badge: t?.badge,
|
|
611
611
|
body: t?.body || e.bodyPreview,
|
|
612
612
|
data: t?.data,
|
|
@@ -621,8 +621,8 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
621
621
|
let { onClick: r } = t;
|
|
622
622
|
n.onclick = () => r(e);
|
|
623
623
|
}
|
|
624
|
-
},
|
|
625
|
-
let t = a(
|
|
624
|
+
}, ke = (e) => {
|
|
625
|
+
let t = a(G);
|
|
626
626
|
if (!t) throw Error("useChat must be used within ChatProvider");
|
|
627
627
|
let { subscribe: n, setEnabled: r, ...i } = t, s = l(e);
|
|
628
628
|
return s.current = e, o(() => {
|
|
@@ -639,7 +639,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
639
639
|
r?.(e);
|
|
640
640
|
break;
|
|
641
641
|
case "new_message_notification":
|
|
642
|
-
i?.(e), t && t.enabled !== !1 &&
|
|
642
|
+
i?.(e), t && t.enabled !== !1 && Oe(e, t);
|
|
643
643
|
break;
|
|
644
644
|
case "presence":
|
|
645
645
|
a?.(e);
|
|
@@ -664,44 +664,44 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
664
664
|
break;
|
|
665
665
|
}
|
|
666
666
|
}), [n]), i;
|
|
667
|
-
},
|
|
667
|
+
}, X = (e, t = "full") => {
|
|
668
668
|
let n = e || navigator.language;
|
|
669
669
|
return t === "short" ? n.split("-")[0] : n;
|
|
670
|
-
},
|
|
671
|
-
let [n, r] = u(() =>
|
|
670
|
+
}, Ae = (e, t = "full") => {
|
|
671
|
+
let [n, r] = u(() => X(e?.language, t));
|
|
672
672
|
return o(() => {
|
|
673
|
-
e && "isInitialized" in e && e.isInitialized && e.language && r(
|
|
673
|
+
e && "isInitialized" in e && e.isInitialized && e.language && r(X(e.language, t));
|
|
674
674
|
let n = (e) => {
|
|
675
|
-
r(
|
|
675
|
+
r(X(e, t));
|
|
676
676
|
};
|
|
677
677
|
return e?.on?.("languageChanged", n), () => {
|
|
678
678
|
e?.off?.("languageChanged", n);
|
|
679
679
|
};
|
|
680
680
|
}, [e, t]), n;
|
|
681
|
-
},
|
|
681
|
+
}, je = "tracktor.filter", Me = {
|
|
682
682
|
getFilter: () => void 0,
|
|
683
683
|
getFilters: () => ({}),
|
|
684
684
|
handleFilter: () => () => {},
|
|
685
685
|
setFilter: () => {}
|
|
686
|
-
},
|
|
686
|
+
}, Ne = (e) => {
|
|
687
687
|
try {
|
|
688
688
|
return JSON.parse(e);
|
|
689
689
|
} catch {
|
|
690
690
|
return e;
|
|
691
691
|
}
|
|
692
|
-
},
|
|
692
|
+
}, Pe = (e, t, n) => `${n}_${e}=>${t}`, Fe = (e) => e.reduce((e, t) => {
|
|
693
693
|
let n = localStorage.getItem(t);
|
|
694
694
|
if (n) try {
|
|
695
695
|
let t = JSON.parse(n), r = Object.keys(t)?.[0];
|
|
696
696
|
r && (e[r] = Object.values(t)?.[0]);
|
|
697
697
|
} catch {}
|
|
698
698
|
return e;
|
|
699
|
-
}, {}),
|
|
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 ||
|
|
701
|
-
if (P) return
|
|
699
|
+
}, {}), Ie = (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 || je, f = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, p = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
|
|
701
|
+
if (P) return Me;
|
|
702
702
|
if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter.");
|
|
703
703
|
let m = () => Object.keys(localStorage).filter((t) => t.startsWith(d) && t.endsWith(e?.pathname || i)), h = (t, n, r = !0) => {
|
|
704
|
-
let a =
|
|
704
|
+
let a = Pe(t, e?.pathname || i, d);
|
|
705
705
|
if (!n || Array.isArray(n) && !n.length) {
|
|
706
706
|
f ? (o.delete(t), s(o)) : l((e) => {
|
|
707
707
|
let n = { ...e };
|
|
@@ -721,13 +721,13 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
721
721
|
getFilter: (t, n) => {
|
|
722
722
|
if (f) {
|
|
723
723
|
let e = o.get(t);
|
|
724
|
-
if (e) return
|
|
724
|
+
if (e) return Ne(e);
|
|
725
725
|
} else {
|
|
726
726
|
let e = c[t];
|
|
727
727
|
if (e !== void 0) return e;
|
|
728
728
|
}
|
|
729
729
|
if (p) {
|
|
730
|
-
let n =
|
|
730
|
+
let n = Pe(t, e?.pathname || i, d), r = localStorage.getItem(n);
|
|
731
731
|
if (r) try {
|
|
732
732
|
let e = JSON.parse(r)[t];
|
|
733
733
|
return !f && e !== void 0 && l((n) => ({
|
|
@@ -739,9 +739,9 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
739
739
|
return n;
|
|
740
740
|
},
|
|
741
741
|
getFilters: () => {
|
|
742
|
-
let e = p ?
|
|
742
|
+
let e = p ? Fe(m()) : {};
|
|
743
743
|
if (f) {
|
|
744
|
-
let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] =
|
|
744
|
+
let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] = Ne(n), e), {});
|
|
745
745
|
return {
|
|
746
746
|
...e,
|
|
747
747
|
...t
|
|
@@ -762,7 +762,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
762
762
|
},
|
|
763
763
|
setFilter: h
|
|
764
764
|
};
|
|
765
|
-
},
|
|
765
|
+
}, Le = () => document.getElementById(I), Re = () => {
|
|
766
766
|
let [e, t] = u(() => !!window.HubSpotConversations);
|
|
767
767
|
return o(() => {
|
|
768
768
|
if (window.HubSpotConversations) {
|
|
@@ -772,16 +772,16 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
772
772
|
window.hsConversationsOnReady = [() => t(!0)];
|
|
773
773
|
}, []), o(() => {
|
|
774
774
|
e && window.HubSpotConversations?.on("widgetClosed", () => {
|
|
775
|
-
|
|
775
|
+
Le()?.classList.remove(L);
|
|
776
776
|
});
|
|
777
777
|
}, [e]), {
|
|
778
778
|
isAvailable: e,
|
|
779
779
|
toggle: i(() => {
|
|
780
|
-
let e = window.HubSpotConversations, t =
|
|
781
|
-
e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(
|
|
780
|
+
let e = window.HubSpotConversations, t = Le();
|
|
781
|
+
e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(L)) : (t.classList.add(L), e.widget.open()));
|
|
782
782
|
}, [])
|
|
783
783
|
};
|
|
784
|
-
},
|
|
784
|
+
}, ze = ({ data: e, fetchNextPage: t, isFetchingNextPage: n, isInitialLoading: r, isLoading: a, enabled: o = !0 }) => {
|
|
785
785
|
let s = i(async (e) => {
|
|
786
786
|
n || !o || await t({ pageParam: e?.pageParam || e.visibleRowsCount });
|
|
787
787
|
}, [
|
|
@@ -797,7 +797,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
797
797
|
loadingVariant: r ? "skeleton" : "linear-progress",
|
|
798
798
|
rows: l
|
|
799
799
|
};
|
|
800
|
-
},
|
|
800
|
+
}, Be = (e) => {
|
|
801
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) => {
|
|
802
802
|
if (e && typeof e == "object" && "response" in e) {
|
|
803
803
|
let { response: t } = e || {};
|
|
@@ -821,38 +821,60 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
821
821
|
}, []),
|
|
822
822
|
printError: l
|
|
823
823
|
};
|
|
824
|
-
}, He = "
|
|
824
|
+
}, Ve = String.raw`(?:chauffeur|conducteur|op[ée]rateur|machiniste|driver|operator)`, He = String.raw`(?:(?:avec|with|incl(?:\.|uding|us)?|y\s+compris)\s+|\+\s*)(?:(?:un|une|le|la|son|sa|an?|the|its)\s+)?`, Ue = String.raw`(?:\s+(?:inclus|compris|included))?`, We = String.raw`(?:${He}${Ve}${Ue}|${Ve}\s+(?:inclus|compris|included))`, Ge = new RegExp(String.raw`\s*[[(]\s*${We}\s*[\])]`, "giu"), Ke = new RegExp(String.raw`(?:^|[\s,;:/|–—-])\s*${We}\s*$`, "iu"), qe = /[\s,;:/|–—-]+$/u, Je = (e, { readDriver: t = !0 } = {}) => {
|
|
825
|
+
if (typeof e != "string") return {
|
|
826
|
+
label: "",
|
|
827
|
+
withDriver: !1
|
|
828
|
+
};
|
|
829
|
+
if (!t) return {
|
|
830
|
+
label: e.trim(),
|
|
831
|
+
withDriver: !1
|
|
832
|
+
};
|
|
833
|
+
let n = e.normalize("NFC"), r = n.replace(Ge, "").replace(Ke, "");
|
|
834
|
+
if (r === n) return {
|
|
835
|
+
label: e.trim(),
|
|
836
|
+
withDriver: !1
|
|
837
|
+
};
|
|
838
|
+
let i = r.replace(qe, "").replace(/\s{2,}/g, " ").trim();
|
|
839
|
+
return i ? {
|
|
840
|
+
label: i,
|
|
841
|
+
withDriver: !0
|
|
842
|
+
} : {
|
|
843
|
+
label: e.trim(),
|
|
844
|
+
withDriver: !1
|
|
845
|
+
};
|
|
846
|
+
}, Ye = "chunk-reload-timestamp", Z = "chunk-reload", Xe = 1e4, Q = 2, Ze = !1;
|
|
825
847
|
if (!P && typeof window < "u") {
|
|
826
848
|
try {
|
|
827
849
|
let e = new URL(window.location.href);
|
|
828
|
-
e.searchParams.has(
|
|
850
|
+
e.searchParams.has(Z) && (Ze = !0, e.searchParams.delete(Z), window.history.replaceState(null, "", e.toString()));
|
|
829
851
|
} catch {}
|
|
830
852
|
window.addEventListener("vite:preloadError", (e) => {
|
|
831
853
|
e.preventDefault();
|
|
832
854
|
});
|
|
833
855
|
}
|
|
834
|
-
var
|
|
856
|
+
var Qe = (e) => {
|
|
835
857
|
if (!(e instanceof Error)) return !1;
|
|
836
858
|
let t = e.message.toLowerCase();
|
|
837
859
|
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";
|
|
838
|
-
},
|
|
860
|
+
}, $e = /import\s*\(\s*(['"])((\w+:(\/?\/?))?[^\s,]+)\1/, et = (e) => e.toString().match($e)?.[2] ?? null, tt = (e) => {
|
|
839
861
|
try {
|
|
840
862
|
return sessionStorage.getItem(e);
|
|
841
863
|
} catch {
|
|
842
864
|
return null;
|
|
843
865
|
}
|
|
844
|
-
},
|
|
866
|
+
}, nt = (e, t) => {
|
|
845
867
|
try {
|
|
846
868
|
sessionStorage.setItem(e, t);
|
|
847
869
|
} catch {}
|
|
848
|
-
},
|
|
849
|
-
for (let t = 0; t <
|
|
850
|
-
return await
|
|
870
|
+
}, rt = (e) => Function("url", "return import(url)")(e), it = async (e) => {
|
|
871
|
+
for (let t = 0; t < Q; t++) try {
|
|
872
|
+
return await rt(`${e}?t=${Date.now()}`);
|
|
851
873
|
} catch {
|
|
852
|
-
t <
|
|
874
|
+
t < Q - 1 && await new Promise((e) => setTimeout(e, 500 * 2 ** t));
|
|
853
875
|
}
|
|
854
|
-
throw Error(`Failed to import ${e} after ${
|
|
855
|
-
},
|
|
876
|
+
throw Error(`Failed to import ${e} after ${Q} retries`);
|
|
877
|
+
}, at = async () => {
|
|
856
878
|
try {
|
|
857
879
|
if (typeof navigator < "u" && "serviceWorker" in navigator) {
|
|
858
880
|
let e = await navigator.serviceWorker.getRegistrations();
|
|
@@ -863,28 +885,28 @@ var We = (e) => {
|
|
|
863
885
|
await Promise.all(e.map((e) => caches.delete(e)));
|
|
864
886
|
}
|
|
865
887
|
} catch {}
|
|
866
|
-
},
|
|
867
|
-
await
|
|
888
|
+
}, ot = async () => {
|
|
889
|
+
await at();
|
|
868
890
|
let e = new URL(window.location.href);
|
|
869
|
-
e.searchParams.set(
|
|
870
|
-
},
|
|
891
|
+
e.searchParams.set(Z, String(Date.now())), window.location.replace(e.toString());
|
|
892
|
+
}, st = (e) => e != null && e.default !== void 0, ct = (e) => r(async () => {
|
|
871
893
|
let t;
|
|
872
894
|
try {
|
|
873
895
|
let n = await e();
|
|
874
|
-
if (
|
|
896
|
+
if (st(n)) return n;
|
|
875
897
|
t = /* @__PURE__ */ Error("Module resolved without a valid default export");
|
|
876
898
|
} catch (e) {
|
|
877
899
|
t = e;
|
|
878
900
|
}
|
|
879
|
-
if (P || !
|
|
880
|
-
let n =
|
|
901
|
+
if (P || !Qe(t)) throw t;
|
|
902
|
+
let n = et(e);
|
|
881
903
|
if (n) try {
|
|
882
|
-
let e = await
|
|
883
|
-
if (
|
|
904
|
+
let e = await it(n);
|
|
905
|
+
if (st(e)) return e;
|
|
884
906
|
} catch {}
|
|
885
|
-
let r = Number(
|
|
886
|
-
return Date.now() - r <
|
|
887
|
-
}),
|
|
907
|
+
let r = Number(tt(Ye) || "0");
|
|
908
|
+
return Date.now() - r < Xe || Ze || (nt(Ye, String(Date.now())), await ot()), { default: () => null };
|
|
909
|
+
}), lt = "Page Left", ut = 1800 * 1e3, dt = 1e3, ft = (e, t = !0) => {
|
|
888
910
|
let n = 0, r = t ? e : null, i = !1, a = (e) => {
|
|
889
911
|
r !== null && (n += Math.max(0, e - r), r = null);
|
|
890
912
|
};
|
|
@@ -895,39 +917,39 @@ var We = (e) => {
|
|
|
895
917
|
resume: (e) => {
|
|
896
918
|
!i && r === null && (r = e);
|
|
897
919
|
},
|
|
898
|
-
stop: (e) => (i ||= (a(e), !0), Math.min(
|
|
920
|
+
stop: (e) => (i ||= (a(e), !0), Math.min(ut, Math.round(n)))
|
|
899
921
|
};
|
|
900
|
-
},
|
|
922
|
+
}, pt = (e, t) => t < 1e3 ? null : {
|
|
901
923
|
duration_ms: Math.round(t),
|
|
902
924
|
page_path: e
|
|
903
|
-
},
|
|
925
|
+
}, mt = (e) => {
|
|
904
926
|
if (typeof e != "object" || !e) return !1;
|
|
905
927
|
let { exp: t, sub: n, entity_id: r, scope: i } = e;
|
|
906
928
|
return typeof t == "number" && typeof n == "string" && typeof r == "number" && Array.isArray(i) && i.every((e) => typeof e == "string");
|
|
907
|
-
},
|
|
929
|
+
}, ht = (e) => {
|
|
908
930
|
let t = e.replace(/-/g, "+").replace(/_/g, "/"), n = t + "=".repeat((4 - t.length % 4) % 4);
|
|
909
931
|
return decodeURIComponent(Array.from(atob(n), (e) => `%${e.charCodeAt(0).toString(16).padStart(2, "0")}`).join(""));
|
|
910
|
-
},
|
|
932
|
+
}, gt = (e) => {
|
|
911
933
|
let t = e?.split(".")[1];
|
|
912
934
|
if (!t) return null;
|
|
913
935
|
try {
|
|
914
|
-
let e = JSON.parse(
|
|
915
|
-
return
|
|
936
|
+
let e = JSON.parse(ht(t));
|
|
937
|
+
return mt(e) ? e : null;
|
|
916
938
|
} catch {
|
|
917
939
|
return null;
|
|
918
940
|
}
|
|
919
|
-
}, $ = (e) => btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""),
|
|
941
|
+
}, $ = (e) => btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""), _t = async (e, t) => {
|
|
920
942
|
let n = new TextEncoder(), r = await crypto.subtle.importKey("raw", n.encode(e), {
|
|
921
943
|
hash: "SHA-256",
|
|
922
944
|
name: "HMAC"
|
|
923
945
|
}, !1, ["sign"]), i = await crypto.subtle.sign("HMAC", r, n.encode(t));
|
|
924
946
|
return $(String.fromCharCode(...new Uint8Array(i)));
|
|
925
|
-
},
|
|
947
|
+
}, vt = async (e, t) => {
|
|
926
948
|
let n = `${$(JSON.stringify({
|
|
927
949
|
alg: "HS256",
|
|
928
950
|
typ: "JWT"
|
|
929
951
|
}))}.${$(JSON.stringify(e))}`;
|
|
930
|
-
return `${n}.${await
|
|
952
|
+
return `${n}.${await _t(t, n)}`;
|
|
931
953
|
};
|
|
932
954
|
//#endregion
|
|
933
|
-
export {
|
|
955
|
+
export { A as AMPLITUDE_FEATURE_SELECTOR, O as AutoReloadOnNewVersion, _ as ChatClient, G as ChatContext, ge as ChatProvider, k as GTMSendPageView, N as InitializeAmplitude, re as InitializeAxiosConfig, ae as InitializeDaysJSConfig, oe as InitializeHubSpot, se as InitializeI18nConfig, ce as InitializeSentryConfig, y as InjectDependenciesContext, b as InjectDependenciesProvider, v as MaskTextField, ut as PAGE_DURATION_CAP_MS, dt as PAGE_DURATION_MIN_MS, lt as PAGE_LEFT_EVENT, xe as QueryProvider, ue as RequireAuth, V as SENTRY_IGNORED_REQUEST_URLS, z as SENTRY_KEEP_REPLAY, F as SUPPORTED_LANGUAGE, de as ShowHubSpotBubble, Je as articleNameAdapter, ft as createVisibleStopwatch, q as dateAdapter, gt as decodeToken, J as distanceAdapter, vt as encodeToken, X as getCurrentLanguage, e as getOrvalConfig, B as isReplayKeptForError, ct as lazyWithRetry, H as matchesRequestUrl, pt as pageLeftProperties, K as shouldRetryQuery, we as useAdapter, Te as useAmplitude, Ee as useAuth, ke as useChat, Ae as useCurrentLanguage, Ie as useFilters, Re as useHubSpot, ze as useInfiniteDataGrid, Be as useResponseError, Y as worksiteNameAdapter };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An article's name split from the mention of its driver.
|
|
3
|
+
*/
|
|
4
|
+
export interface ArticleName {
|
|
5
|
+
/**
|
|
6
|
+
* The name without the mention, to show beside a tag that says it instead.
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* The name said the machine comes with its driver.
|
|
11
|
+
*/
|
|
12
|
+
withDriver: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ArticleNameOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Off, the mention of the driver is left in the name, as written, and never read: where no tag would say it
|
|
17
|
+
* instead.
|
|
18
|
+
*/
|
|
19
|
+
readDriver?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Reads the mention of the driver a catalog or a supplier writes in an article's name ("Grue mobile 50T [avec
|
|
23
|
+
* chauffeur]", "Pelle 9-10 t - avec conducteur", "Crane (with an operator)"), so that a tag says it instead. A
|
|
24
|
+
* mention between brackets or parentheses is read anywhere; one without them only at the end of the name, where it
|
|
25
|
+
* cannot be part of it. "Sans chauffeur" and any other wording are left in the name.
|
|
26
|
+
*/
|
|
27
|
+
declare const articleNameAdapter: (name: unknown, { readDriver }?: ArticleNameOptions) => ArticleName;
|
|
28
|
+
export default articleNameAdapter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|