@getsoren/shared-module 2.46.2 → 2.47.1
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
|
@@ -57,6 +57,7 @@ export default App;
|
|
|
57
57
|
| InitializeMapBoxConfig | React Component | Initialize MapBox | mapbox-gl |
|
|
58
58
|
| InitializeDaysJSConfig | React Component | Initialize DayJS | dayjs |
|
|
59
59
|
| InitializeHubSpot | React Component | Initialize HubSpot chat widget | - |
|
|
60
|
+
| InitializeAmplitude | React Component | Initialize Amplitude (autocapture, session replay) | @amplitude/analytics-browser & plugin-session-replay |
|
|
60
61
|
| PreloadErrorHandler | React Component | his component is used to handle preload error. | dayjs |
|
|
61
62
|
|
|
62
63
|
## Hooks
|
|
@@ -70,6 +71,7 @@ export default App;
|
|
|
70
71
|
| useCurrentLanguage | This get the current language of app | - |
|
|
71
72
|
| useFilters | Hook to handle filter | - |
|
|
72
73
|
| useChat | Hook to consume the ChatProvider context (threads, messaging, presence) | ChatProvider |
|
|
74
|
+
| useAmplitude | Hook to track events, identify users and groups in Amplitude | InitializeAmplitude |
|
|
73
75
|
|
|
74
76
|
|
|
75
77
|
## WebSocket
|
|
@@ -168,8 +170,8 @@ export default defineConfig(config);
|
|
|
168
170
|
When `input` is an object, the OpenAPI schema target is resolved with the following priorities:
|
|
169
171
|
|
|
170
172
|
1. **Local file** (`./openapi.<name>.json`) — pulled schema snapshot
|
|
171
|
-
2. **Local service** (`https://<subdomain>.api.
|
|
172
|
-
3. **Upstream deployed service** (`https://<subdomain>.api.dev.
|
|
173
|
+
2. **Local service** (`https://<subdomain>.api.soren.test/openapi.json`) — docker compose back environment, probed via cURL
|
|
174
|
+
3. **Upstream deployed service** (`https://<subdomain>.api.dev.getsoren.ai/openapi.json`) — dev cluster, fallback
|
|
173
175
|
|
|
174
176
|
### Host
|
|
175
177
|
|
|
@@ -179,15 +181,15 @@ When `input` is an object, the OpenAPI schema target is resolved with the follow
|
|
|
179
181
|
|-------------------|----------------------------------------------------------|
|
|
180
182
|
| `overrideApiName` | `<host>` → generated folders `src/api/<host>/` |
|
|
181
183
|
| `localFile` | `./openapi.<host>.json` |
|
|
182
|
-
| `localUrl` | `https://<subdomain>.api.
|
|
183
|
-
| `upstreamUrl` | `https://<subdomain>.api.dev.
|
|
184
|
+
| `localUrl` | `https://<subdomain>.api.soren.test/openapi.json` |
|
|
185
|
+
| `upstreamUrl` | `https://<subdomain>.api.dev.getsoren.ai/openapi.json` |
|
|
184
186
|
|
|
185
187
|
The subdomain matches the host, except `saas` which is served on the `app` subdomain.
|
|
186
188
|
Every derived value can be overridden individually:
|
|
187
189
|
|
|
188
190
|
```typescript
|
|
189
191
|
// Target a specific environment
|
|
190
|
-
input: { host: "saas", upstreamUrl: "https://app.api.
|
|
192
|
+
input: { host: "saas", upstreamUrl: "https://app.api.stg.getsoren.ai/openapi.json" }
|
|
191
193
|
|
|
192
194
|
// Fully custom, without host
|
|
193
195
|
input: {
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import { SessionReplayOptions } from '@amplitude/plugin-session-replay-browser';
|
|
1
2
|
import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
|
|
2
|
-
|
|
3
|
+
import type * as amplitudeAnalytics from "@amplitude/analytics-browser";
|
|
4
|
+
type AutocaptureOptions = amplitudeAnalytics.Types.AutocaptureOptions;
|
|
5
|
+
type ElementInteractionsOptions = amplitudeAnalytics.Types.ElementInteractionsOptions;
|
|
6
|
+
type FrustrationInteractionsOptions = Exclude<NonNullable<AutocaptureOptions["frustrationInteractions"]>, boolean>;
|
|
7
|
+
/**
|
|
8
|
+
* CSS selector matching any element tagged with a feature id. Appended to the SDK default allowlist so a tagged
|
|
9
|
+
* `div`/`span` (e.g. a clickable MUI Card) is tracked even though it isn't a native interactive element.
|
|
10
|
+
*/
|
|
11
|
+
export declare const AMPLITUDE_FEATURE_SELECTOR = "[data-amp-track-feature]";
|
|
12
|
+
export interface InitializeAmplitudeProps {
|
|
3
13
|
/**
|
|
4
14
|
* Amplitude libraries. Pass `{ analytics, sessionReplayPlugin }` here or inject them via `InjectDependenciesProvider`.
|
|
5
15
|
*/
|
|
@@ -8,20 +18,51 @@ interface InitializeAmplitudeProps {
|
|
|
8
18
|
* Amplitude project API key. When absent the component is a no-op, so dev builds without a key stay silent.
|
|
9
19
|
*/
|
|
10
20
|
apiKey?: string;
|
|
21
|
+
/**
|
|
22
|
+
* App version (e.g. `package.json` version) sent as `version_name` on every event.
|
|
23
|
+
* Lets you split any chart by release and spot regressions after a deploy. Strongly recommended.
|
|
24
|
+
*/
|
|
25
|
+
appVersion?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Click / change autocapture (`[Amplitude] Element Clicked` / `Element Changed`), the data source for heatmaps and
|
|
28
|
+
* "feature usage" charts. Defaults to `true`. Pass `false` to opt out, or an options object to refine
|
|
29
|
+
* (`pageUrlExcludelist`, `cssSelectorAllowlist`, `shouldTrackEventResolver`...). Our `[data-amp-track-feature]`
|
|
30
|
+
* selector is always appended to the allowlist unless you provide your own `cssSelectorAllowlist`.
|
|
31
|
+
* Object values must be referentially stable (module constant / `useMemo`): they are effect deps and re-init the SDK.
|
|
32
|
+
*/
|
|
33
|
+
elementInteractions?: boolean | ElementInteractionsOptions;
|
|
34
|
+
/**
|
|
35
|
+
* Rage / dead click detection (`[Amplitude] Rage Click` / `Dead Click`). Low volume, high UX signal.
|
|
36
|
+
* Defaults to `true` (both enabled) whenever `elementInteractions` is enabled. Pass `false` to opt out.
|
|
37
|
+
*/
|
|
38
|
+
frustrationInteractions?: boolean | FrustrationInteractionsOptions;
|
|
11
39
|
/**
|
|
12
40
|
* Value injected as `platform` on every tracked event (e.g. "desktop", "supplier", "mobile"). Defaults to "desktop".
|
|
13
41
|
*/
|
|
14
42
|
platform?: string;
|
|
15
43
|
/**
|
|
16
|
-
*
|
|
44
|
+
* Amplitude data center hosting the project. Must match the project (US key on the EU endpoint sends nothing).
|
|
45
|
+
* Defaults to the SDK default ("US"). Applies to analytics events, remote config and session replay uploads.
|
|
46
|
+
*/
|
|
47
|
+
serverZone?: amplitudeAnalytics.Types.ServerZoneType;
|
|
48
|
+
/**
|
|
49
|
+
* Session replay privacy settings. Defaults to `{ defaultMaskLevel: "medium" }`: every input is masked, page text is
|
|
50
|
+
* captured. Tag elements with the SDK classes `amp-mask` / `amp-unmask` / `amp-block` for per-element control.
|
|
51
|
+
*/
|
|
52
|
+
sessionReplayPrivacy?: SessionReplayOptions["privacyConfig"];
|
|
53
|
+
/**
|
|
54
|
+
* Fixed session replay sample rate between 0 and 1. Leave `undefined` (default) to let Amplitude drive the rate
|
|
55
|
+
* remotely, which is required for Dynamic Sampling (Amplitude > Settings > Session Replay). Setting a value here
|
|
56
|
+
* overrides the remote rate for this app and disables Dynamic Sampling org-wide.
|
|
17
57
|
*/
|
|
18
58
|
sessionReplaySampleRate?: number;
|
|
19
59
|
}
|
|
20
60
|
/**
|
|
21
61
|
* Initializes the Amplitude SDK once at mount:
|
|
22
|
-
* -
|
|
23
|
-
* -
|
|
62
|
+
* - enables click autocapture (with our feature selector) and rage/dead click detection, the data behind heatmaps,
|
|
63
|
+
* - tracks SPA page views on path changes only (query-string churn from filters doesn't count as a new view),
|
|
64
|
+
* - registers the session replay plugin, remote-controlled sample rate by default (Dynamic Sampling ready),
|
|
24
65
|
* - registers an enrichment plugin that adds `platform` to every event's properties.
|
|
25
66
|
*/
|
|
26
|
-
declare const InitializeAmplitude: ({ apiKey, platform, sessionReplaySampleRate, ...props }: InitializeAmplitudeProps) => null;
|
|
67
|
+
declare const InitializeAmplitude: ({ apiKey, appVersion, elementInteractions, frustrationInteractions, platform, serverZone, sessionReplayPrivacy, sessionReplaySampleRate, ...props }: InitializeAmplitudeProps) => null;
|
|
27
68
|
export default InitializeAmplitude;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/main.js
CHANGED
|
@@ -129,17 +129,17 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
129
129
|
value: i,
|
|
130
130
|
children: e
|
|
131
131
|
});
|
|
132
|
-
}, b = 900 * 1e3, x = 60 * 1e3, S = 600 * 1e3, C = "auto-reload-on-new-version-timestamp", w = /<meta[^>]*name="version"[^>]*content="([^"]*)"/,
|
|
132
|
+
}, b = 900 * 1e3, x = 60 * 1e3, S = 600 * 1e3, C = "auto-reload-on-new-version-timestamp", w = /<meta[^>]*name="version"[^>]*content="([^"]*)"/, ee = (e) => {
|
|
133
133
|
try {
|
|
134
134
|
return sessionStorage.getItem(e);
|
|
135
135
|
} catch {
|
|
136
136
|
return null;
|
|
137
137
|
}
|
|
138
|
-
},
|
|
138
|
+
}, T = (e, t) => {
|
|
139
139
|
try {
|
|
140
140
|
sessionStorage.setItem(e, t);
|
|
141
141
|
} catch {}
|
|
142
|
-
},
|
|
142
|
+
}, E = ({ version: e, checkInterval: t = b, children: n, ...r }) => {
|
|
143
143
|
let { libraries: i } = a(v), s = r?.reactRouter || i?.reactRouter, l = c(!1), d = c(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 = c(m);
|
|
@@ -164,10 +164,10 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
164
164
|
}, [e, t]), o(() => {
|
|
165
165
|
if (m === h.current || (h.current = m, !l.current)) return;
|
|
166
166
|
l.current = !1;
|
|
167
|
-
let e = Number(
|
|
168
|
-
Date.now() - e < S || (
|
|
167
|
+
let e = Number(ee(C) || "0");
|
|
168
|
+
Date.now() - e < S || (T(C, String(Date.now())), window.location.reload());
|
|
169
169
|
}, [m]), n ?? /* @__PURE__ */ u(p, {});
|
|
170
|
-
},
|
|
170
|
+
}, D = ({ data: e, ...t }) => {
|
|
171
171
|
let { libraries: n } = a(v), 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,47 +183,86 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
183
183
|
d,
|
|
184
184
|
f
|
|
185
185
|
]), /* @__PURE__ */ u(l, {});
|
|
186
|
-
},
|
|
187
|
-
|
|
186
|
+
}, O = "[data-amp-track-feature]", k = [
|
|
187
|
+
"a",
|
|
188
|
+
"button",
|
|
189
|
+
"input",
|
|
190
|
+
"select",
|
|
191
|
+
"textarea",
|
|
192
|
+
"label",
|
|
193
|
+
"video",
|
|
194
|
+
"audio",
|
|
195
|
+
"[contenteditable=\"true\" i]",
|
|
196
|
+
"[data-amp-default-track]",
|
|
197
|
+
".amp-default-track"
|
|
198
|
+
], A = { defaultMaskLevel: "medium" }, j = (e, t) => {
|
|
199
|
+
if (e === !1) return !1;
|
|
200
|
+
let n = e === !0 ? {} : e;
|
|
201
|
+
return {
|
|
202
|
+
cssSelectorAllowlist: [...t, O],
|
|
203
|
+
...n
|
|
204
|
+
};
|
|
205
|
+
}, M = (e, t) => !t || e === !1 ? !1 : {
|
|
206
|
+
deadClicks: !0,
|
|
207
|
+
rageClicks: !0,
|
|
208
|
+
...e === !0 ? {} : e
|
|
209
|
+
}, N = ({ apiKey: e, appVersion: t, elementInteractions: n = !0, frustrationInteractions: r = !0, platform: i = "desktop", serverZone: s, sessionReplayPrivacy: c = A, sessionReplaySampleRate: l, ...u }) => {
|
|
210
|
+
let { libraries: d } = a(v), f = u.amplitude || d?.amplitude;
|
|
188
211
|
return o(() => {
|
|
189
|
-
let
|
|
190
|
-
if (!(e &&
|
|
191
|
-
let
|
|
192
|
-
return
|
|
212
|
+
let a = f?.analytics, o = f?.sessionReplayPlugin;
|
|
213
|
+
if (!(e && a)) return;
|
|
214
|
+
let u = "platform-enrichment", d = j(n, a.Types?.DEFAULT_CSS_SELECTOR_ALLOWLIST ?? k);
|
|
215
|
+
return a.init(e, {
|
|
216
|
+
appVersion: t,
|
|
217
|
+
autocapture: {
|
|
218
|
+
elementInteractions: d,
|
|
219
|
+
frustrationInteractions: M(r, d !== !1),
|
|
220
|
+
pageViews: { trackHistoryChanges: "pathOnly" }
|
|
221
|
+
},
|
|
222
|
+
serverZone: s
|
|
223
|
+
}), o && a.add(o({
|
|
224
|
+
privacyConfig: c,
|
|
225
|
+
...l === void 0 ? {} : { sampleRate: l }
|
|
226
|
+
})), a.add({
|
|
193
227
|
execute: async (e) => ({
|
|
194
228
|
...e,
|
|
195
229
|
event_properties: {
|
|
196
230
|
...e.event_properties,
|
|
197
|
-
platform:
|
|
231
|
+
platform: i
|
|
198
232
|
}
|
|
199
233
|
}),
|
|
200
|
-
name:
|
|
234
|
+
name: u,
|
|
201
235
|
type: "enrichment"
|
|
202
236
|
}), () => {
|
|
203
|
-
|
|
237
|
+
o && a.remove("@amplitude/plugin-session-replay-browser"), a.remove(u);
|
|
204
238
|
};
|
|
205
239
|
}, [
|
|
206
240
|
e,
|
|
207
|
-
|
|
241
|
+
f,
|
|
208
242
|
t,
|
|
209
|
-
n
|
|
243
|
+
n,
|
|
244
|
+
r,
|
|
245
|
+
i,
|
|
246
|
+
s,
|
|
247
|
+
c,
|
|
248
|
+
l
|
|
210
249
|
]), null;
|
|
211
|
-
},
|
|
250
|
+
}, P = (() => {
|
|
212
251
|
try {
|
|
213
252
|
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;
|
|
214
253
|
} catch {
|
|
215
254
|
return !1;
|
|
216
255
|
}
|
|
217
|
-
})(),
|
|
218
|
-
let { apiURL: i = r.apiURL, libraries: o, localStorageKeys: s } = a(v), c = r?.userLocalStorageKey || s?.user ||
|
|
256
|
+
})(), F = "user", I = ({ tokenTypeKey: e = "tokenType", tokenKey: t = "accessToken", postContentType: n = "application/json", ...r }) => {
|
|
257
|
+
let { apiURL: i = r.apiURL, libraries: o, localStorageKeys: s } = a(v), c = r?.userLocalStorageKey || s?.user || F, l = r?.axios || o?.axios;
|
|
219
258
|
if (!l) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
220
|
-
if (!l?.defaults ||
|
|
259
|
+
if (!l?.defaults || P) return null;
|
|
221
260
|
if (typeof window < "u" && window.localStorage) {
|
|
222
261
|
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;
|
|
223
262
|
o && (l.defaults.headers.common.Authorization = o);
|
|
224
263
|
}
|
|
225
264
|
return l.defaults.baseURL = i, l.defaults.headers.post["Content-Type"] = n, null;
|
|
226
|
-
},
|
|
265
|
+
}, L = [
|
|
227
266
|
"ar",
|
|
228
267
|
"de",
|
|
229
268
|
"en",
|
|
@@ -231,15 +270,15 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
231
270
|
"fr",
|
|
232
271
|
"it",
|
|
233
272
|
"pt"
|
|
234
|
-
],
|
|
273
|
+
], te = (e) => L.includes(e), ne = ({ language: e, ...t }) => {
|
|
235
274
|
let { libraries: n } = a(v), r = t?.dayjs || n?.dayjs, i = t?.plugin || n?.dayjsPlugin;
|
|
236
275
|
if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");
|
|
237
276
|
r.extend(t.localizedFormat), i && i.forEach((e) => {
|
|
238
277
|
e && r.extend(e);
|
|
239
278
|
});
|
|
240
|
-
let o = e || navigator.language?.slice(0, 2) || "en", s =
|
|
279
|
+
let o = e || navigator.language?.slice(0, 2) || "en", s = te(o) ? o : "en";
|
|
241
280
|
return r.locale() !== s && r.locale(s), null;
|
|
242
|
-
},
|
|
281
|
+
}, R = "hubspot-messages-iframe-container", z = "hs-show", B = "data-hs-hidden", re = ({ hubId: e }) => (o(() => {
|
|
243
282
|
if (!e) return;
|
|
244
283
|
let t = document.createElement("script");
|
|
245
284
|
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), () => {
|
|
@@ -248,14 +287,14 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
248
287
|
}, [e]), o(() => {
|
|
249
288
|
let e = document.createElement("style");
|
|
250
289
|
return e.textContent = `
|
|
251
|
-
html[${
|
|
252
|
-
html[${
|
|
253
|
-
`, document.head.appendChild(e), document.documentElement.setAttribute(
|
|
254
|
-
e.remove(), document.documentElement.removeAttribute(
|
|
290
|
+
html[${B}] div#${R} { display: none !important; }
|
|
291
|
+
html[${B}] div#${R}.${z} { display: initial !important; }
|
|
292
|
+
`, document.head.appendChild(e), document.documentElement.setAttribute(B, ""), () => {
|
|
293
|
+
e.remove(), document.documentElement.removeAttribute(B);
|
|
255
294
|
};
|
|
256
|
-
}, []), null),
|
|
295
|
+
}, []), null), ie = ({ debug: e, resources: t, ...n }) => {
|
|
257
296
|
let { libraries: r } = a(v), i = n?.i18 || r?.i18, { i18next: o, initReactI18next: s, languageDetector: c } = i || {};
|
|
258
|
-
if (
|
|
297
|
+
if (P) return null;
|
|
259
298
|
if (!(i && o && c && s)) throw Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
260
299
|
return o.isInitialized ? null : (o.use(c).use(s).init({
|
|
261
300
|
debug: e,
|
|
@@ -273,7 +312,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
273
312
|
}), o.on("languageChanged", (e) => {
|
|
274
313
|
document.documentElement.setAttribute("lang", e);
|
|
275
314
|
}), null);
|
|
276
|
-
},
|
|
315
|
+
}, ae = ({ dsn: e, integrations: t, tracesSampleRate: n, replaysSessionSampleRate: r, replaysOnErrorSampleRate: i, tracePropagationTargets: s, ignoreErrors: c, debug: l, environment: u, release: d, ...f }) => {
|
|
277
316
|
let { libraries: p } = a(v), m = f?.sentry || p?.sentry, h = f?.reactRouter || p?.reactRouter;
|
|
278
317
|
if (!m) throw Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
279
318
|
if (!h) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
@@ -305,12 +344,12 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
305
344
|
tracePropagationTargets: s,
|
|
306
345
|
tracesSampleRate: n || 1
|
|
307
346
|
}), null;
|
|
308
|
-
},
|
|
309
|
-
let { libraries: c, localStorageKeys: d } = a(v), f = s?.reactRouter || c?.reactRouter, p = s?.axios || c?.axios, m = s?.localStorageKey || d?.user ||
|
|
347
|
+
}, V = /* @__PURE__ */ new WeakMap(), oe = "user", se = ({ Fallback: e, isLogged: n, loginPath: r = "/login", redirect401Path: i = "/login", ...s }) => {
|
|
348
|
+
let { libraries: c, localStorageKeys: d } = a(v), f = s?.reactRouter || c?.reactRouter, p = s?.axios || c?.axios, m = s?.localStorageKey || d?.user || oe;
|
|
310
349
|
if (!f) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
311
350
|
let [h, g] = l(null), { useLocation: _, Navigate: y, Outlet: b } = f, x = _(), S = typeof n == "function" ? n() : !!n, C = typeof S == "boolean" ? S : S?.isLogged;
|
|
312
351
|
return o(() => {
|
|
313
|
-
p && (
|
|
352
|
+
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)))));
|
|
314
353
|
}, [
|
|
315
354
|
p,
|
|
316
355
|
m,
|
|
@@ -326,34 +365,34 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
326
365
|
state: { from: x },
|
|
327
366
|
replace: !0
|
|
328
367
|
});
|
|
329
|
-
},
|
|
368
|
+
}, H = /* @__PURE__ */ new Set(), ce = () => (o(() => {
|
|
330
369
|
let e = Symbol();
|
|
331
|
-
return
|
|
332
|
-
|
|
370
|
+
return H.add(e), document.documentElement.removeAttribute(B), () => {
|
|
371
|
+
H.delete(e), H.size === 0 && document.documentElement.setAttribute(B, "");
|
|
333
372
|
};
|
|
334
|
-
}, []), null),
|
|
373
|
+
}, []), null), le = "user", ue = {
|
|
335
374
|
client: "/v2/threads/ws",
|
|
336
375
|
supplier: "/v1/threads/ws"
|
|
337
|
-
},
|
|
376
|
+
}, de = (e, t) => `${e.startsWith("https") ? "wss" : "ws"}://${e.replace(/^https?:\/\//, "")}${t}`, fe = (e) => {
|
|
338
377
|
try {
|
|
339
378
|
let t = localStorage.getItem(e);
|
|
340
379
|
return t ? JSON.parse(t)?.accessToken ?? null : null;
|
|
341
380
|
} catch {
|
|
342
381
|
return null;
|
|
343
382
|
}
|
|
344
|
-
},
|
|
345
|
-
let [_, y] = l(!1), [b, x] = l(!1), [S, C] = l(0), [w,
|
|
383
|
+
}, U = n(null), pe = ({ children: e, token: t, url: n, wsPath: r, maxReconnectAttempts: s, reconnectBaseDelay: d, maxMessageBodyLength: f = 1e4, reconnect: p = !0, enabled: m = !0, context: h = "client" }) => {
|
|
384
|
+
let [_, y] = l(!1), [b, x] = l(!1), [S, C] = l(0), [w, ee] = l(m), T = m && w, { apiURL: E, localStorageKeys: D } = a(v), O = D?.user || le, k = c(null), A = c(/* @__PURE__ */ new Set());
|
|
346
385
|
o(() => {
|
|
347
|
-
if (!
|
|
348
|
-
let e = r ??
|
|
386
|
+
if (!T) return;
|
|
387
|
+
let e = r ?? ue[h], i = n || (E ? de(E, e) : null);
|
|
349
388
|
if (!i) return;
|
|
350
|
-
let a = () => t ??
|
|
389
|
+
let a = () => t ?? fe(O), o = (e) => {
|
|
351
390
|
switch (e.type) {
|
|
352
391
|
case "ready":
|
|
353
392
|
x(!0), C(e.unreadCount ?? 0);
|
|
354
393
|
break;
|
|
355
394
|
}
|
|
356
|
-
for (let t of
|
|
395
|
+
for (let t of A.current) t(e);
|
|
357
396
|
}, c = setTimeout(() => {
|
|
358
397
|
let e = new g({
|
|
359
398
|
getToken: a,
|
|
@@ -367,69 +406,69 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
367
406
|
reconnectBaseDelay: d,
|
|
368
407
|
url: i
|
|
369
408
|
});
|
|
370
|
-
|
|
409
|
+
k.current = e, e.connect();
|
|
371
410
|
}, 0);
|
|
372
411
|
return () => {
|
|
373
|
-
clearTimeout(c),
|
|
412
|
+
clearTimeout(c), k.current?.disconnect(), k.current = null;
|
|
374
413
|
};
|
|
375
414
|
}, [
|
|
376
|
-
|
|
415
|
+
T,
|
|
377
416
|
n,
|
|
378
417
|
r,
|
|
379
418
|
h,
|
|
380
419
|
t,
|
|
381
420
|
p,
|
|
382
|
-
|
|
383
|
-
|
|
421
|
+
E,
|
|
422
|
+
O,
|
|
384
423
|
f,
|
|
385
424
|
s,
|
|
386
425
|
d
|
|
387
426
|
]);
|
|
388
|
-
let
|
|
389
|
-
|
|
390
|
-
}, []),
|
|
391
|
-
|
|
392
|
-
}, []),
|
|
393
|
-
|
|
394
|
-
}, []),
|
|
395
|
-
|
|
396
|
-
}, []),
|
|
397
|
-
|
|
398
|
-
}, []),
|
|
427
|
+
let j = i((e) => {
|
|
428
|
+
k.current?.joinThread(e);
|
|
429
|
+
}, []), M = i((e) => {
|
|
430
|
+
k.current?.leaveThread(e);
|
|
431
|
+
}, []), N = i((e, t) => {
|
|
432
|
+
k.current?.sendMessage(e, t);
|
|
433
|
+
}, []), P = i((e) => {
|
|
434
|
+
k.current?.markRead(e);
|
|
435
|
+
}, []), F = i((e, t) => {
|
|
436
|
+
k.current?.listThreads(e, t);
|
|
437
|
+
}, []), I = i((e = 1) => {
|
|
399
438
|
C((t) => t + e);
|
|
400
|
-
}, []),
|
|
439
|
+
}, []), L = {
|
|
401
440
|
decrementUnreadCount: i((e = 1) => {
|
|
402
441
|
C((t) => Math.max(0, t - e));
|
|
403
442
|
}, []),
|
|
404
443
|
disconnect: i(() => {
|
|
405
|
-
|
|
444
|
+
k.current?.disconnect(), k.current = null;
|
|
406
445
|
}, []),
|
|
407
|
-
incrementUnreadCount:
|
|
446
|
+
incrementUnreadCount: I,
|
|
408
447
|
isConnected: _,
|
|
409
448
|
isReady: b,
|
|
410
|
-
joinThread:
|
|
411
|
-
leaveThread:
|
|
412
|
-
listThreads:
|
|
413
|
-
markRead:
|
|
414
|
-
sendMessage:
|
|
449
|
+
joinThread: j,
|
|
450
|
+
leaveThread: M,
|
|
451
|
+
listThreads: F,
|
|
452
|
+
markRead: P,
|
|
453
|
+
sendMessage: N,
|
|
415
454
|
setEnabled: i((e) => {
|
|
416
|
-
|
|
455
|
+
ee(e);
|
|
417
456
|
}, []),
|
|
418
|
-
subscribe: i((e) => (
|
|
419
|
-
|
|
457
|
+
subscribe: i((e) => (A.current.add(e), () => {
|
|
458
|
+
A.current.delete(e);
|
|
420
459
|
}), []),
|
|
421
460
|
unreadCount: S
|
|
422
461
|
};
|
|
423
|
-
return /* @__PURE__ */ u(
|
|
424
|
-
value:
|
|
462
|
+
return /* @__PURE__ */ u(U.Provider, {
|
|
463
|
+
value: L,
|
|
425
464
|
children: e
|
|
426
465
|
});
|
|
427
|
-
},
|
|
466
|
+
}, me = (e) => e && typeof e == "function", he = (e) => e && typeof e == "function", ge = ({ children: e, defaultQueriesOptions: t, defaultMutationsOptions: n, ...r }) => {
|
|
428
467
|
let { libraries: i } = a(v), o = r?.QueryClient || i?.reactQuery?.QueryClient, s = r?.QueryClientProvider || i?.reactQuery?.QueryClientProvider;
|
|
429
468
|
if (!o) throw Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
430
469
|
if (!s) throw Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
431
|
-
if (!
|
|
432
|
-
if (!
|
|
470
|
+
if (!me(s)) throw Error("Provided QueryClientProvider dependencies are not valid.");
|
|
471
|
+
if (!he(o)) throw Error("Provided QueryClient dependencies are not valid.");
|
|
433
472
|
let l = c(null);
|
|
434
473
|
return l.current ||= new o({ defaultOptions: {
|
|
435
474
|
mutations: { ...n },
|
|
@@ -443,36 +482,36 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
443
482
|
client: l.current,
|
|
444
483
|
children: e
|
|
445
484
|
});
|
|
446
|
-
},
|
|
485
|
+
}, W = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), G = (e, t) => {
|
|
447
486
|
let { fractionDigits: n = 0, metric: r = "km", spacingBetween: i = !0 } = t || {}, a = Number(e), o = i ? " " : "";
|
|
448
487
|
return Number.isNaN(a) ? `0${o}${r}` : `${a.toFixed(n)}${o}${r}`;
|
|
449
|
-
},
|
|
488
|
+
}, K = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((e) => e.length > 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" "), _e = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, ve = ({ path: e, size: t, apiURL: n }) => {
|
|
450
489
|
if (!e) return "";
|
|
451
|
-
let r = `${n}${
|
|
490
|
+
let r = `${n}${_e(e)}`, i = r.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
|
|
452
491
|
return typeof t == "number" && i ? `${r.replace("/files", `/thumbs/${t}`)}` : r;
|
|
453
|
-
},
|
|
492
|
+
}, ye = (e) => {
|
|
454
493
|
let { apiURL: t, libraries: n } = a(v), r = e?.dayjs || n?.dayjs;
|
|
455
494
|
return {
|
|
456
495
|
dateAdapter: (e, t) => {
|
|
457
496
|
if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
458
|
-
return
|
|
497
|
+
return W({
|
|
459
498
|
date: e,
|
|
460
499
|
format: t,
|
|
461
500
|
library: r
|
|
462
501
|
});
|
|
463
502
|
},
|
|
464
|
-
distanceAdapter:
|
|
503
|
+
distanceAdapter: G,
|
|
465
504
|
filePathAdapter: (e, n) => {
|
|
466
505
|
if (!t) throw Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");
|
|
467
|
-
return typeof e == "string" && /^https?:\/\//.test(e) ? e :
|
|
506
|
+
return typeof e == "string" && /^https?:\/\//.test(e) ? e : ve({
|
|
468
507
|
apiURL: t,
|
|
469
508
|
path: e,
|
|
470
509
|
size: n
|
|
471
510
|
});
|
|
472
511
|
},
|
|
473
|
-
worksiteNameAdapter:
|
|
512
|
+
worksiteNameAdapter: K
|
|
474
513
|
};
|
|
475
|
-
},
|
|
514
|
+
}, be = () => {
|
|
476
515
|
let { libraries: e } = a(v), t = e?.amplitude?.analytics, n = i((e, n) => {
|
|
477
516
|
if (!t || (t.setUserId(e), !n)) return;
|
|
478
517
|
let r = new t.Identify();
|
|
@@ -496,14 +535,14 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
496
535
|
setGroup: r,
|
|
497
536
|
track: o
|
|
498
537
|
};
|
|
499
|
-
},
|
|
538
|
+
}, xe = (e) => {
|
|
500
539
|
let { libraries: t, localStorageKeys: n } = a(v), r = e?.axios || t?.axios, s = e?.localStorageKey || n?.user || "user";
|
|
501
540
|
if (!r) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
|
|
502
541
|
let c = i(({ tokenType: e, accessToken: t }) => {
|
|
503
542
|
r.defaults.headers.common.Authorization = `${e} ${t}`;
|
|
504
543
|
}, [r.defaults.headers.common]);
|
|
505
544
|
return o(() => {
|
|
506
|
-
if (
|
|
545
|
+
if (P) return;
|
|
507
546
|
let e = ({ newValue: e, key: t }) => {
|
|
508
547
|
if (t === s && e) try {
|
|
509
548
|
let { accessToken: t, tokenType: n } = JSON.parse(e);
|
|
@@ -524,9 +563,9 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
524
563
|
},
|
|
525
564
|
setAuthenticationToken: c
|
|
526
565
|
};
|
|
527
|
-
},
|
|
566
|
+
}, Se = "New message", Ce = (e, t) => {
|
|
528
567
|
if (!("Notification" in window) || typeof Notification != "function" || Notification.permission !== "granted" || !document.hidden) return;
|
|
529
|
-
let n = new Notification(t.title ??
|
|
568
|
+
let n = new Notification(t.title ?? Se, {
|
|
530
569
|
badge: t?.badge,
|
|
531
570
|
body: t?.body || e.bodyPreview,
|
|
532
571
|
data: t?.data,
|
|
@@ -541,8 +580,8 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
541
580
|
let { onClick: r } = t;
|
|
542
581
|
n.onclick = () => r(e);
|
|
543
582
|
}
|
|
544
|
-
},
|
|
545
|
-
let t = a(
|
|
583
|
+
}, we = (e) => {
|
|
584
|
+
let t = a(U);
|
|
546
585
|
if (!t) throw Error("useChat must be used within ChatProvider");
|
|
547
586
|
let { subscribe: n, setEnabled: r, ...i } = t, s = c(e);
|
|
548
587
|
return s.current = e, o(() => {
|
|
@@ -559,7 +598,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
559
598
|
r?.(e);
|
|
560
599
|
break;
|
|
561
600
|
case "new_message_notification":
|
|
562
|
-
i?.(e), t && t.enabled !== !1 &&
|
|
601
|
+
i?.(e), t && t.enabled !== !1 && Ce(e, t);
|
|
563
602
|
break;
|
|
564
603
|
case "presence":
|
|
565
604
|
a?.(e);
|
|
@@ -584,44 +623,44 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
584
623
|
break;
|
|
585
624
|
}
|
|
586
625
|
}), [n]), i;
|
|
587
|
-
},
|
|
626
|
+
}, q = (e, t) => t === "short" ? e.split("-")[0] : e, Te = (e, t = "full") => {
|
|
588
627
|
let [n, r] = l(() => {
|
|
589
628
|
let n = e?.language || navigator.language;
|
|
590
|
-
return e && "isInitialized" in e && e.isInitialized,
|
|
629
|
+
return e && "isInitialized" in e && e.isInitialized, q(n, t);
|
|
591
630
|
});
|
|
592
631
|
return o(() => {
|
|
593
|
-
e && "isInitialized" in e && e.isInitialized && e.language && r(
|
|
632
|
+
e && "isInitialized" in e && e.isInitialized && e.language && r(q(e.language, t));
|
|
594
633
|
let n = (e) => {
|
|
595
|
-
r(
|
|
634
|
+
r(q(e, t));
|
|
596
635
|
};
|
|
597
636
|
return e?.on?.("languageChanged", n), () => {
|
|
598
637
|
e?.off?.("languageChanged", n);
|
|
599
638
|
};
|
|
600
639
|
}, [e, t]), n;
|
|
601
|
-
},
|
|
640
|
+
}, Ee = "tracktor.filter", De = {
|
|
602
641
|
getFilter: () => void 0,
|
|
603
642
|
getFilters: () => ({}),
|
|
604
643
|
handleFilter: () => () => {},
|
|
605
644
|
setFilter: () => {}
|
|
606
|
-
},
|
|
645
|
+
}, J = (e) => {
|
|
607
646
|
try {
|
|
608
647
|
return JSON.parse(e);
|
|
609
648
|
} catch {
|
|
610
649
|
return e;
|
|
611
650
|
}
|
|
612
|
-
},
|
|
651
|
+
}, Y = (e, t, n) => `${n}_${e}=>${t}`, Oe = (e) => e.reduce((e, t) => {
|
|
613
652
|
let n = localStorage.getItem(t);
|
|
614
653
|
if (n) try {
|
|
615
654
|
let t = JSON.parse(n), r = Object.keys(t)?.[0];
|
|
616
655
|
r && (e[r] = Object.values(t)?.[0]);
|
|
617
656
|
} catch {}
|
|
618
657
|
return e;
|
|
619
|
-
}, {}),
|
|
620
|
-
let { libraries: t, localStorageKeys: n } = a(v), r = e?.reactRouter || t?.reactRouter, { pathname: i } = r?.useLocation?.() ?? { pathname: "/" }, [o, s] = r?.useSearchParams?.() ?? [new URLSearchParams(), () => {}], [c, u] = l({}), d = n?.filter ||
|
|
621
|
-
if (
|
|
658
|
+
}, {}), ke = (e) => {
|
|
659
|
+
let { libraries: t, localStorageKeys: n } = a(v), r = e?.reactRouter || t?.reactRouter, { pathname: i } = r?.useLocation?.() ?? { pathname: "/" }, [o, s] = r?.useSearchParams?.() ?? [new URLSearchParams(), () => {}], [c, u] = l({}), d = n?.filter || Ee, f = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, p = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
|
|
660
|
+
if (P) return De;
|
|
622
661
|
if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter.");
|
|
623
662
|
let m = () => Object.keys(localStorage).filter((t) => t.startsWith(d) && t.endsWith(e?.pathname || i)), h = (t, n, r = !0) => {
|
|
624
|
-
let a =
|
|
663
|
+
let a = Y(t, e?.pathname || i, d);
|
|
625
664
|
if (!n || Array.isArray(n) && !n.length) {
|
|
626
665
|
f ? (o.delete(t), s(o)) : u((e) => {
|
|
627
666
|
let n = { ...e };
|
|
@@ -641,13 +680,13 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
641
680
|
getFilter: (t, n) => {
|
|
642
681
|
if (f) {
|
|
643
682
|
let e = o.get(t);
|
|
644
|
-
if (e) return
|
|
683
|
+
if (e) return J(e);
|
|
645
684
|
} else {
|
|
646
685
|
let e = c[t];
|
|
647
686
|
if (e !== void 0) return e;
|
|
648
687
|
}
|
|
649
688
|
if (p) {
|
|
650
|
-
let n =
|
|
689
|
+
let n = Y(t, e?.pathname || i, d), r = localStorage.getItem(n);
|
|
651
690
|
if (r) try {
|
|
652
691
|
let e = JSON.parse(r)[t];
|
|
653
692
|
return !f && e !== void 0 && u((n) => ({
|
|
@@ -659,9 +698,9 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
659
698
|
return n;
|
|
660
699
|
},
|
|
661
700
|
getFilters: () => {
|
|
662
|
-
let e = p ?
|
|
701
|
+
let e = p ? Oe(m()) : {};
|
|
663
702
|
if (f) {
|
|
664
|
-
let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] =
|
|
703
|
+
let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] = J(n), e), {});
|
|
665
704
|
return {
|
|
666
705
|
...e,
|
|
667
706
|
...t
|
|
@@ -682,7 +721,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
682
721
|
},
|
|
683
722
|
setFilter: h
|
|
684
723
|
};
|
|
685
|
-
},
|
|
724
|
+
}, X = () => document.getElementById(R), Ae = () => {
|
|
686
725
|
let [e, t] = l(() => !!window.HubSpotConversations);
|
|
687
726
|
return o(() => {
|
|
688
727
|
if (window.HubSpotConversations) {
|
|
@@ -692,16 +731,16 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
692
731
|
window.hsConversationsOnReady = [() => t(!0)];
|
|
693
732
|
}, []), o(() => {
|
|
694
733
|
e && window.HubSpotConversations?.on("widgetClosed", () => {
|
|
695
|
-
|
|
734
|
+
X()?.classList.remove(z);
|
|
696
735
|
});
|
|
697
736
|
}, [e]), {
|
|
698
737
|
isAvailable: e,
|
|
699
738
|
toggle: i(() => {
|
|
700
|
-
let e = window.HubSpotConversations, t =
|
|
701
|
-
e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(
|
|
739
|
+
let e = window.HubSpotConversations, t = X();
|
|
740
|
+
e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(z)) : (t.classList.add(z), e.widget.open()));
|
|
702
741
|
}, [])
|
|
703
742
|
};
|
|
704
|
-
},
|
|
743
|
+
}, je = ({ data: e, fetchNextPage: t, isFetchingNextPage: n, isInitialLoading: r, isLoading: a, enabled: o = !0 }) => {
|
|
705
744
|
let c = i(async (e) => {
|
|
706
745
|
n || !o || await t({ pageParam: e?.pageParam || e.visibleRowsCount });
|
|
707
746
|
}, [
|
|
@@ -717,7 +756,7 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
717
756
|
loadingVariant: r ? "skeleton" : "linear-progress",
|
|
718
757
|
rows: l
|
|
719
758
|
};
|
|
720
|
-
},
|
|
759
|
+
}, Me = (e) => {
|
|
721
760
|
let { libraries: t } = a(v), 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) => {
|
|
722
761
|
if (e && typeof e == "object" && "response" in e) {
|
|
723
762
|
let { response: t } = e || {};
|
|
@@ -741,38 +780,38 @@ var d = 3e4, f = 1e3, p = 1e4, m = (e) => Array.isArray(e) ? e.map(m) : typeof e
|
|
|
741
780
|
}, []),
|
|
742
781
|
printError: l
|
|
743
782
|
};
|
|
744
|
-
},
|
|
745
|
-
if (!
|
|
783
|
+
}, Z = "chunk-reload-timestamp", Q = "chunk-reload", Ne = 1e4, $ = 2, Pe = !1;
|
|
784
|
+
if (!P && typeof window < "u") {
|
|
746
785
|
try {
|
|
747
786
|
let e = new URL(window.location.href);
|
|
748
|
-
e.searchParams.has(
|
|
787
|
+
e.searchParams.has(Q) && (Pe = !0, e.searchParams.delete(Q), window.history.replaceState(null, "", e.toString()));
|
|
749
788
|
} catch {}
|
|
750
789
|
window.addEventListener("vite:preloadError", (e) => {
|
|
751
790
|
e.preventDefault();
|
|
752
791
|
});
|
|
753
792
|
}
|
|
754
|
-
var
|
|
793
|
+
var Fe = (e) => {
|
|
755
794
|
if (!(e instanceof Error)) return !1;
|
|
756
795
|
let t = e.message.toLowerCase();
|
|
757
796
|
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";
|
|
758
|
-
},
|
|
797
|
+
}, Ie = /import\s*\(\s*(['"])((\w+:(\/?\/?))?[^\s,]+)\1/, Le = (e) => e.toString().match(Ie)?.[2] ?? null, Re = (e) => {
|
|
759
798
|
try {
|
|
760
799
|
return sessionStorage.getItem(e);
|
|
761
800
|
} catch {
|
|
762
801
|
return null;
|
|
763
802
|
}
|
|
764
|
-
},
|
|
803
|
+
}, ze = (e, t) => {
|
|
765
804
|
try {
|
|
766
805
|
sessionStorage.setItem(e, t);
|
|
767
806
|
} catch {}
|
|
768
|
-
},
|
|
769
|
-
for (let t = 0; t <
|
|
770
|
-
return await
|
|
807
|
+
}, Be = (e) => Function("url", "return import(url)")(e), Ve = async (e) => {
|
|
808
|
+
for (let t = 0; t < $; t++) try {
|
|
809
|
+
return await Be(`${e}?t=${Date.now()}`);
|
|
771
810
|
} catch {
|
|
772
|
-
t <
|
|
811
|
+
t < $ - 1 && await new Promise((e) => setTimeout(e, 500 * 2 ** t));
|
|
773
812
|
}
|
|
774
|
-
throw Error(`Failed to import ${e} after ${
|
|
775
|
-
},
|
|
813
|
+
throw Error(`Failed to import ${e} after ${$} retries`);
|
|
814
|
+
}, He = async () => {
|
|
776
815
|
try {
|
|
777
816
|
if (typeof navigator < "u" && "serviceWorker" in navigator) {
|
|
778
817
|
let e = await navigator.serviceWorker.getRegistrations();
|
|
@@ -783,27 +822,27 @@ var je = (e) => {
|
|
|
783
822
|
await Promise.all(e.map((e) => caches.delete(e)));
|
|
784
823
|
}
|
|
785
824
|
} catch {}
|
|
786
|
-
},
|
|
787
|
-
await
|
|
825
|
+
}, Ue = async () => {
|
|
826
|
+
await He();
|
|
788
827
|
let e = new URL(window.location.href);
|
|
789
|
-
e.searchParams.set(
|
|
790
|
-
},
|
|
828
|
+
e.searchParams.set(Q, String(Date.now())), window.location.replace(e.toString());
|
|
829
|
+
}, We = (e) => e != null && e.default !== void 0, Ge = (e) => r(async () => {
|
|
791
830
|
let t;
|
|
792
831
|
try {
|
|
793
832
|
let n = await e();
|
|
794
|
-
if (
|
|
833
|
+
if (We(n)) return n;
|
|
795
834
|
t = /* @__PURE__ */ Error("Module resolved without a valid default export");
|
|
796
835
|
} catch (e) {
|
|
797
836
|
t = e;
|
|
798
837
|
}
|
|
799
|
-
if (
|
|
800
|
-
let n =
|
|
838
|
+
if (P || !Fe(t)) throw t;
|
|
839
|
+
let n = Le(e);
|
|
801
840
|
if (n) try {
|
|
802
|
-
let e = await
|
|
803
|
-
if (
|
|
841
|
+
let e = await Ve(n);
|
|
842
|
+
if (We(e)) return e;
|
|
804
843
|
} catch {}
|
|
805
|
-
let r = Number(
|
|
806
|
-
return Date.now() - r <
|
|
844
|
+
let r = Number(Re(Z) || "0");
|
|
845
|
+
return Date.now() - r < Ne || Pe || (ze(Z, String(Date.now())), await Ue()), { default: () => null };
|
|
807
846
|
});
|
|
808
847
|
//#endregion
|
|
809
|
-
export {
|
|
848
|
+
export { O as AMPLITUDE_FEATURE_SELECTOR, E as AutoReloadOnNewVersion, g as ChatClient, U as ChatContext, pe as ChatProvider, D as GTMSendPageView, N as InitializeAmplitude, I as InitializeAxiosConfig, ne as InitializeDaysJSConfig, re as InitializeHubSpot, ie as InitializeI18nConfig, ae as InitializeSentryConfig, v as InjectDependenciesContext, y as InjectDependenciesProvider, _ as MaskTextField, ge as QueryProvider, se as RequireAuth, L as SUPPORTED_LANGUAGE, ce as ShowHubSpotBubble, W as dateAdapter, G as distanceAdapter, e as getOrvalConfig, Ge as lazyWithRetry, ye as useAdapter, be as useAmplitude, xe as useAuth, we as useChat, Te as useCurrentLanguage, ke as useFilters, Ae as useHubSpot, je as useInfiniteDataGrid, Me as useResponseError, K as worksiteNameAdapter };
|
|
@@ -8,8 +8,8 @@ export interface ResolveOrvalHostInputOptions extends Partial<ResolveOrvalInputO
|
|
|
8
8
|
/**
|
|
9
9
|
* API name, also used as default "overrideApiName" and to derive:
|
|
10
10
|
* - localFile: ./openapi.<host>.json
|
|
11
|
-
* - localUrl: https://<subdomain>.api.
|
|
12
|
-
* - upstreamUrl: https://<subdomain>.api.dev.
|
|
11
|
+
* - localUrl: https://<subdomain>.api.soren.test/openapi.json
|
|
12
|
+
* - upstreamUrl: https://<subdomain>.api.dev.getsoren.ai/openapi.json
|
|
13
13
|
* Each value can still be overridden individually.
|
|
14
14
|
*/
|
|
15
15
|
host: OrvalApiHost;
|
package/dist/orval.js
CHANGED
|
@@ -11,7 +11,7 @@ var r = (e, n = 1500) => {
|
|
|
11
11
|
} catch {
|
|
12
12
|
return !1;
|
|
13
13
|
}
|
|
14
|
-
}, i = ({ localFile: e, localUrl: t, upstreamUrl: i }) => e && n(e) ? (console.log(`Hint: remove ${e} to change target by upstream (http) instead.`), e) : t && r(t) ? t : i, a = "api.
|
|
14
|
+
}, i = ({ localFile: e, localUrl: t, upstreamUrl: i }) => e && n(e) ? (console.log(`Hint: remove ${e} to change target by upstream (http) instead.`), e) : t && r(t) ? t : i, a = "api.soren.test", o = "api.dev.getsoren.ai", s = {
|
|
15
15
|
auth: "auth",
|
|
16
16
|
saas: "app",
|
|
17
17
|
supplier: "supplier"
|