@fluid-app/rep-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +413 -0
  2. package/dist/ContactsScreen-BYXF74BO.js +4 -0
  3. package/dist/ContactsScreen-BYXF74BO.js.map +1 -0
  4. package/dist/ContactsScreen-XZOQJVFE.cjs +17 -0
  5. package/dist/ContactsScreen-XZOQJVFE.cjs.map +1 -0
  6. package/dist/CustomersScreen-53SXRDDK.cjs +17 -0
  7. package/dist/CustomersScreen-53SXRDDK.cjs.map +1 -0
  8. package/dist/CustomersScreen-VS6LGULO.js +4 -0
  9. package/dist/CustomersScreen-VS6LGULO.js.map +1 -0
  10. package/dist/MessagingScreen-O42JEJMW.js +4 -0
  11. package/dist/MessagingScreen-O42JEJMW.js.map +1 -0
  12. package/dist/MessagingScreen-UCVLYWZB.cjs +17 -0
  13. package/dist/MessagingScreen-UCVLYWZB.cjs.map +1 -0
  14. package/dist/OrdersScreen-QQJFTTSS.js +4 -0
  15. package/dist/OrdersScreen-QQJFTTSS.js.map +1 -0
  16. package/dist/OrdersScreen-WNT2WDLI.cjs +17 -0
  17. package/dist/OrdersScreen-WNT2WDLI.cjs.map +1 -0
  18. package/dist/ProductsScreen-CTIAKS3Z.cjs +17 -0
  19. package/dist/ProductsScreen-CTIAKS3Z.cjs.map +1 -0
  20. package/dist/ProductsScreen-TRIT2FE3.js +4 -0
  21. package/dist/ProductsScreen-TRIT2FE3.js.map +1 -0
  22. package/dist/chunk-2AWTZV3T.js +16 -0
  23. package/dist/chunk-2AWTZV3T.js.map +1 -0
  24. package/dist/chunk-CXRJSGO6.js +16 -0
  25. package/dist/chunk-CXRJSGO6.js.map +1 -0
  26. package/dist/chunk-DEQ3PBVX.cjs +29 -0
  27. package/dist/chunk-DEQ3PBVX.cjs.map +1 -0
  28. package/dist/chunk-JZRNKSKT.cjs +19 -0
  29. package/dist/chunk-JZRNKSKT.cjs.map +1 -0
  30. package/dist/chunk-LO2HDG6C.js +26 -0
  31. package/dist/chunk-LO2HDG6C.js.map +1 -0
  32. package/dist/chunk-MBUCXIUN.cjs +19 -0
  33. package/dist/chunk-MBUCXIUN.cjs.map +1 -0
  34. package/dist/chunk-MEOOAMH2.cjs +19 -0
  35. package/dist/chunk-MEOOAMH2.cjs.map +1 -0
  36. package/dist/chunk-PJWPO4BJ.js +16 -0
  37. package/dist/chunk-PJWPO4BJ.js.map +1 -0
  38. package/dist/chunk-PZIHCYDD.js +16 -0
  39. package/dist/chunk-PZIHCYDD.js.map +1 -0
  40. package/dist/chunk-QUVJ3R4T.cjs +19 -0
  41. package/dist/chunk-QUVJ3R4T.cjs.map +1 -0
  42. package/dist/chunk-WH7WZXT6.js +16 -0
  43. package/dist/chunk-WH7WZXT6.js.map +1 -0
  44. package/dist/chunk-YII3IXF4.cjs +19 -0
  45. package/dist/chunk-YII3IXF4.cjs.map +1 -0
  46. package/dist/index.cjs +2446 -0
  47. package/dist/index.cjs.map +1 -0
  48. package/dist/index.d.cts +2164 -0
  49. package/dist/index.d.ts +2164 -0
  50. package/dist/index.js +2079 -0
  51. package/dist/index.js.map +1 -0
  52. package/package.json +58 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,2446 @@
