@rpcbase/client 0.405.0 → 0.407.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/errorReporting-Dfcrn3W1.js +18 -0
- package/dist/errorReporting-Dfcrn3W1.js.map +1 -0
- package/dist/getServerApiClient-udstTQk3.js +153 -0
- package/dist/getServerApiClient-udstTQk3.js.map +1 -0
- package/dist/index.js +2332 -2568
- package/dist/index.js.map +1 -1
- package/dist/instrument.js +32 -40
- package/dist/instrument.js.map +1 -1
- package/dist/rts/index.js +2 -29
- package/dist/rts-C9dMrcRZ.js +1991 -0
- package/dist/rts-C9dMrcRZ.js.map +1 -0
- package/dist/spatial-nav/index.js +4790 -4327
- package/dist/spatial-nav/index.js.map +1 -1
- package/dist/throttle-Cz-gYuKD.js +606 -0
- package/dist/throttle-Cz-gYuKD.js.map +1 -0
- package/package.json +1 -1
- package/dist/errorReporting-CVoUUKxW.js +0 -18
- package/dist/errorReporting-CVoUUKxW.js.map +0 -1
- package/dist/getServerApiClient-C1UInaMF.js +0 -179
- package/dist/getServerApiClient-C1UInaMF.js.map +0 -1
- package/dist/rts/index.js.map +0 -1
- package/dist/throttle-CXOc9Dto.js +0 -396
- package/dist/throttle-CXOc9Dto.js.map +0 -1
- package/dist/useQuery-XvXbEwG_.js +0 -2312
- package/dist/useQuery-XvXbEwG_.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,2672 +1,2436 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as require_toString, m as __toESM, p as __commonJSMin, t as require_throttle } from "./throttle-Cz-gYuKD.js";
|
|
2
|
+
import { n as setClientExceptionReporter, t as reportClientException } from "./errorReporting-Dfcrn3W1.js";
|
|
3
|
+
import { C as peekHydratedRtsQueryData, S as hydrateRtsFromWindow, T as peekHydratedRtsQueryTotalCount, b as STATIC_RPCBASE_RTS_HYDRATION_DATA_KEY, t as useQuery, w as peekHydratedRtsQueryPageInfo, x as clearHydratedRtsQueryData, y as RtsSsrRuntimeProvider } from "./rts-C9dMrcRZ.js";
|
|
2
4
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import {
|
|
5
|
+
import { StrictMode, Suspense, createContext, lazy, useContext, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
7
|
import env from "@rpcbase/env";
|
|
5
|
-
import {
|
|
8
|
+
import { RoutePrefetchProvider, RouterProvider, createBrowserRouter, createRoutesFromElements, getNavigationGuards, isRouteErrorResponse, matchRoutes, useLocation, useRouteError } from "@rpcbase/router";
|
|
6
9
|
import { hydrateRoot } from "react-dom/client";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if ($[2] !== query) {
|
|
39
|
-
t1 = () => {
|
|
40
|
-
if (isServer) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
return window.matchMedia(query).matches;
|
|
44
|
-
};
|
|
45
|
-
$[2] = query;
|
|
46
|
-
$[3] = t1;
|
|
47
|
-
} else {
|
|
48
|
-
t1 = $[3];
|
|
49
|
-
}
|
|
50
|
-
const getSnapshot = t1;
|
|
51
|
-
return useSyncExternalStore(subscribe, getSnapshot, _temp$3);
|
|
10
|
+
//#region src/hooks/useMediaQuery.ts
|
|
11
|
+
var emptyUnsubscribe = () => {};
|
|
12
|
+
var useMediaQuery = (query) => {
|
|
13
|
+
const $ = c(4);
|
|
14
|
+
const isServer = typeof window === "undefined";
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] !== query) {
|
|
17
|
+
t0 = (callback) => {
|
|
18
|
+
if (isServer) return emptyUnsubscribe;
|
|
19
|
+
const mql = window.matchMedia(query);
|
|
20
|
+
if (mql.addEventListener) {
|
|
21
|
+
mql.addEventListener("change", callback);
|
|
22
|
+
return () => mql.removeEventListener("change", callback);
|
|
23
|
+
}
|
|
24
|
+
mql.addListener(callback);
|
|
25
|
+
return () => mql.removeListener(callback);
|
|
26
|
+
};
|
|
27
|
+
$[0] = query;
|
|
28
|
+
$[1] = t0;
|
|
29
|
+
} else t0 = $[1];
|
|
30
|
+
const subscribe = t0;
|
|
31
|
+
let t1;
|
|
32
|
+
if ($[2] !== query) {
|
|
33
|
+
t1 = () => {
|
|
34
|
+
if (isServer) return false;
|
|
35
|
+
return window.matchMedia(query).matches;
|
|
36
|
+
};
|
|
37
|
+
$[2] = query;
|
|
38
|
+
$[3] = t1;
|
|
39
|
+
} else t1 = $[3];
|
|
40
|
+
return useSyncExternalStore(subscribe, t1, _temp$3);
|
|
52
41
|
};
|
|
53
42
|
function _temp$3() {
|
|
54
|
-
|
|
43
|
+
return false;
|
|
55
44
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
m.toast(message, nextData);
|
|
138
|
-
});
|
|
139
|
-
return id;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/toast.tsx
|
|
47
|
+
var sonner = null;
|
|
48
|
+
var sonnerImport = null;
|
|
49
|
+
var queued = [];
|
|
50
|
+
var toasterRequested = false;
|
|
51
|
+
var toasterListeners = /* @__PURE__ */ new Set();
|
|
52
|
+
var toasterMounted = false;
|
|
53
|
+
var toasterPreloadStarted = false;
|
|
54
|
+
var idCounter = 0;
|
|
55
|
+
var createToastId = () => `rb-toast-${++idCounter}`;
|
|
56
|
+
var resolveId = (id) => {
|
|
57
|
+
if (typeof id === "number") return id;
|
|
58
|
+
if (typeof id === "string" && id.length > 0) return id;
|
|
59
|
+
};
|
|
60
|
+
var requestToasterMount = () => {
|
|
61
|
+
if (toasterRequested) return;
|
|
62
|
+
toasterRequested = true;
|
|
63
|
+
for (const listener of toasterListeners) listener();
|
|
64
|
+
};
|
|
65
|
+
var subscribeToasterRequested = (listener) => {
|
|
66
|
+
toasterListeners.add(listener);
|
|
67
|
+
return () => {
|
|
68
|
+
toasterListeners.delete(listener);
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
var getToasterRequested = () => toasterRequested;
|
|
72
|
+
var flushQueue = () => {
|
|
73
|
+
if (!sonner) return;
|
|
74
|
+
if (typeof document !== "undefined" && !toasterMounted) return;
|
|
75
|
+
while (queued.length) {
|
|
76
|
+
const fn = queued.shift();
|
|
77
|
+
if (fn) fn(sonner);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
var setToasterMounted = (mounted) => {
|
|
81
|
+
toasterMounted = mounted;
|
|
82
|
+
if (mounted) flushQueue();
|
|
83
|
+
};
|
|
84
|
+
var loadSonner = () => {
|
|
85
|
+
if (sonner) return Promise.resolve(sonner);
|
|
86
|
+
if (sonnerImport) return sonnerImport;
|
|
87
|
+
sonnerImport = import("sonner").then((mod) => {
|
|
88
|
+
sonner = mod;
|
|
89
|
+
flushQueue();
|
|
90
|
+
return mod;
|
|
91
|
+
});
|
|
92
|
+
return sonnerImport;
|
|
93
|
+
};
|
|
94
|
+
var enqueue = (fn) => {
|
|
95
|
+
if (sonner && (toasterMounted || typeof document === "undefined")) {
|
|
96
|
+
fn(sonner);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
queued.push(fn);
|
|
100
|
+
};
|
|
101
|
+
var isPageLoaded = () => {
|
|
102
|
+
if (typeof document === "undefined") return false;
|
|
103
|
+
return document.readyState === "complete";
|
|
104
|
+
};
|
|
105
|
+
var startToaster = () => {
|
|
106
|
+
if (toasterPreloadStarted) return;
|
|
107
|
+
toasterPreloadStarted = true;
|
|
108
|
+
requestToasterMount();
|
|
109
|
+
loadSonner();
|
|
110
|
+
};
|
|
111
|
+
var ensureReady = () => {
|
|
112
|
+
if (typeof document === "undefined") startToaster();
|
|
113
|
+
};
|
|
114
|
+
var buildToastData = (data, id) => data ? {
|
|
115
|
+
...data,
|
|
116
|
+
id
|
|
117
|
+
} : { id };
|
|
118
|
+
var toastFn = ((message, data) => {
|
|
119
|
+
ensureReady();
|
|
120
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
121
|
+
const nextData = buildToastData(data, id);
|
|
122
|
+
enqueue((m) => {
|
|
123
|
+
m.toast(message, nextData);
|
|
124
|
+
});
|
|
125
|
+
return id;
|
|
140
126
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
promise: toastPromise,
|
|
247
|
-
dismiss: toastDismiss,
|
|
248
|
-
getHistory: toastGetHistory,
|
|
249
|
-
getToasts: toastGetToasts
|
|
127
|
+
var toastSuccess = (message, data) => {
|
|
128
|
+
ensureReady();
|
|
129
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
130
|
+
const nextData = buildToastData(data, id);
|
|
131
|
+
enqueue((m) => {
|
|
132
|
+
m.toast.success(message, nextData);
|
|
133
|
+
});
|
|
134
|
+
return id;
|
|
135
|
+
};
|
|
136
|
+
var toastInfo = (message, data) => {
|
|
137
|
+
ensureReady();
|
|
138
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
139
|
+
const nextData = buildToastData(data, id);
|
|
140
|
+
enqueue((m) => {
|
|
141
|
+
m.toast.info(message, nextData);
|
|
142
|
+
});
|
|
143
|
+
return id;
|
|
144
|
+
};
|
|
145
|
+
var toastWarning = (message, data) => {
|
|
146
|
+
ensureReady();
|
|
147
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
148
|
+
const nextData = buildToastData(data, id);
|
|
149
|
+
enqueue((m) => {
|
|
150
|
+
m.toast.warning(message, nextData);
|
|
151
|
+
});
|
|
152
|
+
return id;
|
|
153
|
+
};
|
|
154
|
+
var toastError = (message, data) => {
|
|
155
|
+
ensureReady();
|
|
156
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
157
|
+
const nextData = buildToastData(data, id);
|
|
158
|
+
enqueue((m) => {
|
|
159
|
+
m.toast.error(message, nextData);
|
|
160
|
+
});
|
|
161
|
+
return id;
|
|
162
|
+
};
|
|
163
|
+
var toastMessage = (message, data) => {
|
|
164
|
+
ensureReady();
|
|
165
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
166
|
+
const nextData = buildToastData(data, id);
|
|
167
|
+
enqueue((m) => {
|
|
168
|
+
m.toast.message(message, nextData);
|
|
169
|
+
});
|
|
170
|
+
return id;
|
|
171
|
+
};
|
|
172
|
+
var toastLoading = (message, data) => {
|
|
173
|
+
ensureReady();
|
|
174
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
175
|
+
const nextData = buildToastData(data, id);
|
|
176
|
+
enqueue((m) => {
|
|
177
|
+
m.toast.loading(message, nextData);
|
|
178
|
+
});
|
|
179
|
+
return id;
|
|
180
|
+
};
|
|
181
|
+
var toastCustom = (jsx, data) => {
|
|
182
|
+
ensureReady();
|
|
183
|
+
const id = resolveId(data?.id) ?? createToastId();
|
|
184
|
+
const nextData = buildToastData(data, id);
|
|
185
|
+
enqueue((m) => {
|
|
186
|
+
m.toast.custom(jsx, nextData);
|
|
187
|
+
});
|
|
188
|
+
return id;
|
|
189
|
+
};
|
|
190
|
+
var toastPromise = (promise, data) => {
|
|
191
|
+
ensureReady();
|
|
192
|
+
if (!data) return void 0;
|
|
193
|
+
const startedPromise = promise instanceof Function ? promise() : promise;
|
|
194
|
+
const unwrap = () => Promise.resolve(startedPromise);
|
|
195
|
+
if (data.loading === void 0) {
|
|
196
|
+
enqueue((m) => {
|
|
197
|
+
m.toast.promise(startedPromise, data);
|
|
198
|
+
});
|
|
199
|
+
return { unwrap };
|
|
200
|
+
}
|
|
201
|
+
const id = resolveId(data.id) ?? createToastId();
|
|
202
|
+
const nextData = {
|
|
203
|
+
...data,
|
|
204
|
+
id
|
|
205
|
+
};
|
|
206
|
+
enqueue((m) => {
|
|
207
|
+
m.toast.promise(startedPromise, nextData);
|
|
208
|
+
});
|
|
209
|
+
return Object.assign(id, { unwrap });
|
|
210
|
+
};
|
|
211
|
+
var toastDismiss = (id) => {
|
|
212
|
+
ensureReady();
|
|
213
|
+
enqueue((m) => {
|
|
214
|
+
m.toast.dismiss(id);
|
|
215
|
+
});
|
|
216
|
+
return id;
|
|
217
|
+
};
|
|
218
|
+
var toastGetHistory = () => sonner ? sonner.toast.getHistory() : [];
|
|
219
|
+
var toastGetToasts = () => sonner ? sonner.toast.getToasts() : [];
|
|
220
|
+
var toast = Object.assign(toastFn, {
|
|
221
|
+
success: toastSuccess,
|
|
222
|
+
info: toastInfo,
|
|
223
|
+
warning: toastWarning,
|
|
224
|
+
error: toastError,
|
|
225
|
+
message: toastMessage,
|
|
226
|
+
loading: toastLoading,
|
|
227
|
+
custom: toastCustom,
|
|
228
|
+
promise: toastPromise,
|
|
229
|
+
dismiss: toastDismiss,
|
|
230
|
+
getHistory: toastGetHistory,
|
|
231
|
+
getToasts: toastGetToasts
|
|
250
232
|
});
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
return {
|
|
254
|
-
default: mod.Toaster
|
|
255
|
-
};
|
|
233
|
+
var LazySonnerToaster = lazy(async () => {
|
|
234
|
+
return { default: (await import("sonner")).Toaster };
|
|
256
235
|
});
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
useEffect(_temp8, t0);
|
|
345
|
-
const requested = useSyncExternalStore(subscribeToasterRequested, getToasterRequested, getToasterRequested);
|
|
346
|
-
if (!requested) {
|
|
347
|
-
return null;
|
|
348
|
-
}
|
|
349
|
-
let t1;
|
|
350
|
-
if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
351
|
-
t1 = /* @__PURE__ */ jsx(ActiveToaster, {});
|
|
352
|
-
$[1] = t1;
|
|
353
|
-
} else {
|
|
354
|
-
t1 = $[1];
|
|
355
|
-
}
|
|
356
|
-
return t1;
|
|
236
|
+
var MountedLazyToaster = (props) => {
|
|
237
|
+
const $ = c(3);
|
|
238
|
+
let t0;
|
|
239
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
240
|
+
t0 = [];
|
|
241
|
+
$[0] = t0;
|
|
242
|
+
} else t0 = $[0];
|
|
243
|
+
useEffect(_temp2$1, t0);
|
|
244
|
+
let t1;
|
|
245
|
+
if ($[1] !== props) {
|
|
246
|
+
t1 = /* @__PURE__ */ jsx(LazySonnerToaster, { ...props });
|
|
247
|
+
$[1] = props;
|
|
248
|
+
$[2] = t1;
|
|
249
|
+
} else t1 = $[2];
|
|
250
|
+
return t1;
|
|
251
|
+
};
|
|
252
|
+
var ActiveToaster = () => {
|
|
253
|
+
const $ = c(9);
|
|
254
|
+
const isMobile = useMediaQuery("(max-width: 767px)");
|
|
255
|
+
const isCoarsePointer = useMediaQuery("(hover: none) and (pointer: coarse)");
|
|
256
|
+
const position = isMobile ? "top-center" : void 0;
|
|
257
|
+
let t0;
|
|
258
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
259
|
+
t0 = [];
|
|
260
|
+
$[0] = t0;
|
|
261
|
+
} else t0 = $[0];
|
|
262
|
+
useEffect(_temp4$1, t0);
|
|
263
|
+
const t1 = !isCoarsePointer;
|
|
264
|
+
let t2;
|
|
265
|
+
if ($[1] !== isCoarsePointer) {
|
|
266
|
+
t2 = isCoarsePointer ? void 0 : [];
|
|
267
|
+
$[1] = isCoarsePointer;
|
|
268
|
+
$[2] = t2;
|
|
269
|
+
} else t2 = $[2];
|
|
270
|
+
let t3;
|
|
271
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
272
|
+
t3 = {
|
|
273
|
+
pointerEvents: "auto",
|
|
274
|
+
"--toast-close-button-start": "unset",
|
|
275
|
+
"--toast-close-button-end": "0",
|
|
276
|
+
"--toast-close-button-transform": "translate(35%, -35%)"
|
|
277
|
+
};
|
|
278
|
+
$[3] = t3;
|
|
279
|
+
} else t3 = $[3];
|
|
280
|
+
let t4;
|
|
281
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
282
|
+
t4 = { style: {
|
|
283
|
+
pointerEvents: "auto",
|
|
284
|
+
userSelect: "text"
|
|
285
|
+
} };
|
|
286
|
+
$[4] = t4;
|
|
287
|
+
} else t4 = $[4];
|
|
288
|
+
let t5;
|
|
289
|
+
if ($[5] !== position || $[6] !== t1 || $[7] !== t2) {
|
|
290
|
+
t5 = /* @__PURE__ */ jsx(Suspense, {
|
|
291
|
+
fallback: null,
|
|
292
|
+
children: /* @__PURE__ */ jsx(MountedLazyToaster, {
|
|
293
|
+
closeButton: t1,
|
|
294
|
+
theme: "dark",
|
|
295
|
+
position,
|
|
296
|
+
swipeDirections: t2,
|
|
297
|
+
style: t3,
|
|
298
|
+
toastOptions: t4
|
|
299
|
+
})
|
|
300
|
+
});
|
|
301
|
+
$[5] = position;
|
|
302
|
+
$[6] = t1;
|
|
303
|
+
$[7] = t2;
|
|
304
|
+
$[8] = t5;
|
|
305
|
+
} else t5 = $[8];
|
|
306
|
+
return t5;
|
|
307
|
+
};
|
|
308
|
+
var Toaster = () => {
|
|
309
|
+
const $ = c(2);
|
|
310
|
+
let t0;
|
|
311
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
312
|
+
t0 = [];
|
|
313
|
+
$[0] = t0;
|
|
314
|
+
} else t0 = $[0];
|
|
315
|
+
useEffect(_temp8, t0);
|
|
316
|
+
if (!useSyncExternalStore(subscribeToasterRequested, getToasterRequested, getToasterRequested)) return null;
|
|
317
|
+
let t1;
|
|
318
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
319
|
+
t1 = /* @__PURE__ */ jsx(ActiveToaster, {});
|
|
320
|
+
$[1] = t1;
|
|
321
|
+
} else t1 = $[1];
|
|
322
|
+
return t1;
|
|
357
323
|
};
|
|
358
324
|
function _temp$2() {
|
|
359
|
-
|
|
325
|
+
return setToasterMounted(false);
|
|
360
326
|
}
|
|
361
327
|
function _temp2$1() {
|
|
362
|
-
|
|
363
|
-
|
|
328
|
+
setToasterMounted(true);
|
|
329
|
+
return _temp$2;
|
|
364
330
|
}
|
|
365
331
|
function _temp3$1(event) {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
if (!target.closest("[data-sonner-toaster]")) {
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
event.preventDefault();
|
|
332
|
+
const target = event.target;
|
|
333
|
+
if (!(target instanceof Element)) return;
|
|
334
|
+
if (!target.closest("[data-sonner-toaster]")) return;
|
|
335
|
+
event.preventDefault();
|
|
374
336
|
}
|
|
375
337
|
function _temp4$1() {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
338
|
+
const handler = _temp3$1;
|
|
339
|
+
document.addEventListener("dismissableLayer.pointerDownOutside", handler, true);
|
|
340
|
+
document.addEventListener("dismissableLayer.focusOutside", handler, true);
|
|
341
|
+
return () => {
|
|
342
|
+
document.removeEventListener("dismissableLayer.pointerDownOutside", handler, true);
|
|
343
|
+
document.removeEventListener("dismissableLayer.focusOutside", handler, true);
|
|
344
|
+
};
|
|
383
345
|
}
|
|
384
346
|
function _temp5$1() {
|
|
385
|
-
|
|
347
|
+
return startToaster();
|
|
386
348
|
}
|
|
387
349
|
function _temp6() {
|
|
388
|
-
|
|
350
|
+
return startToaster();
|
|
389
351
|
}
|
|
390
352
|
function _temp7() {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
window.setTimeout(_temp6, 150);
|
|
353
|
+
if (typeof window.requestIdleCallback === "function") {
|
|
354
|
+
window.requestIdleCallback(_temp5$1, { timeout: 2e3 });
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
window.setTimeout(_temp6, 150);
|
|
398
358
|
}
|
|
399
359
|
function _temp8() {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
});
|
|
411
|
-
return () => {
|
|
412
|
-
window.removeEventListener("load", startDeferred);
|
|
413
|
-
};
|
|
360
|
+
if (typeof window === "undefined") return;
|
|
361
|
+
const startDeferred = _temp7;
|
|
362
|
+
if (isPageLoaded()) {
|
|
363
|
+
startDeferred();
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
window.addEventListener("load", startDeferred, { once: true });
|
|
367
|
+
return () => {
|
|
368
|
+
window.removeEventListener("load", startDeferred);
|
|
369
|
+
};
|
|
414
370
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
const
|
|
543
|
-
const
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
} else {
|
|
767
|
-
t10 = $[18];
|
|
768
|
-
}
|
|
769
|
-
return t10;
|
|
770
|
-
};
|
|
771
|
-
const isProduction = env.MODE === "production";
|
|
772
|
-
const LOADER_TIMEOUT_MS = 8e3;
|
|
773
|
-
const HYDRATION_IDENTIFIER_PREFIX = "rb-";
|
|
774
|
-
const IMMUTABLE_LAZY_ROUTE_KEYS = /* @__PURE__ */ new Set(["lazy", "caseSensitive", "path", "id", "index", "children"]);
|
|
775
|
-
const showErrorOverlay = (err) => {
|
|
776
|
-
const ErrorOverlay = customElements.get("vite-error-overlay");
|
|
777
|
-
if (!ErrorOverlay) {
|
|
778
|
-
return;
|
|
779
|
-
}
|
|
780
|
-
console.log(err);
|
|
781
|
-
const overlay = new ErrorOverlay(err);
|
|
782
|
-
document.body.appendChild(overlay);
|
|
783
|
-
};
|
|
784
|
-
const handleServerErrors = () => {
|
|
785
|
-
const hydrationData = window.__staticRouterHydrationData;
|
|
786
|
-
if (hydrationData?.errors) {
|
|
787
|
-
const {
|
|
788
|
-
errors
|
|
789
|
-
} = hydrationData;
|
|
790
|
-
Object.values(errors).forEach((error) => {
|
|
791
|
-
showErrorOverlay({
|
|
792
|
-
plugin: "ssr-router",
|
|
793
|
-
...error.reason
|
|
794
|
-
});
|
|
795
|
-
});
|
|
796
|
-
}
|
|
797
|
-
};
|
|
798
|
-
const clearStaticRouterHydrationData = () => {
|
|
799
|
-
delete window.__staticRouterHydrationData;
|
|
800
|
-
};
|
|
801
|
-
const wrapLoaderWithTimeout = (loader, routeId) => async (...args) => new Promise((resolve, reject) => {
|
|
802
|
-
const timer = setTimeout(() => {
|
|
803
|
-
console.error("[rpcbase timeout][client loader]", {
|
|
804
|
-
routeId,
|
|
805
|
-
ms: LOADER_TIMEOUT_MS,
|
|
806
|
-
url: window.location.href
|
|
807
|
-
});
|
|
808
|
-
reject(new Response("Loader timeout", {
|
|
809
|
-
status: 504
|
|
810
|
-
}));
|
|
811
|
-
}, LOADER_TIMEOUT_MS);
|
|
812
|
-
Promise.resolve(loader(...args)).then((val) => {
|
|
813
|
-
clearTimeout(timer);
|
|
814
|
-
resolve(val);
|
|
815
|
-
}).catch((err) => {
|
|
816
|
-
clearTimeout(timer);
|
|
817
|
-
reject(err);
|
|
818
|
-
});
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region src/apiClient/index.ts
|
|
373
|
+
var apiClient;
|
|
374
|
+
var initApiClient = async (args) => {
|
|
375
|
+
if (env.SSR) {
|
|
376
|
+
if (!args) throw new Error("Server args must be provided in SSR mode");
|
|
377
|
+
const { getServerApiClient } = await import("./getServerApiClient-udstTQk3.js");
|
|
378
|
+
apiClient = await getServerApiClient(args.app);
|
|
379
|
+
} else {
|
|
380
|
+
const axiosClient = (await import("axios/dist/browser/axios.cjs")).default.create({
|
|
381
|
+
baseURL: args && "baseURL" in args ? args?.baseURL ?? "/" : "/",
|
|
382
|
+
withCredentials: true,
|
|
383
|
+
headers: { "Content-Type": "application/json" }
|
|
384
|
+
});
|
|
385
|
+
const createMethod = (method) => {
|
|
386
|
+
return async (path, payload, _ctx) => {
|
|
387
|
+
const config = {
|
|
388
|
+
method,
|
|
389
|
+
url: path,
|
|
390
|
+
...method === "get" ? { params: payload } : { data: payload },
|
|
391
|
+
headers: {}
|
|
392
|
+
};
|
|
393
|
+
try {
|
|
394
|
+
return (await axiosClient(config)).data;
|
|
395
|
+
} catch (error) {
|
|
396
|
+
console.log("AXIOS API ERROR", error);
|
|
397
|
+
throw error;
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
apiClient = {
|
|
402
|
+
get: createMethod("get"),
|
|
403
|
+
put: createMethod("put"),
|
|
404
|
+
post: createMethod("post"),
|
|
405
|
+
delete: createMethod("delete")
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/cleanupURL.ts
|
|
411
|
+
var CLEANUP_WAIT_DELAY = 1e3;
|
|
412
|
+
var cleanupURL = () => {
|
|
413
|
+
if (env.SSR) return;
|
|
414
|
+
const runCleanup = () => {
|
|
415
|
+
setTimeout(() => {
|
|
416
|
+
const url = new URL(window.location.href);
|
|
417
|
+
const params = new URLSearchParams(url.search);
|
|
418
|
+
Array.from(params.keys()).forEach((key) => {
|
|
419
|
+
if (key.startsWith("utm_")) params.delete(key);
|
|
420
|
+
});
|
|
421
|
+
const cleanUrl = url.pathname + (params.toString() ? "?" + params.toString() : "") + url.hash;
|
|
422
|
+
window.history.replaceState({}, document.title, cleanUrl);
|
|
423
|
+
}, CLEANUP_WAIT_DELAY);
|
|
424
|
+
};
|
|
425
|
+
if (document.readyState === "complete" || document.readyState === "interactive") runCleanup();
|
|
426
|
+
else document.addEventListener("DOMContentLoaded", runCleanup, { once: true });
|
|
427
|
+
};
|
|
428
|
+
//#endregion
|
|
429
|
+
//#region src/isDesktopDevice.ts
|
|
430
|
+
var isDesktopDevice = () => {
|
|
431
|
+
if (typeof window === "undefined") return false;
|
|
432
|
+
if (typeof window.matchMedia !== "function") return false;
|
|
433
|
+
const hasDesktopPointer = window.matchMedia("(hover: hover) and (pointer: fine)").matches;
|
|
434
|
+
const hasTouch = typeof navigator !== "undefined" && navigator.maxTouchPoints > 0;
|
|
435
|
+
return hasDesktopPointer && !hasTouch;
|
|
436
|
+
};
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region src/isPlaywrightTestEnvironment.ts
|
|
439
|
+
var isPlaywrightTestEnvironment = () => {
|
|
440
|
+
if (typeof navigator === "undefined") return false;
|
|
441
|
+
return navigator.webdriver === true;
|
|
442
|
+
};
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region src/navigationGuard/installGlobalNavigationGuard.ts
|
|
445
|
+
var DEFAULT_PRIORITY = 0;
|
|
446
|
+
var canBlockNavigation = (guard, { isPathnameChange, isSearchChange }) => {
|
|
447
|
+
if (!guard.enabled) return false;
|
|
448
|
+
if (isPathnameChange) return true;
|
|
449
|
+
if (isSearchChange && guard.blockOnSearch) return true;
|
|
450
|
+
return false;
|
|
451
|
+
};
|
|
452
|
+
var pickNavigationGuard = (args) => {
|
|
453
|
+
const isPathnameChange = args.currentLocation.pathname !== args.nextLocation.pathname;
|
|
454
|
+
const isSearchChange = args.currentLocation.search !== args.nextLocation.search;
|
|
455
|
+
if (!isPathnameChange && !isSearchChange) return null;
|
|
456
|
+
const eligibleGuards = getNavigationGuards().filter((guard) => canBlockNavigation(guard, {
|
|
457
|
+
isPathnameChange,
|
|
458
|
+
isSearchChange
|
|
459
|
+
})).filter((guard) => guard.shouldBlockNavigation(args));
|
|
460
|
+
if (eligibleGuards.length === 0) return null;
|
|
461
|
+
return eligibleGuards.reduce((best, guard) => {
|
|
462
|
+
const bestPriority = best.priority ?? DEFAULT_PRIORITY;
|
|
463
|
+
return (guard.priority ?? DEFAULT_PRIORITY) > bestPriority ? guard : best;
|
|
464
|
+
}, eligibleGuards[0]);
|
|
465
|
+
};
|
|
466
|
+
var getLocationDedupKey = (location) => location.key ?? `${location.pathname}${location.search}`;
|
|
467
|
+
var hasUnloadBlockers = () => getNavigationGuards().some((guard) => guard.enabled && guard.shouldBlockUnload);
|
|
468
|
+
var WINDOW_STATE_KEY = "__rpcbaseNavigationGuardWindowState";
|
|
469
|
+
var INSTALLED_ROUTERS_KEY = "__rpcbaseNavigationGuardInstalledRouters";
|
|
470
|
+
var BEFORE_UNLOAD_INSTALLED_KEY = "__rpcbaseBeforeUnloadNavigationGuardInstalled";
|
|
471
|
+
var getWindowState = () => {
|
|
472
|
+
if (typeof window === "undefined") return null;
|
|
473
|
+
const globalWindow = window;
|
|
474
|
+
const existing = globalWindow[WINDOW_STATE_KEY];
|
|
475
|
+
if (existing) {
|
|
476
|
+
if (typeof existing.suppressBeforeUnloadFromKey === "undefined") existing.suppressBeforeUnloadFromKey = null;
|
|
477
|
+
return existing;
|
|
478
|
+
}
|
|
479
|
+
const created = {
|
|
480
|
+
suppressBeforeUnloadFromKey: null,
|
|
481
|
+
nativePromptActive: false
|
|
482
|
+
};
|
|
483
|
+
globalWindow[WINDOW_STATE_KEY] = created;
|
|
484
|
+
return created;
|
|
485
|
+
};
|
|
486
|
+
var getGlobalGuardWeakSet = () => {
|
|
487
|
+
const globalScope = globalThis;
|
|
488
|
+
const existing = globalScope[INSTALLED_ROUTERS_KEY];
|
|
489
|
+
if (existing && existing instanceof WeakSet) return existing;
|
|
490
|
+
const created = /* @__PURE__ */ new WeakSet();
|
|
491
|
+
globalScope[INSTALLED_ROUTERS_KEY] = created;
|
|
492
|
+
return created;
|
|
493
|
+
};
|
|
494
|
+
var installGlobalNavigationGuard = (router) => {
|
|
495
|
+
const installedRouters = getGlobalGuardWeakSet();
|
|
496
|
+
if (installedRouters.has(router)) return;
|
|
497
|
+
installedRouters.add(router);
|
|
498
|
+
const blockerKey = "rpcbase:navigation-guards";
|
|
499
|
+
const windowState = getWindowState();
|
|
500
|
+
let lastArgs = null;
|
|
501
|
+
let lastPromptedLocationKey = null;
|
|
502
|
+
router.getBlocker(blockerKey, (args) => {
|
|
503
|
+
lastArgs = args;
|
|
504
|
+
if (windowState?.nativePromptActive && args.historyAction !== "POP") windowState.nativePromptActive = false;
|
|
505
|
+
return pickNavigationGuard(args) !== null;
|
|
506
|
+
});
|
|
507
|
+
router.subscribe((state) => {
|
|
508
|
+
if (windowState?.suppressBeforeUnloadFromKey) {
|
|
509
|
+
if (getLocationDedupKey(state.location) !== windowState.suppressBeforeUnloadFromKey) windowState.suppressBeforeUnloadFromKey = null;
|
|
510
|
+
}
|
|
511
|
+
const blocker = state.blockers.get(blockerKey);
|
|
512
|
+
if (!blocker || blocker.state !== "blocked") {
|
|
513
|
+
lastPromptedLocationKey = null;
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
const blockedLocation = blocker.location;
|
|
517
|
+
const dedupKey = getLocationDedupKey(blockedLocation);
|
|
518
|
+
if (lastPromptedLocationKey === dedupKey) return;
|
|
519
|
+
lastPromptedLocationKey = dedupKey;
|
|
520
|
+
if (windowState?.nativePromptActive && lastArgs?.historyAction === "POP") {
|
|
521
|
+
windowState.nativePromptActive = false;
|
|
522
|
+
blocker.reset();
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
const args = lastArgs;
|
|
526
|
+
if (!args) {
|
|
527
|
+
blocker.proceed();
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
const guard = pickNavigationGuard(args);
|
|
531
|
+
if (!guard) {
|
|
532
|
+
blocker.proceed();
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
if (window.confirm(guard.message)) {
|
|
536
|
+
if (windowState) windowState.suppressBeforeUnloadFromKey = getLocationDedupKey(args.currentLocation);
|
|
537
|
+
blocker.proceed();
|
|
538
|
+
} else blocker.reset();
|
|
539
|
+
});
|
|
540
|
+
if (typeof window !== "undefined") {
|
|
541
|
+
const globalWindow = window;
|
|
542
|
+
if (!globalWindow[BEFORE_UNLOAD_INSTALLED_KEY]) {
|
|
543
|
+
globalWindow[BEFORE_UNLOAD_INSTALLED_KEY] = true;
|
|
544
|
+
window.addEventListener("beforeunload", (event) => {
|
|
545
|
+
const state = getWindowState();
|
|
546
|
+
if (state && state.suppressBeforeUnloadFromKey) {
|
|
547
|
+
state.suppressBeforeUnloadFromKey = null;
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
if (!hasUnloadBlockers()) return;
|
|
551
|
+
if (state) state.nativePromptActive = true;
|
|
552
|
+
event.preventDefault();
|
|
553
|
+
event.returnValue = "";
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
//#endregion
|
|
559
|
+
//#region src/ssrErrorState.ts
|
|
560
|
+
var SSR_ERROR_STATE_GLOBAL_KEY = "__RPCBASE_SSR_ERROR__";
|
|
561
|
+
var ESCAPED_LT = /</g;
|
|
562
|
+
var ESCAPED_U2028 = /\u2028/g;
|
|
563
|
+
var ESCAPED_U2029 = /\u2029/g;
|
|
564
|
+
var serializeSsrErrorState = (state) => JSON.stringify(state).replace(ESCAPED_LT, "\\u003c").replace(ESCAPED_U2028, "\\u2028").replace(ESCAPED_U2029, "\\u2029");
|
|
565
|
+
var peekClientSsrErrorState = () => {
|
|
566
|
+
if (typeof window === "undefined") return null;
|
|
567
|
+
const state = window[SSR_ERROR_STATE_GLOBAL_KEY];
|
|
568
|
+
if (state && typeof state === "object") return state;
|
|
569
|
+
return null;
|
|
570
|
+
};
|
|
571
|
+
var consumeClientSsrErrorState = () => {
|
|
572
|
+
const state = peekClientSsrErrorState();
|
|
573
|
+
if (!state) return null;
|
|
574
|
+
if (typeof window !== "undefined") delete window[SSR_ERROR_STATE_GLOBAL_KEY];
|
|
575
|
+
return state;
|
|
576
|
+
};
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region src/components/SsrErrorFallback.tsx
|
|
579
|
+
var DEFAULT_TITLE = "Something went wrong";
|
|
580
|
+
var DEFAULT_MESSAGE = "We couldn't render this page. Please try again in a few seconds.";
|
|
581
|
+
var SsrErrorFallback = (t0) => {
|
|
582
|
+
const $ = c(19);
|
|
583
|
+
const { state, renderErrorExtra } = t0;
|
|
584
|
+
const { statusCode: t1, title: t2, message: t3, details } = state;
|
|
585
|
+
const statusCode = t1 === void 0 ? 500 : t1;
|
|
586
|
+
const title = t2 === void 0 ? DEFAULT_TITLE : t2;
|
|
587
|
+
const message = t3 === void 0 ? DEFAULT_MESSAGE : t3;
|
|
588
|
+
let t4;
|
|
589
|
+
if ($[0] !== renderErrorExtra || $[1] !== state) {
|
|
590
|
+
t4 = renderErrorExtra?.(state);
|
|
591
|
+
$[0] = renderErrorExtra;
|
|
592
|
+
$[1] = state;
|
|
593
|
+
$[2] = t4;
|
|
594
|
+
} else t4 = $[2];
|
|
595
|
+
const extra = t4;
|
|
596
|
+
let t5;
|
|
597
|
+
if ($[3] !== statusCode) {
|
|
598
|
+
t5 = /* @__PURE__ */ jsx("p", {
|
|
599
|
+
className: "text-base font-semibold text-rose-600",
|
|
600
|
+
children: statusCode
|
|
601
|
+
});
|
|
602
|
+
$[3] = statusCode;
|
|
603
|
+
$[4] = t5;
|
|
604
|
+
} else t5 = $[4];
|
|
605
|
+
let t6;
|
|
606
|
+
if ($[5] !== title) {
|
|
607
|
+
t6 = /* @__PURE__ */ jsx("h1", {
|
|
608
|
+
className: "mt-4 text-pretty text-4xl font-semibold tracking-tight text-gray-900 sm:text-5xl",
|
|
609
|
+
children: title
|
|
610
|
+
});
|
|
611
|
+
$[5] = title;
|
|
612
|
+
$[6] = t6;
|
|
613
|
+
} else t6 = $[6];
|
|
614
|
+
let t7;
|
|
615
|
+
if ($[7] !== message) {
|
|
616
|
+
t7 = /* @__PURE__ */ jsx("p", {
|
|
617
|
+
className: "mt-6 text-lg text-gray-600 sm:text-xl/relaxed",
|
|
618
|
+
children: message
|
|
619
|
+
});
|
|
620
|
+
$[7] = message;
|
|
621
|
+
$[8] = t7;
|
|
622
|
+
} else t7 = $[8];
|
|
623
|
+
let t8;
|
|
624
|
+
if ($[9] !== details) {
|
|
625
|
+
t8 = details ? /* @__PURE__ */ jsxs("div", {
|
|
626
|
+
className: "mt-10 w-full rounded-2xl bg-gray-900/95 p-5 text-left shadow-2xl",
|
|
627
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
628
|
+
className: "text-sm font-semibold uppercase tracking-wide text-gray-400",
|
|
629
|
+
children: "Debug details"
|
|
630
|
+
}), /* @__PURE__ */ jsx("pre", {
|
|
631
|
+
className: "mt-3 max-h-64 overflow-auto whitespace-pre-wrap text-sm text-gray-100",
|
|
632
|
+
children: details
|
|
633
|
+
})]
|
|
634
|
+
}) : null;
|
|
635
|
+
$[9] = details;
|
|
636
|
+
$[10] = t8;
|
|
637
|
+
} else t8 = $[10];
|
|
638
|
+
let t9;
|
|
639
|
+
if ($[11] !== extra) {
|
|
640
|
+
t9 = extra ? /* @__PURE__ */ jsx("div", {
|
|
641
|
+
className: "mt-10 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-center",
|
|
642
|
+
children: extra
|
|
643
|
+
}) : null;
|
|
644
|
+
$[11] = extra;
|
|
645
|
+
$[12] = t9;
|
|
646
|
+
} else t9 = $[12];
|
|
647
|
+
let t10;
|
|
648
|
+
if ($[13] !== t5 || $[14] !== t6 || $[15] !== t7 || $[16] !== t8 || $[17] !== t9) {
|
|
649
|
+
t10 = /* @__PURE__ */ jsx("div", {
|
|
650
|
+
className: "bg-white min-h-screen",
|
|
651
|
+
children: /* @__PURE__ */ jsxs("main", {
|
|
652
|
+
className: "mx-auto flex min-h-screen max-w-2xl flex-col items-center justify-center px-6 py-12 text-center sm:py-24",
|
|
653
|
+
children: [
|
|
654
|
+
t5,
|
|
655
|
+
t6,
|
|
656
|
+
t7,
|
|
657
|
+
t8,
|
|
658
|
+
t9
|
|
659
|
+
]
|
|
660
|
+
})
|
|
661
|
+
});
|
|
662
|
+
$[13] = t5;
|
|
663
|
+
$[14] = t6;
|
|
664
|
+
$[15] = t7;
|
|
665
|
+
$[16] = t8;
|
|
666
|
+
$[17] = t9;
|
|
667
|
+
$[18] = t10;
|
|
668
|
+
} else t10 = $[18];
|
|
669
|
+
return t10;
|
|
670
|
+
};
|
|
671
|
+
//#endregion
|
|
672
|
+
//#region src/initWithRoutes.tsx
|
|
673
|
+
var isProduction = env.MODE === "production";
|
|
674
|
+
var LOADER_TIMEOUT_MS = 8e3;
|
|
675
|
+
var HYDRATION_IDENTIFIER_PREFIX = "rb-";
|
|
676
|
+
var IMMUTABLE_LAZY_ROUTE_KEYS = new Set([
|
|
677
|
+
"lazy",
|
|
678
|
+
"caseSensitive",
|
|
679
|
+
"path",
|
|
680
|
+
"id",
|
|
681
|
+
"index",
|
|
682
|
+
"children"
|
|
683
|
+
]);
|
|
684
|
+
var showErrorOverlay = (err) => {
|
|
685
|
+
const ErrorOverlay = customElements.get("vite-error-overlay");
|
|
686
|
+
if (!ErrorOverlay) return;
|
|
687
|
+
console.log(err);
|
|
688
|
+
const overlay = new ErrorOverlay(err);
|
|
689
|
+
document.body.appendChild(overlay);
|
|
690
|
+
};
|
|
691
|
+
var handleServerErrors = () => {
|
|
692
|
+
const hydrationData = window.__staticRouterHydrationData;
|
|
693
|
+
if (hydrationData?.errors) {
|
|
694
|
+
const { errors } = hydrationData;
|
|
695
|
+
Object.values(errors).forEach((error) => {
|
|
696
|
+
showErrorOverlay({
|
|
697
|
+
plugin: "ssr-router",
|
|
698
|
+
...error.reason
|
|
699
|
+
});
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
var clearStaticRouterHydrationData = () => {
|
|
704
|
+
delete window.__staticRouterHydrationData;
|
|
705
|
+
};
|
|
706
|
+
var wrapLoaderWithTimeout = (loader, routeId) => async (...args) => new Promise((resolve, reject) => {
|
|
707
|
+
const timer = setTimeout(() => {
|
|
708
|
+
console.error("[rpcbase timeout][client loader]", {
|
|
709
|
+
routeId,
|
|
710
|
+
ms: LOADER_TIMEOUT_MS,
|
|
711
|
+
url: window.location.href
|
|
712
|
+
});
|
|
713
|
+
reject(new Response("Loader timeout", { status: 504 }));
|
|
714
|
+
}, LOADER_TIMEOUT_MS);
|
|
715
|
+
Promise.resolve(loader(...args)).then((val) => {
|
|
716
|
+
clearTimeout(timer);
|
|
717
|
+
resolve(val);
|
|
718
|
+
}).catch((err) => {
|
|
719
|
+
clearTimeout(timer);
|
|
720
|
+
reject(err);
|
|
721
|
+
});
|
|
819
722
|
});
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
};
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
};
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
function
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
var
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
}
|
|
723
|
+
var applyLoaderTimeouts = (routes) => {
|
|
724
|
+
routes.forEach((route) => {
|
|
725
|
+
if (typeof route.loader === "function") route.loader = wrapLoaderWithTimeout(route.loader, route.id);
|
|
726
|
+
if (typeof route.lazy === "function") {
|
|
727
|
+
const origLazy = route.lazy;
|
|
728
|
+
route.lazy = async (...lazyArgs) => {
|
|
729
|
+
const mod = await origLazy(...lazyArgs);
|
|
730
|
+
if (typeof mod.loader === "function") {
|
|
731
|
+
const origLoader = mod.loader;
|
|
732
|
+
mod.loader = (...loaderArgs) => wrapLoaderWithTimeout(origLoader, route.id)(...loaderArgs);
|
|
733
|
+
}
|
|
734
|
+
return mod;
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
if (route.children) applyLoaderTimeouts(route.children);
|
|
738
|
+
});
|
|
739
|
+
};
|
|
740
|
+
var resolveLazyRoute = async (route) => {
|
|
741
|
+
const lazy = route.lazy;
|
|
742
|
+
if (typeof lazy !== "function") return;
|
|
743
|
+
const lazyModule = await lazy();
|
|
744
|
+
if (!lazyModule || typeof lazyModule !== "object") {
|
|
745
|
+
route.lazy = void 0;
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
const mutableRoute = route;
|
|
749
|
+
for (const [key, value] of Object.entries(lazyModule)) {
|
|
750
|
+
if (IMMUTABLE_LAZY_ROUTE_KEYS.has(key)) continue;
|
|
751
|
+
if (mutableRoute[key] !== void 0) continue;
|
|
752
|
+
mutableRoute[key] = value;
|
|
753
|
+
}
|
|
754
|
+
route.lazy = void 0;
|
|
755
|
+
};
|
|
756
|
+
var preloadMatchedLazyRoutes = async (routes) => {
|
|
757
|
+
const matches = matchRoutes(routes, {
|
|
758
|
+
pathname: window.location.pathname,
|
|
759
|
+
search: window.location.search,
|
|
760
|
+
hash: window.location.hash
|
|
761
|
+
});
|
|
762
|
+
if (!matches?.length) return;
|
|
763
|
+
await Promise.all(matches.map((match) => resolveLazyRoute(match.route)));
|
|
764
|
+
};
|
|
765
|
+
var getRootElement = () => {
|
|
766
|
+
const el = document.getElementById("root");
|
|
767
|
+
if (!el) throw new Error("Root element #root not found");
|
|
768
|
+
return el;
|
|
769
|
+
};
|
|
770
|
+
var hydrateSsrFallbackIfPresent = (rootElement, renderErrorExtra) => {
|
|
771
|
+
const ssrErrorState = peekClientSsrErrorState();
|
|
772
|
+
if (!ssrErrorState) return false;
|
|
773
|
+
consumeClientSsrErrorState();
|
|
774
|
+
hydrateRoot(rootElement, /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(SsrErrorFallback, {
|
|
775
|
+
state: ssrErrorState,
|
|
776
|
+
renderErrorExtra
|
|
777
|
+
}) }));
|
|
778
|
+
return true;
|
|
779
|
+
};
|
|
780
|
+
var ClientOnly = (t0) => {
|
|
781
|
+
const $ = c(4);
|
|
782
|
+
const { children } = t0;
|
|
783
|
+
const [mounted, setMounted] = useState(false);
|
|
784
|
+
let t1;
|
|
785
|
+
let t2;
|
|
786
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
787
|
+
t1 = () => {
|
|
788
|
+
setMounted(true);
|
|
789
|
+
};
|
|
790
|
+
t2 = [];
|
|
791
|
+
$[0] = t1;
|
|
792
|
+
$[1] = t2;
|
|
793
|
+
} else {
|
|
794
|
+
t1 = $[0];
|
|
795
|
+
t2 = $[1];
|
|
796
|
+
}
|
|
797
|
+
useEffect(t1, t2);
|
|
798
|
+
if (!mounted) return null;
|
|
799
|
+
let t3;
|
|
800
|
+
if ($[2] !== children) {
|
|
801
|
+
t3 = /* @__PURE__ */ jsx(Fragment, { children });
|
|
802
|
+
$[2] = children;
|
|
803
|
+
$[3] = t3;
|
|
804
|
+
} else t3 = $[3];
|
|
805
|
+
return t3;
|
|
806
|
+
};
|
|
807
|
+
var initWithRoutes = async (routesElement, opts) => {
|
|
808
|
+
const rootElement = getRootElement();
|
|
809
|
+
if (hydrateSsrFallbackIfPresent(rootElement, opts?.renderErrorExtra)) return;
|
|
810
|
+
await initApiClient();
|
|
811
|
+
cleanupURL();
|
|
812
|
+
handleServerErrors();
|
|
813
|
+
hydrateRtsFromWindow();
|
|
814
|
+
const routes = createRoutesFromElements(routesElement);
|
|
815
|
+
applyLoaderTimeouts(routes);
|
|
816
|
+
await preloadMatchedLazyRoutes(routes);
|
|
817
|
+
const router = createBrowserRouter(routes, {});
|
|
818
|
+
clearStaticRouterHydrationData();
|
|
819
|
+
installGlobalNavigationGuard(router);
|
|
820
|
+
const toError = (error) => error instanceof Error ? error : new Error(String(error));
|
|
821
|
+
const mentionsHydration = (value, depth = 0) => {
|
|
822
|
+
if (depth > 5) return false;
|
|
823
|
+
if (typeof value === "string") return value.toLowerCase().includes("hydrat");
|
|
824
|
+
if (value instanceof Error) {
|
|
825
|
+
const digest = value.digest;
|
|
826
|
+
const cause = value.cause;
|
|
827
|
+
return mentionsHydration(value.message, depth + 1) || mentionsHydration(digest, depth + 1) || mentionsHydration(cause, depth + 1);
|
|
828
|
+
}
|
|
829
|
+
return false;
|
|
830
|
+
};
|
|
831
|
+
const reactErrorHandler = (reactContext) => (error, errorInfo) => {
|
|
832
|
+
const err = toError(error);
|
|
833
|
+
reportClientException(err, {
|
|
834
|
+
reactContext,
|
|
835
|
+
componentStack: errorInfo?.componentStack
|
|
836
|
+
});
|
|
837
|
+
if (reactContext === "uncaught") console.warn("Uncaught error", err, errorInfo?.componentStack);
|
|
838
|
+
};
|
|
839
|
+
const baseHydrationOptions = { identifierPrefix: HYDRATION_IDENTIFIER_PREFIX };
|
|
840
|
+
const hydrationOptions = isProduction ? {
|
|
841
|
+
...baseHydrationOptions,
|
|
842
|
+
onUncaughtError: reactErrorHandler("uncaught"),
|
|
843
|
+
onCaughtError: reactErrorHandler("caught"),
|
|
844
|
+
onRecoverableError: reactErrorHandler("recoverable")
|
|
845
|
+
} : opts?.devThrowsOnHydrationErrors ? {
|
|
846
|
+
...baseHydrationOptions,
|
|
847
|
+
onRecoverableError(error, errorInfo) {
|
|
848
|
+
const err = toError(error);
|
|
849
|
+
if (mentionsHydration(err) || mentionsHydration(errorInfo?.componentStack)) throw err;
|
|
850
|
+
console.error(err, errorInfo?.componentStack);
|
|
851
|
+
}
|
|
852
|
+
} : baseHydrationOptions;
|
|
853
|
+
hydrateRoot(rootElement, /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(RouterProvider, { router }), /* @__PURE__ */ jsx(ClientOnly, { children: /* @__PURE__ */ jsx(Toaster, {}) })] }) }), hydrationOptions);
|
|
854
|
+
};
|
|
855
|
+
if (!isProduction && !env.SSR && isDesktopDevice() && !isPlaywrightTestEnvironment()) import("react-grab/core").then(({ init }) => {
|
|
856
|
+
init({});
|
|
857
|
+
});
|
|
858
|
+
//#endregion
|
|
859
|
+
//#region node_modules/lodash/_arrayReduce.js
|
|
860
|
+
var require__arrayReduce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
861
|
+
/**
|
|
862
|
+
* A specialized version of `_.reduce` for arrays without support for
|
|
863
|
+
* iteratee shorthands.
|
|
864
|
+
*
|
|
865
|
+
* @private
|
|
866
|
+
* @param {Array} [array] The array to iterate over.
|
|
867
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
868
|
+
* @param {*} [accumulator] The initial value.
|
|
869
|
+
* @param {boolean} [initAccum] Specify using the first element of `array` as
|
|
870
|
+
* the initial value.
|
|
871
|
+
* @returns {*} Returns the accumulated value.
|
|
872
|
+
*/
|
|
873
|
+
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
874
|
+
var index = -1, length = array == null ? 0 : array.length;
|
|
875
|
+
if (initAccum && length) accumulator = array[++index];
|
|
876
|
+
while (++index < length) accumulator = iteratee(accumulator, array[index], index, array);
|
|
877
|
+
return accumulator;
|
|
878
|
+
}
|
|
879
|
+
module.exports = arrayReduce;
|
|
880
|
+
}));
|
|
881
|
+
//#endregion
|
|
882
|
+
//#region node_modules/lodash/_basePropertyOf.js
|
|
883
|
+
var require__basePropertyOf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
884
|
+
/**
|
|
885
|
+
* The base implementation of `_.propertyOf` without support for deep paths.
|
|
886
|
+
*
|
|
887
|
+
* @private
|
|
888
|
+
* @param {Object} object The object to query.
|
|
889
|
+
* @returns {Function} Returns the new accessor function.
|
|
890
|
+
*/
|
|
891
|
+
function basePropertyOf(object) {
|
|
892
|
+
return function(key) {
|
|
893
|
+
return object == null ? void 0 : object[key];
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
module.exports = basePropertyOf;
|
|
897
|
+
}));
|
|
898
|
+
//#endregion
|
|
899
|
+
//#region node_modules/lodash/_deburrLetter.js
|
|
900
|
+
var require__deburrLetter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
901
|
+
module.exports = require__basePropertyOf()({
|
|
902
|
+
"À": "A",
|
|
903
|
+
"Á": "A",
|
|
904
|
+
"Â": "A",
|
|
905
|
+
"Ã": "A",
|
|
906
|
+
"Ä": "A",
|
|
907
|
+
"Å": "A",
|
|
908
|
+
"à": "a",
|
|
909
|
+
"á": "a",
|
|
910
|
+
"â": "a",
|
|
911
|
+
"ã": "a",
|
|
912
|
+
"ä": "a",
|
|
913
|
+
"å": "a",
|
|
914
|
+
"Ç": "C",
|
|
915
|
+
"ç": "c",
|
|
916
|
+
"Ð": "D",
|
|
917
|
+
"ð": "d",
|
|
918
|
+
"È": "E",
|
|
919
|
+
"É": "E",
|
|
920
|
+
"Ê": "E",
|
|
921
|
+
"Ë": "E",
|
|
922
|
+
"è": "e",
|
|
923
|
+
"é": "e",
|
|
924
|
+
"ê": "e",
|
|
925
|
+
"ë": "e",
|
|
926
|
+
"Ì": "I",
|
|
927
|
+
"Í": "I",
|
|
928
|
+
"Î": "I",
|
|
929
|
+
"Ï": "I",
|
|
930
|
+
"ì": "i",
|
|
931
|
+
"í": "i",
|
|
932
|
+
"î": "i",
|
|
933
|
+
"ï": "i",
|
|
934
|
+
"Ñ": "N",
|
|
935
|
+
"ñ": "n",
|
|
936
|
+
"Ò": "O",
|
|
937
|
+
"Ó": "O",
|
|
938
|
+
"Ô": "O",
|
|
939
|
+
"Õ": "O",
|
|
940
|
+
"Ö": "O",
|
|
941
|
+
"Ø": "O",
|
|
942
|
+
"ò": "o",
|
|
943
|
+
"ó": "o",
|
|
944
|
+
"ô": "o",
|
|
945
|
+
"õ": "o",
|
|
946
|
+
"ö": "o",
|
|
947
|
+
"ø": "o",
|
|
948
|
+
"Ù": "U",
|
|
949
|
+
"Ú": "U",
|
|
950
|
+
"Û": "U",
|
|
951
|
+
"Ü": "U",
|
|
952
|
+
"ù": "u",
|
|
953
|
+
"ú": "u",
|
|
954
|
+
"û": "u",
|
|
955
|
+
"ü": "u",
|
|
956
|
+
"Ý": "Y",
|
|
957
|
+
"ý": "y",
|
|
958
|
+
"ÿ": "y",
|
|
959
|
+
"Æ": "Ae",
|
|
960
|
+
"æ": "ae",
|
|
961
|
+
"Þ": "Th",
|
|
962
|
+
"þ": "th",
|
|
963
|
+
"ß": "ss",
|
|
964
|
+
"Ā": "A",
|
|
965
|
+
"Ă": "A",
|
|
966
|
+
"Ą": "A",
|
|
967
|
+
"ā": "a",
|
|
968
|
+
"ă": "a",
|
|
969
|
+
"ą": "a",
|
|
970
|
+
"Ć": "C",
|
|
971
|
+
"Ĉ": "C",
|
|
972
|
+
"Ċ": "C",
|
|
973
|
+
"Č": "C",
|
|
974
|
+
"ć": "c",
|
|
975
|
+
"ĉ": "c",
|
|
976
|
+
"ċ": "c",
|
|
977
|
+
"č": "c",
|
|
978
|
+
"Ď": "D",
|
|
979
|
+
"Đ": "D",
|
|
980
|
+
"ď": "d",
|
|
981
|
+
"đ": "d",
|
|
982
|
+
"Ē": "E",
|
|
983
|
+
"Ĕ": "E",
|
|
984
|
+
"Ė": "E",
|
|
985
|
+
"Ę": "E",
|
|
986
|
+
"Ě": "E",
|
|
987
|
+
"ē": "e",
|
|
988
|
+
"ĕ": "e",
|
|
989
|
+
"ė": "e",
|
|
990
|
+
"ę": "e",
|
|
991
|
+
"ě": "e",
|
|
992
|
+
"Ĝ": "G",
|
|
993
|
+
"Ğ": "G",
|
|
994
|
+
"Ġ": "G",
|
|
995
|
+
"Ģ": "G",
|
|
996
|
+
"ĝ": "g",
|
|
997
|
+
"ğ": "g",
|
|
998
|
+
"ġ": "g",
|
|
999
|
+
"ģ": "g",
|
|
1000
|
+
"Ĥ": "H",
|
|
1001
|
+
"Ħ": "H",
|
|
1002
|
+
"ĥ": "h",
|
|
1003
|
+
"ħ": "h",
|
|
1004
|
+
"Ĩ": "I",
|
|
1005
|
+
"Ī": "I",
|
|
1006
|
+
"Ĭ": "I",
|
|
1007
|
+
"Į": "I",
|
|
1008
|
+
"İ": "I",
|
|
1009
|
+
"ĩ": "i",
|
|
1010
|
+
"ī": "i",
|
|
1011
|
+
"ĭ": "i",
|
|
1012
|
+
"į": "i",
|
|
1013
|
+
"ı": "i",
|
|
1014
|
+
"Ĵ": "J",
|
|
1015
|
+
"ĵ": "j",
|
|
1016
|
+
"Ķ": "K",
|
|
1017
|
+
"ķ": "k",
|
|
1018
|
+
"ĸ": "k",
|
|
1019
|
+
"Ĺ": "L",
|
|
1020
|
+
"Ļ": "L",
|
|
1021
|
+
"Ľ": "L",
|
|
1022
|
+
"Ŀ": "L",
|
|
1023
|
+
"Ł": "L",
|
|
1024
|
+
"ĺ": "l",
|
|
1025
|
+
"ļ": "l",
|
|
1026
|
+
"ľ": "l",
|
|
1027
|
+
"ŀ": "l",
|
|
1028
|
+
"ł": "l",
|
|
1029
|
+
"Ń": "N",
|
|
1030
|
+
"Ņ": "N",
|
|
1031
|
+
"Ň": "N",
|
|
1032
|
+
"Ŋ": "N",
|
|
1033
|
+
"ń": "n",
|
|
1034
|
+
"ņ": "n",
|
|
1035
|
+
"ň": "n",
|
|
1036
|
+
"ŋ": "n",
|
|
1037
|
+
"Ō": "O",
|
|
1038
|
+
"Ŏ": "O",
|
|
1039
|
+
"Ő": "O",
|
|
1040
|
+
"ō": "o",
|
|
1041
|
+
"ŏ": "o",
|
|
1042
|
+
"ő": "o",
|
|
1043
|
+
"Ŕ": "R",
|
|
1044
|
+
"Ŗ": "R",
|
|
1045
|
+
"Ř": "R",
|
|
1046
|
+
"ŕ": "r",
|
|
1047
|
+
"ŗ": "r",
|
|
1048
|
+
"ř": "r",
|
|
1049
|
+
"Ś": "S",
|
|
1050
|
+
"Ŝ": "S",
|
|
1051
|
+
"Ş": "S",
|
|
1052
|
+
"Š": "S",
|
|
1053
|
+
"ś": "s",
|
|
1054
|
+
"ŝ": "s",
|
|
1055
|
+
"ş": "s",
|
|
1056
|
+
"š": "s",
|
|
1057
|
+
"Ţ": "T",
|
|
1058
|
+
"Ť": "T",
|
|
1059
|
+
"Ŧ": "T",
|
|
1060
|
+
"ţ": "t",
|
|
1061
|
+
"ť": "t",
|
|
1062
|
+
"ŧ": "t",
|
|
1063
|
+
"Ũ": "U",
|
|
1064
|
+
"Ū": "U",
|
|
1065
|
+
"Ŭ": "U",
|
|
1066
|
+
"Ů": "U",
|
|
1067
|
+
"Ű": "U",
|
|
1068
|
+
"Ų": "U",
|
|
1069
|
+
"ũ": "u",
|
|
1070
|
+
"ū": "u",
|
|
1071
|
+
"ŭ": "u",
|
|
1072
|
+
"ů": "u",
|
|
1073
|
+
"ű": "u",
|
|
1074
|
+
"ų": "u",
|
|
1075
|
+
"Ŵ": "W",
|
|
1076
|
+
"ŵ": "w",
|
|
1077
|
+
"Ŷ": "Y",
|
|
1078
|
+
"ŷ": "y",
|
|
1079
|
+
"Ÿ": "Y",
|
|
1080
|
+
"Ź": "Z",
|
|
1081
|
+
"Ż": "Z",
|
|
1082
|
+
"Ž": "Z",
|
|
1083
|
+
"ź": "z",
|
|
1084
|
+
"ż": "z",
|
|
1085
|
+
"ž": "z",
|
|
1086
|
+
"IJ": "IJ",
|
|
1087
|
+
"ij": "ij",
|
|
1088
|
+
"Œ": "Oe",
|
|
1089
|
+
"œ": "oe",
|
|
1090
|
+
"ʼn": "'n",
|
|
1091
|
+
"ſ": "s"
|
|
1092
|
+
});
|
|
1093
|
+
}));
|
|
1094
|
+
//#endregion
|
|
1095
|
+
//#region node_modules/lodash/deburr.js
|
|
1096
|
+
var require_deburr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1097
|
+
var deburrLetter = require__deburrLetter(), toString = require_toString();
|
|
1098
|
+
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
|
1099
|
+
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
1100
|
+
/**
|
|
1101
|
+
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
|
|
1102
|
+
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
|
|
1103
|
+
*/
|
|
1104
|
+
var reComboMark = RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", "g");
|
|
1105
|
+
/**
|
|
1106
|
+
* Deburrs `string` by converting
|
|
1107
|
+
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
|
1108
|
+
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
|
|
1109
|
+
* letters to basic Latin letters and removing
|
|
1110
|
+
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
|
1111
|
+
*
|
|
1112
|
+
* @static
|
|
1113
|
+
* @memberOf _
|
|
1114
|
+
* @since 3.0.0
|
|
1115
|
+
* @category String
|
|
1116
|
+
* @param {string} [string=''] The string to deburr.
|
|
1117
|
+
* @returns {string} Returns the deburred string.
|
|
1118
|
+
* @example
|
|
1119
|
+
*
|
|
1120
|
+
* _.deburr('déjà vu');
|
|
1121
|
+
* // => 'deja vu'
|
|
1122
|
+
*/
|
|
1123
|
+
function deburr(string) {
|
|
1124
|
+
string = toString(string);
|
|
1125
|
+
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
|
|
1126
|
+
}
|
|
1127
|
+
module.exports = deburr;
|
|
1128
|
+
}));
|
|
1129
|
+
//#endregion
|
|
1130
|
+
//#region node_modules/lodash/_asciiWords.js
|
|
1131
|
+
var require__asciiWords = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1132
|
+
/** Used to match words composed of alphanumeric characters. */
|
|
1133
|
+
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
1134
|
+
/**
|
|
1135
|
+
* Splits an ASCII `string` into an array of its words.
|
|
1136
|
+
*
|
|
1137
|
+
* @private
|
|
1138
|
+
* @param {string} The string to inspect.
|
|
1139
|
+
* @returns {Array} Returns the words of `string`.
|
|
1140
|
+
*/
|
|
1141
|
+
function asciiWords(string) {
|
|
1142
|
+
return string.match(reAsciiWord) || [];
|
|
1143
|
+
}
|
|
1144
|
+
module.exports = asciiWords;
|
|
1145
|
+
}));
|
|
1146
|
+
//#endregion
|
|
1147
|
+
//#region node_modules/lodash/_hasUnicodeWord.js
|
|
1148
|
+
var require__hasUnicodeWord = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1149
|
+
/** Used to detect strings that need a more robust regexp to match words. */
|
|
1150
|
+
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
1151
|
+
/**
|
|
1152
|
+
* Checks if `string` contains a word composed of Unicode symbols.
|
|
1153
|
+
*
|
|
1154
|
+
* @private
|
|
1155
|
+
* @param {string} string The string to inspect.
|
|
1156
|
+
* @returns {boolean} Returns `true` if a word is found, else `false`.
|
|
1157
|
+
*/
|
|
1158
|
+
function hasUnicodeWord(string) {
|
|
1159
|
+
return reHasUnicodeWord.test(string);
|
|
1160
|
+
}
|
|
1161
|
+
module.exports = hasUnicodeWord;
|
|
1162
|
+
}));
|
|
1163
|
+
//#endregion
|
|
1164
|
+
//#region node_modules/lodash/_unicodeWords.js
|
|
1165
|
+
var require__unicodeWords = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1166
|
+
/** Used to compose unicode character classes. */
|
|
1167
|
+
var rsAstralRange = "\\ud800-\\udfff", rsComboRange = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
1168
|
+
/** Used to compose unicode capture groups. */
|
|
1169
|
+
var rsApos = "['’]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsModifier = "(?:" + rsCombo + "|\\ud83c[\\udffb-\\udfff])", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
|
|
1170
|
+
/** Used to compose unicode regexes. */
|
|
1171
|
+
var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [
|
|
1172
|
+
rsNonAstral,
|
|
1173
|
+
rsRegional,
|
|
1174
|
+
rsSurrPair
|
|
1175
|
+
].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [
|
|
1176
|
+
rsDingbat,
|
|
1177
|
+
rsRegional,
|
|
1178
|
+
rsSurrPair
|
|
1179
|
+
].join("|") + ")" + rsSeq;
|
|
1180
|
+
/** Used to match complex or compound words. */
|
|
1181
|
+
var reUnicodeWord = RegExp([
|
|
1182
|
+
rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [
|
|
1183
|
+
rsBreak,
|
|
1184
|
+
rsUpper,
|
|
1185
|
+
"$"
|
|
1186
|
+
].join("|") + ")",
|
|
1187
|
+
rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [
|
|
1188
|
+
rsBreak,
|
|
1189
|
+
rsUpper + rsMiscLower,
|
|
1190
|
+
"$"
|
|
1191
|
+
].join("|") + ")",
|
|
1192
|
+
rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
|
|
1193
|
+
rsUpper + "+" + rsOptContrUpper,
|
|
1194
|
+
rsOrdUpper,
|
|
1195
|
+
rsOrdLower,
|
|
1196
|
+
rsDigits,
|
|
1197
|
+
rsEmoji
|
|
1198
|
+
].join("|"), "g");
|
|
1199
|
+
/**
|
|
1200
|
+
* Splits a Unicode `string` into an array of its words.
|
|
1201
|
+
*
|
|
1202
|
+
* @private
|
|
1203
|
+
* @param {string} The string to inspect.
|
|
1204
|
+
* @returns {Array} Returns the words of `string`.
|
|
1205
|
+
*/
|
|
1206
|
+
function unicodeWords(string) {
|
|
1207
|
+
return string.match(reUnicodeWord) || [];
|
|
1208
|
+
}
|
|
1209
|
+
module.exports = unicodeWords;
|
|
1210
|
+
}));
|
|
1211
|
+
//#endregion
|
|
1212
|
+
//#region node_modules/lodash/words.js
|
|
1213
|
+
var require_words = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1214
|
+
var asciiWords = require__asciiWords(), hasUnicodeWord = require__hasUnicodeWord(), toString = require_toString(), unicodeWords = require__unicodeWords();
|
|
1215
|
+
/**
|
|
1216
|
+
* Splits `string` into an array of its words.
|
|
1217
|
+
*
|
|
1218
|
+
* @static
|
|
1219
|
+
* @memberOf _
|
|
1220
|
+
* @since 3.0.0
|
|
1221
|
+
* @category String
|
|
1222
|
+
* @param {string} [string=''] The string to inspect.
|
|
1223
|
+
* @param {RegExp|string} [pattern] The pattern to match words.
|
|
1224
|
+
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
|
1225
|
+
* @returns {Array} Returns the words of `string`.
|
|
1226
|
+
* @example
|
|
1227
|
+
*
|
|
1228
|
+
* _.words('fred, barney, & pebbles');
|
|
1229
|
+
* // => ['fred', 'barney', 'pebbles']
|
|
1230
|
+
*
|
|
1231
|
+
* _.words('fred, barney, & pebbles', /[^, ]+/g);
|
|
1232
|
+
* // => ['fred', 'barney', '&', 'pebbles']
|
|
1233
|
+
*/
|
|
1234
|
+
function words(string, pattern, guard) {
|
|
1235
|
+
string = toString(string);
|
|
1236
|
+
pattern = guard ? void 0 : pattern;
|
|
1237
|
+
if (pattern === void 0) return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
|
|
1238
|
+
return string.match(pattern) || [];
|
|
1239
|
+
}
|
|
1240
|
+
module.exports = words;
|
|
1241
|
+
}));
|
|
1242
|
+
//#endregion
|
|
1243
|
+
//#region node_modules/lodash/_createCompounder.js
|
|
1244
|
+
var require__createCompounder = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1245
|
+
var arrayReduce = require__arrayReduce(), deburr = require_deburr(), words = require_words();
|
|
1246
|
+
/** Used to match apostrophes. */
|
|
1247
|
+
var reApos = RegExp("['’]", "g");
|
|
1248
|
+
/**
|
|
1249
|
+
* Creates a function like `_.camelCase`.
|
|
1250
|
+
*
|
|
1251
|
+
* @private
|
|
1252
|
+
* @param {Function} callback The function to combine each word.
|
|
1253
|
+
* @returns {Function} Returns the new compounder function.
|
|
1254
|
+
*/
|
|
1255
|
+
function createCompounder(callback) {
|
|
1256
|
+
return function(string) {
|
|
1257
|
+
return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
|
|
1258
|
+
};
|
|
1259
|
+
}
|
|
1260
|
+
module.exports = createCompounder;
|
|
1261
|
+
}));
|
|
1262
|
+
//#endregion
|
|
1263
|
+
//#region src/getFeatureFlag.ts
|
|
1264
|
+
var import_snakeCase = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1265
|
+
module.exports = require__createCompounder()(function(result, word, index) {
|
|
1266
|
+
return result + (index ? "_" : "") + word.toLowerCase();
|
|
1267
|
+
});
|
|
1268
|
+
})))(), 1);
|
|
1269
|
+
var getFeatureFlagNYI = async (_flag) => {};
|
|
1270
|
+
var getFeatureFlag = async (flag) => {
|
|
1271
|
+
const envKey = `RB_PUBLIC_FLAG_${(0, import_snakeCase.default)(flag).toUpperCase()}`;
|
|
1272
|
+
if (env.SSR) {
|
|
1273
|
+
if (process.env[envKey] !== void 0) return process.env[envKey];
|
|
1274
|
+
return await getFeatureFlagNYI(flag);
|
|
1275
|
+
} else {
|
|
1276
|
+
if (globalThis.__rb_env__[envKey] !== void 0) return globalThis.__rb_env__[envKey];
|
|
1277
|
+
return await getFeatureFlagNYI(flag);
|
|
1278
|
+
}
|
|
1279
|
+
};
|
|
1280
|
+
//#endregion
|
|
1281
|
+
//#region src/utils/useApplyScroll.ts
|
|
1351
1282
|
function throttle(callback, limit) {
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1283
|
+
let wait = false;
|
|
1284
|
+
return (...args) => {
|
|
1285
|
+
if (!wait) {
|
|
1286
|
+
callback(...args);
|
|
1287
|
+
wait = true;
|
|
1288
|
+
setTimeout(() => {
|
|
1289
|
+
wait = false;
|
|
1290
|
+
}, limit);
|
|
1291
|
+
}
|
|
1292
|
+
};
|
|
1362
1293
|
}
|
|
1363
1294
|
function useApplyScroll() {
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
const id_0 = link.hash.substring(1);
|
|
1542
|
-
const element_0 = document.getElementById(id_0);
|
|
1543
|
-
if (element_0) {
|
|
1544
|
-
event.preventDefault();
|
|
1545
|
-
event.stopPropagation();
|
|
1546
|
-
markProgrammaticScroll();
|
|
1547
|
-
element_0.scrollIntoView({
|
|
1548
|
-
behavior: "smooth"
|
|
1549
|
-
});
|
|
1550
|
-
}
|
|
1551
|
-
};
|
|
1552
|
-
document.addEventListener("click", handleClick, true);
|
|
1553
|
-
return () => document.removeEventListener("click", handleClick, true);
|
|
1554
|
-
};
|
|
1555
|
-
t11 = [location.hash, location.pathname, markProgrammaticScroll];
|
|
1556
|
-
$[13] = location.hash;
|
|
1557
|
-
$[14] = location.pathname;
|
|
1558
|
-
$[15] = t10;
|
|
1559
|
-
$[16] = t11;
|
|
1560
|
-
} else {
|
|
1561
|
-
t10 = $[15];
|
|
1562
|
-
t11 = $[16];
|
|
1563
|
-
}
|
|
1564
|
-
useEffect(t10, t11);
|
|
1295
|
+
const $ = c(17);
|
|
1296
|
+
const location = useLocation();
|
|
1297
|
+
const previousPathRef = useRef(location.pathname);
|
|
1298
|
+
const hasAppliedLocationRef = useRef(false);
|
|
1299
|
+
const isScrollingProgrammatically = useRef(false);
|
|
1300
|
+
const scrollTimeoutRef = useRef(null);
|
|
1301
|
+
const lastAppliedHashRef = useRef("");
|
|
1302
|
+
let t0;
|
|
1303
|
+
let t1;
|
|
1304
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1305
|
+
t0 = () => {
|
|
1306
|
+
if (typeof window !== "undefined") lastAppliedHashRef.current = window.location.hash || "";
|
|
1307
|
+
};
|
|
1308
|
+
t1 = [];
|
|
1309
|
+
$[0] = t0;
|
|
1310
|
+
$[1] = t1;
|
|
1311
|
+
} else {
|
|
1312
|
+
t0 = $[0];
|
|
1313
|
+
t1 = $[1];
|
|
1314
|
+
}
|
|
1315
|
+
useEffect(t0, t1);
|
|
1316
|
+
let t2;
|
|
1317
|
+
let t3;
|
|
1318
|
+
if ($[2] !== location.hash) {
|
|
1319
|
+
t2 = () => {
|
|
1320
|
+
lastAppliedHashRef.current = location.hash || "";
|
|
1321
|
+
};
|
|
1322
|
+
t3 = [location.hash];
|
|
1323
|
+
$[2] = location.hash;
|
|
1324
|
+
$[3] = t2;
|
|
1325
|
+
$[4] = t3;
|
|
1326
|
+
} else {
|
|
1327
|
+
t2 = $[3];
|
|
1328
|
+
t3 = $[4];
|
|
1329
|
+
}
|
|
1330
|
+
useEffect(t2, t3);
|
|
1331
|
+
let t4;
|
|
1332
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1333
|
+
t4 = (hash) => {
|
|
1334
|
+
if (typeof window === "undefined") return;
|
|
1335
|
+
if (lastAppliedHashRef.current === hash) return;
|
|
1336
|
+
const base = `${window.location.pathname}${window.location.search}`;
|
|
1337
|
+
window.history.replaceState(window.history.state, "", `${base}${hash}`);
|
|
1338
|
+
lastAppliedHashRef.current = hash;
|
|
1339
|
+
};
|
|
1340
|
+
$[5] = t4;
|
|
1341
|
+
} else t4 = $[5];
|
|
1342
|
+
const replaceHashSilently = t4;
|
|
1343
|
+
let t5;
|
|
1344
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1345
|
+
t5 = () => {
|
|
1346
|
+
isScrollingProgrammatically.current = true;
|
|
1347
|
+
if (scrollTimeoutRef.current) clearTimeout(scrollTimeoutRef.current);
|
|
1348
|
+
scrollTimeoutRef.current = setTimeout(() => {
|
|
1349
|
+
isScrollingProgrammatically.current = false;
|
|
1350
|
+
}, 1e3);
|
|
1351
|
+
};
|
|
1352
|
+
$[6] = t5;
|
|
1353
|
+
} else t5 = $[6];
|
|
1354
|
+
const markProgrammaticScroll = t5;
|
|
1355
|
+
let t6;
|
|
1356
|
+
let t7;
|
|
1357
|
+
if ($[7] !== location.hash || $[8] !== location.pathname) {
|
|
1358
|
+
t6 = () => {
|
|
1359
|
+
const isInitialLocation = !hasAppliedLocationRef.current;
|
|
1360
|
+
hasAppliedLocationRef.current = true;
|
|
1361
|
+
const pathChanged = previousPathRef.current !== location.pathname;
|
|
1362
|
+
const applyHashScroll = (behavior) => {
|
|
1363
|
+
const id = location.hash.substring(1);
|
|
1364
|
+
const element = document.getElementById(id);
|
|
1365
|
+
if (!element) return;
|
|
1366
|
+
markProgrammaticScroll();
|
|
1367
|
+
element.scrollIntoView({ behavior });
|
|
1368
|
+
};
|
|
1369
|
+
if (pathChanged) {
|
|
1370
|
+
previousPathRef.current = location.pathname;
|
|
1371
|
+
if (!location.hash) {
|
|
1372
|
+
window.scrollTo({
|
|
1373
|
+
top: 0,
|
|
1374
|
+
left: 0,
|
|
1375
|
+
behavior: "auto"
|
|
1376
|
+
});
|
|
1377
|
+
return;
|
|
1378
|
+
}
|
|
1379
|
+
setTimeout(() => {
|
|
1380
|
+
applyHashScroll("auto");
|
|
1381
|
+
}, 100);
|
|
1382
|
+
return;
|
|
1383
|
+
}
|
|
1384
|
+
if (!location.hash) return;
|
|
1385
|
+
applyHashScroll(isInitialLocation ? "auto" : "smooth");
|
|
1386
|
+
};
|
|
1387
|
+
t7 = [
|
|
1388
|
+
location.hash,
|
|
1389
|
+
location.pathname,
|
|
1390
|
+
markProgrammaticScroll
|
|
1391
|
+
];
|
|
1392
|
+
$[7] = location.hash;
|
|
1393
|
+
$[8] = location.pathname;
|
|
1394
|
+
$[9] = t6;
|
|
1395
|
+
$[10] = t7;
|
|
1396
|
+
} else {
|
|
1397
|
+
t6 = $[9];
|
|
1398
|
+
t7 = $[10];
|
|
1399
|
+
}
|
|
1400
|
+
useEffect(t6, t7);
|
|
1401
|
+
let t8;
|
|
1402
|
+
let t9;
|
|
1403
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1404
|
+
t8 = () => {
|
|
1405
|
+
if (typeof window === "undefined") return;
|
|
1406
|
+
const handleScroll = throttle(() => {
|
|
1407
|
+
if (isScrollingProgrammatically.current) return;
|
|
1408
|
+
const sections = Array.from(document.querySelectorAll("section[id]"));
|
|
1409
|
+
if (sections.length === 0) {
|
|
1410
|
+
replaceHashSilently("");
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
const checkPoint = window.scrollY + window.innerHeight / 3;
|
|
1414
|
+
let activeSectionId = null;
|
|
1415
|
+
for (const section of sections) if (section.offsetTop <= checkPoint && section.offsetTop + section.offsetHeight > checkPoint) {
|
|
1416
|
+
activeSectionId = section.id;
|
|
1417
|
+
break;
|
|
1418
|
+
}
|
|
1419
|
+
replaceHashSilently(activeSectionId ? `#${activeSectionId}` : "");
|
|
1420
|
+
}, 150);
|
|
1421
|
+
document.addEventListener("scroll", handleScroll);
|
|
1422
|
+
return () => {
|
|
1423
|
+
document.removeEventListener("scroll", handleScroll);
|
|
1424
|
+
if (scrollTimeoutRef.current) {
|
|
1425
|
+
clearTimeout(scrollTimeoutRef.current);
|
|
1426
|
+
scrollTimeoutRef.current = null;
|
|
1427
|
+
}
|
|
1428
|
+
};
|
|
1429
|
+
};
|
|
1430
|
+
t9 = [replaceHashSilently];
|
|
1431
|
+
$[11] = t8;
|
|
1432
|
+
$[12] = t9;
|
|
1433
|
+
} else {
|
|
1434
|
+
t8 = $[11];
|
|
1435
|
+
t9 = $[12];
|
|
1436
|
+
}
|
|
1437
|
+
useEffect(t8, t9);
|
|
1438
|
+
let t10;
|
|
1439
|
+
let t11;
|
|
1440
|
+
if ($[13] !== location.hash || $[14] !== location.pathname) {
|
|
1441
|
+
t10 = () => {
|
|
1442
|
+
const handleClick = (event) => {
|
|
1443
|
+
const link = event.target?.closest("a");
|
|
1444
|
+
const currentHash = typeof window !== "undefined" ? window.location.hash : location.hash || "";
|
|
1445
|
+
if (!link || !link.hash || link.pathname !== location.pathname || link.hash !== currentHash) return;
|
|
1446
|
+
const id_0 = link.hash.substring(1);
|
|
1447
|
+
const element_0 = document.getElementById(id_0);
|
|
1448
|
+
if (element_0) {
|
|
1449
|
+
event.preventDefault();
|
|
1450
|
+
event.stopPropagation();
|
|
1451
|
+
markProgrammaticScroll();
|
|
1452
|
+
element_0.scrollIntoView({ behavior: "smooth" });
|
|
1453
|
+
}
|
|
1454
|
+
};
|
|
1455
|
+
document.addEventListener("click", handleClick, true);
|
|
1456
|
+
return () => document.removeEventListener("click", handleClick, true);
|
|
1457
|
+
};
|
|
1458
|
+
t11 = [
|
|
1459
|
+
location.hash,
|
|
1460
|
+
location.pathname,
|
|
1461
|
+
markProgrammaticScroll
|
|
1462
|
+
];
|
|
1463
|
+
$[13] = location.hash;
|
|
1464
|
+
$[14] = location.pathname;
|
|
1465
|
+
$[15] = t10;
|
|
1466
|
+
$[16] = t11;
|
|
1467
|
+
} else {
|
|
1468
|
+
t10 = $[15];
|
|
1469
|
+
t11 = $[16];
|
|
1470
|
+
}
|
|
1471
|
+
useEffect(t10, t11);
|
|
1565
1472
|
}
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1473
|
+
//#endregion
|
|
1474
|
+
//#region src/RootProvider/index.tsx
|
|
1475
|
+
var RootProvider = (t0) => {
|
|
1476
|
+
const $ = c(4);
|
|
1477
|
+
const { children, routePrefetch } = t0;
|
|
1478
|
+
useApplyScroll();
|
|
1479
|
+
const t1 = routePrefetch?.defaultPrefetch ?? "intent";
|
|
1480
|
+
let t2;
|
|
1481
|
+
if ($[0] !== children || $[1] !== routePrefetch || $[2] !== t1) {
|
|
1482
|
+
t2 = /* @__PURE__ */ jsx(RoutePrefetchProvider, {
|
|
1483
|
+
...routePrefetch,
|
|
1484
|
+
defaultPrefetch: t1,
|
|
1485
|
+
children
|
|
1486
|
+
});
|
|
1487
|
+
$[0] = children;
|
|
1488
|
+
$[1] = routePrefetch;
|
|
1489
|
+
$[2] = t1;
|
|
1490
|
+
$[3] = t2;
|
|
1491
|
+
} else t2 = $[3];
|
|
1492
|
+
return t2;
|
|
1493
|
+
};
|
|
1494
|
+
//#endregion
|
|
1495
|
+
//#region ../../node_modules/fast-equals/dist/es/index.mjs
|
|
1496
|
+
var import_throttle = /* @__PURE__ */ __toESM(require_throttle(), 1);
|
|
1497
|
+
var { getOwnPropertyNames, getOwnPropertySymbols } = Object;
|
|
1498
|
+
var { hasOwnProperty } = Object.prototype;
|
|
1499
|
+
/**
|
|
1500
|
+
* Combine two comparators into a single comparators.
|
|
1501
|
+
*/
|
|
1588
1502
|
function combineComparators(comparatorA, comparatorB) {
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1503
|
+
return function isEqual(a, b, state) {
|
|
1504
|
+
return comparatorA(a, b, state) && comparatorB(a, b, state);
|
|
1505
|
+
};
|
|
1592
1506
|
}
|
|
1507
|
+
/**
|
|
1508
|
+
* Wrap the provided `areItemsEqual` method to manage the circular state, allowing
|
|
1509
|
+
* for circular references to be safely included in the comparison without creating
|
|
1510
|
+
* stack overflows.
|
|
1511
|
+
*/
|
|
1593
1512
|
function createIsCircular(areItemsEqual) {
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
cache.delete(a);
|
|
1608
|
-
cache.delete(b);
|
|
1609
|
-
return result;
|
|
1610
|
-
};
|
|
1513
|
+
return function isCircular(a, b, state) {
|
|
1514
|
+
if (!a || !b || typeof a !== "object" || typeof b !== "object") return areItemsEqual(a, b, state);
|
|
1515
|
+
const { cache } = state;
|
|
1516
|
+
const cachedA = cache.get(a);
|
|
1517
|
+
const cachedB = cache.get(b);
|
|
1518
|
+
if (cachedA && cachedB) return cachedA === b && cachedB === a;
|
|
1519
|
+
cache.set(a, b);
|
|
1520
|
+
cache.set(b, a);
|
|
1521
|
+
const result = areItemsEqual(a, b, state);
|
|
1522
|
+
cache.delete(a);
|
|
1523
|
+
cache.delete(b);
|
|
1524
|
+
return result;
|
|
1525
|
+
};
|
|
1611
1526
|
}
|
|
1527
|
+
/**
|
|
1528
|
+
* Get the properties to strictly examine, which include both own properties that are
|
|
1529
|
+
* not enumerable and symbol properties.
|
|
1530
|
+
*/
|
|
1612
1531
|
function getStrictProperties(object) {
|
|
1613
|
-
|
|
1532
|
+
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
1614
1533
|
}
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
);
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1534
|
+
/**
|
|
1535
|
+
* Whether the object contains the property passed as an own property.
|
|
1536
|
+
*/
|
|
1537
|
+
var hasOwn = Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property));
|
|
1538
|
+
var PREACT_VNODE = "__v";
|
|
1539
|
+
var PREACT_OWNER = "__o";
|
|
1540
|
+
var REACT_OWNER = "_owner";
|
|
1541
|
+
var { getOwnPropertyDescriptor, keys } = Object;
|
|
1542
|
+
/**
|
|
1543
|
+
* Whether the values passed are equal based on a [SameValue](https://262.ecma-international.org/7.0/#sec-samevalue) basis.
|
|
1544
|
+
* Simplified, this maps to if the two values are referentially equal to one another (`a === b`) or both are `NaN`.
|
|
1545
|
+
*
|
|
1546
|
+
* @note
|
|
1547
|
+
* When available in the environment, this is just a re-export of the global
|
|
1548
|
+
* [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) method.
|
|
1549
|
+
*/
|
|
1550
|
+
var sameValueEqual = Object.is || function sameValueEqual(a, b) {
|
|
1551
|
+
return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;
|
|
1552
|
+
};
|
|
1553
|
+
/**
|
|
1554
|
+
* Whether the values passed are equal based on a
|
|
1555
|
+
* [Strict Equality Comparison](https://262.ecma-international.org/7.0/#sec-strict-equality-comparison) basis.
|
|
1556
|
+
* Simplified, this maps to if the two values are referentially equal to one another (`a === b`).
|
|
1557
|
+
*
|
|
1558
|
+
* @note
|
|
1559
|
+
* This is mainly available as a convenience function, such as being a default when a function to determine equality between
|
|
1560
|
+
* two objects is used.
|
|
1561
|
+
*/
|
|
1629
1562
|
function strictEqual(a, b) {
|
|
1630
|
-
|
|
1563
|
+
return a === b;
|
|
1631
1564
|
}
|
|
1565
|
+
/**
|
|
1566
|
+
* Whether the array buffers are equal in value.
|
|
1567
|
+
*/
|
|
1632
1568
|
function areArrayBuffersEqual(a, b) {
|
|
1633
|
-
|
|
1569
|
+
return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));
|
|
1634
1570
|
}
|
|
1571
|
+
/**
|
|
1572
|
+
* Whether the arrays are equal in value.
|
|
1573
|
+
*/
|
|
1635
1574
|
function areArraysEqual(a, b, state) {
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
while (index-- > 0) {
|
|
1641
|
-
if (!state.equals(a[index], b[index], index, index, a, b, state)) {
|
|
1642
|
-
return false;
|
|
1643
|
-
}
|
|
1644
|
-
}
|
|
1645
|
-
return true;
|
|
1575
|
+
let index = a.length;
|
|
1576
|
+
if (b.length !== index) return false;
|
|
1577
|
+
while (index-- > 0) if (!state.equals(a[index], b[index], index, index, a, b, state)) return false;
|
|
1578
|
+
return true;
|
|
1646
1579
|
}
|
|
1580
|
+
/**
|
|
1581
|
+
* Whether the dataviews are equal in value.
|
|
1582
|
+
*/
|
|
1647
1583
|
function areDataViewsEqual(a, b) {
|
|
1648
|
-
|
|
1584
|
+
return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength));
|
|
1649
1585
|
}
|
|
1586
|
+
/**
|
|
1587
|
+
* Whether the dates passed are equal in value.
|
|
1588
|
+
*/
|
|
1650
1589
|
function areDatesEqual(a, b) {
|
|
1651
|
-
|
|
1590
|
+
return sameValueEqual(a.getTime(), b.getTime());
|
|
1652
1591
|
}
|
|
1592
|
+
/**
|
|
1593
|
+
* Whether the errors passed are equal in value.
|
|
1594
|
+
*/
|
|
1653
1595
|
function areErrorsEqual(a, b) {
|
|
1654
|
-
|
|
1596
|
+
return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
|
|
1655
1597
|
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Whether the `Map`s are equal in value.
|
|
1600
|
+
*/
|
|
1656
1601
|
function areMapsEqual(a, b, state) {
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
break;
|
|
1689
|
-
}
|
|
1690
|
-
matchIndex++;
|
|
1691
|
-
}
|
|
1692
|
-
if (!hasMatch) {
|
|
1693
|
-
return false;
|
|
1694
|
-
}
|
|
1695
|
-
index++;
|
|
1696
|
-
}
|
|
1697
|
-
return true;
|
|
1602
|
+
const size = a.size;
|
|
1603
|
+
if (size !== b.size) return false;
|
|
1604
|
+
if (!size) return true;
|
|
1605
|
+
const matchedIndices = new Array(size);
|
|
1606
|
+
const aIterable = a.entries();
|
|
1607
|
+
let aResult;
|
|
1608
|
+
let bResult;
|
|
1609
|
+
let index = 0;
|
|
1610
|
+
while (aResult = aIterable.next()) {
|
|
1611
|
+
if (aResult.done) break;
|
|
1612
|
+
const bIterable = b.entries();
|
|
1613
|
+
let hasMatch = false;
|
|
1614
|
+
let matchIndex = 0;
|
|
1615
|
+
while (bResult = bIterable.next()) {
|
|
1616
|
+
if (bResult.done) break;
|
|
1617
|
+
if (matchedIndices[matchIndex]) {
|
|
1618
|
+
matchIndex++;
|
|
1619
|
+
continue;
|
|
1620
|
+
}
|
|
1621
|
+
const aEntry = aResult.value;
|
|
1622
|
+
const bEntry = bResult.value;
|
|
1623
|
+
if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
|
|
1624
|
+
hasMatch = matchedIndices[matchIndex] = true;
|
|
1625
|
+
break;
|
|
1626
|
+
}
|
|
1627
|
+
matchIndex++;
|
|
1628
|
+
}
|
|
1629
|
+
if (!hasMatch) return false;
|
|
1630
|
+
index++;
|
|
1631
|
+
}
|
|
1632
|
+
return true;
|
|
1698
1633
|
}
|
|
1634
|
+
/**
|
|
1635
|
+
* Whether the objects are equal in value.
|
|
1636
|
+
*/
|
|
1699
1637
|
function areObjectsEqual(a, b, state) {
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
while (index-- > 0) {
|
|
1706
|
-
if (!isPropertyEqual(a, b, state, properties[index])) {
|
|
1707
|
-
return false;
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1710
|
-
return true;
|
|
1638
|
+
const properties = keys(a);
|
|
1639
|
+
let index = properties.length;
|
|
1640
|
+
if (keys(b).length !== index) return false;
|
|
1641
|
+
while (index-- > 0) if (!isPropertyEqual(a, b, state, properties[index])) return false;
|
|
1642
|
+
return true;
|
|
1711
1643
|
}
|
|
1644
|
+
/**
|
|
1645
|
+
* Whether the objects are equal in value with strict property checking.
|
|
1646
|
+
*/
|
|
1712
1647
|
function areObjectsEqualStrict(a, b, state) {
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
descriptorB = getOwnPropertyDescriptor(b, property);
|
|
1728
|
-
if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) {
|
|
1729
|
-
return false;
|
|
1730
|
-
}
|
|
1731
|
-
}
|
|
1732
|
-
return true;
|
|
1648
|
+
const properties = getStrictProperties(a);
|
|
1649
|
+
let index = properties.length;
|
|
1650
|
+
if (getStrictProperties(b).length !== index) return false;
|
|
1651
|
+
let property;
|
|
1652
|
+
let descriptorA;
|
|
1653
|
+
let descriptorB;
|
|
1654
|
+
while (index-- > 0) {
|
|
1655
|
+
property = properties[index];
|
|
1656
|
+
if (!isPropertyEqual(a, b, state, property)) return false;
|
|
1657
|
+
descriptorA = getOwnPropertyDescriptor(a, property);
|
|
1658
|
+
descriptorB = getOwnPropertyDescriptor(b, property);
|
|
1659
|
+
if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) return false;
|
|
1660
|
+
}
|
|
1661
|
+
return true;
|
|
1733
1662
|
}
|
|
1663
|
+
/**
|
|
1664
|
+
* Whether the primitive wrappers passed are equal in value.
|
|
1665
|
+
*/
|
|
1734
1666
|
function arePrimitiveWrappersEqual(a, b) {
|
|
1735
|
-
|
|
1667
|
+
return sameValueEqual(a.valueOf(), b.valueOf());
|
|
1736
1668
|
}
|
|
1669
|
+
/**
|
|
1670
|
+
* Whether the regexps passed are equal in value.
|
|
1671
|
+
*/
|
|
1737
1672
|
function areRegExpsEqual(a, b) {
|
|
1738
|
-
|
|
1673
|
+
return a.source === b.source && a.flags === b.flags;
|
|
1739
1674
|
}
|
|
1675
|
+
/**
|
|
1676
|
+
* Whether the `Set`s are equal in value.
|
|
1677
|
+
*/
|
|
1740
1678
|
function areSetsEqual(a, b, state) {
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
hasMatch = matchedIndices[matchIndex] = true;
|
|
1765
|
-
break;
|
|
1766
|
-
}
|
|
1767
|
-
matchIndex++;
|
|
1768
|
-
}
|
|
1769
|
-
if (!hasMatch) {
|
|
1770
|
-
return false;
|
|
1771
|
-
}
|
|
1772
|
-
}
|
|
1773
|
-
return true;
|
|
1679
|
+
const size = a.size;
|
|
1680
|
+
if (size !== b.size) return false;
|
|
1681
|
+
if (!size) return true;
|
|
1682
|
+
const matchedIndices = new Array(size);
|
|
1683
|
+
const aIterable = a.values();
|
|
1684
|
+
let aResult;
|
|
1685
|
+
let bResult;
|
|
1686
|
+
while (aResult = aIterable.next()) {
|
|
1687
|
+
if (aResult.done) break;
|
|
1688
|
+
const bIterable = b.values();
|
|
1689
|
+
let hasMatch = false;
|
|
1690
|
+
let matchIndex = 0;
|
|
1691
|
+
while (bResult = bIterable.next()) {
|
|
1692
|
+
if (bResult.done) break;
|
|
1693
|
+
if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
|
|
1694
|
+
hasMatch = matchedIndices[matchIndex] = true;
|
|
1695
|
+
break;
|
|
1696
|
+
}
|
|
1697
|
+
matchIndex++;
|
|
1698
|
+
}
|
|
1699
|
+
if (!hasMatch) return false;
|
|
1700
|
+
}
|
|
1701
|
+
return true;
|
|
1774
1702
|
}
|
|
1703
|
+
/**
|
|
1704
|
+
* Whether the TypedArray instances are equal in value.
|
|
1705
|
+
*/
|
|
1775
1706
|
function areTypedArraysEqual(a, b) {
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
while (index-- > 0) {
|
|
1781
|
-
if (a[index] !== b[index]) {
|
|
1782
|
-
return false;
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
return true;
|
|
1707
|
+
let index = a.byteLength;
|
|
1708
|
+
if (b.byteLength !== index || a.byteOffset !== b.byteOffset) return false;
|
|
1709
|
+
while (index-- > 0) if (a[index] !== b[index]) return false;
|
|
1710
|
+
return true;
|
|
1786
1711
|
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Whether the URL instances are equal in value.
|
|
1714
|
+
*/
|
|
1787
1715
|
function areUrlsEqual(a, b) {
|
|
1788
|
-
|
|
1716
|
+
return a.hostname === b.hostname && a.pathname === b.pathname && a.protocol === b.protocol && a.port === b.port && a.hash === b.hash && a.username === b.username && a.password === b.password;
|
|
1789
1717
|
}
|
|
1790
1718
|
function isPropertyEqual(a, b, state, property) {
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
}
|
|
1794
|
-
return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
|
|
1719
|
+
if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a.$$typeof || b.$$typeof)) return true;
|
|
1720
|
+
return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
|
|
1795
1721
|
}
|
|
1796
|
-
|
|
1722
|
+
var toString = Object.prototype.toString;
|
|
1723
|
+
/**
|
|
1724
|
+
* Create a comparator method based on the type-specific equality comparators passed.
|
|
1725
|
+
*/
|
|
1797
1726
|
function createEqualityComparator(config) {
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
if (constructor === Date) {
|
|
1831
|
-
return areDatesEqual2(a, b, state);
|
|
1832
|
-
}
|
|
1833
|
-
if (constructor === RegExp) {
|
|
1834
|
-
return areRegExpsEqual2(a, b, state);
|
|
1835
|
-
}
|
|
1836
|
-
if (constructor === Map) {
|
|
1837
|
-
return areMapsEqual2(a, b, state);
|
|
1838
|
-
}
|
|
1839
|
-
if (constructor === Set) {
|
|
1840
|
-
return areSetsEqual2(a, b, state);
|
|
1841
|
-
}
|
|
1842
|
-
if (constructor === Promise) {
|
|
1843
|
-
return false;
|
|
1844
|
-
}
|
|
1845
|
-
if (Array.isArray(a)) {
|
|
1846
|
-
return areArraysEqual2(a, b, state);
|
|
1847
|
-
}
|
|
1848
|
-
const tag = toString.call(a);
|
|
1849
|
-
const supportedComparator = supportedComparatorMap[tag];
|
|
1850
|
-
if (supportedComparator) {
|
|
1851
|
-
return supportedComparator(a, b, state);
|
|
1852
|
-
}
|
|
1853
|
-
const unsupportedCustomComparator = getUnsupportedCustomComparator && getUnsupportedCustomComparator(a, b, state, tag);
|
|
1854
|
-
if (unsupportedCustomComparator) {
|
|
1855
|
-
return unsupportedCustomComparator(a, b, state);
|
|
1856
|
-
}
|
|
1857
|
-
return false;
|
|
1858
|
-
};
|
|
1727
|
+
const supportedComparatorMap = createSupportedComparatorMap(config);
|
|
1728
|
+
const { areArraysEqual, areDatesEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, areRegExpsEqual, areSetsEqual, getUnsupportedCustomComparator } = config;
|
|
1729
|
+
/**
|
|
1730
|
+
* compare the value of the two objects and return true if they are equivalent in values
|
|
1731
|
+
*/
|
|
1732
|
+
return function comparator(a, b, state) {
|
|
1733
|
+
if (a === b) return true;
|
|
1734
|
+
if (a == null || b == null) return false;
|
|
1735
|
+
const type = typeof a;
|
|
1736
|
+
if (type !== typeof b) return false;
|
|
1737
|
+
if (type !== "object") {
|
|
1738
|
+
if (type === "number" || type === "bigint") return areNumbersEqual(a, b, state);
|
|
1739
|
+
if (type === "function") return areFunctionsEqual(a, b, state);
|
|
1740
|
+
return false;
|
|
1741
|
+
}
|
|
1742
|
+
const constructor = a.constructor;
|
|
1743
|
+
if (constructor !== b.constructor) return false;
|
|
1744
|
+
if (constructor === Object) return areObjectsEqual(a, b, state);
|
|
1745
|
+
if (constructor === Array) return areArraysEqual(a, b, state);
|
|
1746
|
+
if (constructor === Date) return areDatesEqual(a, b, state);
|
|
1747
|
+
if (constructor === RegExp) return areRegExpsEqual(a, b, state);
|
|
1748
|
+
if (constructor === Map) return areMapsEqual(a, b, state);
|
|
1749
|
+
if (constructor === Set) return areSetsEqual(a, b, state);
|
|
1750
|
+
if (constructor === Promise) return false;
|
|
1751
|
+
if (Array.isArray(a)) return areArraysEqual(a, b, state);
|
|
1752
|
+
const tag = toString.call(a);
|
|
1753
|
+
const supportedComparator = supportedComparatorMap[tag];
|
|
1754
|
+
if (supportedComparator) return supportedComparator(a, b, state);
|
|
1755
|
+
const unsupportedCustomComparator = getUnsupportedCustomComparator && getUnsupportedCustomComparator(a, b, state, tag);
|
|
1756
|
+
if (unsupportedCustomComparator) return unsupportedCustomComparator(a, b, state);
|
|
1757
|
+
return false;
|
|
1758
|
+
};
|
|
1859
1759
|
}
|
|
1760
|
+
/**
|
|
1761
|
+
* Create the configuration object used for building comparators.
|
|
1762
|
+
*/
|
|
1860
1763
|
function createEqualityComparatorConfig({ circular, createCustomConfig, strict }) {
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
}
|
|
1893
|
-
return config;
|
|
1764
|
+
let config = {
|
|
1765
|
+
areArrayBuffersEqual,
|
|
1766
|
+
areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
|
|
1767
|
+
areDataViewsEqual,
|
|
1768
|
+
areDatesEqual,
|
|
1769
|
+
areErrorsEqual,
|
|
1770
|
+
areFunctionsEqual: strictEqual,
|
|
1771
|
+
areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
|
|
1772
|
+
areNumbersEqual: sameValueEqual,
|
|
1773
|
+
areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
|
|
1774
|
+
arePrimitiveWrappersEqual,
|
|
1775
|
+
areRegExpsEqual,
|
|
1776
|
+
areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
|
|
1777
|
+
areTypedArraysEqual: strict ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict) : areTypedArraysEqual,
|
|
1778
|
+
areUrlsEqual,
|
|
1779
|
+
getUnsupportedCustomComparator: void 0
|
|
1780
|
+
};
|
|
1781
|
+
if (createCustomConfig) config = Object.assign({}, config, createCustomConfig(config));
|
|
1782
|
+
if (circular) {
|
|
1783
|
+
const areArraysEqual = createIsCircular(config.areArraysEqual);
|
|
1784
|
+
const areMapsEqual = createIsCircular(config.areMapsEqual);
|
|
1785
|
+
const areObjectsEqual = createIsCircular(config.areObjectsEqual);
|
|
1786
|
+
const areSetsEqual = createIsCircular(config.areSetsEqual);
|
|
1787
|
+
config = Object.assign({}, config, {
|
|
1788
|
+
areArraysEqual,
|
|
1789
|
+
areMapsEqual,
|
|
1790
|
+
areObjectsEqual,
|
|
1791
|
+
areSetsEqual
|
|
1792
|
+
});
|
|
1793
|
+
}
|
|
1794
|
+
return config;
|
|
1894
1795
|
}
|
|
1796
|
+
/**
|
|
1797
|
+
* Default equality comparator pass-through, used as the standard `isEqual` creator for
|
|
1798
|
+
* use inside the built comparator.
|
|
1799
|
+
*/
|
|
1895
1800
|
function createInternalEqualityComparator(compare) {
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1801
|
+
return function(a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
|
|
1802
|
+
return compare(a, b, state);
|
|
1803
|
+
};
|
|
1899
1804
|
}
|
|
1805
|
+
/**
|
|
1806
|
+
* Create the `isEqual` function used by the consuming application.
|
|
1807
|
+
*/
|
|
1900
1808
|
function createIsEqual({ circular, comparator, createState, equals, strict }) {
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
};
|
|
1928
|
-
return function isEqual(a, b) {
|
|
1929
|
-
return comparator(a, b, state);
|
|
1930
|
-
};
|
|
1809
|
+
if (createState) return function isEqual(a, b) {
|
|
1810
|
+
const { cache = circular ? /* @__PURE__ */ new WeakMap() : void 0, meta } = createState();
|
|
1811
|
+
return comparator(a, b, {
|
|
1812
|
+
cache,
|
|
1813
|
+
equals,
|
|
1814
|
+
meta,
|
|
1815
|
+
strict
|
|
1816
|
+
});
|
|
1817
|
+
};
|
|
1818
|
+
if (circular) return function isEqual(a, b) {
|
|
1819
|
+
return comparator(a, b, {
|
|
1820
|
+
cache: /* @__PURE__ */ new WeakMap(),
|
|
1821
|
+
equals,
|
|
1822
|
+
meta: void 0,
|
|
1823
|
+
strict
|
|
1824
|
+
});
|
|
1825
|
+
};
|
|
1826
|
+
const state = {
|
|
1827
|
+
cache: void 0,
|
|
1828
|
+
equals,
|
|
1829
|
+
meta: void 0,
|
|
1830
|
+
strict
|
|
1831
|
+
};
|
|
1832
|
+
return function isEqual(a, b) {
|
|
1833
|
+
return comparator(a, b, state);
|
|
1834
|
+
};
|
|
1931
1835
|
}
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
"[object URL]": areUrlsEqual2,
|
|
1969
|
-
"[object Uint8Array]": areTypedArraysEqual2,
|
|
1970
|
-
"[object Uint8ClampedArray]": areTypedArraysEqual2,
|
|
1971
|
-
"[object Uint16Array]": areTypedArraysEqual2,
|
|
1972
|
-
"[object Uint32Array]": areTypedArraysEqual2
|
|
1973
|
-
};
|
|
1836
|
+
/**
|
|
1837
|
+
* Create a map of `toString()` values to their respective handlers for `tag`-based lookups.
|
|
1838
|
+
*/
|
|
1839
|
+
function createSupportedComparatorMap({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual }) {
|
|
1840
|
+
return {
|
|
1841
|
+
"[object Arguments]": areObjectsEqual,
|
|
1842
|
+
"[object Array]": areArraysEqual,
|
|
1843
|
+
"[object ArrayBuffer]": areArrayBuffersEqual,
|
|
1844
|
+
"[object AsyncGeneratorFunction]": areFunctionsEqual,
|
|
1845
|
+
"[object BigInt]": areNumbersEqual,
|
|
1846
|
+
"[object BigInt64Array]": areTypedArraysEqual,
|
|
1847
|
+
"[object BigUint64Array]": areTypedArraysEqual,
|
|
1848
|
+
"[object Boolean]": arePrimitiveWrappersEqual,
|
|
1849
|
+
"[object DataView]": areDataViewsEqual,
|
|
1850
|
+
"[object Date]": areDatesEqual,
|
|
1851
|
+
"[object Error]": areErrorsEqual,
|
|
1852
|
+
"[object Float16Array]": areTypedArraysEqual,
|
|
1853
|
+
"[object Float32Array]": areTypedArraysEqual,
|
|
1854
|
+
"[object Float64Array]": areTypedArraysEqual,
|
|
1855
|
+
"[object Function]": areFunctionsEqual,
|
|
1856
|
+
"[object GeneratorFunction]": areFunctionsEqual,
|
|
1857
|
+
"[object Int8Array]": areTypedArraysEqual,
|
|
1858
|
+
"[object Int16Array]": areTypedArraysEqual,
|
|
1859
|
+
"[object Int32Array]": areTypedArraysEqual,
|
|
1860
|
+
"[object Map]": areMapsEqual,
|
|
1861
|
+
"[object Number]": arePrimitiveWrappersEqual,
|
|
1862
|
+
"[object Object]": (a, b, state) => typeof a.then !== "function" && typeof b.then !== "function" && areObjectsEqual(a, b, state),
|
|
1863
|
+
"[object RegExp]": areRegExpsEqual,
|
|
1864
|
+
"[object Set]": areSetsEqual,
|
|
1865
|
+
"[object String]": arePrimitiveWrappersEqual,
|
|
1866
|
+
"[object URL]": areUrlsEqual,
|
|
1867
|
+
"[object Uint8Array]": areTypedArraysEqual,
|
|
1868
|
+
"[object Uint8ClampedArray]": areTypedArraysEqual,
|
|
1869
|
+
"[object Uint16Array]": areTypedArraysEqual,
|
|
1870
|
+
"[object Uint32Array]": areTypedArraysEqual
|
|
1871
|
+
};
|
|
1974
1872
|
}
|
|
1975
|
-
|
|
1873
|
+
/**
|
|
1874
|
+
* Whether the items passed are deeply-equal in value.
|
|
1875
|
+
*/
|
|
1876
|
+
var deepEqual = createCustomEqual();
|
|
1976
1877
|
createCustomEqual({ strict: true });
|
|
1977
1878
|
createCustomEqual({ circular: true });
|
|
1978
1879
|
createCustomEqual({
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
});
|
|
1982
|
-
createCustomEqual({
|
|
1983
|
-
createInternalComparator: () => sameValueEqual
|
|
1880
|
+
circular: true,
|
|
1881
|
+
strict: true
|
|
1984
1882
|
});
|
|
1883
|
+
createCustomEqual({ createInternalComparator: () => sameValueEqual });
|
|
1985
1884
|
createCustomEqual({
|
|
1986
|
-
|
|
1987
|
-
|
|
1885
|
+
strict: true,
|
|
1886
|
+
createInternalComparator: () => sameValueEqual
|
|
1988
1887
|
});
|
|
1989
1888
|
createCustomEqual({
|
|
1990
|
-
|
|
1991
|
-
|
|
1889
|
+
circular: true,
|
|
1890
|
+
createInternalComparator: () => sameValueEqual
|
|
1992
1891
|
});
|
|
1993
1892
|
createCustomEqual({
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1893
|
+
circular: true,
|
|
1894
|
+
createInternalComparator: () => sameValueEqual,
|
|
1895
|
+
strict: true
|
|
1997
1896
|
});
|
|
1897
|
+
/**
|
|
1898
|
+
* Create a custom equality comparison method.
|
|
1899
|
+
*
|
|
1900
|
+
* This can be done to create very targeted comparisons in extreme hot-path scenarios
|
|
1901
|
+
* where the standard methods are not performant enough, but can also be used to provide
|
|
1902
|
+
* support for legacy environments that do not support expected features like
|
|
1903
|
+
* `RegExp.prototype.flags` out of the box.
|
|
1904
|
+
*/
|
|
1998
1905
|
function createCustomEqual(options = {}) {
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
1906
|
+
const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false } = options;
|
|
1907
|
+
const comparator = createEqualityComparator(createEqualityComparatorConfig(options));
|
|
1908
|
+
return createIsEqual({
|
|
1909
|
+
circular,
|
|
1910
|
+
comparator,
|
|
1911
|
+
createState,
|
|
1912
|
+
equals: createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator),
|
|
1913
|
+
strict
|
|
1914
|
+
});
|
|
2004
1915
|
}
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
throttledSetRect.cancel();
|
|
2125
|
-
};
|
|
2126
|
-
};
|
|
2127
|
-
t4 = [measuredRect, throttledSetRect];
|
|
2128
|
-
$[3] = measuredRect;
|
|
2129
|
-
$[4] = throttledSetRect;
|
|
2130
|
-
$[5] = t3;
|
|
2131
|
-
$[6] = t4;
|
|
2132
|
-
} else {
|
|
2133
|
-
t3 = $[5];
|
|
2134
|
-
t4 = $[6];
|
|
2135
|
-
}
|
|
2136
|
-
useEffect(t3, t4);
|
|
2137
|
-
let t5;
|
|
2138
|
-
if ($[7] !== rect || $[8] !== ref) {
|
|
2139
|
-
t5 = [ref, rect];
|
|
2140
|
-
$[7] = rect;
|
|
2141
|
-
$[8] = ref;
|
|
2142
|
-
$[9] = t5;
|
|
2143
|
-
} else {
|
|
2144
|
-
t5 = $[9];
|
|
2145
|
-
}
|
|
2146
|
-
return t5;
|
|
1916
|
+
//#endregion
|
|
1917
|
+
//#region src/hooks/useThrottledMeasure.ts
|
|
1918
|
+
var defaultRect = {
|
|
1919
|
+
x: 0,
|
|
1920
|
+
y: 0,
|
|
1921
|
+
width: 0,
|
|
1922
|
+
height: 0,
|
|
1923
|
+
top: 0,
|
|
1924
|
+
left: 0,
|
|
1925
|
+
bottom: 0,
|
|
1926
|
+
right: 0
|
|
1927
|
+
};
|
|
1928
|
+
var useLocalMeasure = () => {
|
|
1929
|
+
const $ = c(6);
|
|
1930
|
+
const [node, setNode] = useState(null);
|
|
1931
|
+
let t0;
|
|
1932
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1933
|
+
t0 = (el) => setNode(el);
|
|
1934
|
+
$[0] = t0;
|
|
1935
|
+
} else t0 = $[0];
|
|
1936
|
+
const ref = t0;
|
|
1937
|
+
const [rect, setRect] = useState(defaultRect);
|
|
1938
|
+
let t1;
|
|
1939
|
+
let t2;
|
|
1940
|
+
if ($[1] !== node) {
|
|
1941
|
+
t1 = () => {
|
|
1942
|
+
if (typeof window === "undefined" || typeof ResizeObserver === "undefined") return;
|
|
1943
|
+
if (!node) return;
|
|
1944
|
+
const observer = new ResizeObserver((entries) => {
|
|
1945
|
+
const entry = entries[0];
|
|
1946
|
+
if (!entry?.contentRect) return;
|
|
1947
|
+
const { x, y, width, height, top, left, bottom, right } = entry.contentRect;
|
|
1948
|
+
setRect({
|
|
1949
|
+
x,
|
|
1950
|
+
y,
|
|
1951
|
+
width,
|
|
1952
|
+
height,
|
|
1953
|
+
top,
|
|
1954
|
+
left,
|
|
1955
|
+
bottom,
|
|
1956
|
+
right
|
|
1957
|
+
});
|
|
1958
|
+
});
|
|
1959
|
+
observer.observe(node);
|
|
1960
|
+
return () => observer.disconnect();
|
|
1961
|
+
};
|
|
1962
|
+
t2 = [node];
|
|
1963
|
+
$[1] = node;
|
|
1964
|
+
$[2] = t1;
|
|
1965
|
+
$[3] = t2;
|
|
1966
|
+
} else {
|
|
1967
|
+
t1 = $[2];
|
|
1968
|
+
t2 = $[3];
|
|
1969
|
+
}
|
|
1970
|
+
useLayoutEffect(t1, t2);
|
|
1971
|
+
let t3;
|
|
1972
|
+
if ($[4] !== rect) {
|
|
1973
|
+
t3 = [ref, rect];
|
|
1974
|
+
$[4] = rect;
|
|
1975
|
+
$[5] = t3;
|
|
1976
|
+
} else t3 = $[5];
|
|
1977
|
+
return t3;
|
|
1978
|
+
};
|
|
1979
|
+
var DEFAULT_THROTTLE_TIME = 16;
|
|
1980
|
+
var useThrottledMeasure = (t0) => {
|
|
1981
|
+
const $ = c(10);
|
|
1982
|
+
const throttleDuration = t0 === void 0 ? DEFAULT_THROTTLE_TIME : t0;
|
|
1983
|
+
const hasInitialMeasure = useRef(false);
|
|
1984
|
+
const [ref, measuredRect] = useLocalMeasure();
|
|
1985
|
+
const [rect, setRect] = useState(_temp$1);
|
|
1986
|
+
let t1;
|
|
1987
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1988
|
+
t1 = (newRect) => {
|
|
1989
|
+
setRect((current) => deepEqual(current, newRect) ? current : newRect);
|
|
1990
|
+
};
|
|
1991
|
+
$[0] = t1;
|
|
1992
|
+
} else t1 = $[0];
|
|
1993
|
+
let t2;
|
|
1994
|
+
if ($[1] !== throttleDuration) {
|
|
1995
|
+
t2 = (0, import_throttle.default)(t1, throttleDuration, {
|
|
1996
|
+
leading: true,
|
|
1997
|
+
trailing: true
|
|
1998
|
+
});
|
|
1999
|
+
$[1] = throttleDuration;
|
|
2000
|
+
$[2] = t2;
|
|
2001
|
+
} else t2 = $[2];
|
|
2002
|
+
const throttledSetRect = t2;
|
|
2003
|
+
let t3;
|
|
2004
|
+
let t4;
|
|
2005
|
+
if ($[3] !== measuredRect || $[4] !== throttledSetRect) {
|
|
2006
|
+
t3 = () => {
|
|
2007
|
+
if (measuredRect.width > 0 && !hasInitialMeasure.current) {
|
|
2008
|
+
hasInitialMeasure.current = true;
|
|
2009
|
+
setRect((current_0) => deepEqual(current_0, measuredRect) ? current_0 : measuredRect);
|
|
2010
|
+
return;
|
|
2011
|
+
}
|
|
2012
|
+
throttledSetRect(measuredRect);
|
|
2013
|
+
return () => {
|
|
2014
|
+
throttledSetRect.cancel();
|
|
2015
|
+
};
|
|
2016
|
+
};
|
|
2017
|
+
t4 = [measuredRect, throttledSetRect];
|
|
2018
|
+
$[3] = measuredRect;
|
|
2019
|
+
$[4] = throttledSetRect;
|
|
2020
|
+
$[5] = t3;
|
|
2021
|
+
$[6] = t4;
|
|
2022
|
+
} else {
|
|
2023
|
+
t3 = $[5];
|
|
2024
|
+
t4 = $[6];
|
|
2025
|
+
}
|
|
2026
|
+
useEffect(t3, t4);
|
|
2027
|
+
let t5;
|
|
2028
|
+
if ($[7] !== rect || $[8] !== ref) {
|
|
2029
|
+
t5 = [ref, rect];
|
|
2030
|
+
$[7] = rect;
|
|
2031
|
+
$[8] = ref;
|
|
2032
|
+
$[9] = t5;
|
|
2033
|
+
} else t5 = $[9];
|
|
2034
|
+
return t5;
|
|
2147
2035
|
};
|
|
2148
2036
|
function _temp$1() {
|
|
2149
|
-
|
|
2037
|
+
return defaultRect;
|
|
2150
2038
|
}
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
const
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
};
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
};
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
};
|
|
2285
|
-
|
|
2286
|
-
const
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
return {
|
|
2295
|
-
id,
|
|
2296
|
-
topic: typeof doc.topic === "string" ? doc.topic : void 0,
|
|
2297
|
-
title: typeof doc.title === "string" ? doc.title : "",
|
|
2298
|
-
body: typeof doc.body === "string" ? doc.body : void 0,
|
|
2299
|
-
url: typeof doc.url === "string" ? doc.url : void 0,
|
|
2300
|
-
createdAt: toIso(doc.createdAt) ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
2301
|
-
seenAt: toIso(doc.seenAt),
|
|
2302
|
-
readAt: toIso(doc.readAt),
|
|
2303
|
-
archivedAt: toIso(doc.archivedAt),
|
|
2304
|
-
metadata: typeof doc.metadata === "object" && doc.metadata !== null ? doc.metadata : void 0
|
|
2305
|
-
};
|
|
2306
|
-
};
|
|
2307
|
-
const buildDisabledTopics = (settings) => {
|
|
2308
|
-
const raw = settings?.topicPreferences;
|
|
2309
|
-
if (!Array.isArray(raw) || raw.length === 0) return [];
|
|
2310
|
-
return raw.map((pref) => {
|
|
2311
|
-
if (!pref || typeof pref !== "object") return null;
|
|
2312
|
-
const topic = typeof pref.topic === "string" ? pref.topic.trim() : "";
|
|
2313
|
-
if (!topic) return null;
|
|
2314
|
-
return pref.inApp === false ? topic : null;
|
|
2315
|
-
}).filter((topic) => Boolean(topic));
|
|
2039
|
+
//#endregion
|
|
2040
|
+
//#region src/components/RouteErrorBoundary.tsx
|
|
2041
|
+
var defaultState = {
|
|
2042
|
+
statusCode: 500,
|
|
2043
|
+
title: "Something went wrong",
|
|
2044
|
+
message: "We couldn't render this route. Please try again shortly."
|
|
2045
|
+
};
|
|
2046
|
+
var toSsrErrorState = (error) => {
|
|
2047
|
+
if (isRouteErrorResponse(error)) {
|
|
2048
|
+
const data = error.data;
|
|
2049
|
+
const message = typeof data === "string" ? data : data?.message || defaultState.message;
|
|
2050
|
+
let details;
|
|
2051
|
+
if (env.DEV && data && typeof data !== "string") try {
|
|
2052
|
+
details = JSON.stringify(data, null, 2);
|
|
2053
|
+
} catch {
|
|
2054
|
+
details = void 0;
|
|
2055
|
+
}
|
|
2056
|
+
return {
|
|
2057
|
+
statusCode: error.status ?? defaultState.statusCode,
|
|
2058
|
+
title: error.statusText || defaultState.title,
|
|
2059
|
+
message,
|
|
2060
|
+
details
|
|
2061
|
+
};
|
|
2062
|
+
}
|
|
2063
|
+
if (error instanceof Error) return {
|
|
2064
|
+
statusCode: defaultState.statusCode,
|
|
2065
|
+
title: defaultState.title,
|
|
2066
|
+
message: error.message || defaultState.message,
|
|
2067
|
+
details: globalThis.__rb_env__.DEV ? error.stack ?? error.message : void 0
|
|
2068
|
+
};
|
|
2069
|
+
if (typeof error === "string") return {
|
|
2070
|
+
statusCode: defaultState.statusCode,
|
|
2071
|
+
title: defaultState.title,
|
|
2072
|
+
message: error
|
|
2073
|
+
};
|
|
2074
|
+
return defaultState;
|
|
2075
|
+
};
|
|
2076
|
+
var RouteErrorBoundary = (t0) => {
|
|
2077
|
+
const $ = c(5);
|
|
2078
|
+
const { renderErrorExtra } = t0;
|
|
2079
|
+
const routeError = useRouteError();
|
|
2080
|
+
let t1;
|
|
2081
|
+
if ($[0] !== routeError) {
|
|
2082
|
+
t1 = toSsrErrorState(routeError);
|
|
2083
|
+
$[0] = routeError;
|
|
2084
|
+
$[1] = t1;
|
|
2085
|
+
} else t1 = $[1];
|
|
2086
|
+
const state = t1;
|
|
2087
|
+
let t2;
|
|
2088
|
+
if ($[2] !== renderErrorExtra || $[3] !== state) {
|
|
2089
|
+
t2 = /* @__PURE__ */ jsx(SsrErrorFallback, {
|
|
2090
|
+
state,
|
|
2091
|
+
renderErrorExtra
|
|
2092
|
+
});
|
|
2093
|
+
$[2] = renderErrorExtra;
|
|
2094
|
+
$[3] = state;
|
|
2095
|
+
$[4] = t2;
|
|
2096
|
+
} else t2 = $[4];
|
|
2097
|
+
return t2;
|
|
2098
|
+
};
|
|
2099
|
+
//#endregion
|
|
2100
|
+
//#region src/notifications.ts
|
|
2101
|
+
var listNotifications = async (input = {}) => {
|
|
2102
|
+
const result = await apiClient.post("/api/rb/notifications", input);
|
|
2103
|
+
if (!result?.ok) throw new Error(result?.error || "Failed to load notifications");
|
|
2104
|
+
return {
|
|
2105
|
+
notifications: Array.isArray(result.notifications) ? result.notifications : [],
|
|
2106
|
+
unreadCount: Number.isFinite(result.unreadCount) ? Math.max(0, Math.floor(result.unreadCount ?? 0)) : 0,
|
|
2107
|
+
unseenCount: Number.isFinite(result.unseenCount) ? Math.max(0, Math.floor(result.unseenCount ?? 0)) : 0
|
|
2108
|
+
};
|
|
2109
|
+
};
|
|
2110
|
+
var markNotificationRead = async (notificationId) => {
|
|
2111
|
+
const id = notificationId.trim();
|
|
2112
|
+
if (!id) throw new Error("notificationId is required");
|
|
2113
|
+
const result = await apiClient.post(`/api/rb/notifications/${encodeURIComponent(id)}/read`, {});
|
|
2114
|
+
if (!result?.ok) throw new Error(result?.error || "Failed to mark notification read");
|
|
2115
|
+
};
|
|
2116
|
+
var archiveNotification = async (notificationId) => {
|
|
2117
|
+
const id = notificationId.trim();
|
|
2118
|
+
if (!id) throw new Error("notificationId is required");
|
|
2119
|
+
const result = await apiClient.post(`/api/rb/notifications/${encodeURIComponent(id)}/archive`, {});
|
|
2120
|
+
if (!result?.ok) throw new Error(result?.error || "Failed to archive notification");
|
|
2121
|
+
};
|
|
2122
|
+
var markAllNotificationsRead = async () => {
|
|
2123
|
+
const result = await apiClient.post("/api/rb/notifications/mark-all-read", {});
|
|
2124
|
+
if (!result?.ok) throw new Error(result?.error || "Failed to mark all notifications read");
|
|
2125
|
+
};
|
|
2126
|
+
var getNotificationSettings = async () => {
|
|
2127
|
+
const result = await apiClient.get("/api/rb/notifications/settings", {});
|
|
2128
|
+
if (!result?.ok) throw new Error(result?.error || "Failed to load notification settings");
|
|
2129
|
+
return result.settings ?? {
|
|
2130
|
+
digestFrequency: "weekly",
|
|
2131
|
+
topicPreferences: []
|
|
2132
|
+
};
|
|
2133
|
+
};
|
|
2134
|
+
var updateNotificationSettings = async (partial) => {
|
|
2135
|
+
const result = await apiClient.put("/api/rb/notifications/settings", partial);
|
|
2136
|
+
if (!result?.ok) throw new Error(result?.error || "Failed to update notification settings");
|
|
2137
|
+
return result.settings ?? {
|
|
2138
|
+
digestFrequency: "weekly",
|
|
2139
|
+
topicPreferences: []
|
|
2140
|
+
};
|
|
2141
|
+
};
|
|
2142
|
+
var runNotificationDigest = async ({ force = false } = {}) => {
|
|
2143
|
+
const result = await apiClient.post("/api/rb/notifications/digest/run", { force });
|
|
2144
|
+
if (!result?.ok) throw new Error(result?.error || "Failed to run digest");
|
|
2145
|
+
return {
|
|
2146
|
+
sent: result.sent === true,
|
|
2147
|
+
skippedReason: result.skippedReason
|
|
2148
|
+
};
|
|
2149
|
+
};
|
|
2150
|
+
//#endregion
|
|
2151
|
+
//#region src/notificationsRealtime.tsx
|
|
2152
|
+
var NotificationsRealtimeContext = createContext(null);
|
|
2153
|
+
var toIso = (value) => {
|
|
2154
|
+
if (value instanceof Date) return value.toISOString();
|
|
2155
|
+
if (typeof value === "string") return value;
|
|
2156
|
+
};
|
|
2157
|
+
var toNotificationItem = (doc) => {
|
|
2158
|
+
const id = typeof doc._id === "string" ? doc._id : String(doc._id ?? "");
|
|
2159
|
+
if (!id) return null;
|
|
2160
|
+
return {
|
|
2161
|
+
id,
|
|
2162
|
+
topic: typeof doc.topic === "string" ? doc.topic : void 0,
|
|
2163
|
+
title: typeof doc.title === "string" ? doc.title : "",
|
|
2164
|
+
body: typeof doc.body === "string" ? doc.body : void 0,
|
|
2165
|
+
url: typeof doc.url === "string" ? doc.url : void 0,
|
|
2166
|
+
createdAt: toIso(doc.createdAt) ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
2167
|
+
seenAt: toIso(doc.seenAt),
|
|
2168
|
+
readAt: toIso(doc.readAt),
|
|
2169
|
+
archivedAt: toIso(doc.archivedAt),
|
|
2170
|
+
metadata: typeof doc.metadata === "object" && doc.metadata !== null ? doc.metadata : void 0
|
|
2171
|
+
};
|
|
2172
|
+
};
|
|
2173
|
+
var buildDisabledTopics = (settings) => {
|
|
2174
|
+
const raw = settings?.topicPreferences;
|
|
2175
|
+
if (!Array.isArray(raw) || raw.length === 0) return [];
|
|
2176
|
+
return raw.map((pref) => {
|
|
2177
|
+
if (!pref || typeof pref !== "object") return null;
|
|
2178
|
+
const topic = typeof pref.topic === "string" ? pref.topic.trim() : "";
|
|
2179
|
+
if (!topic) return null;
|
|
2180
|
+
return pref.inApp === false ? topic : null;
|
|
2181
|
+
}).filter((topic) => Boolean(topic));
|
|
2316
2182
|
};
|
|
2317
2183
|
function NotificationsRealtimeProvider(t0) {
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
lastToastIds.current.add(n_4.id);
|
|
2549
|
-
}
|
|
2550
|
-
const isTabActive = typeof document !== "undefined" && document.visibilityState === "visible";
|
|
2551
|
-
if (!isTabActive) {
|
|
2552
|
-
return;
|
|
2553
|
-
}
|
|
2554
|
-
const eligible = nextNew.filter((n_5) => {
|
|
2555
|
-
const createdAtMs = Date.parse(n_5.createdAt);
|
|
2556
|
-
if (!Number.isFinite(createdAtMs)) {
|
|
2557
|
-
return true;
|
|
2558
|
-
}
|
|
2559
|
-
return createdAtMs >= toastStartMs.current;
|
|
2560
|
-
});
|
|
2561
|
-
if (!eligible.length) {
|
|
2562
|
-
return;
|
|
2563
|
-
}
|
|
2564
|
-
if (eligible.length > 3) {
|
|
2565
|
-
toast(`${eligible.length} new notifications`, {
|
|
2566
|
-
description: "Open the notifications drawer to view them."
|
|
2567
|
-
});
|
|
2568
|
-
return;
|
|
2569
|
-
}
|
|
2570
|
-
for (const n_6 of eligible) {
|
|
2571
|
-
toast(n_6.title || "New notification", {
|
|
2572
|
-
description: n_6.body
|
|
2573
|
-
});
|
|
2574
|
-
}
|
|
2575
|
-
};
|
|
2576
|
-
t18 = [canUseRts, notifications, notificationsQuery.loading, toastOnNew];
|
|
2577
|
-
$[32] = canUseRts;
|
|
2578
|
-
$[33] = notifications;
|
|
2579
|
-
$[34] = notificationsQuery.loading;
|
|
2580
|
-
$[35] = toastOnNew;
|
|
2581
|
-
$[36] = t17;
|
|
2582
|
-
$[37] = t18;
|
|
2583
|
-
} else {
|
|
2584
|
-
t17 = $[36];
|
|
2585
|
-
t18 = $[37];
|
|
2586
|
-
}
|
|
2587
|
-
useEffect(t17, t18);
|
|
2588
|
-
let t19;
|
|
2589
|
-
if ($[38] !== notifications || $[39] !== notificationsQuery.error || $[40] !== notificationsQuery.loading || $[41] !== unreadCount || $[42] !== unseenCount) {
|
|
2590
|
-
t19 = {
|
|
2591
|
-
notifications,
|
|
2592
|
-
unreadCount,
|
|
2593
|
-
unseenCount,
|
|
2594
|
-
loading: notificationsQuery.loading,
|
|
2595
|
-
error: notificationsQuery.error
|
|
2596
|
-
};
|
|
2597
|
-
$[38] = notifications;
|
|
2598
|
-
$[39] = notificationsQuery.error;
|
|
2599
|
-
$[40] = notificationsQuery.loading;
|
|
2600
|
-
$[41] = unreadCount;
|
|
2601
|
-
$[42] = unseenCount;
|
|
2602
|
-
$[43] = t19;
|
|
2603
|
-
} else {
|
|
2604
|
-
t19 = $[43];
|
|
2605
|
-
}
|
|
2606
|
-
const value = t19;
|
|
2607
|
-
const t20 = canUseRts ? value : null;
|
|
2608
|
-
let t21;
|
|
2609
|
-
if ($[44] !== children || $[45] !== t20) {
|
|
2610
|
-
t21 = /* @__PURE__ */ jsx(NotificationsRealtimeContext.Provider, { value: t20, children });
|
|
2611
|
-
$[44] = children;
|
|
2612
|
-
$[45] = t20;
|
|
2613
|
-
$[46] = t21;
|
|
2614
|
-
} else {
|
|
2615
|
-
t21 = $[46];
|
|
2616
|
-
}
|
|
2617
|
-
return t21;
|
|
2184
|
+
const $ = c(47);
|
|
2185
|
+
const { userId, limit: t1, toastOnNew: t2, children } = t0;
|
|
2186
|
+
const limit = t1 === void 0 ? 200 : t1;
|
|
2187
|
+
const toastOnNew = t2 === void 0 ? true : t2;
|
|
2188
|
+
let t3;
|
|
2189
|
+
if ($[0] !== userId) {
|
|
2190
|
+
t3 = typeof userId === "string" ? userId.trim() : "";
|
|
2191
|
+
$[0] = userId;
|
|
2192
|
+
$[1] = t3;
|
|
2193
|
+
} else t3 = $[1];
|
|
2194
|
+
const trimmedUserId = t3;
|
|
2195
|
+
const canUseRts = Boolean(trimmedUserId);
|
|
2196
|
+
let t4;
|
|
2197
|
+
if ($[2] !== canUseRts || $[3] !== trimmedUserId) {
|
|
2198
|
+
t4 = canUseRts ? { userId: trimmedUserId } : {};
|
|
2199
|
+
$[2] = canUseRts;
|
|
2200
|
+
$[3] = trimmedUserId;
|
|
2201
|
+
$[4] = t4;
|
|
2202
|
+
} else t4 = $[4];
|
|
2203
|
+
let t5;
|
|
2204
|
+
if ($[5] !== canUseRts) {
|
|
2205
|
+
t5 = {
|
|
2206
|
+
key: "rb.notifications.settings",
|
|
2207
|
+
limit: 1,
|
|
2208
|
+
enabled: canUseRts
|
|
2209
|
+
};
|
|
2210
|
+
$[5] = canUseRts;
|
|
2211
|
+
$[6] = t5;
|
|
2212
|
+
} else t5 = $[6];
|
|
2213
|
+
const settings = useQuery("RBNotificationSettings", t4, t5).data?.[0] ?? null;
|
|
2214
|
+
let t6;
|
|
2215
|
+
if ($[7] !== settings) {
|
|
2216
|
+
t6 = buildDisabledTopics(settings);
|
|
2217
|
+
$[7] = settings;
|
|
2218
|
+
$[8] = t6;
|
|
2219
|
+
} else t6 = $[8];
|
|
2220
|
+
const disabledTopics = t6;
|
|
2221
|
+
let t7;
|
|
2222
|
+
bb0: {
|
|
2223
|
+
if (!canUseRts) {
|
|
2224
|
+
let t8;
|
|
2225
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2226
|
+
t8 = {};
|
|
2227
|
+
$[9] = t8;
|
|
2228
|
+
} else t8 = $[9];
|
|
2229
|
+
t7 = t8;
|
|
2230
|
+
break bb0;
|
|
2231
|
+
}
|
|
2232
|
+
let t8;
|
|
2233
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2234
|
+
t8 = { $exists: false };
|
|
2235
|
+
$[10] = t8;
|
|
2236
|
+
} else t8 = $[10];
|
|
2237
|
+
let base;
|
|
2238
|
+
if ($[11] !== disabledTopics || $[12] !== trimmedUserId) {
|
|
2239
|
+
base = {
|
|
2240
|
+
userId: trimmedUserId,
|
|
2241
|
+
archivedAt: t8
|
|
2242
|
+
};
|
|
2243
|
+
if (disabledTopics.length > 0) {
|
|
2244
|
+
let t9;
|
|
2245
|
+
if ($[14] !== disabledTopics) {
|
|
2246
|
+
t9 = { $nin: disabledTopics };
|
|
2247
|
+
$[14] = disabledTopics;
|
|
2248
|
+
$[15] = t9;
|
|
2249
|
+
} else t9 = $[15];
|
|
2250
|
+
base.topic = t9;
|
|
2251
|
+
}
|
|
2252
|
+
$[11] = disabledTopics;
|
|
2253
|
+
$[12] = trimmedUserId;
|
|
2254
|
+
$[13] = base;
|
|
2255
|
+
} else base = $[13];
|
|
2256
|
+
t7 = base;
|
|
2257
|
+
}
|
|
2258
|
+
const query = t7;
|
|
2259
|
+
let t8;
|
|
2260
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2261
|
+
t8 = { createdAt: -1 };
|
|
2262
|
+
$[16] = t8;
|
|
2263
|
+
} else t8 = $[16];
|
|
2264
|
+
let t9;
|
|
2265
|
+
if ($[17] !== canUseRts || $[18] !== limit) {
|
|
2266
|
+
t9 = {
|
|
2267
|
+
key: "rb.notifications",
|
|
2268
|
+
sort: t8,
|
|
2269
|
+
limit,
|
|
2270
|
+
enabled: canUseRts
|
|
2271
|
+
};
|
|
2272
|
+
$[17] = canUseRts;
|
|
2273
|
+
$[18] = limit;
|
|
2274
|
+
$[19] = t9;
|
|
2275
|
+
} else t9 = $[19];
|
|
2276
|
+
const notificationsQuery = useQuery("RBNotification", query, t9);
|
|
2277
|
+
let t10;
|
|
2278
|
+
bb1: {
|
|
2279
|
+
const raw = notificationsQuery.data;
|
|
2280
|
+
if (!Array.isArray(raw)) {
|
|
2281
|
+
let t11;
|
|
2282
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2283
|
+
t11 = [];
|
|
2284
|
+
$[20] = t11;
|
|
2285
|
+
} else t11 = $[20];
|
|
2286
|
+
t10 = t11;
|
|
2287
|
+
break bb1;
|
|
2288
|
+
}
|
|
2289
|
+
let t11;
|
|
2290
|
+
if ($[21] !== raw) {
|
|
2291
|
+
t11 = raw.map(_temp).filter(_temp2);
|
|
2292
|
+
$[21] = raw;
|
|
2293
|
+
$[22] = t11;
|
|
2294
|
+
} else t11 = $[22];
|
|
2295
|
+
t10 = t11;
|
|
2296
|
+
}
|
|
2297
|
+
const notifications = t10;
|
|
2298
|
+
let t11;
|
|
2299
|
+
if ($[23] !== notifications) {
|
|
2300
|
+
t11 = notifications.reduce(_temp3, 0);
|
|
2301
|
+
$[23] = notifications;
|
|
2302
|
+
$[24] = t11;
|
|
2303
|
+
} else t11 = $[24];
|
|
2304
|
+
const unreadCount = t11;
|
|
2305
|
+
let t12;
|
|
2306
|
+
if ($[25] !== notifications) {
|
|
2307
|
+
t12 = notifications.reduce(_temp4, 0);
|
|
2308
|
+
$[25] = notifications;
|
|
2309
|
+
$[26] = t12;
|
|
2310
|
+
} else t12 = $[26];
|
|
2311
|
+
const unseenCount = t12;
|
|
2312
|
+
let t13;
|
|
2313
|
+
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2314
|
+
t13 = /* @__PURE__ */ new Set();
|
|
2315
|
+
$[27] = t13;
|
|
2316
|
+
} else t13 = $[27];
|
|
2317
|
+
const lastToastIds = useRef(t13);
|
|
2318
|
+
const hasSeededToastIds = useRef(false);
|
|
2319
|
+
let t14;
|
|
2320
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2321
|
+
t14 = Date.now();
|
|
2322
|
+
$[28] = t14;
|
|
2323
|
+
} else t14 = $[28];
|
|
2324
|
+
const toastStartMs = useRef(t14);
|
|
2325
|
+
let t15;
|
|
2326
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2327
|
+
t15 = () => {
|
|
2328
|
+
hasSeededToastIds.current = false;
|
|
2329
|
+
lastToastIds.current = /* @__PURE__ */ new Set();
|
|
2330
|
+
toastStartMs.current = Date.now();
|
|
2331
|
+
};
|
|
2332
|
+
$[29] = t15;
|
|
2333
|
+
} else t15 = $[29];
|
|
2334
|
+
let t16;
|
|
2335
|
+
if ($[30] !== trimmedUserId) {
|
|
2336
|
+
t16 = [trimmedUserId];
|
|
2337
|
+
$[30] = trimmedUserId;
|
|
2338
|
+
$[31] = t16;
|
|
2339
|
+
} else t16 = $[31];
|
|
2340
|
+
useEffect(t15, t16);
|
|
2341
|
+
let t17;
|
|
2342
|
+
let t18;
|
|
2343
|
+
if ($[32] !== canUseRts || $[33] !== notifications || $[34] !== notificationsQuery.loading || $[35] !== toastOnNew) {
|
|
2344
|
+
t17 = () => {
|
|
2345
|
+
if (!toastOnNew) return;
|
|
2346
|
+
if (!canUseRts) return;
|
|
2347
|
+
if (notificationsQuery.loading) return;
|
|
2348
|
+
if (!hasSeededToastIds.current) {
|
|
2349
|
+
hasSeededToastIds.current = true;
|
|
2350
|
+
lastToastIds.current = new Set(notifications.map(_temp5));
|
|
2351
|
+
return;
|
|
2352
|
+
}
|
|
2353
|
+
const nextNew = notifications.filter((n_3) => !lastToastIds.current.has(n_3.id));
|
|
2354
|
+
if (!nextNew.length) return;
|
|
2355
|
+
for (const n_4 of nextNew) lastToastIds.current.add(n_4.id);
|
|
2356
|
+
if (!(typeof document !== "undefined" && document.visibilityState === "visible")) return;
|
|
2357
|
+
const eligible = nextNew.filter((n_5) => {
|
|
2358
|
+
const createdAtMs = Date.parse(n_5.createdAt);
|
|
2359
|
+
if (!Number.isFinite(createdAtMs)) return true;
|
|
2360
|
+
return createdAtMs >= toastStartMs.current;
|
|
2361
|
+
});
|
|
2362
|
+
if (!eligible.length) return;
|
|
2363
|
+
if (eligible.length > 3) {
|
|
2364
|
+
toast(`${eligible.length} new notifications`, { description: "Open the notifications drawer to view them." });
|
|
2365
|
+
return;
|
|
2366
|
+
}
|
|
2367
|
+
for (const n_6 of eligible) toast(n_6.title || "New notification", { description: n_6.body });
|
|
2368
|
+
};
|
|
2369
|
+
t18 = [
|
|
2370
|
+
canUseRts,
|
|
2371
|
+
notifications,
|
|
2372
|
+
notificationsQuery.loading,
|
|
2373
|
+
toastOnNew
|
|
2374
|
+
];
|
|
2375
|
+
$[32] = canUseRts;
|
|
2376
|
+
$[33] = notifications;
|
|
2377
|
+
$[34] = notificationsQuery.loading;
|
|
2378
|
+
$[35] = toastOnNew;
|
|
2379
|
+
$[36] = t17;
|
|
2380
|
+
$[37] = t18;
|
|
2381
|
+
} else {
|
|
2382
|
+
t17 = $[36];
|
|
2383
|
+
t18 = $[37];
|
|
2384
|
+
}
|
|
2385
|
+
useEffect(t17, t18);
|
|
2386
|
+
let t19;
|
|
2387
|
+
if ($[38] !== notifications || $[39] !== notificationsQuery.error || $[40] !== notificationsQuery.loading || $[41] !== unreadCount || $[42] !== unseenCount) {
|
|
2388
|
+
t19 = {
|
|
2389
|
+
notifications,
|
|
2390
|
+
unreadCount,
|
|
2391
|
+
unseenCount,
|
|
2392
|
+
loading: notificationsQuery.loading,
|
|
2393
|
+
error: notificationsQuery.error
|
|
2394
|
+
};
|
|
2395
|
+
$[38] = notifications;
|
|
2396
|
+
$[39] = notificationsQuery.error;
|
|
2397
|
+
$[40] = notificationsQuery.loading;
|
|
2398
|
+
$[41] = unreadCount;
|
|
2399
|
+
$[42] = unseenCount;
|
|
2400
|
+
$[43] = t19;
|
|
2401
|
+
} else t19 = $[43];
|
|
2402
|
+
const t20 = canUseRts ? t19 : null;
|
|
2403
|
+
let t21;
|
|
2404
|
+
if ($[44] !== children || $[45] !== t20) {
|
|
2405
|
+
t21 = /* @__PURE__ */ jsx(NotificationsRealtimeContext.Provider, {
|
|
2406
|
+
value: t20,
|
|
2407
|
+
children
|
|
2408
|
+
});
|
|
2409
|
+
$[44] = children;
|
|
2410
|
+
$[45] = t20;
|
|
2411
|
+
$[46] = t21;
|
|
2412
|
+
} else t21 = $[46];
|
|
2413
|
+
return t21;
|
|
2618
2414
|
}
|
|
2619
2415
|
function _temp5(n_2) {
|
|
2620
|
-
|
|
2416
|
+
return n_2.id;
|
|
2621
2417
|
}
|
|
2622
2418
|
function _temp4(acc_0, n_1) {
|
|
2623
|
-
|
|
2419
|
+
return acc_0 + (n_1.seenAt ? 0 : 1);
|
|
2624
2420
|
}
|
|
2625
2421
|
function _temp3(acc, n_0) {
|
|
2626
|
-
|
|
2422
|
+
return acc + (n_0.readAt ? 0 : 1);
|
|
2627
2423
|
}
|
|
2628
2424
|
function _temp2(n) {
|
|
2629
|
-
|
|
2425
|
+
return Boolean(n);
|
|
2630
2426
|
}
|
|
2631
2427
|
function _temp(doc) {
|
|
2632
|
-
|
|
2428
|
+
return toNotificationItem(doc);
|
|
2633
2429
|
}
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
};
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
RouteErrorBoundary,
|
|
2642
|
-
R as RtsSsrRuntimeProvider,
|
|
2643
|
-
SSR_ERROR_STATE_GLOBAL_KEY,
|
|
2644
|
-
S as STATIC_RPCBASE_RTS_HYDRATION_DATA_KEY,
|
|
2645
|
-
SsrErrorFallback,
|
|
2646
|
-
apiClient,
|
|
2647
|
-
archiveNotification,
|
|
2648
|
-
p as clearHydratedRtsQueryData,
|
|
2649
|
-
consumeClientSsrErrorState,
|
|
2650
|
-
getFeatureFlag,
|
|
2651
|
-
getNotificationSettings,
|
|
2652
|
-
hydrateRtsFromWindow,
|
|
2653
|
-
initApiClient,
|
|
2654
|
-
initWithRoutes,
|
|
2655
|
-
listNotifications,
|
|
2656
|
-
markAllNotificationsRead,
|
|
2657
|
-
markNotificationRead,
|
|
2658
|
-
peekClientSsrErrorState,
|
|
2659
|
-
q as peekHydratedRtsQueryData,
|
|
2660
|
-
t as peekHydratedRtsQueryPageInfo,
|
|
2661
|
-
v as peekHydratedRtsQueryTotalCount,
|
|
2662
|
-
reportClientException,
|
|
2663
|
-
runNotificationDigest,
|
|
2664
|
-
serializeSsrErrorState,
|
|
2665
|
-
s as setClientExceptionReporter,
|
|
2666
|
-
toast,
|
|
2667
|
-
updateNotificationSettings,
|
|
2668
|
-
useMediaQuery,
|
|
2669
|
-
useNotificationsRealtime,
|
|
2670
|
-
useThrottledMeasure
|
|
2671
|
-
};
|
|
2672
|
-
//# sourceMappingURL=index.js.map
|
|
2430
|
+
var useNotificationsRealtime = () => {
|
|
2431
|
+
return useContext(NotificationsRealtimeContext);
|
|
2432
|
+
};
|
|
2433
|
+
//#endregion
|
|
2434
|
+
export { NotificationsRealtimeContext, NotificationsRealtimeProvider, RootProvider, RouteErrorBoundary, RtsSsrRuntimeProvider, SSR_ERROR_STATE_GLOBAL_KEY, STATIC_RPCBASE_RTS_HYDRATION_DATA_KEY, SsrErrorFallback, apiClient, archiveNotification, clearHydratedRtsQueryData, consumeClientSsrErrorState, getFeatureFlag, getNotificationSettings, hydrateRtsFromWindow, initApiClient, initWithRoutes, listNotifications, markAllNotificationsRead, markNotificationRead, peekClientSsrErrorState, peekHydratedRtsQueryData, peekHydratedRtsQueryPageInfo, peekHydratedRtsQueryTotalCount, reportClientException, runNotificationDigest, serializeSsrErrorState, setClientExceptionReporter, toast, updateNotificationSettings, useMediaQuery, useNotificationsRealtime, useThrottledMeasure };
|
|
2435
|
+
|
|
2436
|
+
//# sourceMappingURL=index.js.map
|