1
+ 'use strict';
2
+
3
+ var chunkJZRNKSKT_cjs = require('./chunk-JZRNKSKT.cjs');
4
+ var chunkMEOOAMH2_cjs = require('./chunk-MEOOAMH2.cjs');
5
+ var chunkYII3IXF4_cjs = require('./chunk-YII3IXF4.cjs');
6
+ var chunkMBUCXIUN_cjs = require('./chunk-MBUCXIUN.cjs');
7
+ var chunkQUVJ3R4T_cjs = require('./chunk-QUVJ3R4T.cjs');
8
+ var chunkDEQ3PBVX_cjs = require('./chunk-DEQ3PBVX.cjs');
9
+ var react = require('react');
10
+ var reactQuery = require('@tanstack/react-query');
11
+ var jsxRuntime = require('react/jsx-runtime');
12
+ var jose = require('jose');
13
+ var types = require('@fluid-app/rep-core/types');
14
+ var theme_star = require('@fluid-app/rep-core/theme');
15
+ var widgets = require('@fluid-app/rep-widgets/widgets');
16
+ var widgetUtils = require('@fluid-app/rep-core/widget-utils');
17
+ var registries = require('@fluid-app/rep-core/registries');
18
+
19
+ function _interopNamespace(e) {
20
+ if (e && e.__esModule) return e;
21
+ var n = Object.create(null);
22
+ if (e) {
23
+ Object.keys(e).forEach(function (k) {
24
+ if (k !== 'default') {
25
+ var d = Object.getOwnPropertyDescriptor(e, k);
26
+ Object.defineProperty(n, k, d.get ? d : {
27
+ enumerable: true,
28
+ get: function () { return e[k]; }
29
+ });
30
+ }
31
+ });
32
+ }
33
+ n.default = e;
34
+ return Object.freeze(n);
35
+ }
36
+
37
+ var theme_star__namespace = /*#__PURE__*/_interopNamespace(theme_star);
38
+
39
+ // src/client/types.ts
40
+ var HTTP_METHODS = {
41
+ GET: "GET",
42
+ POST: "POST",
43
+ PUT: "PUT",
44
+ PATCH: "PATCH",
45
+ DELETE: "DELETE"
46
+ };
47
+
48
+ // src/client/fluid-client.ts
49
+ var ApiError = class _ApiError extends Error {
50
+ status;
51
+ data;
52
+ constructor(message, status, data) {
53
+ super(message);
54
+ this.name = "ApiError";
55
+ this.status = status;
56
+ this.data = data;
57
+ const errorWithCapture = Error;
58
+ if (errorWithCapture.captureStackTrace) {
59
+ errorWithCapture.captureStackTrace(this, _ApiError);
60
+ }
61
+ }
62
+ toJSON() {
63
+ return {
64
+ name: this.name,
65
+ message: this.message,
66
+ status: this.status,
67
+ data: this.data
68
+ };
69
+ }
70
+ };
71
+ function isApiError(error) {
72
+ return error instanceof ApiError;
73
+ }
74
+ function isString(value) {
75
+ return typeof value === "string";
76
+ }
77
+ function extractErrorMessage(data, fallback) {
78
+ if ("message" in data && isString(data.message)) {
79
+ return data.message;
80
+ }
81
+ if ("error_message" in data && isString(data.error_message)) {
82
+ return data.error_message;
83
+ }
84
+ if ("error" in data && isString(data.error)) {
85
+ return data.error;
86
+ }
87
+ return fallback;
88
+ }
89
+ function createFluidClient(config) {
90
+ const { baseUrl, getAuthToken, onAuthError, defaultHeaders = {} } = config;
91
+ async function buildHeaders(customHeaders) {
92
+ const headers = {
93
+ "Content-Type": "application/json",
94
+ ...defaultHeaders,
95
+ ...customHeaders
96
+ };
97
+ if (getAuthToken) {
98
+ const token = await getAuthToken();
99
+ if (token) {
100
+ headers.Authorization = `Bearer ${token}`;
101
+ }
102
+ }
103
+ return headers;
104
+ }
105
+ function buildUrl(endpoint, params) {
106
+ const normalizedBase = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
107
+ const normalizedEndpoint = endpoint.startsWith("/") ? endpoint : `/${endpoint}`;
108
+ const url = new URL(normalizedBase + normalizedEndpoint);
109
+ if (params) {
110
+ for (const [key, value] of Object.entries(params)) {
111
+ if (value === void 0 || value === null) {
112
+ continue;
113
+ }
114
+ if (Array.isArray(value)) {
115
+ for (const item of value) {
116
+ url.searchParams.append(`${key}[]`, String(item));
117
+ }
118
+ } else if (typeof value === "object") {
119
+ for (const [subKey, subValue] of Object.entries(
120
+ value
121
+ )) {
122
+ if (subValue === void 0 || subValue === null) {
123
+ continue;
124
+ }
125
+ if (Array.isArray(subValue)) {
126
+ for (const item of subValue) {
127
+ url.searchParams.append(`${key}[${subKey}][]`, String(item));
128
+ }
129
+ } else {
130
+ url.searchParams.append(`${key}[${subKey}]`, String(subValue));
131
+ }
132
+ }
133
+ } else {
134
+ url.searchParams.append(key, String(value));
135
+ }
136
+ }
137
+ }
138
+ return url.toString();
139
+ }
140
+ const defaultRequestOptions = {
141
+ method: HTTP_METHODS.GET
142
+ };
143
+ async function request(endpoint, options = {}) {
144
+ const {
145
+ method = defaultRequestOptions.method,
146
+ headers: customHeaders,
147
+ params,
148
+ body,
149
+ signal
150
+ } = options;
151
+ const url = buildUrl(
152
+ endpoint,
153
+ method === HTTP_METHODS.GET ? params : void 0
154
+ );
155
+ const headers = await buildHeaders(customHeaders);
156
+ let response;
157
+ try {
158
+ const fetchOptions = {
159
+ method,
160
+ headers
161
+ };
162
+ if (signal !== void 0) {
163
+ fetchOptions.signal = signal;
164
+ }
165
+ if (body && method !== HTTP_METHODS.GET) {
166
+ fetchOptions.body = JSON.stringify(body);
167
+ }
168
+ response = await fetch(url, fetchOptions);
169
+ } catch (networkError) {
170
+ throw new ApiError(
171
+ `Network error: ${networkError instanceof Error ? networkError.message : "Unknown network error"}`,
172
+ 0,
173
+ null
174
+ );
175
+ }
176
+ if (response.status === 401 && onAuthError) {
177
+ onAuthError();
178
+ }
179
+ if (!response.ok) {
180
+ try {
181
+ const contentType = response.headers.get("content-type");
182
+ if (contentType?.includes("application/json")) {
183
+ const data = await response.json();
184
+ const errorMessage = extractErrorMessage(
185
+ data,
186
+ `${method} request failed`
187
+ );
188
+ throw new ApiError(
189
+ errorMessage,
190
+ response.status,
191
+ "errors" in data ? data.errors : data
192
+ );
193
+ } else {
194
+ throw new ApiError(
195
+ `${method} request failed with status ${response.status}`,
196
+ response.status,
197
+ null
198
+ );
199
+ }
200
+ } catch (error) {
201
+ if (isApiError(error)) {
202
+ throw error;
203
+ }
204
+ throw new ApiError(
205
+ `${method} request failed with status ${response.status}`,
206
+ response.status,
207
+ null
208
+ );
209
+ }
210
+ }
211
+ if (response.status === 204 || response.headers.get("content-length") === "0") {
212
+ return null;
213
+ }
214
+ try {
215
+ const data = await response.json();
216
+ if (data === null || data === void 0) {
217
+ throw new ApiError(
218
+ "Unexpected null/undefined in JSON response",
219
+ response.status,
220
+ null
221
+ );
222
+ }
223
+ return data;
224
+ } catch (parseError) {
225
+ if (isApiError(parseError)) {
226
+ throw parseError;
227
+ }
228
+ throw new ApiError(
229
+ "Failed to parse response as JSON",
230
+ response.status,
231
+ null
232
+ );
233
+ }
234
+ }
235
+ async function requestNullable(endpoint, options = {}) {
236
+ return request(endpoint, options);
237
+ }
238
+ async function safeRequest(endpoint, options = {}) {
239
+ try {
240
+ const data = await request(endpoint, options);
241
+ return { success: true, data };
242
+ } catch (error) {
243
+ if (isApiError(error)) {
244
+ return { success: false, error };
245
+ }
246
+ return {
247
+ success: false,
248
+ error: new ApiError(
249
+ error instanceof Error ? error.message : "Unknown error",
250
+ 0,
251
+ null
252
+ )
253
+ };
254
+ }
255
+ }
256
+ function toParams(params) {
257
+ return params;
258
+ }
259
+ const get = (endpoint, params, options) => {
260
+ const baseOptions = {
261
+ ...options,
262
+ method: HTTP_METHODS.GET
263
+ };
264
+ const convertedParams = toParams(params);
265
+ const requestOptions = convertedParams !== void 0 ? { ...baseOptions, params: convertedParams } : baseOptions;
266
+ return request(endpoint, requestOptions);
267
+ };
268
+ const post = (endpoint, body, options) => request(endpoint, {
269
+ ...options,
270
+ method: HTTP_METHODS.POST,
271
+ body
272
+ });
273
+ const put = (endpoint, body, options) => request(endpoint, {
274
+ ...options,
275
+ method: HTTP_METHODS.PUT,
276
+ body
277
+ });
278
+ const patch = (endpoint, body, options) => request(endpoint, {
279
+ ...options,
280
+ method: HTTP_METHODS.PATCH,
281
+ body
282
+ });
283
+ const del = (endpoint, options) => request(endpoint, {
284
+ ...options,
285
+ method: HTTP_METHODS.DELETE
286
+ });
287
+ return {
288
+ // Low-level methods for custom endpoints
289
+ request,
290
+ requestNullable,
291
+ safeRequest,
292
+ get,
293
+ post,
294
+ put,
295
+ patch,
296
+ delete: del,
297
+ // Products API - matches fluid-admin's /company/v1/products
298
+ products: {
299
+ list: (params) => get(
300
+ "/company/v1/products",
301
+ params
302
+ ),
303
+ get: (id) => get(`/company/v1/products/${id}`),
304
+ search: (query, params) => get("/company/v1/products", {
305
+ search_query: query,
306
+ ...params
307
+ })
308
+ },
309
+ // Orders API
310
+ orders: {
311
+ list: (params) => get("/orders", params),
312
+ get: (id) => get(`/orders/${id}`),
313
+ create: (data) => post("/orders", data)
314
+ },
315
+ // Reps API
316
+ reps: {
317
+ current: () => get("/reps/me"),
318
+ updateProfile: (data) => patch("/reps/me", data)
319
+ },
320
+ // Profile API (themes, navigation, screens)
321
+ profile: {
322
+ get: () => get("/rep_app/manifest")
323
+ },
324
+ // Permissions API
325
+ permissions: {
326
+ get: () => get("/company/roles/my_permissions")
327
+ },
328
+ // Analytics API
329
+ analytics: {
330
+ dashboard: () => get("/analytics/dashboard"),
331
+ sales: (params) => get("/analytics/sales", params)
332
+ }
333
+ };
334
+ }
335
+ var ThemeContext = react.createContext(null);
336
+ function applyThemeVariables(theme, container) {
337
+ const target = container ?? document.documentElement;
338
+ for (const [key, value] of Object.entries(theme.config)) {
339
+ target.style.setProperty(`--fluid-${key}`, value);
340
+ }
341
+ if (theme.mode) {
342
+ target.dataset.fluidThemeMode = theme.mode;
343
+ }
344
+ }
345
+ function FluidThemeProvider({
346
+ children,
347
+ initialTheme,
348
+ container
349
+ }) {
350
+ const [currentTheme, setCurrentTheme] = react.useState(
351
+ initialTheme ?? null
352
+ );
353
+ react.useEffect(() => {
354
+ if (currentTheme) {
355
+ applyThemeVariables(currentTheme, container ?? null);
356
+ }
357
+ }, [currentTheme, container]);
358
+ const setTheme = react.useCallback((theme) => {
359
+ setCurrentTheme(theme);
360
+ }, []);
361
+ const setThemeMode = react.useCallback((mode) => {
362
+ setCurrentTheme((prev) => prev ? { ...prev, mode } : null);
363
+ }, []);
364
+ const value = react.useMemo(
365
+ () => ({
366
+ currentTheme,
367
+ setTheme,
368
+ setThemeMode
369
+ }),
370
+ [currentTheme, setTheme, setThemeMode]
371
+ );
372
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value, children });
373
+ }
374
+ function useThemeContext() {
375
+ const context = react.useContext(ThemeContext);
376
+ if (!context) {
377
+ throw new Error("useThemeContext must be used within a FluidThemeProvider");
378
+ }
379
+ return context;
380
+ }
381
+ var FluidContext = react.createContext(null);
382
+ function FluidProvider({
383
+ config,
384
+ children,
385
+ queryClient,
386
+ initialTheme,
387
+ themeContainer
388
+ }) {
389
+ const defaultQueryClient = react.useMemo(
390
+ () => new reactQuery.QueryClient({
391
+ defaultOptions: {
392
+ queries: {
393
+ staleTime: 1e3 * 60,
394
+ // 1 minute
395
+ retry: 1
396
+ }
397
+ }
398
+ }),
399
+ []
400
+ );
401
+ const configRef = react.useRef(config);
402
+ configRef.current = config;
403
+ const client = react.useMemo(
404
+ () => createFluidClient(configRef.current),
405
+ // eslint-disable-next-line react-hooks/exhaustive-deps
406
+ [config.baseUrl]
407
+ );
408
+ const contextValue = react.useMemo(
409
+ () => ({ client, config: configRef.current }),
410
+ [client]
411
+ );
412
+ const themeProviderProps = {
413
+ ...initialTheme !== void 0 && { initialTheme },
414
+ ...themeContainer !== void 0 && { container: themeContainer }
415
+ };
416
+ return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient ?? defaultQueryClient, children: /* @__PURE__ */ jsxRuntime.jsx(FluidContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(FluidThemeProvider, { ...themeProviderProps, children }) }) });
417
+ }
418
+ function useFluidContext() {
419
+ const context = react.useContext(FluidContext);
420
+ if (!context) {
421
+ throw new Error("useFluidContext must be used within a FluidProvider");
422
+ }
423
+ return context;
424
+ }
425
+
426
+ // src/auth/constants.ts
427
+ var AUTH_CONSTANTS = {
428
+ /**
429
+ * Grace period in milliseconds to account for clock skew
430
+ * when checking token expiration. Tokens are considered valid
431
+ * if they expire within this period.
432
+ */
433
+ TOKEN_GRACE_PERIOD_MS: 30 * 1e3,
434
+ // 30 seconds
435
+ /**
436
+ * Default cookie max age in seconds (9 days).
437
+ * This matches the typical JWT token lifetime from the Fluid API.
438
+ */
439
+ COOKIE_MAX_AGE: 9 * 24 * 60 * 60
440
+ // 9 days = 777600 seconds
441
+ };
442
+ var STORAGE_KEYS = {
443
+ /** localStorage key for user token */
444
+ USER_TOKEN: "fluidUserToken",
445
+ /** localStorage key for company token (legacy) */
446
+ COMPANY_TOKEN: "fluidCompanyToken",
447
+ /** Cookie name for auth token */
448
+ AUTH_COOKIE: "auth_token"
449
+ };
450
+ var URL_PARAMS = {
451
+ /** URL parameter name for user token */
452
+ USER_TOKEN: "fluidUserToken",
453
+ /** URL parameter name for company token (legacy) */
454
+ COMPANY_TOKEN: "fluidCompanyToken"
455
+ };
456
+
457
+ // src/auth/url-token.ts
458
+ function isBrowser() {
459
+ return typeof window !== "undefined";
460
+ }
461
+ function extractTokenFromUrl(tokenKey = URL_PARAMS.USER_TOKEN) {
462
+ if (!isBrowser()) {
463
+ return null;
464
+ }
465
+ try {
466
+ const searchParams = new URLSearchParams(window.location.search);
467
+ return searchParams.get(tokenKey);
468
+ } catch {
469
+ return null;
470
+ }
471
+ }
472
+ function extractCompanyTokenFromUrl(tokenKey = URL_PARAMS.COMPANY_TOKEN) {
473
+ if (!isBrowser()) {
474
+ return null;
475
+ }
476
+ try {
477
+ const searchParams = new URLSearchParams(window.location.search);
478
+ return searchParams.get(tokenKey);
479
+ } catch {
480
+ return null;
481
+ }
482
+ }
483
+ function cleanTokenFromUrl(tokenKey = URL_PARAMS.USER_TOKEN) {
484
+ if (!isBrowser()) {
485
+ return;
486
+ }
487
+ try {
488
+ const url = new URL(window.location.href);
489
+ const hadToken = url.searchParams.has(tokenKey);
490
+ const hadCompanyToken = url.searchParams.has(URL_PARAMS.COMPANY_TOKEN);
491
+ url.searchParams.delete(tokenKey);
492
+ url.searchParams.delete(URL_PARAMS.COMPANY_TOKEN);
493
+ if (hadToken || hadCompanyToken) {
494
+ window.history.replaceState(
495
+ window.history.state,
496
+ document.title,
497
+ url.toString()
498
+ );
499
+ }
500
+ } catch (error) {
501
+ console.warn("[FluidAuth] Failed to clean token from URL:", error);
502
+ }
503
+ }
504
+ function hasTokenInUrl(tokenKey = URL_PARAMS.USER_TOKEN) {
505
+ if (!isBrowser()) {
506
+ return false;
507
+ }
508
+ try {
509
+ const searchParams = new URLSearchParams(window.location.search);
510
+ return searchParams.has(tokenKey);
511
+ } catch {
512
+ return false;
513
+ }
514
+ }
515
+ function extractAllTokensFromUrl(userTokenKey = URL_PARAMS.USER_TOKEN, companyTokenKey = URL_PARAMS.COMPANY_TOKEN) {
516
+ if (!isBrowser()) {
517
+ return { userToken: null, companyToken: null };
518
+ }
519
+ try {
520
+ const searchParams = new URLSearchParams(window.location.search);
521
+ return {
522
+ userToken: searchParams.get(userTokenKey),
523
+ companyToken: searchParams.get(companyTokenKey)
524
+ };
525
+ } catch {
526
+ return { userToken: null, companyToken: null };
527
+ }
528
+ }
529
+
530
+ // src/auth/token-storage.ts
531
+ function isBrowser2() {
532
+ return typeof window !== "undefined" && typeof document !== "undefined";
533
+ }
534
+ function parseCookies() {
535
+ if (!isBrowser2()) {
536
+ return {};
537
+ }
538
+ const cookies = {};
539
+ const cookieString = document.cookie;
540
+ if (!cookieString) {
541
+ return cookies;
542
+ }
543
+ cookieString.split(";").forEach((cookie) => {
544
+ const [name, ...valueParts] = cookie.trim().split("=");
545
+ if (name) {
546
+ cookies[name] = decodeURIComponent(valueParts.join("="));
547
+ }
548
+ });
549
+ return cookies;
550
+ }
551
+ function setCookie(name, value, options = {}) {
552
+ if (!isBrowser2()) {
553
+ return;
554
+ }
555
+ const {
556
+ maxAge = AUTH_CONSTANTS.COOKIE_MAX_AGE,
557
+ path = "/",
558
+ sameSite = "lax",
559
+ secure = window.location.protocol === "https:"
560
+ } = options;
561
+ let cookieString = `${name}=${encodeURIComponent(value)}`;
562
+ cookieString += `; path=${path}`;
563
+ cookieString += `; max-age=${maxAge}`;
564
+ cookieString += `; samesite=${sameSite}`;
565
+ if (secure) {
566
+ cookieString += "; secure";
567
+ }
568
+ document.cookie = cookieString;
569
+ }
570
+ function deleteCookie(name, path = "/") {
571
+ if (!isBrowser2()) {
572
+ return;
573
+ }
574
+ document.cookie = `${name}=; path=${path}; max-age=0`;
575
+ }
576
+ function getStoredToken(config) {
577
+ if (!isBrowser2()) {
578
+ return null;
579
+ }
580
+ const cookieKey = config?.cookieKey ?? STORAGE_KEYS.AUTH_COOKIE;
581
+ const localStorageKey = STORAGE_KEYS.USER_TOKEN;
582
+ const cookies = parseCookies();
583
+ const cookieToken = cookies[cookieKey];
584
+ if (cookieToken) {
585
+ return cookieToken;
586
+ }
587
+ try {
588
+ return localStorage.getItem(localStorageKey);
589
+ } catch {
590
+ return null;
591
+ }
592
+ }
593
+ function storeToken(token, config) {
594
+ if (!isBrowser2()) {
595
+ return;
596
+ }
597
+ const cookieKey = config?.cookieKey ?? STORAGE_KEYS.AUTH_COOKIE;
598
+ const maxAge = config?.cookieMaxAge ?? AUTH_CONSTANTS.COOKIE_MAX_AGE;
599
+ try {
600
+ setCookie(cookieKey, token, {
601
+ maxAge,
602
+ path: "/",
603
+ // Use 'none' with secure for cross-origin iframe scenarios
604
+ sameSite: window.self !== window.top ? "none" : "lax",
605
+ secure: window.location.protocol === "https:"
606
+ });
607
+ } catch (error) {
608
+ console.warn("[FluidAuth] Failed to store token in cookie:", error);
609
+ }
610
+ try {
611
+ localStorage.setItem(STORAGE_KEYS.USER_TOKEN, token);
612
+ } catch (error) {
613
+ console.warn("[FluidAuth] Failed to store token in localStorage:", error);
614
+ }
615
+ }
616
+ function clearTokens(config) {
617
+ if (!isBrowser2()) {
618
+ return;
619
+ }
620
+ const cookieKey = config?.cookieKey ?? STORAGE_KEYS.AUTH_COOKIE;
621
+ try {
622
+ deleteCookie(cookieKey);
623
+ } catch {
624
+ }
625
+ try {
626
+ localStorage.removeItem(STORAGE_KEYS.USER_TOKEN);
627
+ localStorage.removeItem(STORAGE_KEYS.COMPANY_TOKEN);
628
+ } catch {
629
+ }
630
+ }
631
+ function hasStoredToken(config) {
632
+ return getStoredToken(config) !== null;
633
+ }
634
+ function extractPayloadFromJose(decoded) {
635
+ return {
636
+ id: decoded.id,
637
+ email: decoded.email,
638
+ full_name: decoded.full_name,
639
+ user_type: decoded.user_type ?? "rep",
640
+ og_user_type: decoded.og_user_type,
641
+ company_id: decoded.company_id,
642
+ exp: decoded.exp,
643
+ auth_type: decoded.auth_type
644
+ };
645
+ }
646
+ function decodeToken(token) {
647
+ try {
648
+ const decoded = jose.decodeJwt(token);
649
+ return extractPayloadFromJose(decoded);
650
+ } catch (error) {
651
+ console.error("[FluidAuth] Failed to decode JWT token:", error);
652
+ return null;
653
+ }
654
+ }
655
+ function isTokenExpired(token, gracePeriodMs = AUTH_CONSTANTS.TOKEN_GRACE_PERIOD_MS) {
656
+ try {
657
+ const decoded = jose.decodeJwt(token);
658
+ if (!decoded.exp) {
659
+ return false;
660
+ }
661
+ const expirationTime = decoded.exp * 1e3;
662
+ const currentTime = Date.now();
663
+ return currentTime > expirationTime + gracePeriodMs;
664
+ } catch {
665
+ return true;
666
+ }
667
+ }
668
+ function validateToken(token, gracePeriodMs = AUTH_CONSTANTS.TOKEN_GRACE_PERIOD_MS) {
669
+ if (!token || token.trim() === "") {
670
+ return {
671
+ isValid: false,
672
+ error: "Token is empty or not provided"
673
+ };
674
+ }
675
+ const payload = decodeToken(token);
676
+ if (!payload) {
677
+ return {
678
+ isValid: false,
679
+ error: "Token has invalid format"
680
+ };
681
+ }
682
+ if (isTokenExpired(token, gracePeriodMs)) {
683
+ return {
684
+ isValid: false,
685
+ payload,
686
+ error: "Token has expired"
687
+ };
688
+ }
689
+ return {
690
+ isValid: true,
691
+ payload
692
+ };
693
+ }
694
+ function isValidToken(result) {
695
+ return result.isValid === true;
696
+ }
697
+ function getTokenExpiration(token) {
698
+ try {
699
+ const decoded = jose.decodeJwt(token);
700
+ if (!decoded.exp) {
701
+ return null;
702
+ }
703
+ return new Date(decoded.exp * 1e3);
704
+ } catch {
705
+ return null;
706
+ }
707
+ }
708
+ function getTokenTimeRemaining(token) {
709
+ try {
710
+ const decoded = jose.decodeJwt(token);
711
+ if (!decoded.exp) {
712
+ return Infinity;
713
+ }
714
+ const expirationTime = decoded.exp * 1e3;
715
+ const remaining = expirationTime - Date.now();
716
+ return Math.max(0, remaining);
717
+ } catch {
718
+ return 0;
719
+ }
720
+ }
721
+ async function verifyToken(token, jwksUrl) {
722
+ try {
723
+ const JWKS = jose.createRemoteJWKSet(new URL(jwksUrl));
724
+ const { payload } = await jose.jwtVerify(token, JWKS);
725
+ const decoded = payload;
726
+ return extractPayloadFromJose(decoded);
727
+ } catch (error) {
728
+ console.error("[FluidAuth] JWT signature verification failed:", error);
729
+ return null;
730
+ }
731
+ }
732
+
733
+ // src/auth/types.ts
734
+ var USER_TYPES = {
735
+ admin: "admin",
736
+ rep: "rep",
737
+ root_admin: "root_admin",
738
+ customer: "customer"
739
+ };
740
+ function isUserType(value) {
741
+ return Object.values(USER_TYPES).includes(value);
742
+ }
743
+
744
+ // src/auth/dev-utils.ts
745
+ function isDevBypassActive(devBypass) {
746
+ if (!devBypass) return false;
747
+ try {
748
+ return undefined.DEV === true;
749
+ } catch {
750
+ return false;
751
+ }
752
+ }
753
+ function createDevUser() {
754
+ return {
755
+ id: 0,
756
+ email: "dev@localhost",
757
+ full_name: "Dev User",
758
+ user_type: USER_TYPES.rep,
759
+ og_user_type: void 0,
760
+ company_id: 0,
761
+ exp: void 0,
762
+ // Never expires
763
+ auth_type: "dev_bypass"
764
+ };
765
+ }
766
+ var FluidAuthContext = react.createContext(null);
767
+ function FluidAuthProvider({
768
+ children,
769
+ config
770
+ }) {
771
+ const configRef = react.useRef(config);
772
+ configRef.current = config;
773
+ const [isLoading2, setIsLoading] = react.useState(true);
774
+ const [token, setToken] = react.useState(null);
775
+ const [user, setUser] = react.useState(null);
776
+ const [error, setError] = react.useState(null);
777
+ react.useEffect(() => {
778
+ const initializeAuth = async () => {
779
+ try {
780
+ if (isDevBypassActive(config?.devBypass)) {
781
+ const envToken = undefined.VITE_DEV_TOKEN;
782
+ if (envToken) {
783
+ const validation = validateToken(envToken, config?.gracePeriodMs);
784
+ if (validation.isValid && validation.payload) {
785
+ storeToken(envToken, config);
786
+ setToken(envToken);
787
+ setUser(validation.payload);
788
+ setError(null);
789
+ return;
790
+ }
791
+ console.warn(
792
+ "[FluidAuth] VITE_DEV_TOKEN is invalid or expired, falling back to mock user"
793
+ );
794
+ }
795
+ console.warn(
796
+ "[FluidAuth] Dev bypass active - using mock user. API calls will fail without a real token."
797
+ );
798
+ const devUser = createDevUser();
799
+ setToken(null);
800
+ setUser(devUser);
801
+ setError(null);
802
+ return;
803
+ }
804
+ const tokenKey = config?.tokenKey ?? "fluidUserToken";
805
+ let candidateToken = extractTokenFromUrl(tokenKey);
806
+ cleanTokenFromUrl(tokenKey);
807
+ if (!candidateToken) {
808
+ candidateToken = getStoredToken(config);
809
+ }
810
+ if (candidateToken) {
811
+ let payload = null;
812
+ if (config?.jwksUrl) {
813
+ payload = await verifyToken(candidateToken, config.jwksUrl);
814
+ if (!payload) {
815
+ clearTokens(config);
816
+ setToken(null);
817
+ setUser(null);
818
+ setError(new Error("JWT signature verification failed"));
819
+ config?.onAuthFailure?.();
820
+ return;
821
+ }
822
+ if (isTokenExpired(candidateToken, config?.gracePeriodMs)) {
823
+ clearTokens(config);
824
+ setToken(null);
825
+ setUser(null);
826
+ setError(new Error("Token has expired"));
827
+ config?.onAuthFailure?.();
828
+ return;
829
+ }
830
+ } else {
831
+ const validation = validateToken(
832
+ candidateToken,
833
+ config?.gracePeriodMs
834
+ );
835
+ if (validation.isValid && validation.payload) {
836
+ payload = validation.payload;
837
+ } else {
838
+ clearTokens(config);
839
+ setToken(null);
840
+ setUser(null);
841
+ setError(new Error(validation.error ?? "Invalid token"));
842
+ config?.onAuthFailure?.();
843
+ return;
844
+ }
845
+ }
846
+ storeToken(candidateToken, config);
847
+ setToken(candidateToken);
848
+ setUser(payload);
849
+ setError(null);
850
+ } else {
851
+ setToken(null);
852
+ setUser(null);
853
+ setError(new Error("No authentication token found"));
854
+ config?.onAuthFailure?.();
855
+ }
856
+ } catch (err) {
857
+ const error2 = err instanceof Error ? err : new Error("Authentication error");
858
+ setError(error2);
859
+ setToken(null);
860
+ setUser(null);
861
+ config?.onAuthFailure?.();
862
+ } finally {
863
+ setIsLoading(false);
864
+ }
865
+ };
866
+ void initializeAuth();
867
+ }, []);
868
+ const clearAuth = react.useCallback(() => {
869
+ clearTokens(configRef.current);
870
+ setToken(null);
871
+ setUser(null);
872
+ setError(null);
873
+ }, []);
874
+ const contextValue = react.useMemo(
875
+ () => ({
876
+ isAuthenticated: user !== null,
877
+ isLoading: isLoading2,
878
+ user,
879
+ token,
880
+ clearAuth,
881
+ error
882
+ }),
883
+ [token, isLoading2, user, clearAuth, error]
884
+ );
885
+ return /* @__PURE__ */ jsxRuntime.jsx(FluidAuthContext.Provider, { value: contextValue, children });
886
+ }
887
+ function useFluidAuthContext() {
888
+ const context = react.useContext(FluidAuthContext);
889
+ if (!context) {
890
+ throw new Error(
891
+ "useFluidAuthContext must be used within a FluidAuthProvider. Wrap your app with <FluidAuthProvider> to use authentication features."
892
+ );
893
+ }
894
+ return context;
895
+ }
896
+
897
+ // src/types/page-template.ts
898
+ var PAGE_CATEGORIES = {
899
+ CORE: "core",
900
+ COMMERCE: "commerce",
901
+ COMMUNICATION: "communication",
902
+ DATA: "data",
903
+ CUSTOM: "custom"
904
+ };
905
+
906
+ // src/registries/page-template-registry.ts
907
+ var PageTemplateRegistryImpl = class {
908
+ templates = /* @__PURE__ */ new Map();
909
+ categories = [];
910
+ constructor() {
911
+ this.categories = [
912
+ { id: PAGE_CATEGORIES.CORE, label: "Core Features", icon: "star" },
913
+ {
914
+ id: PAGE_CATEGORIES.COMMERCE,
915
+ label: "Commerce",
916
+ icon: "shopping-cart"
917
+ },
918
+ {
919
+ id: PAGE_CATEGORIES.COMMUNICATION,
920
+ label: "Communication",
921
+ icon: "message-circle"
922
+ },
923
+ {
924
+ id: PAGE_CATEGORIES.DATA,
925
+ label: "Data & Analytics",
926
+ icon: "bar-chart"
927
+ },
928
+ { id: PAGE_CATEGORIES.CUSTOM, label: "Custom", icon: "puzzle" }
929
+ ];
930
+ }
931
+ /**
932
+ * Register a new page template.
933
+ * @throws Error if a template with the same ID already exists
934
+ */
935
+ register(template) {
936
+ if (this.templates.has(template.id)) {
937
+ throw new Error(
938
+ `Page template with ID "${template.id}" is already registered`
939
+ );
940
+ }
941
+ this.templates.set(template.id, template);
942
+ }
943
+ /**
944
+ * Unregister a page template by ID.
945
+ * Core templates cannot be unregistered.
946
+ * @returns true if the template was removed, false if it didn't exist or is a core template
947
+ */
948
+ unregister(id) {
949
+ const template = this.templates.get(id);
950
+ if (!template) {
951
+ return false;
952
+ }
953
+ if (template.isCore) {
954
+ console.warn(
955
+ `Cannot unregister core page template "${id}". Core templates are required.`
956
+ );
957
+ return false;
958
+ }
959
+ return this.templates.delete(id);
960
+ }
961
+ /**
962
+ * Get a page template by ID.
963
+ */
964
+ get(id) {
965
+ return this.templates.get(id);
966
+ }
967
+ /**
968
+ * Get all page templates in a specific category.
969
+ */
970
+ getByCategory(category) {
971
+ return Array.from(this.templates.values()).filter(
972
+ (t) => t.category === category
973
+ );
974
+ }
975
+ /**
976
+ * List all registered page templates.
977
+ */
978
+ listAll() {
979
+ return Array.from(this.templates.values());
980
+ }
981
+ /**
982
+ * List all core page templates (isCore: true).
983
+ */
984
+ listCore() {
985
+ return Array.from(this.templates.values()).filter((t) => t.isCore);
986
+ }
987
+ /**
988
+ * List all non-core page templates.
989
+ */
990
+ listOptional() {
991
+ return Array.from(this.templates.values()).filter((t) => !t.isCore);
992
+ }
993
+ /**
994
+ * List all registered categories.
995
+ */
996
+ listCategories() {
997
+ return [...this.categories];
998
+ }
999
+ /**
1000
+ * Add a custom category.
1001
+ */
1002
+ addCategory(category) {
1003
+ if (this.categories.some((c) => c.id === category.id)) {
1004
+ console.warn(`Category with ID "${category.id}" already exists`);
1005
+ return;
1006
+ }
1007
+ this.categories.push(category);
1008
+ }
1009
+ /**
1010
+ * Check if a template exists by ID.
1011
+ */
1012
+ has(id) {
1013
+ return this.templates.has(id);
1014
+ }
1015
+ /**
1016
+ * Get the count of registered templates.
1017
+ */
1018
+ get size() {
1019
+ return this.templates.size;
1020
+ }
1021
+ /**
1022
+ * Clear all non-core templates.
1023
+ * Useful for testing or resetting the registry.
1024
+ */
1025
+ clearNonCore() {
1026
+ for (const [id, template] of this.templates) {
1027
+ if (!template.isCore) {
1028
+ this.templates.delete(id);
1029
+ }
1030
+ }
1031
+ }
1032
+ };
1033
+ var PageTemplateRegistry = new PageTemplateRegistryImpl();
1034
+
1035
+ // src/core/resolve-pages.ts
1036
+ function applyOverrides(componentTree, overrides) {
1037
+ if (!overrides.length) {
1038
+ return [...componentTree];
1039
+ }
1040
+ const overrideMap = new Map(overrides.map((o) => [o.widget_id, o.props]));
1041
+ return componentTree.map(
1042
+ (widget) => applyWidgetOverrides(widget, overrideMap)
1043
+ );
1044
+ }
1045
+ function applyWidgetOverrides(widget, overrideMap) {
1046
+ const override = widget.id ? overrideMap.get(widget.id) : void 0;
1047
+ const children = widget.props.children;
1048
+ const hasChildren = Array.isArray(children) && children.length > 0;
1049
+ if (!override && !hasChildren) {
1050
+ return widget;
1051
+ }
1052
+ const newProps = override ? { ...widget.props, ...override } : { ...widget.props };
1053
+ if (hasChildren) {
1054
+ newProps.children = children.map(
1055
+ (child) => applyWidgetOverrides(child, overrideMap)
1056
+ );
1057
+ }
1058
+ return { ...widget, props: newProps };
1059
+ }
1060
+ function resolvePageReference(ref) {
1061
+ const template = PageTemplateRegistry.get(ref.page_template_id);
1062
+ if (!template) {
1063
+ console.warn(
1064
+ `Page template "${ref.page_template_id}" not found in registry`
1065
+ );
1066
+ return void 0;
1067
+ }
1068
+ const componentTree = ref.overrides ? applyOverrides(template.component_tree, ref.overrides) : [...template.component_tree];
1069
+ return {
1070
+ id: ref.screen_id,
1071
+ slug: template.slug,
1072
+ name: template.name,
1073
+ component_tree: componentTree
1074
+ };
1075
+ }
1076
+ function resolveNavigationPages(navigation) {
1077
+ const localScreenIds = new Set(navigation.screens.map((s) => s.id));
1078
+ const result = [...navigation.screens];
1079
+ if (navigation.page_refs) {
1080
+ for (const ref of navigation.page_refs) {
1081
+ if (localScreenIds.has(ref.screen_id)) {
1082
+ continue;
1083
+ }
1084
+ const screen = resolvePageReference(ref);
1085
+ if (screen) {
1086
+ result.push(screen);
1087
+ }
1088
+ }
1089
+ }
1090
+ return result;
1091
+ }
1092
+ function getAvailablePageTemplates() {
1093
+ return PageTemplateRegistry.listAll();
1094
+ }
1095
+ function getCorePageTemplates() {
1096
+ return PageTemplateRegistry.listCore();
1097
+ }
1098
+ function getOptionalPageTemplates() {
1099
+ return PageTemplateRegistry.listOptional();
1100
+ }
1101
+ function validateNavigationPages(navigation) {
1102
+ const corePages = PageTemplateRegistry.listCore();
1103
+ const referencedTemplateIds = new Set(
1104
+ navigation.page_refs?.map((ref) => ref.page_template_id) ?? []
1105
+ );
1106
+ const missingCorePages = corePages.filter((page) => !referencedTemplateIds.has(page.id)).map((page) => page.id);
1107
+ return {
1108
+ valid: missingCorePages.length === 0,
1109
+ missingCorePages
1110
+ };
1111
+ }
1112
+ var EMPTY_TEMPLATES = [];
1113
+ var PageTemplateContext = react.createContext(
1114
+ null
1115
+ );
1116
+ function PageTemplateProvider({
1117
+ children,
1118
+ templates = EMPTY_TEMPLATES
1119
+ }) {
1120
+ const registeredIds = react.useRef([]);
1121
+ const templateKey = templates.map((t) => t.id).join(",");
1122
+ react.useEffect(() => {
1123
+ const registered = [];
1124
+ for (const template of templates) {
1125
+ if (!PageTemplateRegistry.has(template.id)) {
1126
+ try {
1127
+ PageTemplateRegistry.register(template);
1128
+ registered.push(template.id);
1129
+ } catch (error) {
1130
+ console.warn(
1131
+ `Failed to register page template "${template.id}":`,
1132
+ error
1133
+ );
1134
+ }
1135
+ }
1136
+ }
1137
+ registeredIds.current = registered;
1138
+ return () => {
1139
+ for (const id of registeredIds.current) {
1140
+ PageTemplateRegistry.unregister(id);
1141
+ }
1142
+ registeredIds.current = [];
1143
+ };
1144
+ }, [templateKey]);
1145
+ const contextValue = react.useMemo(
1146
+ () => ({
1147
+ resolvePages: resolveNavigationPages,
1148
+ listTemplates: () => PageTemplateRegistry.listAll(),
1149
+ getTemplate: (id) => PageTemplateRegistry.get(id),
1150
+ hasTemplate: (id) => PageTemplateRegistry.has(id)
1151
+ }),
1152
+ []
1153
+ );
1154
+ return /* @__PURE__ */ jsxRuntime.jsx(PageTemplateContext.Provider, { value: contextValue, children });
1155
+ }
1156
+ function usePageTemplates() {
1157
+ const context = react.useContext(PageTemplateContext);
1158
+ if (!context) {
1159
+ throw new Error(
1160
+ "usePageTemplates must be used within a PageTemplateProvider"
1161
+ );
1162
+ }
1163
+ return context;
1164
+ }
1165
+ function useResolvedPages(navigation) {
1166
+ const { resolvePages } = usePageTemplates();
1167
+ return react.useMemo(() => resolvePages(navigation), [resolvePages, navigation]);
1168
+ }
1169
+
1170
+ // src/hooks/use-fluid-api.ts
1171
+ function useFluidApi() {
1172
+ const { client } = useFluidContext();
1173
+ return client;
1174
+ }
1175
+ var PROFILE_QUERY_KEY = ["fluid", "profile"];
1176
+ function useFluidProfile() {
1177
+ const api = useFluidApi();
1178
+ return reactQuery.useQuery({
1179
+ queryKey: PROFILE_QUERY_KEY,
1180
+ queryFn: () => api.profile.get()
1181
+ });
1182
+ }
1183
+ var PERMISSIONS_QUERY_KEY = ["fluid", "permissions"];
1184
+ function useFluidPermissions() {
1185
+ const api = useFluidApi();
1186
+ const query = reactQuery.useQuery({
1187
+ queryKey: PERMISSIONS_QUERY_KEY,
1188
+ queryFn: () => api.permissions.get()
1189
+ });
1190
+ const permissions = query.data;
1191
+ const can = react.useMemo(() => {
1192
+ return (resource, action = "view") => {
1193
+ if (!permissions) {
1194
+ return false;
1195
+ }
1196
+ if (permissions.is_super_admin) {
1197
+ return true;
1198
+ }
1199
+ const resourcePermissions = permissions.permissions[resource];
1200
+ if (!resourcePermissions) {
1201
+ return false;
1202
+ }
1203
+ return resourcePermissions[action] ?? false;
1204
+ };
1205
+ }, [permissions]);
1206
+ const isSuperAdmin = permissions?.is_super_admin ?? false;
1207
+ return {
1208
+ query,
1209
+ permissions,
1210
+ can,
1211
+ isSuperAdmin
1212
+ };
1213
+ }
1214
+
1215
+ // src/hooks/use-fluid-theme.ts
1216
+ function useFluidTheme() {
1217
+ const { currentTheme, setTheme, setThemeMode } = useThemeContext();
1218
+ return {
1219
+ currentTheme,
1220
+ setTheme,
1221
+ setThemeMode,
1222
+ mode: currentTheme?.mode
1223
+ };
1224
+ }
1225
+ var CURRENT_REP_QUERY_KEY = ["fluid", "currentRep"];
1226
+ function useCurrentRep() {
1227
+ const api = useFluidApi();
1228
+ return reactQuery.useQuery({
1229
+ queryKey: CURRENT_REP_QUERY_KEY,
1230
+ queryFn: () => api.reps.current()
1231
+ });
1232
+ }
1233
+
1234
+ // src/hooks/use-fluid-auth.ts
1235
+ function useFluidAuth() {
1236
+ return useFluidAuthContext();
1237
+ }
1238
+
1239
+ // src/hooks/demo-data/calendar-events.ts
1240
+ var now = /* @__PURE__ */ new Date();
1241
+ function daysFromNow(days, hour, minute = 0) {
1242
+ const d = new Date(now);
1243
+ d.setDate(d.getDate() + days);
1244
+ d.setHours(hour, minute, 0, 0);
1245
+ return d;
1246
+ }
1247
+ var DEMO_CALENDAR_EVENTS = [
1248
+ {
1249
+ id: 1,
1250
+ title: "Team Standup",
1251
+ description: { body: "Daily sync with the sales team" },
1252
+ color: "#4f46e5",
1253
+ start: daysFromNow(0, 9, 0).toISOString(),
1254
+ end: daysFromNow(0, 9, 30).toISOString(),
1255
+ active: true,
1256
+ status: "confirmed"
1257
+ },
1258
+ {
1259
+ id: 2,
1260
+ title: "Client Review - Acme Corp",
1261
+ description: { body: "Quarterly business review with key accounts" },
1262
+ color: "#059669",
1263
+ start: daysFromNow(2, 14, 0).toISOString(),
1264
+ end: daysFromNow(2, 15, 0).toISOString(),
1265
+ active: true,
1266
+ status: "confirmed",
1267
+ venue: "Conference Room B"
1268
+ },
1269
+ {
1270
+ id: 3,
1271
+ title: "Product Training Webinar",
1272
+ description: { body: "New product line training for the field" },
1273
+ color: "#d97706",
1274
+ start: daysFromNow(4, 11, 0).toISOString(),
1275
+ end: daysFromNow(4, 12, 30).toISOString(),
1276
+ active: true,
1277
+ status: "confirmed",
1278
+ url: "https://example.com/webinar"
1279
+ },
1280
+ {
1281
+ id: 4,
1282
+ title: "Regional Conference",
1283
+ description: { body: "Annual West Coast regional conference" },
1284
+ color: "#dc2626",
1285
+ start: daysFromNow(10, 8, 0).toISOString(),
1286
+ end: daysFromNow(12, 17, 0).toISOString(),
1287
+ active: true,
1288
+ status: "confirmed",
1289
+ venue: "San Diego Convention Center",
1290
+ isAllDay: true
1291
+ }
1292
+ ];
1293
+
1294
+ // src/hooks/use-calendar-events.ts
1295
+ function useCalendarEvents() {
1296
+ return {
1297
+ data: [...DEMO_CALENDAR_EVENTS],
1298
+ isLoading: false,
1299
+ isError: false
1300
+ };
1301
+ }
1302
+
1303
+ // src/hooks/demo-data/todos.ts
1304
+ var now2 = /* @__PURE__ */ new Date();
1305
+ function daysFromNow2(days) {
1306
+ const d = new Date(now2);
1307
+ d.setDate(d.getDate() + days);
1308
+ return d.toISOString();
1309
+ }
1310
+ var DEMO_TODOS = [
1311
+ {
1312
+ id: 1,
1313
+ body: "Follow up with Sarah about Q2 order",
1314
+ dueAt: daysFromNow2(1),
1315
+ completedAt: null,
1316
+ createdAt: daysFromNow2(-2),
1317
+ contactName: "Sarah Johnson"
1318
+ },
1319
+ {
1320
+ id: 2,
1321
+ body: "Send pricing proposal to Acme Corp",
1322
+ dueAt: daysFromNow2(7),
1323
+ completedAt: null,
1324
+ createdAt: daysFromNow2(-1),
1325
+ contactName: "Mike Chen"
1326
+ },
1327
+ {
1328
+ id: 3,
1329
+ body: "Schedule onboarding call with new team member",
1330
+ dueAt: daysFromNow2(3),
1331
+ completedAt: null,
1332
+ createdAt: daysFromNow2(0),
1333
+ contactName: "Emily Rodriguez"
1334
+ },
1335
+ {
1336
+ id: 4,
1337
+ body: "Review and approve Q1 expense report",
1338
+ dueAt: daysFromNow2(-1),
1339
+ completedAt: daysFromNow2(-1),
1340
+ createdAt: daysFromNow2(-5),
1341
+ contactName: null
1342
+ },
1343
+ {
1344
+ id: 5,
1345
+ body: "Prepare presentation for Friday team meeting",
1346
+ dueAt: daysFromNow2(4),
1347
+ completedAt: daysFromNow2(0),
1348
+ createdAt: daysFromNow2(-3),
1349
+ contactName: null
1350
+ }
1351
+ ];
1352
+
1353
+ // src/hooks/use-todos.ts
1354
+ function useTodos() {
1355
+ return {
1356
+ data: [...DEMO_TODOS],
1357
+ isLoading: false,
1358
+ isError: false
1359
+ };
1360
+ }
1361
+
1362
+ // src/hooks/hook-types.ts
1363
+ function hasData(result) {
1364
+ return result.data != null && !result.isLoading && !result.isError;
1365
+ }
1366
+ function isLoading(result) {
1367
+ return result.isLoading;
1368
+ }
1369
+ function isErrorResult(result) {
1370
+ return result.isError && result.error !== void 0;
1371
+ }
1372
+ function isIdle(result) {
1373
+ return !result.isLoading && !result.isError;
1374
+ }
1375
+ function selectProperty(items, key) {
1376
+ return items.map((item) => item[key]);
1377
+ }
1378
+ function getProperty(item, key) {
1379
+ return item?.[key];
1380
+ }
1381
+ var ACTIVITY_SLUGS = {
1382
+ abandonedCart: "abandoned_cart",
1383
+ announcements: "announcements",
1384
+ cartItemsAdded: "cart_items_added",
1385
+ commentReply: "comment_reply",
1386
+ directMessage: "direct_message",
1387
+ fantasyPoint: "fantasy_point",
1388
+ newLead: "new_lead",
1389
+ orderPlaced: "order_placed",
1390
+ pageViews: "page_views",
1391
+ pageViewsContact: "page_views_contact",
1392
+ tasks: "tasks",
1393
+ upcomingEvent: "upcoming_event",
1394
+ video: "video",
1395
+ videoComplete: "video_complete",
1396
+ videoCompleteContact: "video_complete_contact",
1397
+ videoContact: "video_contact",
1398
+ messageReceived: "message_received",
1399
+ messageSent: "message_sent",
1400
+ newCartItemsAdded: "new_cart_items_added",
1401
+ smartLinkClicked: "smart_link_clicked",
1402
+ reviewLeft: "review_left"
1403
+ };
1404
+ function isActivitySlug(value) {
1405
+ return Object.values(ACTIVITY_SLUGS).includes(value);
1406
+ }
1407
+
1408
+ // src/hooks/demo-data/activities.ts
1409
+ var now3 = /* @__PURE__ */ new Date();
1410
+ function hoursAgo(hours) {
1411
+ const d = new Date(now3);
1412
+ d.setHours(d.getHours() - hours);
1413
+ return d.toISOString();
1414
+ }
1415
+ var DEMO_ACTIVITIES = [
1416
+ {
1417
+ id: 1,
1418
+ userName: "Sarah Johnson",
1419
+ avatarUrl: null,
1420
+ activityType: "New Order",
1421
+ targetName: "Wellness Starter Kit",
1422
+ timestamp: hoursAgo(1),
1423
+ slug: "order_placed"
1424
+ },
1425
+ {
1426
+ id: 2,
1427
+ userName: "Mike Chen",
1428
+ avatarUrl: null,
1429
+ activityType: "New Lead",
1430
+ targetName: "Referral from LinkedIn campaign",
1431
+ timestamp: hoursAgo(3),
1432
+ slug: "new_lead"
1433
+ },
1434
+ {
1435
+ id: 3,
1436
+ userName: "Emily Rodriguez",
1437
+ avatarUrl: null,
1438
+ activityType: "Page View",
1439
+ targetName: "Product Catalog",
1440
+ timestamp: hoursAgo(5),
1441
+ slug: "page_views"
1442
+ },
1443
+ {
1444
+ id: 4,
1445
+ userName: "David Park",
1446
+ avatarUrl: null,
1447
+ activityType: "Cart Items Added",
1448
+ targetName: "Premium Bundle (3 items)",
1449
+ timestamp: hoursAgo(8),
1450
+ slug: "cart_items_added"
1451
+ },
1452
+ {
1453
+ id: 5,
1454
+ userName: "Lisa Thompson",
1455
+ avatarUrl: null,
1456
+ activityType: "Video Watched",
1457
+ targetName: "Getting Started Tutorial",
1458
+ timestamp: hoursAgo(12),
1459
+ slug: "video_complete"
1460
+ },
1461
+ {
1462
+ id: 6,
1463
+ userName: "James Wilson",
1464
+ avatarUrl: null,
1465
+ activityType: "Message Received",
1466
+ targetName: "Question about shipping",
1467
+ timestamp: hoursAgo(18),
1468
+ slug: "message_received"
1469
+ },
1470
+ {
1471
+ id: 7,
1472
+ userName: "Rachel Kim",
1473
+ avatarUrl: null,
1474
+ activityType: "Smart Link Clicked",
1475
+ targetName: "Holiday Promo Link",
1476
+ timestamp: hoursAgo(24),
1477
+ slug: "smart_link_clicked"
1478
+ },
1479
+ {
1480
+ id: 8,
1481
+ userName: "Tom Martinez",
1482
+ avatarUrl: null,
1483
+ activityType: "Review Left",
1484
+ targetName: "Essential Oil Set - 5 stars",
1485
+ timestamp: hoursAgo(36),
1486
+ slug: "review_left"
1487
+ }
1488
+ ];
1489
+
1490
+ // src/hooks/use-activities.ts
1491
+ function useActivities() {
1492
+ return {
1493
+ data: [...DEMO_ACTIVITIES],
1494
+ isLoading: false,
1495
+ isError: false
1496
+ };
1497
+ }
1498
+
1499
+ // src/hooks/demo-data/catchups.ts
1500
+ var DEMO_CATCHUPS = [
1501
+ {
1502
+ id: 1,
1503
+ suggestion_title: "Sarah Johnson hasn't ordered in 30 days"
1504
+ },
1505
+ {
1506
+ id: 2,
1507
+ suggestion_title: "Mike Chen's subscription is expiring soon"
1508
+ },
1509
+ {
1510
+ id: 3,
1511
+ suggestion_title: "Emily Rodriguez left a cart with 3 items"
1512
+ }
1513
+ ];
1514
+
1515
+ // src/hooks/use-catchups.ts
1516
+ function useCatchUps() {
1517
+ return {
1518
+ data: [...DEMO_CATCHUPS],
1519
+ isLoading: false,
1520
+ isError: false
1521
+ };
1522
+ }
1523
+
1524
+ // src/hooks/demo-data/mysite.ts
1525
+ var DEMO_MYSITE = {
1526
+ url: "https://my-portal.example.com",
1527
+ views: 1243,
1528
+ leads: 37,
1529
+ userName: "Demo User"
1530
+ };
1531
+
1532
+ // src/hooks/use-mysite.ts
1533
+ function useMySite() {
1534
+ return {
1535
+ data: DEMO_MYSITE,
1536
+ isLoading: false,
1537
+ isError: false
1538
+ };
1539
+ }
1540
+
1541
+ // src/hooks/demo-data/conversations.ts
1542
+ var now4 = /* @__PURE__ */ new Date();
1543
+ function hoursAgo2(hours) {
1544
+ const d = new Date(now4);
1545
+ d.setHours(d.getHours() - hours);
1546
+ return d.toISOString();
1547
+ }
1548
+ function daysAgo(days) {
1549
+ const d = new Date(now4);
1550
+ d.setDate(d.getDate() - days);
1551
+ return d.toISOString();
1552
+ }
1553
+ var DEMO_CONVERSATIONS = [
1554
+ {
1555
+ id: "conv-1",
1556
+ title: "Sarah Johnson",
1557
+ participants: [
1558
+ { id: "user-1", name: "You", email: "me@example.com", isOnline: true },
1559
+ {
1560
+ id: "user-2",
1561
+ name: "Sarah Johnson",
1562
+ email: "sarah.johnson@example.com",
1563
+ isOnline: true
1564
+ }
1565
+ ],
1566
+ lastMessage: {
1567
+ id: "msg-1-3",
1568
+ conversationId: "conv-1",
1569
+ senderId: "user-2",
1570
+ senderName: "Sarah Johnson",
1571
+ type: "text",
1572
+ content: "Sounds great! I'll place the order by end of day.",
1573
+ timestamp: hoursAgo2(1),
1574
+ isRead: false
1575
+ },
1576
+ unreadCount: 1,
1577
+ status: "active",
1578
+ createdAt: daysAgo(30),
1579
+ updatedAt: hoursAgo2(1)
1580
+ },
1581
+ {
1582
+ id: "conv-2",
1583
+ title: "Mike Chen",
1584
+ participants: [
1585
+ { id: "user-1", name: "You", email: "me@example.com", isOnline: true },
1586
+ {
1587
+ id: "user-3",
1588
+ name: "Mike Chen",
1589
+ email: "mike.chen@acmecorp.com",
1590
+ isOnline: false
1591
+ }
1592
+ ],
1593
+ lastMessage: {
1594
+ id: "msg-2-2",
1595
+ conversationId: "conv-2",
1596
+ senderId: "user-1",
1597
+ senderName: "You",
1598
+ type: "text",
1599
+ content: "I've attached the updated pricing sheet. Let me know if you have any questions!",
1600
+ timestamp: hoursAgo2(5),
1601
+ isRead: true
1602
+ },
1603
+ unreadCount: 0,
1604
+ status: "active",
1605
+ createdAt: daysAgo(14),
1606
+ updatedAt: hoursAgo2(5)
1607
+ },
1608
+ {
1609
+ id: "conv-3",
1610
+ title: "Team Updates",
1611
+ participants: [
1612
+ { id: "user-1", name: "You", email: "me@example.com", isOnline: true },
1613
+ {
1614
+ id: "user-4",
1615
+ name: "Emily Rodriguez",
1616
+ email: "emily.r@healthfirst.io"
1617
+ },
1618
+ { id: "user-5", name: "David Park", email: "david.park@email.com" }
1619
+ ],
1620
+ lastMessage: {
1621
+ id: "msg-3-4",
1622
+ conversationId: "conv-3",
1623
+ senderId: "user-4",
1624
+ senderName: "Emily Rodriguez",
1625
+ type: "text",
1626
+ content: "The new product samples arrived today. Will distribute to the team tomorrow.",
1627
+ timestamp: daysAgo(1),
1628
+ isRead: true
1629
+ },
1630
+ unreadCount: 0,
1631
+ status: "active",
1632
+ createdAt: daysAgo(60),
1633
+ updatedAt: daysAgo(1)
1634
+ }
1635
+ ];
1636
+ var DEMO_MESSAGES = [
1637
+ {
1638
+ id: "msg-1-1",
1639
+ conversationId: "conv-1",
1640
+ senderId: "user-1",
1641
+ senderName: "You",
1642
+ type: "text",
1643
+ content: "Hi Sarah! I wanted to follow up on the Wellness Starter Kit. We have a special promotion running this month.",
1644
+ timestamp: hoursAgo2(3),
1645
+ isRead: true
1646
+ },
1647
+ {
1648
+ id: "msg-1-2",
1649
+ conversationId: "conv-1",
1650
+ senderId: "user-2",
1651
+ senderName: "Sarah Johnson",
1652
+ type: "text",
1653
+ content: "That's perfect timing! I was just thinking about reordering. What's the promo?",
1654
+ timestamp: hoursAgo2(2),
1655
+ isRead: true
1656
+ },
1657
+ {
1658
+ id: "msg-1-3",
1659
+ conversationId: "conv-1",
1660
+ senderId: "user-2",
1661
+ senderName: "Sarah Johnson",
1662
+ type: "text",
1663
+ content: "Sounds great! I'll place the order by end of day.",
1664
+ timestamp: hoursAgo2(1),
1665
+ isRead: false
1666
+ }
1667
+ ];
1668
+
1669
+ // src/hooks/use-conversations.ts
1670
+ function useConversations() {
1671
+ return {
1672
+ data: [...DEMO_CONVERSATIONS],
1673
+ isLoading: false,
1674
+ isError: false
1675
+ };
1676
+ }
1677
+ function useConversationMessages(_conversationId) {
1678
+ return {
1679
+ data: [...DEMO_MESSAGES],
1680
+ isLoading: false,
1681
+ isError: false
1682
+ };
1683
+ }
1684
+
1685
+ // src/types/screen-types.ts
1686
+ var CONTACT_STATUSES = {
1687
+ active: "active",
1688
+ inactive: "inactive",
1689
+ lead: "lead",
1690
+ prospect: "prospect"
1691
+ };
1692
+
1693
+ // src/hooks/demo-data/contacts.ts
1694
+ var now5 = /* @__PURE__ */ new Date();
1695
+ function daysAgo2(days) {
1696
+ const d = new Date(now5);
1697
+ d.setDate(d.getDate() - days);
1698
+ return d.toISOString();
1699
+ }
1700
+ var DEMO_CONTACTS = [
1701
+ {
1702
+ id: "contact-1",
1703
+ firstName: "Sarah",
1704
+ lastName: "Johnson",
1705
+ email: "sarah.johnson@example.com",
1706
+ phone: "+1 (555) 123-4567",
1707
+ company: "Wellness Works Inc.",
1708
+ jobTitle: "Purchasing Manager",
1709
+ status: "active",
1710
+ type: "individual",
1711
+ tags: ["VIP", "Repeat Buyer"],
1712
+ createdAt: daysAgo2(90),
1713
+ updatedAt: daysAgo2(2)
1714
+ },
1715
+ {
1716
+ id: "contact-2",
1717
+ firstName: "Mike",
1718
+ lastName: "Chen",
1719
+ email: "mike.chen@acmecorp.com",
1720
+ phone: "+1 (555) 234-5678",
1721
+ company: "Acme Corp",
1722
+ jobTitle: "Director of Operations",
1723
+ status: "active",
1724
+ type: "individual",
1725
+ tags: ["Enterprise"],
1726
+ createdAt: daysAgo2(60),
1727
+ updatedAt: daysAgo2(5)
1728
+ },
1729
+ {
1730
+ id: "contact-3",
1731
+ firstName: "Emily",
1732
+ lastName: "Rodriguez",
1733
+ email: "emily.r@healthfirst.io",
1734
+ company: "HealthFirst",
1735
+ status: "lead",
1736
+ type: "individual",
1737
+ notes: "Interested in bulk pricing for team orders",
1738
+ createdAt: daysAgo2(7),
1739
+ updatedAt: daysAgo2(1)
1740
+ },
1741
+ {
1742
+ id: "contact-4",
1743
+ firstName: "David",
1744
+ lastName: "Park",
1745
+ email: "david.park@email.com",
1746
+ phone: "+1 (555) 345-6789",
1747
+ status: "prospect",
1748
+ type: "individual",
1749
+ tags: ["Referral"],
1750
+ createdAt: daysAgo2(14),
1751
+ updatedAt: daysAgo2(10)
1752
+ },
1753
+ {
1754
+ id: "contact-5",
1755
+ firstName: "Lisa",
1756
+ lastName: "Thompson",
1757
+ email: "lisa.t@globalfit.com",
1758
+ company: "Global Fitness",
1759
+ jobTitle: "CEO",
1760
+ status: "active",
1761
+ type: "individual",
1762
+ address: {
1763
+ city: "Los Angeles",
1764
+ state: "CA",
1765
+ country: "US"
1766
+ },
1767
+ createdAt: daysAgo2(120),
1768
+ updatedAt: daysAgo2(15)
1769
+ },
1770
+ {
1771
+ id: "contact-6",
1772
+ firstName: "James",
1773
+ lastName: "Wilson",
1774
+ email: "jwilson@retired.net",
1775
+ status: "inactive",
1776
+ type: "individual",
1777
+ notes: "Moved out of area, no longer purchasing",
1778
+ createdAt: daysAgo2(200),
1779
+ updatedAt: daysAgo2(45)
1780
+ }
1781
+ ];
1782
+ var DEMO_CONTACT = DEMO_CONTACTS[0];
1783
+
1784
+ // src/hooks/use-contacts.ts
1785
+ function isContactStatus(value) {
1786
+ return Object.values(CONTACT_STATUSES).includes(value);
1787
+ }
1788
+ function useContacts(_params) {
1789
+ return {
1790
+ data: [...DEMO_CONTACTS],
1791
+ isLoading: false,
1792
+ isError: false,
1793
+ totalCount: DEMO_CONTACTS.length
1794
+ };
1795
+ }
1796
+ function useContact(_contactId) {
1797
+ return {
1798
+ data: DEMO_CONTACT,
1799
+ isLoading: false,
1800
+ isError: false
1801
+ };
1802
+ }
1803
+ function AuthError({
1804
+ message = "You need to be authenticated to view this content.",
1805
+ title = "Authentication Required",
1806
+ children
1807
+ }) {
1808
+ return /* @__PURE__ */ jsxRuntime.jsx(
1809
+ "div",
1810
+ {
1811
+ style: {
1812
+ display: "flex",
1813
+ flexDirection: "column",
1814
+ alignItems: "center",
1815
+ justifyContent: "center",
1816
+ minHeight: "100vh",
1817
+ padding: "2rem",
1818
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
1819
+ backgroundColor: "#f9fafb",
1820
+ color: "#111827"
1821
+ },
1822
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1823
+ "div",
1824
+ {
1825
+ style: {
1826
+ maxWidth: "400px",
1827
+ textAlign: "center",
1828
+ padding: "2rem",
1829
+ backgroundColor: "#ffffff",
1830
+ borderRadius: "0.75rem",
1831
+ boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"
1832
+ },
1833
+ children: [
1834
+ /* @__PURE__ */ jsxRuntime.jsx(
1835
+ "div",
1836
+ {
1837
+ style: {
1838
+ width: "64px",
1839
+ height: "64px",
1840
+ margin: "0 auto 1.5rem",
1841
+ backgroundColor: "#fee2e2",
1842
+ borderRadius: "50%",
1843
+ display: "flex",
1844
+ alignItems: "center",
1845
+ justifyContent: "center"
1846
+ },
1847
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1848
+ "svg",
1849
+ {
1850
+ width: "32",
1851
+ height: "32",
1852
+ viewBox: "0 0 24 24",
1853
+ fill: "none",
1854
+ stroke: "#dc2626",
1855
+ strokeWidth: "2",
1856
+ strokeLinecap: "round",
1857
+ strokeLinejoin: "round",
1858
+ children: [
1859
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }),
1860
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
1861
+ ]
1862
+ }
1863
+ )
1864
+ }
1865
+ ),
1866
+ /* @__PURE__ */ jsxRuntime.jsx(
1867
+ "h1",
1868
+ {
1869
+ style: {
1870
+ fontSize: "1.5rem",
1871
+ fontWeight: "600",
1872
+ marginBottom: "0.75rem",
1873
+ color: "#111827"
1874
+ },
1875
+ children: title
1876
+ }
1877
+ ),
1878
+ /* @__PURE__ */ jsxRuntime.jsx(
1879
+ "p",
1880
+ {
1881
+ style: {
1882
+ fontSize: "1rem",
1883
+ color: "#6b7280",
1884
+ marginBottom: children ? "1.5rem" : "0",
1885
+ lineHeight: "1.5"
1886
+ },
1887
+ children: message
1888
+ }
1889
+ ),
1890
+ children
1891
+ ]
1892
+ }
1893
+ )
1894
+ }
1895
+ );
1896
+ }
1897
+ function AuthLoading() {
1898
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1899
+ "div",
1900
+ {
1901
+ style: {
1902
+ display: "flex",
1903
+ flexDirection: "column",
1904
+ alignItems: "center",
1905
+ justifyContent: "center",
1906
+ minHeight: "100vh",
1907
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
1908
+ backgroundColor: "#f9fafb"
1909
+ },
1910
+ children: [
1911
+ /* @__PURE__ */ jsxRuntime.jsx(
1912
+ "div",
1913
+ {
1914
+ style: {
1915
+ width: "40px",
1916
+ height: "40px",
1917
+ border: "3px solid #e5e7eb",
1918
+ borderTopColor: "#3b82f6",
1919
+ borderRadius: "50%",
1920
+ animation: "spin 1s linear infinite"
1921
+ }
1922
+ }
1923
+ ),
1924
+ /* @__PURE__ */ jsxRuntime.jsx(
1925
+ "p",
1926
+ {
1927
+ style: {
1928
+ marginTop: "1rem",
1929
+ color: "#6b7280",
1930
+ fontSize: "0.875rem"
1931
+ },
1932
+ children: "Authenticating..."
1933
+ }
1934
+ ),
1935
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
1936
+ @keyframes spin {
1937
+ to { transform: rotate(360deg); }
1938
+ }
1939
+ ` })
1940
+ ]
1941
+ }
1942
+ );
1943
+ }
1944
+ function RequireAuth({
1945
+ children,
1946
+ fallback = /* @__PURE__ */ jsxRuntime.jsx(AuthLoading, {}),
1947
+ errorComponent = /* @__PURE__ */ jsxRuntime.jsx(AuthError, {})
1948
+ }) {
1949
+ const { isAuthenticated, isLoading: isLoading2, error } = useFluidAuth();
1950
+ if (isLoading2) {
1951
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: fallback });
1952
+ }
1953
+ if (!isAuthenticated || error) {
1954
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: errorComponent });
1955
+ }
1956
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
1957
+ }
1958
+
1959
+ // src/themes/index.ts
1960
+ var themes_exports = {};
1961
+ chunkDEQ3PBVX_cjs.__reExport(themes_exports, theme_star__namespace);
1962
+
1963
+ // src/screens/index.ts
1964
+ var screenPropertySchemas = {
1965
+ MessagingScreen: () => import('./MessagingScreen-UCVLYWZB.cjs').then((m) => m.messagingScreenPropertySchema),
1966
+ ContactsScreen: () => import('./ContactsScreen-XZOQJVFE.cjs').then((m) => m.contactsScreenPropertySchema),
1967
+ OrdersScreen: () => import('./OrdersScreen-WNT2WDLI.cjs').then((m) => m.ordersScreenPropertySchema),
1968
+ CustomersScreen: () => import('./CustomersScreen-53SXRDDK.cjs').then((m) => m.customersScreenPropertySchema),
1969
+ ProductsScreen: () => import('./ProductsScreen-CTIAKS3Z.cjs').then((m) => m.productsScreenPropertySchema)
1970
+ };
1971
+ var CORE_PAGE_IDS = {
1972
+ MESSAGING: "core-messaging",
1973
+ CONTACTS: "core-contacts",
1974
+ ORDERS: "core-orders",
1975
+ CUSTOMERS: "core-customers",
1976
+ PRODUCTS: "core-products"
1977
+ };
1978
+ function registerCorePageTemplates() {
1979
+ PageTemplateRegistry.register({
1980
+ id: CORE_PAGE_IDS.MESSAGING,
1981
+ slug: "messaging",
1982
+ name: "Messaging",
1983
+ description: "Messaging interface provided by Fluid Commerce",
1984
+ category: PAGE_CATEGORIES.COMMUNICATION,
1985
+ tags: ["messaging", "chat", "conversations", "communication"],
1986
+ version: "1.0.0",
1987
+ isCore: true,
1988
+ component_tree: [
1989
+ {
1990
+ type: "MessagingScreen",
1991
+ id: "messaging-screen-root",
1992
+ props: {}
1993
+ }
1994
+ ],
1995
+ defaultProps: {}
1996
+ });
1997
+ PageTemplateRegistry.register({
1998
+ id: CORE_PAGE_IDS.CONTACTS,
1999
+ slug: "contacts",
2000
+ name: "Contacts",
2001
+ description: "Contact management provided by Fluid Commerce",
2002
+ category: PAGE_CATEGORIES.CORE,
2003
+ tags: ["contacts", "people", "address-book"],
2004
+ version: "1.0.0",
2005
+ isCore: true,
2006
+ component_tree: [
2007
+ {
2008
+ type: "ContactsScreen",
2009
+ id: "contacts-screen-root",
2010
+ props: {}
2011
+ }
2012
+ ],
2013
+ defaultProps: {}
2014
+ });
2015
+ PageTemplateRegistry.register({
2016
+ id: CORE_PAGE_IDS.ORDERS,
2017
+ slug: "orders",
2018
+ name: "Orders",
2019
+ description: "Order management provided by Fluid Commerce",
2020
+ category: PAGE_CATEGORIES.CORE,
2021
+ tags: ["orders", "commerce", "sales"],
2022
+ version: "1.0.0",
2023
+ isCore: true,
2024
+ component_tree: [
2025
+ {
2026
+ type: "OrdersScreen",
2027
+ id: "orders-screen-root",
2028
+ props: {}
2029
+ }
2030
+ ],
2031
+ defaultProps: {}
2032
+ });
2033
+ PageTemplateRegistry.register({
2034
+ id: CORE_PAGE_IDS.CUSTOMERS,
2035
+ slug: "customers",
2036
+ name: "Customers",
2037
+ description: "Customer management provided by Fluid Commerce",
2038
+ category: PAGE_CATEGORIES.CORE,
2039
+ tags: ["customers", "people", "commerce"],
2040
+ version: "1.0.0",
2041
+ isCore: true,
2042
+ component_tree: [
2043
+ {
2044
+ type: "CustomersScreen",
2045
+ id: "customers-screen-root",
2046
+ props: {}
2047
+ }
2048
+ ],
2049
+ defaultProps: {}
2050
+ });
2051
+ PageTemplateRegistry.register({
2052
+ id: CORE_PAGE_IDS.PRODUCTS,
2053
+ slug: "products",
2054
+ name: "Products",
2055
+ description: "Product catalog provided by Fluid Commerce",
2056
+ category: PAGE_CATEGORIES.CORE,
2057
+ tags: ["products", "catalog", "commerce"],
2058
+ version: "1.0.0",
2059
+ isCore: true,
2060
+ component_tree: [
2061
+ {
2062
+ type: "ProductsScreen",
2063
+ id: "products-screen-root",
2064
+ props: {}
2065
+ }
2066
+ ],
2067
+ defaultProps: {}
2068
+ });
2069
+ }
2070
+ registerCorePageTemplates();
2071
+ var export_BUILT_IN_THEMES = themes_exports.BUILT_IN_THEMES;
2072
+ var export_CORE_COLOR_KEYS = themes_exports.CORE_COLOR_KEYS;
2073
+ var export_DEFAULT_CORE_COLORS = themes_exports.DEFAULT_CORE_COLORS;
2074
+ var export_catppuccinMocha = themes_exports.catppuccinMocha;
2075
+ var export_clampChroma = themes_exports.clampChroma;
2076
+ var export_defaultTheme = themes_exports.defaultTheme;
2077
+ var export_detectThemeMode = themes_exports.detectThemeMode;
2078
+ var export_dracula = themes_exports.dracula;
2079
+ var export_everforest = themes_exports.everforest;
2080
+ var export_generateColorSwatches = themes_exports.generateColorSwatches;
2081
+ var export_generateDualTheme = themes_exports.generateDualTheme;
2082
+ var export_generateSmartDualTheme = themes_exports.generateSmartDualTheme;
2083
+ var export_generateTheme = themes_exports.generateTheme;
2084
+ var export_generateThemeCssVars = themes_exports.generateThemeCssVars;
2085
+ var export_gruvbox = themes_exports.gruvbox;
2086
+ var export_mod = themes_exports.mod;
2087
+ var export_monokai = themes_exports.monokai;
2088
+ var export_nord = themes_exports.nord;
2089
+ var export_oklchString = themes_exports.oklchString;
2090
+ var export_parseOklch = themes_exports.parseOklch;
2091
+ var export_rosePine = themes_exports.rosePine;
2092
+ var export_rotateHue = themes_exports.rotateHue;
2093
+ var export_rotateSoft = themes_exports.rotateSoft;
2094
+ var export_solarized = themes_exports.solarized;
2095
+ var export_toDarkMode = themes_exports.toDarkMode;
2096
+ var export_toLightMode = themes_exports.toLightMode;
2097
+ var export_tokyoNight = themes_exports.tokyoNight;
2098
+
2099
+ Object.defineProperty(exports, "MessagingScreen", {
2100
+ enumerable: true,
2101
+ get: function () { return chunkJZRNKSKT_cjs.MessagingScreen; }
2102
+ });
2103
+ Object.defineProperty(exports, "messagingScreenPropertySchema", {
2104
+ enumerable: true,
2105
+ get: function () { return chunkJZRNKSKT_cjs.messagingScreenPropertySchema; }
2106
+ });
2107
+ Object.defineProperty(exports, "ContactsScreen", {
2108
+ enumerable: true,
2109
+ get: function () { return chunkMEOOAMH2_cjs.ContactsScreen; }
2110
+ });
2111
+ Object.defineProperty(exports, "contactsScreenPropertySchema", {
2112
+ enumerable: true,
2113
+ get: function () { return chunkMEOOAMH2_cjs.contactsScreenPropertySchema; }
2114
+ });
2115
+ Object.defineProperty(exports, "OrdersScreen", {
2116
+ enumerable: true,
2117
+ get: function () { return chunkYII3IXF4_cjs.OrdersScreen; }
2118
+ });
2119
+ Object.defineProperty(exports, "ordersScreenPropertySchema", {
2120
+ enumerable: true,
2121
+ get: function () { return chunkYII3IXF4_cjs.ordersScreenPropertySchema; }
2122
+ });
2123
+ Object.defineProperty(exports, "CustomersScreen", {
2124
+ enumerable: true,
2125
+ get: function () { return chunkMBUCXIUN_cjs.CustomersScreen; }
2126
+ });
2127
+ Object.defineProperty(exports, "customersScreenPropertySchema", {
2128
+ enumerable: true,
2129
+ get: function () { return chunkMBUCXIUN_cjs.customersScreenPropertySchema; }
2130
+ });
2131
+ Object.defineProperty(exports, "ProductsScreen", {
2132
+ enumerable: true,
2133
+ get: function () { return chunkQUVJ3R4T_cjs.ProductsScreen; }
2134
+ });
2135
+ Object.defineProperty(exports, "productsScreenPropertySchema", {
2136
+ enumerable: true,
2137
+ get: function () { return chunkQUVJ3R4T_cjs.productsScreenPropertySchema; }
2138
+ });
2139
+ Object.defineProperty(exports, "WIDGET_TYPE_NAMES", {
2140
+ enumerable: true,
2141
+ get: function () { return types.WIDGET_TYPE_NAMES; }
2142
+ });
2143
+ Object.defineProperty(exports, "assertDefined", {
2144
+ enumerable: true,
2145
+ get: function () { return types.assertDefined; }
2146
+ });
2147
+ Object.defineProperty(exports, "assertNever", {
2148
+ enumerable: true,
2149
+ get: function () { return types.assertNever; }
2150
+ });
2151
+ Object.defineProperty(exports, "isWidgetType", {
2152
+ enumerable: true,
2153
+ get: function () { return types.isWidgetType; }
2154
+ });
2155
+ Object.defineProperty(exports, "isWidgetTypeName", {
2156
+ enumerable: true,
2157
+ get: function () { return types.isWidgetTypeName; }
2158
+ });
2159
+ Object.defineProperty(exports, "sectionLayoutConfig", {
2160
+ enumerable: true,
2161
+ get: function () { return types.sectionLayoutConfig; }
2162
+ });
2163
+ Object.defineProperty(exports, "AlertWidget", {
2164
+ enumerable: true,
2165
+ get: function () { return widgets.AlertWidget; }
2166
+ });
2167
+ Object.defineProperty(exports, "CalendarWidget", {
2168
+ enumerable: true,
2169
+ get: function () { return widgets.CalendarWidget; }
2170
+ });
2171
+ Object.defineProperty(exports, "CarouselWidget", {
2172
+ enumerable: true,
2173
+ get: function () { return widgets.CarouselWidget; }
2174
+ });
2175
+ Object.defineProperty(exports, "CatchUpWidget", {
2176
+ enumerable: true,
2177
+ get: function () { return widgets.CatchUpWidget; }
2178
+ });
2179
+ Object.defineProperty(exports, "ChartWidget", {
2180
+ enumerable: true,
2181
+ get: function () { return widgets.ChartWidget; }
2182
+ });
2183
+ Object.defineProperty(exports, "ContainerWidget", {
2184
+ enumerable: true,
2185
+ get: function () { return widgets.ContainerWidget; }
2186
+ });
2187
+ Object.defineProperty(exports, "EmbedWidget", {
2188
+ enumerable: true,
2189
+ get: function () { return widgets.EmbedWidget; }
2190
+ });
2191
+ Object.defineProperty(exports, "ImageWidget", {
2192
+ enumerable: true,
2193
+ get: function () { return widgets.ImageWidget; }
2194
+ });
2195
+ Object.defineProperty(exports, "LayoutWidget", {
2196
+ enumerable: true,
2197
+ get: function () { return widgets.LayoutWidget; }
2198
+ });
2199
+ Object.defineProperty(exports, "ListWidget", {
2200
+ enumerable: true,
2201
+ get: function () { return widgets.ListWidget; }
2202
+ });
2203
+ Object.defineProperty(exports, "MySiteWidget", {
2204
+ enumerable: true,
2205
+ get: function () { return widgets.MySiteWidget; }
2206
+ });
2207
+ Object.defineProperty(exports, "NestedWidget", {
2208
+ enumerable: true,
2209
+ get: function () { return widgets.NestedWidget; }
2210
+ });
2211
+ Object.defineProperty(exports, "QuickShareWidget", {
2212
+ enumerable: true,
2213
+ get: function () { return widgets.QuickShareWidget; }
2214
+ });
2215
+ Object.defineProperty(exports, "RecentActivityWidget", {
2216
+ enumerable: true,
2217
+ get: function () { return widgets.RecentActivityWidget; }
2218
+ });
2219
+ Object.defineProperty(exports, "SpacerWidget", {
2220
+ enumerable: true,
2221
+ get: function () { return widgets.SpacerWidget; }
2222
+ });
2223
+ Object.defineProperty(exports, "TableWidget", {
2224
+ enumerable: true,
2225
+ get: function () { return widgets.TableWidget; }
2226
+ });
2227
+ Object.defineProperty(exports, "TextWidget", {
2228
+ enumerable: true,
2229
+ get: function () { return widgets.TextWidget; }
2230
+ });
2231
+ Object.defineProperty(exports, "ToDoWidget", {
2232
+ enumerable: true,
2233
+ get: function () { return widgets.ToDoWidget; }
2234
+ });
2235
+ Object.defineProperty(exports, "VideoWidget", {
2236
+ enumerable: true,
2237
+ get: function () { return widgets.VideoWidget; }
2238
+ });
2239
+ Object.defineProperty(exports, "alertWidgetPropertySchema", {
2240
+ enumerable: true,
2241
+ get: function () { return widgets.alertWidgetPropertySchema; }
2242
+ });
2243
+ Object.defineProperty(exports, "calendarWidgetPropertySchema", {
2244
+ enumerable: true,
2245
+ get: function () { return widgets.calendarWidgetPropertySchema; }
2246
+ });
2247
+ Object.defineProperty(exports, "carouselWidgetPropertySchema", {
2248
+ enumerable: true,
2249
+ get: function () { return widgets.carouselWidgetPropertySchema; }
2250
+ });
2251
+ Object.defineProperty(exports, "catchUpWidgetPropertySchema", {
2252
+ enumerable: true,
2253
+ get: function () { return widgets.catchUpWidgetPropertySchema; }
2254
+ });
2255
+ Object.defineProperty(exports, "chartWidgetPropertySchema", {
2256
+ enumerable: true,
2257
+ get: function () { return widgets.chartWidgetPropertySchema; }
2258
+ });
2259
+ Object.defineProperty(exports, "containerWidgetPropertySchema", {
2260
+ enumerable: true,
2261
+ get: function () { return widgets.containerWidgetPropertySchema; }
2262
+ });
2263
+ Object.defineProperty(exports, "embedWidgetPropertySchema", {
2264
+ enumerable: true,
2265
+ get: function () { return widgets.embedWidgetPropertySchema; }
2266
+ });
2267
+ Object.defineProperty(exports, "imageWidgetPropertySchema", {
2268
+ enumerable: true,
2269
+ get: function () { return widgets.imageWidgetPropertySchema; }
2270
+ });
2271
+ Object.defineProperty(exports, "layoutWidgetPropertySchema", {
2272
+ enumerable: true,
2273
+ get: function () { return widgets.layoutWidgetPropertySchema; }
2274
+ });
2275
+ Object.defineProperty(exports, "listWidgetPropertySchema", {
2276
+ enumerable: true,
2277
+ get: function () { return widgets.listWidgetPropertySchema; }
2278
+ });
2279
+ Object.defineProperty(exports, "mySiteWidgetPropertySchema", {
2280
+ enumerable: true,
2281
+ get: function () { return widgets.mySiteWidgetPropertySchema; }
2282
+ });
2283
+ Object.defineProperty(exports, "nestedWidgetPropertySchema", {
2284
+ enumerable: true,
2285
+ get: function () { return widgets.nestedWidgetPropertySchema; }
2286
+ });
2287
+ Object.defineProperty(exports, "quickShareWidgetPropertySchema", {
2288
+ enumerable: true,
2289
+ get: function () { return widgets.quickShareWidgetPropertySchema; }
2290
+ });
2291
+ Object.defineProperty(exports, "recentActivityWidgetPropertySchema", {
2292
+ enumerable: true,
2293
+ get: function () { return widgets.recentActivityWidgetPropertySchema; }
2294
+ });
2295
+ Object.defineProperty(exports, "spacerWidgetPropertySchema", {
2296
+ enumerable: true,
2297
+ get: function () { return widgets.spacerWidgetPropertySchema; }
2298
+ });
2299
+ Object.defineProperty(exports, "tableWidgetPropertySchema", {
2300
+ enumerable: true,
2301
+ get: function () { return widgets.tableWidgetPropertySchema; }
2302
+ });
2303
+ Object.defineProperty(exports, "textWidgetPropertySchema", {
2304
+ enumerable: true,
2305
+ get: function () { return widgets.textWidgetPropertySchema; }
2306
+ });
2307
+ Object.defineProperty(exports, "toDoWidgetPropertySchema", {
2308
+ enumerable: true,
2309
+ get: function () { return widgets.toDoWidgetPropertySchema; }
2310
+ });
2311
+ Object.defineProperty(exports, "videoWidgetPropertySchema", {
2312
+ enumerable: true,
2313
+ get: function () { return widgets.videoWidgetPropertySchema; }
2314
+ });
2315
+ Object.defineProperty(exports, "widgetPropertySchemas", {
2316
+ enumerable: true,
2317
+ get: function () { return widgets.widgetPropertySchemas; }
2318
+ });
2319
+ Object.defineProperty(exports, "createScreen", {
2320
+ enumerable: true,
2321
+ get: function () { return widgetUtils.createScreen; }
2322
+ });
2323
+ Object.defineProperty(exports, "createWidgetFromShareable", {
2324
+ enumerable: true,
2325
+ get: function () { return widgetUtils.createWidgetFromShareable; }
2326
+ });
2327
+ Object.defineProperty(exports, "createWidgetRegistry", {
2328
+ enumerable: true,
2329
+ get: function () { return widgetUtils.createWidgetRegistry; }
2330
+ });
2331
+ Object.defineProperty(exports, "groupChildrenByColumn", {
2332
+ enumerable: true,
2333
+ get: function () { return widgetUtils.groupChildrenByColumn; }
2334
+ });
2335
+ Object.defineProperty(exports, "PROPERTY_FIELD_TYPES", {
2336
+ enumerable: true,
2337
+ get: function () { return registries.PROPERTY_FIELD_TYPES; }
2338
+ });
2339
+ Object.defineProperty(exports, "gapValues", {
2340
+ enumerable: true,
2341
+ get: function () { return registries.gapValues; }
2342
+ });
2343
+ Object.defineProperty(exports, "isPropertyFieldType", {
2344
+ enumerable: true,
2345
+ get: function () { return registries.isPropertyFieldType; }
2346
+ });
2347
+ exports.ACTIVITY_SLUGS = ACTIVITY_SLUGS;
2348
+ exports.AUTH_CONSTANTS = AUTH_CONSTANTS;
2349
+ exports.ApiError = ApiError;
2350
+ exports.AuthError = AuthError;
2351
+ exports.AuthLoading = AuthLoading;
2352
+ exports.BUILT_IN_THEMES = export_BUILT_IN_THEMES;
2353
+ exports.CORE_COLOR_KEYS = export_CORE_COLOR_KEYS;
2354
+ exports.CORE_PAGE_IDS = CORE_PAGE_IDS;
2355
+ exports.CURRENT_REP_QUERY_KEY = CURRENT_REP_QUERY_KEY;
2356
+ exports.DEFAULT_CORE_COLORS = export_DEFAULT_CORE_COLORS;
2357
+ exports.FluidAuthProvider = FluidAuthProvider;
2358
+ exports.FluidProvider = FluidProvider;
2359
+ exports.FluidThemeProvider = FluidThemeProvider;
2360
+ exports.PAGE_CATEGORIES = PAGE_CATEGORIES;
2361
+ exports.PERMISSIONS_QUERY_KEY = PERMISSIONS_QUERY_KEY;
2362
+ exports.PROFILE_QUERY_KEY = PROFILE_QUERY_KEY;
2363
+ exports.PageTemplateProvider = PageTemplateProvider;
2364
+ exports.PageTemplateRegistry = PageTemplateRegistry;
2365
+ exports.RequireAuth = RequireAuth;
2366
+ exports.STORAGE_KEYS = STORAGE_KEYS;
2367
+ exports.URL_PARAMS = URL_PARAMS;
2368
+ exports.USER_TYPES = USER_TYPES;
2369
+ exports.catppuccinMocha = export_catppuccinMocha;
2370
+ exports.clampChroma = export_clampChroma;
2371
+ exports.cleanTokenFromUrl = cleanTokenFromUrl;
2372
+ exports.clearTokens = clearTokens;
2373
+ exports.createFluidClient = createFluidClient;
2374
+ exports.decodeToken = decodeToken;
2375
+ exports.defaultTheme = export_defaultTheme;
2376
+ exports.detectThemeMode = export_detectThemeMode;
2377
+ exports.dracula = export_dracula;
2378
+ exports.everforest = export_everforest;
2379
+ exports.extractAllTokensFromUrl = extractAllTokensFromUrl;
2380
+ exports.extractCompanyTokenFromUrl = extractCompanyTokenFromUrl;
2381
+ exports.extractTokenFromUrl = extractTokenFromUrl;
2382
+ exports.generateColorSwatches = export_generateColorSwatches;
2383
+ exports.generateDualTheme = export_generateDualTheme;
2384
+ exports.generateSmartDualTheme = export_generateSmartDualTheme;
2385
+ exports.generateTheme = export_generateTheme;
2386
+ exports.generateThemeCssVars = export_generateThemeCssVars;
2387
+ exports.getAvailablePageTemplates = getAvailablePageTemplates;
2388
+ exports.getCorePageTemplates = getCorePageTemplates;
2389
+ exports.getOptionalPageTemplates = getOptionalPageTemplates;
2390
+ exports.getProperty = getProperty;
2391
+ exports.getStoredToken = getStoredToken;
2392
+ exports.getTokenExpiration = getTokenExpiration;
2393
+ exports.getTokenTimeRemaining = getTokenTimeRemaining;
2394
+ exports.gruvbox = export_gruvbox;
2395
+ exports.hasData = hasData;
2396
+ exports.hasStoredToken = hasStoredToken;
2397
+ exports.hasTokenInUrl = hasTokenInUrl;
2398
+ exports.isActivitySlug = isActivitySlug;
2399
+ exports.isApiError = isApiError;
2400
+ exports.isContactStatus = isContactStatus;
2401
+ exports.isErrorResult = isErrorResult;
2402
+ exports.isIdle = isIdle;
2403
+ exports.isLoading = isLoading;
2404
+ exports.isTokenExpired = isTokenExpired;
2405
+ exports.isUserType = isUserType;
2406
+ exports.isValidToken = isValidToken;
2407
+ exports.mod = export_mod;
2408
+ exports.monokai = export_monokai;
2409
+ exports.nord = export_nord;
2410
+ exports.oklchString = export_oklchString;
2411
+ exports.parseOklch = export_parseOklch;
2412
+ exports.resolveNavigationPages = resolveNavigationPages;
2413
+ exports.rosePine = export_rosePine;
2414
+ exports.rotateHue = export_rotateHue;
2415
+ exports.rotateSoft = export_rotateSoft;
2416
+ exports.screenPropertySchemas = screenPropertySchemas;
2417
+ exports.selectProperty = selectProperty;
2418
+ exports.solarized = export_solarized;
2419
+ exports.storeToken = storeToken;
2420
+ exports.toDarkMode = export_toDarkMode;
2421
+ exports.toLightMode = export_toLightMode;
2422
+ exports.tokyoNight = export_tokyoNight;
2423
+ exports.useActivities = useActivities;
2424
+ exports.useCalendarEvents = useCalendarEvents;
2425
+ exports.useCatchUps = useCatchUps;
2426
+ exports.useContact = useContact;
2427
+ exports.useContacts = useContacts;
2428
+ exports.useConversationMessages = useConversationMessages;
2429
+ exports.useConversations = useConversations;
2430
+ exports.useCurrentRep = useCurrentRep;
2431
+ exports.useFluidApi = useFluidApi;
2432
+ exports.useFluidAuth = useFluidAuth;
2433
+ exports.useFluidAuthContext = useFluidAuthContext;
2434
+ exports.useFluidContext = useFluidContext;
2435
+ exports.useFluidPermissions = useFluidPermissions;
2436
+ exports.useFluidProfile = useFluidProfile;
2437
+ exports.useFluidTheme = useFluidTheme;
2438
+ exports.useMySite = useMySite;
2439
+ exports.usePageTemplates = usePageTemplates;
2440
+ exports.useResolvedPages = useResolvedPages;
2441
+ exports.useThemeContext = useThemeContext;
2442
+ exports.useTodos = useTodos;
2443
+ exports.validateNavigationPages = validateNavigationPages;
2444
+ exports.validateToken = validateToken;
2445
+ //# sourceMappingURL=index.cjs.map
2446
+ //# sourceMappingURL=index.cjs.map