@flamingo-stack/openframe-frontend-core 0.0.719 → 0.0.721
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/assets/index.cjs +6 -0
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js +5 -1
- package/dist/assets/mobile-app-qr.d.ts +17 -0
- package/dist/assets/mobile-app-qr.d.ts.map +1 -0
- package/dist/{chunk-2JLP2X2M.js → chunk-2P2M27EW.js} +2396 -2369
- package/dist/{chunk-IWCPXJEE.js → chunk-2TXGR7IK.js} +138 -63
- package/dist/{chunk-FVQJBII6.js → chunk-3LY7V3RF.js} +3 -3
- package/dist/{chunk-HCFNEKO3.cjs → chunk-3R32ZNA2.cjs} +46 -46
- package/dist/{chunk-WSDT7LYL.js → chunk-3UBWDR65.js} +1 -1
- package/dist/{chunk-NZ5BHDFZ.js → chunk-44Q6MV7C.js} +2 -2
- package/dist/{chunk-CMZ3QTFQ.js → chunk-4I3K6LEH.js} +24 -0
- package/dist/{chunk-ZXCZYMN4.cjs → chunk-4LY6R4TN.cjs} +137 -62
- package/dist/{chunk-EAHOB64X.js → chunk-57UTI7ZH.js} +106 -42
- package/dist/{chunk-XGHGGBM3.js → chunk-5QXE5HMV.js} +4 -4
- package/dist/{chunk-NYWESHOQ.cjs → chunk-6AJIOW3S.cjs} +57 -57
- package/dist/{chunk-4QFWGLZO.js → chunk-6YBUQAOH.js} +1 -1
- package/dist/{chunk-JHQ334WS.js → chunk-742BGXNX.js} +2 -0
- package/dist/{chunk-D6PMVWDI.js → chunk-74N742ZG.js} +6 -6
- package/dist/{chunk-AECTRMGQ.cjs → chunk-7GRPR7XA.cjs} +13 -1
- package/dist/{chunk-4HJRHEXD.cjs → chunk-7Z5FMQYR.cjs} +22 -22
- package/dist/chunk-AFTRPEXO.js +13 -0
- package/dist/{chunk-WBNAEYTQ.cjs → chunk-BYUIFT7Q.cjs} +6 -6
- package/dist/{chunk-LCLDFMDF.cjs → chunk-BYVVE7HP.cjs} +58 -58
- package/dist/{chunk-JPD4NXH6.js → chunk-CO3FOZIH.js} +1 -1
- package/dist/{chunk-E7YCPY7K.cjs → chunk-D2DH6VZL.cjs} +3 -3
- package/dist/{chunk-HWVUR735.cjs → chunk-DFM572VH.cjs} +2 -2
- package/dist/{chunk-YDPKUAP4.js → chunk-DJ4IFQNQ.js} +2 -0
- package/dist/{chunk-5U3KWQXP.js → chunk-E6SMMMKV.js} +13 -13
- package/dist/chunk-EWPR7662.cjs +13 -0
- package/dist/{chunk-SWAVO7BB.cjs → chunk-F7ORKKEF.cjs} +108 -108
- package/dist/{chunk-AGVXKD4K.js → chunk-FSQQZFVG.js} +12 -0
- package/dist/{chunk-ETYLOZOB.cjs → chunk-GCK75D7F.cjs} +109 -22
- package/dist/{chunk-ZKNZ2CXW.cjs → chunk-GGBYZKMS.cjs} +11 -11
- package/dist/{chunk-Y4MB25KW.js → chunk-GYAXV3MZ.js} +3 -3
- package/dist/{chunk-UWQWMGJ7.cjs → chunk-HJMSNOBT.cjs} +1040 -696
- package/dist/{chunk-DFQYAYBH.cjs → chunk-HQIOMFJH.cjs} +2 -0
- package/dist/{chunk-JH2SIWPQ.js → chunk-HXB7SEYG.js} +1611 -1267
- package/dist/{chunk-LE5WKGJV.cjs → chunk-I2254QN6.cjs} +16 -16
- package/dist/{chunk-PSVSEN4J.cjs → chunk-IMTY3GRR.cjs} +2 -0
- package/dist/{chunk-ILNN6QRW.js → chunk-JDBZ4ZHU.js} +3 -3
- package/dist/{chunk-GQ7JJUIT.cjs → chunk-K2JUJ37D.cjs} +25 -1
- package/dist/{chunk-6YPTUHM7.js → chunk-K76ACBR3.js} +3 -3
- package/dist/{chunk-2NASBO7O.js → chunk-KFOAV77K.js} +2 -2
- package/dist/{chunk-CU6NWO2M.js → chunk-LAXKEBDD.js} +14 -18
- package/dist/{chunk-5YAGX5DY.js → chunk-LGKMR7NZ.js} +7 -7
- package/dist/{chunk-E2V2EH2G.cjs → chunk-LODMNSQY.cjs} +16 -16
- package/dist/{chunk-4D6NMPOO.js → chunk-NJ5TBTJG.js} +7 -7
- package/dist/{chunk-TDZ76NCB.cjs → chunk-NMPVK53I.cjs} +29 -29
- package/dist/{chunk-TTVOLEUS.js → chunk-NPSJE7J3.js} +90 -3
- package/dist/{chunk-H5VIMBRN.cjs → chunk-O5EHOJZD.cjs} +4 -4
- package/dist/{chunk-KT3U3ZRP.cjs → chunk-OKE5BIQH.cjs} +8 -8
- package/dist/{chunk-DC4RTYWK.cjs → chunk-QLTXT562.cjs} +5 -5
- package/dist/{chunk-H5V7GRN5.js → chunk-QQCFPMAA.js} +5 -7
- package/dist/{chunk-7BREFV7G.cjs → chunk-QYS4YVEP.cjs} +34 -36
- package/dist/{chunk-7BCY77W6.js → chunk-RCI3PALX.js} +8 -10
- package/dist/{chunk-P3JMAMHP.js → chunk-REETLEL5.js} +1 -1
- package/dist/{chunk-4JIGEK7C.cjs → chunk-RJMWJAJO.cjs} +97 -33
- package/dist/{chunk-WS7WRR5Z.cjs → chunk-RQZQHLNS.cjs} +86 -90
- package/dist/{chunk-FFT56TYB.cjs → chunk-RUZIICXT.cjs} +2 -2
- package/dist/{chunk-AJHSQ5XK.js → chunk-S63QBBT7.js} +6 -6
- package/dist/{chunk-TELAANY6.js → chunk-UXU7Y5BH.js} +2 -2
- package/dist/{chunk-NQVS4G7G.cjs → chunk-UZTOI6FJ.cjs} +773 -746
- package/dist/{chunk-DFEPUYTF.cjs → chunk-VFICDEYJ.cjs} +45 -47
- package/dist/{chunk-LOZLHG2U.cjs → chunk-XE2K53GH.cjs} +20 -20
- package/dist/{chunk-QBCDSTLE.cjs → chunk-XXO52RZR.cjs} +26 -26
- package/dist/{chunk-TTEFN6VO.js → chunk-ZLUFEWZZ.js} +10 -10
- package/dist/{chunk-MA4Q5RBP.cjs → chunk-ZSOFLPQN.cjs} +9 -9
- package/dist/{chunk-KBJJQFYU.js → chunk-ZZEKXGFS.js} +2 -2
- package/dist/{cloud-tenants-FBUO66GW.cjs → cloud-tenants-HZHKRUIW.cjs} +16 -16
- package/dist/{cloud-tenants-DNBPNQNP.js → cloud-tenants-Q4TCJS5Y.js} +15 -15
- package/dist/components/calendar.cjs +4 -4
- package/dist/components/calendar.js +1 -1
- package/dist/components/case-studies/index.cjs +30 -30
- package/dist/components/case-studies/index.js +16 -16
- package/dist/components/chat/ask-prompts.d.ts +10 -2
- package/dist/components/chat/ask-prompts.d.ts.map +1 -1
- package/dist/components/chat/assistant-ask-prompts.d.ts +27 -0
- package/dist/components/chat/assistant-ask-prompts.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
- package/dist/components/chat/hooks/index.d.ts +1 -0
- package/dist/components/chat/hooks/index.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-ask-prompts.d.ts +63 -0
- package/dist/components/chat/hooks/use-ask-prompts.d.ts.map +1 -0
- package/dist/components/chat/index.cjs +27 -10
- package/dist/components/chat/index.d.ts +1 -0
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +26 -9
- package/dist/components/chat/utils/icon-library.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +17 -17
- package/dist/components/contact/index.js +16 -16
- package/dist/components/docs/index.cjs +20 -20
- package/dist/components/docs/index.js +19 -19
- package/dist/components/embeds/index.cjs +17 -17
- package/dist/components/embeds/index.js +16 -16
- package/dist/components/faq/faq-ask-card.d.ts +44 -0
- package/dist/components/faq/faq-ask-card.d.ts.map +1 -0
- package/dist/components/faq/faq-document-page.d.ts +5 -1
- package/dist/components/faq/faq-document-page.d.ts.map +1 -1
- package/dist/components/faq/faq-section.d.ts +18 -5
- package/dist/components/faq/faq-section.d.ts.map +1 -1
- package/dist/components/faq/index.cjs +19 -18
- package/dist/components/faq/index.d.ts +1 -0
- package/dist/components/faq/index.d.ts.map +1 -1
- package/dist/components/faq/index.js +18 -17
- package/dist/components/features/auth/auth-benefits-panel.d.ts.map +1 -1
- package/dist/components/features/index.cjs +16 -16
- package/dist/components/features/index.js +15 -15
- package/dist/components/help-center-pages/download-apps-page.d.ts +55 -0
- package/dist/components/help-center-pages/download-apps-page.d.ts.map +1 -0
- package/dist/components/help-center-pages/index.cjs +333 -119
- package/dist/components/help-center-pages/index.d.ts +1 -0
- package/dist/components/help-center-pages/index.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.js +251 -37
- package/dist/components/help-center-pages/trust-center-page.d.ts +4 -1
- package/dist/components/help-center-pages/trust-center-page.d.ts.map +1 -1
- package/dist/components/index.cjs +131 -217
- package/dist/components/index.js +236 -322
- package/dist/components/meeting-scheduler/index.cjs +61 -62
- package/dist/components/meeting-scheduler/index.js +18 -19
- package/dist/components/navigation/index.cjs +19 -19
- package/dist/components/navigation/index.js +18 -18
- package/dist/components/navigation/mingo-ai-button.d.ts +1 -1
- package/dist/components/navigation/mingo-ai-button.d.ts.map +1 -1
- package/dist/components/onboarding-guides/index.cjs +19 -20
- package/dist/components/onboarding-guides/index.js +18 -19
- package/dist/components/product-demo/index.cjs +8 -8
- package/dist/components/product-demo/index.js +8 -8
- package/dist/components/related-content/index.cjs +7 -9
- package/dist/components/related-content/index.js +6 -8
- package/dist/components/tickets/index.cjs +21 -21
- package/dist/components/tickets/index.js +20 -20
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/file-manager/index.cjs +11 -11
- package/dist/components/ui/file-manager/index.js +1 -1
- package/dist/components/ui/index.cjs +34 -16
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +33 -15
- package/dist/components/ui/mobile-app-qr.d.ts +23 -0
- package/dist/components/ui/mobile-app-qr.d.ts.map +1 -0
- package/dist/components/ui/store-badges.d.ts +7 -4
- package/dist/components/ui/store-badges.d.ts.map +1 -1
- package/dist/contexts/assistant-runtime-context.d.ts +74 -0
- package/dist/contexts/assistant-runtime-context.d.ts.map +1 -0
- package/dist/contexts/index.cjs +7 -1
- package/dist/contexts/index.d.ts +1 -0
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/contexts/index.js +6 -0
- package/dist/{devices-5A5TY4JD.cjs → devices-6XHUFIC6.cjs} +17 -17
- package/dist/{devices-PLDAEUSL.js → devices-NOUGVTES.js} +15 -15
- package/dist/hooks/index.cjs +10 -5
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +9 -4
- package/dist/hooks/use-downloads.d.ts +41 -0
- package/dist/hooks/use-downloads.d.ts.map +1 -0
- package/dist/index.cjs +80 -20
- package/dist/index.js +79 -19
- package/dist/{knowledge-G6Q5KRWV.js → knowledge-2YTUXQ2Z.js} +15 -15
- package/dist/{knowledge-FKTJ723Z.cjs → knowledge-ANEKPMO2.cjs} +17 -17
- package/dist/{logs-CJCXUBU6.cjs → logs-U3IB3HUM.cjs} +25 -25
- package/dist/{logs-QMV6XIC4.js → logs-WVQIONUT.js} +15 -15
- package/dist/{policies-G6D7AX6F.js → policies-66EGDW2H.js} +15 -15
- package/dist/{policies-QMRTK3CY.cjs → policies-UFRN2EQF.cjs} +20 -20
- package/dist/{remote-session-DBD6OSTX.js → remote-session-6WEUJZDC.js} +5 -5
- package/dist/{remote-session-2JVI7RVA.cjs → remote-session-A75X5NPC.cjs} +7 -7
- package/dist/{software-update-PNZMRDBT.cjs → software-update-2MHKL76D.cjs} +20 -20
- package/dist/{software-update-6BQM6BKH.js → software-update-3ZD3MXF3.js} +15 -15
- package/dist/{tickets-board-BHLPAVNJ.cjs → tickets-board-IFWMIZ35.cjs} +9 -9
- package/dist/{tickets-board-PYDNELSK.js → tickets-board-MYXG3V72.js} +4 -4
- package/dist/types/downloads.d.ts +67 -0
- package/dist/types/downloads.d.ts.map +1 -0
- package/dist/types/index.cjs +24 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +16 -1
- package/dist/utils/index.cjs +46 -2
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +40 -3
- package/dist/utils/list-url.d.ts.map +1 -1
- package/dist/utils/mobile-app.cjs +46 -0
- package/dist/utils/mobile-app.d.ts +40 -0
- package/dist/utils/mobile-app.d.ts.map +1 -0
- package/dist/utils/mobile-app.js +40 -0
- package/dist/utils/source-icons.d.ts.map +1 -1
- package/dist/utils/trial.d.ts +18 -0
- package/dist/utils/trial.d.ts.map +1 -0
- package/package.json +7 -1
- package/src/assets/index.ts +1 -0
- package/src/assets/mobile-app-qr.ts +19 -0
- package/src/components/chat/ask-prompts.tsx +25 -3
- package/src/components/chat/assistant-ask-prompts.tsx +78 -0
- package/src/components/chat/entity-cards/dispatch.tsx +38 -4
- package/src/components/chat/hooks/index.ts +12 -0
- package/src/components/chat/hooks/use-ask-prompts.ts +188 -0
- package/src/components/chat/index.ts +1 -0
- package/src/components/chat/utils/icon-library.tsx +6 -0
- package/src/components/faq/faq-ask-card.tsx +115 -0
- package/src/components/faq/faq-document-page.tsx +6 -1
- package/src/components/faq/faq-section.tsx +27 -5
- package/src/components/faq/index.ts +1 -0
- package/src/components/features/auth/auth-benefits-panel.tsx +5 -4
- package/src/components/help-center-pages/download-apps-page.tsx +364 -0
- package/src/components/help-center-pages/index.ts +1 -0
- package/src/components/help-center-pages/trust-center-page.tsx +5 -2
- package/src/components/navigation/mingo-ai-button.tsx +27 -6
- package/src/components/ui/button/button.tsx +3 -0
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/mobile-app-qr.tsx +40 -0
- package/src/components/ui/store-badges.tsx +17 -9
- package/src/contexts/assistant-runtime-context.tsx +84 -0
- package/src/contexts/index.ts +9 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-downloads.ts +138 -0
- package/src/types/downloads.ts +82 -0
- package/src/types/index.ts +1 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/list-url.ts +4 -0
- package/src/utils/mobile-app.ts +57 -0
- package/src/utils/source-icons.ts +10 -2
- package/src/utils/trial.ts +19 -0
- package/dist/chunk-6X3O67OL.cjs +0 -89
- package/dist/chunk-AUMKE74M.cjs +0 -16
- package/dist/chunk-G3GRYDMS.js +0 -16
- package/dist/chunk-RR6PY34K.js +0 -89
|
@@ -7,9 +7,7 @@ import {
|
|
|
7
7
|
useRequiredEndpointsRuntime
|
|
8
8
|
} from "./chunk-HFL2F4RM.js";
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
} from "./chunk-G3GRYDMS.js";
|
|
12
|
-
import {
|
|
10
|
+
DOWNLOADS_API_PATH,
|
|
13
11
|
ELAPSED_MS_FIELD,
|
|
14
12
|
FORM_RESCUE_ATTEMPT_FIELD,
|
|
15
13
|
FORM_RESCUE_DEBOUNCE_MS,
|
|
@@ -20,6 +18,7 @@ import {
|
|
|
20
18
|
LOCATION_HASH_SYNC_EVENT,
|
|
21
19
|
captureFormRescueEvent,
|
|
22
20
|
consumeAccessCode,
|
|
21
|
+
desktopOsOf,
|
|
23
22
|
filledRescueFields,
|
|
24
23
|
getHashTargetElement,
|
|
25
24
|
isFormAttemptId,
|
|
@@ -35,9 +34,10 @@ import {
|
|
|
35
34
|
transformPlatformConfigsToOptions,
|
|
36
35
|
useAutoplay,
|
|
37
36
|
useDebounce,
|
|
37
|
+
useVisitorOs,
|
|
38
38
|
validateAccessCode,
|
|
39
39
|
validateAndConsumeAccessCode
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-4I3K6LEH.js";
|
|
41
41
|
import {
|
|
42
42
|
ToolIcon,
|
|
43
43
|
apiErrorMessage
|
|
@@ -47,11 +47,12 @@ import {
|
|
|
47
47
|
useSearchParams
|
|
48
48
|
} from "./chunk-GY4IZG22.js";
|
|
49
49
|
import {
|
|
50
|
+
contentFetch,
|
|
50
51
|
createSearchParams,
|
|
51
52
|
parseSchemaParams,
|
|
52
53
|
positiveInt,
|
|
53
54
|
shouldIncludeInUrl
|
|
54
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-FSQQZFVG.js";
|
|
55
56
|
import {
|
|
56
57
|
Chevron02DownIcon,
|
|
57
58
|
XmarkIcon
|
|
@@ -1204,8 +1205,79 @@ function useCopyToClipboard({
|
|
|
1204
1205
|
return { copy, copied };
|
|
1205
1206
|
}
|
|
1206
1207
|
|
|
1208
|
+
// src/hooks/use-downloads.ts
|
|
1209
|
+
import { useCallback as useCallback10, useEffect as useEffect12, useSyncExternalStore } from "react";
|
|
1210
|
+
var IDLE = { data: null, isLoading: false, error: false };
|
|
1211
|
+
var entries = /* @__PURE__ */ new Map();
|
|
1212
|
+
function entryFor(endpoint) {
|
|
1213
|
+
let entry = entries.get(endpoint);
|
|
1214
|
+
if (!entry) {
|
|
1215
|
+
entry = { state: IDLE, request: null, listeners: /* @__PURE__ */ new Set() };
|
|
1216
|
+
entries.set(endpoint, entry);
|
|
1217
|
+
}
|
|
1218
|
+
return entry;
|
|
1219
|
+
}
|
|
1220
|
+
function publish(endpoint, state) {
|
|
1221
|
+
const entry = entryFor(endpoint);
|
|
1222
|
+
entry.state = state;
|
|
1223
|
+
for (const listener of entry.listeners) listener();
|
|
1224
|
+
}
|
|
1225
|
+
function load(endpoint, force = false) {
|
|
1226
|
+
const entry = entryFor(endpoint);
|
|
1227
|
+
if (entry.request || entry.state.data && !force) return;
|
|
1228
|
+
publish(endpoint, { data: entry.state.data, isLoading: true, error: false });
|
|
1229
|
+
entry.request = contentFetch(endpoint).then(async (response) => {
|
|
1230
|
+
if (!response.ok) throw new Error(`Request failed (${response.status})`);
|
|
1231
|
+
publish(endpoint, { data: await response.json(), isLoading: false, error: false });
|
|
1232
|
+
}).catch(() => publish(endpoint, { data: entry.state.data, isLoading: false, error: true })).finally(() => {
|
|
1233
|
+
entry.request = null;
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
function resetDownloadsStore() {
|
|
1237
|
+
entries.clear();
|
|
1238
|
+
}
|
|
1239
|
+
function useDownloads({ endpoint = DOWNLOADS_API_PATH, initialData, enabled = true } = {}) {
|
|
1240
|
+
const entry = entryFor(endpoint);
|
|
1241
|
+
if (initialData && entry.state.data !== initialData && !entry.request) {
|
|
1242
|
+
entry.state = { data: initialData, isLoading: false, error: false };
|
|
1243
|
+
}
|
|
1244
|
+
useEffect12(() => {
|
|
1245
|
+
if (!initialData) return;
|
|
1246
|
+
for (const listener of entry.listeners) listener();
|
|
1247
|
+
}, [entry, initialData]);
|
|
1248
|
+
const subscribe2 = useCallback10(
|
|
1249
|
+
(listener) => {
|
|
1250
|
+
entry.listeners.add(listener);
|
|
1251
|
+
return () => {
|
|
1252
|
+
entry.listeners.delete(listener);
|
|
1253
|
+
};
|
|
1254
|
+
},
|
|
1255
|
+
[entry]
|
|
1256
|
+
);
|
|
1257
|
+
const state = useSyncExternalStore(
|
|
1258
|
+
subscribe2,
|
|
1259
|
+
() => entry.state,
|
|
1260
|
+
() => entry.state
|
|
1261
|
+
);
|
|
1262
|
+
useEffect12(() => {
|
|
1263
|
+
if (enabled) load(endpoint);
|
|
1264
|
+
}, [enabled, endpoint]);
|
|
1265
|
+
const reload = useCallback10(() => load(endpoint, true), [endpoint]);
|
|
1266
|
+
const isLoading = state.isLoading || enabled && !state.data && !state.error;
|
|
1267
|
+
return { data: state.data, isLoading, error: state.error, reload };
|
|
1268
|
+
}
|
|
1269
|
+
function useVisitorDesktopDownload(options = {}) {
|
|
1270
|
+
const enabled = options.enabled ?? true;
|
|
1271
|
+
const visitor = useVisitorOs();
|
|
1272
|
+
const { data, error } = useDownloads(options);
|
|
1273
|
+
if (!enabled || !visitor.known || !data && !error) return { known: false, download: null };
|
|
1274
|
+
const os = desktopOsOf(visitor.os);
|
|
1275
|
+
const download = data?.desktop.find((row) => row.kind === "binary" && row.url && row.os === os) ?? null;
|
|
1276
|
+
return { known: true, download };
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1207
1279
|
// src/hooks/use-batch-images.ts
|
|
1208
|
-
import { useEffect as
|
|
1280
|
+
import { useEffect as useEffect13, useMemo as useMemo3, useState as useState13, useRef as useRef6 } from "react";
|
|
1209
1281
|
var globalBatchImageConfig = {};
|
|
1210
1282
|
function configureBatchImageFetch(config) {
|
|
1211
1283
|
globalBatchImageConfig = { ...globalBatchImageConfig, ...config };
|
|
@@ -1285,10 +1357,10 @@ function useBatchImages(imageUrls, config) {
|
|
|
1285
1357
|
);
|
|
1286
1358
|
const requestedUrls = useRef6(/* @__PURE__ */ new Set());
|
|
1287
1359
|
const fetchedImagesRef = useRef6(fetchedImages);
|
|
1288
|
-
|
|
1360
|
+
useEffect13(() => {
|
|
1289
1361
|
fetchedImagesRef.current = fetchedImages;
|
|
1290
1362
|
}, [fetchedImages]);
|
|
1291
|
-
|
|
1363
|
+
useEffect13(
|
|
1292
1364
|
() => () => {
|
|
1293
1365
|
Object.values(fetchedImagesRef.current).forEach((blobUrl) => {
|
|
1294
1366
|
if (blobUrl && blobUrl.startsWith("blob:")) {
|
|
@@ -1298,7 +1370,7 @@ function useBatchImages(imageUrls, config) {
|
|
|
1298
1370
|
},
|
|
1299
1371
|
[]
|
|
1300
1372
|
);
|
|
1301
|
-
|
|
1373
|
+
useEffect13(() => {
|
|
1302
1374
|
const urlsToFetch = uniqueUrls.filter((url) => !requestedUrls.current.has(url));
|
|
1303
1375
|
if (urlsToFetch.length === 0) {
|
|
1304
1376
|
return;
|
|
@@ -1316,7 +1388,7 @@ function useBatchImages(imageUrls, config) {
|
|
|
1316
1388
|
}
|
|
1317
1389
|
|
|
1318
1390
|
// src/hooks/use-authenticated-image.ts
|
|
1319
|
-
import { useEffect as
|
|
1391
|
+
import { useEffect as useEffect14, useState as useState14, useRef as useRef7 } from "react";
|
|
1320
1392
|
var globalImageConfig = {};
|
|
1321
1393
|
var imageCache = /* @__PURE__ */ new Map();
|
|
1322
1394
|
var pendingRequests = /* @__PURE__ */ new Map();
|
|
@@ -1364,7 +1436,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
1364
1436
|
}
|
|
1365
1437
|
}
|
|
1366
1438
|
const cacheKey = fullImageUrl === null ? null : refreshKey ? `${fullImageUrl}?v=${refreshKey}` : fullImageUrl;
|
|
1367
|
-
|
|
1439
|
+
useEffect14(() => {
|
|
1368
1440
|
if (cacheKey === null) {
|
|
1369
1441
|
if (currentCacheKeyRef.current) {
|
|
1370
1442
|
const entry = imageCache.get(currentCacheKeyRef.current);
|
|
@@ -1441,7 +1513,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
1441
1513
|
});
|
|
1442
1514
|
pendingRequests.set(cacheKey, fetchPromise2);
|
|
1443
1515
|
}, [cacheKey, fullImageUrl, refreshKey, enableDevMode, accessTokenKey]);
|
|
1444
|
-
|
|
1516
|
+
useEffect14(() => {
|
|
1445
1517
|
return () => {
|
|
1446
1518
|
if (currentCacheKeyRef.current) {
|
|
1447
1519
|
const entry = imageCache.get(currentCacheKeyRef.current);
|
|
@@ -1462,7 +1534,7 @@ function useAuthenticatedImage(imageUrl, refreshKey, config) {
|
|
|
1462
1534
|
}
|
|
1463
1535
|
|
|
1464
1536
|
// src/hooks/state/use-query-params.ts
|
|
1465
|
-
import { useEffect as
|
|
1537
|
+
import { useEffect as useEffect15, useState as useState15, useMemo as useMemo4, useCallback as useCallback11, useRef as useRef8 } from "react";
|
|
1466
1538
|
|
|
1467
1539
|
// src/hooks/state/flatten-schema.ts
|
|
1468
1540
|
function flattenQueryVariables(queryVariables, introspector2) {
|
|
@@ -1925,14 +1997,14 @@ function useQueryParams(query, options = {}) {
|
|
|
1925
1997
|
paramMapping: options.paramMapping,
|
|
1926
1998
|
defaultValues
|
|
1927
1999
|
});
|
|
1928
|
-
|
|
2000
|
+
useEffect15(() => {
|
|
1929
2001
|
initSourceRef.current = {
|
|
1930
2002
|
introspectionHeaders: options.introspectionHeaders,
|
|
1931
2003
|
paramMapping: options.paramMapping,
|
|
1932
2004
|
defaultValues
|
|
1933
2005
|
};
|
|
1934
2006
|
});
|
|
1935
|
-
|
|
2007
|
+
useEffect15(() => {
|
|
1936
2008
|
let cancelled = false;
|
|
1937
2009
|
async function initialize() {
|
|
1938
2010
|
try {
|
|
@@ -2009,7 +2081,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2009
2081
|
});
|
|
2010
2082
|
return result;
|
|
2011
2083
|
}, [searchParams]);
|
|
2012
|
-
const updateUrl =
|
|
2084
|
+
const updateUrl = useCallback11(
|
|
2013
2085
|
(newParams) => {
|
|
2014
2086
|
const url = newParams.toString() ? `?${newParams.toString()}` : window.location.pathname;
|
|
2015
2087
|
if (debug) {
|
|
@@ -2019,7 +2091,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2019
2091
|
},
|
|
2020
2092
|
[router, debug]
|
|
2021
2093
|
);
|
|
2022
|
-
const setParam =
|
|
2094
|
+
const setParam = useCallback11(
|
|
2023
2095
|
(key, value) => {
|
|
2024
2096
|
if (!isReady) {
|
|
2025
2097
|
console.warn("[useQueryParams] Schema not ready, cannot set param");
|
|
@@ -2035,7 +2107,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2035
2107
|
},
|
|
2036
2108
|
[variables, schema, isReady, updateUrl]
|
|
2037
2109
|
);
|
|
2038
|
-
const setParams =
|
|
2110
|
+
const setParams = useCallback11(
|
|
2039
2111
|
(updates) => {
|
|
2040
2112
|
if (!isReady) {
|
|
2041
2113
|
console.warn("[useQueryParams] Schema not ready, cannot set params");
|
|
@@ -2051,7 +2123,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2051
2123
|
},
|
|
2052
2124
|
[variables, schema, isReady, updateUrl]
|
|
2053
2125
|
);
|
|
2054
|
-
const clearParamsHandler =
|
|
2126
|
+
const clearParamsHandler = useCallback11(
|
|
2055
2127
|
(keys) => {
|
|
2056
2128
|
if (!isReady) {
|
|
2057
2129
|
console.warn("[useQueryParams] Schema not ready, cannot clear params");
|
|
@@ -2067,7 +2139,7 @@ function useQueryParams(query, options = {}) {
|
|
|
2067
2139
|
},
|
|
2068
2140
|
[variables, schema, isReady, updateUrl]
|
|
2069
2141
|
);
|
|
2070
|
-
const resetParams =
|
|
2142
|
+
const resetParams = useCallback11(() => {
|
|
2071
2143
|
if (debug) {
|
|
2072
2144
|
console.log("[useQueryParams] Resetting params");
|
|
2073
2145
|
}
|
|
@@ -2102,7 +2174,7 @@ function applyParamMapping(schema, mapping) {
|
|
|
2102
2174
|
}
|
|
2103
2175
|
|
|
2104
2176
|
// src/hooks/state/use-api-params.ts
|
|
2105
|
-
import { useCallback as
|
|
2177
|
+
import { useCallback as useCallback12, useEffect as useEffect16, useMemo as useMemo5, useRef as useRef9, useState as useState16 } from "react";
|
|
2106
2178
|
function useContentStable(value, key) {
|
|
2107
2179
|
const [cached, setCached] = useState16({ value, key });
|
|
2108
2180
|
if (cached.key !== key) setCached({ value, key });
|
|
@@ -2133,7 +2205,7 @@ function useApiParams(schema, options = {}) {
|
|
|
2133
2205
|
const searchString = searchParamsLive.toString();
|
|
2134
2206
|
const pendingRef = useRef9([]);
|
|
2135
2207
|
const [pendingTail, setPendingTail] = useState16(void 0);
|
|
2136
|
-
const syncPendingTail =
|
|
2208
|
+
const syncPendingTail = useCallback12(() => {
|
|
2137
2209
|
setPendingTail(pendingRef.current[pendingRef.current.length - 1]);
|
|
2138
2210
|
}, []);
|
|
2139
2211
|
const schemaKey = useMemo5(() => JSON.stringify(schema), [schema]);
|
|
@@ -2168,7 +2240,7 @@ function useApiParams(schema, options = {}) {
|
|
|
2168
2240
|
setParamsCache({ src: rawParams, value: stableParams });
|
|
2169
2241
|
}
|
|
2170
2242
|
const params = stableParams;
|
|
2171
|
-
const addParamToSearchParams =
|
|
2243
|
+
const addParamToSearchParams = useCallback12((searchParams, key, value) => {
|
|
2172
2244
|
for (const [k, v] of createSearchParams({ [key]: value })) searchParams.append(k, v);
|
|
2173
2245
|
}, []);
|
|
2174
2246
|
const urlSearchParams = useMemo5(() => {
|
|
@@ -2183,7 +2255,7 @@ function useApiParams(schema, options = {}) {
|
|
|
2183
2255
|
}
|
|
2184
2256
|
return newParams;
|
|
2185
2257
|
}, [params, flattenedSchema, addParamToSearchParams, stableSchema]);
|
|
2186
|
-
const updateUrl =
|
|
2258
|
+
const updateUrl = useCallback12(
|
|
2187
2259
|
(newParams, keysToRemove = []) => {
|
|
2188
2260
|
const base = pendingRef.current[pendingRef.current.length - 1] ?? searchString;
|
|
2189
2261
|
const finalParams = new URLSearchParams(base);
|
|
@@ -2218,14 +2290,14 @@ function useApiParams(schema, options = {}) {
|
|
|
2218
2290
|
},
|
|
2219
2291
|
[router, debug, searchString, stableSchema, syncPendingTail]
|
|
2220
2292
|
);
|
|
2221
|
-
|
|
2293
|
+
useEffect16(() => {
|
|
2222
2294
|
const queue = pendingRef.current;
|
|
2223
2295
|
if (queue.length === 0) return;
|
|
2224
2296
|
const hit = queue.indexOf(searchString);
|
|
2225
2297
|
pendingRef.current = hit === -1 ? [] : queue.slice(hit + 1);
|
|
2226
2298
|
syncPendingTail();
|
|
2227
2299
|
}, [searchString, syncPendingTail]);
|
|
2228
|
-
const setParam =
|
|
2300
|
+
const setParam = useCallback12(
|
|
2229
2301
|
(key, value) => {
|
|
2230
2302
|
const config = stableSchema[key];
|
|
2231
2303
|
if (!config) {
|
|
@@ -2242,7 +2314,7 @@ function useApiParams(schema, options = {}) {
|
|
|
2242
2314
|
},
|
|
2243
2315
|
[updateUrl, addParamToSearchParams, stableSchema]
|
|
2244
2316
|
);
|
|
2245
|
-
const setParams =
|
|
2317
|
+
const setParams = useCallback12(
|
|
2246
2318
|
(updates) => {
|
|
2247
2319
|
const newParams = new URLSearchParams();
|
|
2248
2320
|
const keysToRemove = [];
|
|
@@ -2262,14 +2334,14 @@ function useApiParams(schema, options = {}) {
|
|
|
2262
2334
|
},
|
|
2263
2335
|
[updateUrl, addParamToSearchParams, stableSchema, flattenedSchema]
|
|
2264
2336
|
);
|
|
2265
|
-
const clearParams2 =
|
|
2337
|
+
const clearParams2 = useCallback12(
|
|
2266
2338
|
(keys) => {
|
|
2267
2339
|
const newParams = new URLSearchParams();
|
|
2268
2340
|
updateUrl(newParams, keys);
|
|
2269
2341
|
},
|
|
2270
2342
|
[updateUrl]
|
|
2271
2343
|
);
|
|
2272
|
-
const resetParams =
|
|
2344
|
+
const resetParams = useCallback12(() => {
|
|
2273
2345
|
if (debug) {
|
|
2274
2346
|
console.log("[useApiParams] Resetting params");
|
|
2275
2347
|
}
|
|
@@ -2293,7 +2365,7 @@ function useApiParams(schema, options = {}) {
|
|
|
2293
2365
|
}
|
|
2294
2366
|
|
|
2295
2367
|
// src/hooks/state/use-cursor-pagination-state.ts
|
|
2296
|
-
import { useCallback as
|
|
2368
|
+
import { useCallback as useCallback13, useEffect as useEffect17, useRef as useRef10, useState as useState17 } from "react";
|
|
2297
2369
|
var urlSchema = {
|
|
2298
2370
|
search: { type: "string", default: "" },
|
|
2299
2371
|
cursor: { type: "string", default: "" }
|
|
@@ -2310,12 +2382,12 @@ function useCursorPaginationState(options) {
|
|
|
2310
2382
|
const searchInputRef = useRef10(searchInput);
|
|
2311
2383
|
const onInitialLoadRef = useRef10(onInitialLoad);
|
|
2312
2384
|
const paramsRef = useRef10(params);
|
|
2313
|
-
|
|
2385
|
+
useEffect17(() => {
|
|
2314
2386
|
searchInputRef.current = searchInput;
|
|
2315
2387
|
onInitialLoadRef.current = onInitialLoad;
|
|
2316
2388
|
paramsRef.current = params;
|
|
2317
2389
|
});
|
|
2318
|
-
|
|
2390
|
+
useEffect17(() => {
|
|
2319
2391
|
if (isInitialLoadInProgress.current) return;
|
|
2320
2392
|
const urlSearch = params.search || "";
|
|
2321
2393
|
if (urlSearch !== searchInputRef.current) {
|
|
@@ -2326,7 +2398,7 @@ function useCursorPaginationState(options) {
|
|
|
2326
2398
|
}, 0);
|
|
2327
2399
|
}
|
|
2328
2400
|
}, [params.search, initialLoadCount]);
|
|
2329
|
-
|
|
2401
|
+
useEffect17(() => {
|
|
2330
2402
|
if (isInitialLoadInProgress.current) return;
|
|
2331
2403
|
if (isSyncingFromUrl.current) return;
|
|
2332
2404
|
if (searchInput !== params.search) {
|
|
@@ -2337,7 +2409,7 @@ function useCursorPaginationState(options) {
|
|
|
2337
2409
|
});
|
|
2338
2410
|
}
|
|
2339
2411
|
}, [searchInput, params.search, setParams, initialLoadCount]);
|
|
2340
|
-
|
|
2412
|
+
useEffect17(() => {
|
|
2341
2413
|
if (initialLoadCount === 0) {
|
|
2342
2414
|
const cursor = paramsRef.current.cursor || null;
|
|
2343
2415
|
const search = paramsRef.current.search || "";
|
|
@@ -2353,7 +2425,7 @@ function useCursorPaginationState(options) {
|
|
|
2353
2425
|
});
|
|
2354
2426
|
}
|
|
2355
2427
|
}, [initialLoadCount]);
|
|
2356
|
-
|
|
2428
|
+
useEffect17(() => {
|
|
2357
2429
|
if (isInitialLoadInProgress.current) return;
|
|
2358
2430
|
if (initialLoadCount === 0) return;
|
|
2359
2431
|
const currentSearch = params.search || "";
|
|
@@ -2365,7 +2437,7 @@ function useCursorPaginationState(options) {
|
|
|
2365
2437
|
});
|
|
2366
2438
|
}
|
|
2367
2439
|
}, [params.search, onSearchChange, initialLoadCount]);
|
|
2368
|
-
const handleNextPage =
|
|
2440
|
+
const handleNextPage = useCallback13(
|
|
2369
2441
|
async (endCursor, fetchFn) => {
|
|
2370
2442
|
setParam("cursor", endCursor);
|
|
2371
2443
|
await fetchFn();
|
|
@@ -2373,7 +2445,7 @@ function useCursorPaginationState(options) {
|
|
|
2373
2445
|
},
|
|
2374
2446
|
[setParam]
|
|
2375
2447
|
);
|
|
2376
|
-
const handleResetToFirstPage =
|
|
2448
|
+
const handleResetToFirstPage = useCallback13(
|
|
2377
2449
|
async (fetchFn) => {
|
|
2378
2450
|
setParam("cursor", "");
|
|
2379
2451
|
await fetchFn();
|
|
@@ -2395,7 +2467,7 @@ function useCursorPaginationState(options) {
|
|
|
2395
2467
|
}
|
|
2396
2468
|
|
|
2397
2469
|
// src/hooks/nats/use-nats-client.ts
|
|
2398
|
-
import { useEffect as
|
|
2470
|
+
import { useEffect as useEffect18, useMemo as useMemo6, useState as useState18 } from "react";
|
|
2399
2471
|
function useNatsClient(clientOptions, options = {}) {
|
|
2400
2472
|
const { autoConnect = true } = options;
|
|
2401
2473
|
const client = useMemo6(() => {
|
|
@@ -2410,7 +2482,7 @@ function useNatsClient(clientOptions, options = {}) {
|
|
|
2410
2482
|
setStatus("disconnected");
|
|
2411
2483
|
setLastError(null);
|
|
2412
2484
|
}
|
|
2413
|
-
|
|
2485
|
+
useEffect18(() => {
|
|
2414
2486
|
if (!client) return void 0;
|
|
2415
2487
|
const off = client.onStatus((event) => {
|
|
2416
2488
|
setStatus(event.status);
|
|
@@ -2437,7 +2509,7 @@ function useNatsClient(clientOptions, options = {}) {
|
|
|
2437
2509
|
}
|
|
2438
2510
|
|
|
2439
2511
|
// src/hooks/use-scenario-player.ts
|
|
2440
|
-
import { useCallback as
|
|
2512
|
+
import { useCallback as useCallback14, useEffect as useEffect19, useRef as useRef11, useState as useState19 } from "react";
|
|
2441
2513
|
var START_MS = 300;
|
|
2442
2514
|
function useScenarioPlayer({
|
|
2443
2515
|
scenarioCount,
|
|
@@ -2457,7 +2529,7 @@ function useScenarioPlayer({
|
|
|
2457
2529
|
const playing = auto.playing && scenarioCount > 0;
|
|
2458
2530
|
const starting = useRef11(false);
|
|
2459
2531
|
const wasPlaying = useRef11(false);
|
|
2460
|
-
|
|
2532
|
+
useEffect19(() => {
|
|
2461
2533
|
if (playing && !wasPlaying.current) starting.current = true;
|
|
2462
2534
|
wasPlaying.current = playing;
|
|
2463
2535
|
if (!playing) return void 0;
|
|
@@ -2477,14 +2549,14 @@ function useScenarioPlayer({
|
|
|
2477
2549
|
);
|
|
2478
2550
|
return () => clearTimeout(timer);
|
|
2479
2551
|
}, [playing, rawStep, lastStep, stepMs, holdMs, scenario, scenarioCount]);
|
|
2480
|
-
const setStep =
|
|
2552
|
+
const setStep = useCallback14(
|
|
2481
2553
|
(next) => {
|
|
2482
2554
|
setRawStep(Math.max(0, Math.min(lastStep, next)));
|
|
2483
2555
|
setPaused(false);
|
|
2484
2556
|
},
|
|
2485
2557
|
[lastStep, setPaused]
|
|
2486
2558
|
);
|
|
2487
|
-
const go =
|
|
2559
|
+
const go = useCallback14(
|
|
2488
2560
|
(next) => {
|
|
2489
2561
|
setScenario(next);
|
|
2490
2562
|
setRawStep(0);
|
|
@@ -2539,7 +2611,7 @@ function useAccessCodeIntegration() {
|
|
|
2539
2611
|
}
|
|
2540
2612
|
|
|
2541
2613
|
// src/hooks/use-claude-mirror-src.ts
|
|
2542
|
-
import { useEffect as
|
|
2614
|
+
import { useEffect as useEffect20, useState as useState20 } from "react";
|
|
2543
2615
|
async function revalidateMirror(mirrorPath) {
|
|
2544
2616
|
try {
|
|
2545
2617
|
const res = await fetch(`${mirrorPath}?revalidate=1`);
|
|
@@ -2555,7 +2627,7 @@ function useClaudeMirrorSrc(url) {
|
|
|
2555
2627
|
const mirrorPath = toClaudeMirrorPath(url, endpoints?.storageViewBaseUrl);
|
|
2556
2628
|
const [resolved, setResolved] = useState20(null);
|
|
2557
2629
|
const state = resolved && resolved.key === mirrorPath ? resolved.value : { src: null, status: mirrorPath ? "probing" : "absent" };
|
|
2558
|
-
|
|
2630
|
+
useEffect20(() => {
|
|
2559
2631
|
if (!mirrorPath) return void 0;
|
|
2560
2632
|
let cancelled = false;
|
|
2561
2633
|
const settle = (value) => {
|
|
@@ -2582,7 +2654,7 @@ function useClaudeMirrorSrc(url) {
|
|
|
2582
2654
|
}
|
|
2583
2655
|
|
|
2584
2656
|
// src/hooks/use-location-hash.ts
|
|
2585
|
-
import { useSyncExternalStore } from "react";
|
|
2657
|
+
import { useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
2586
2658
|
var HASH_EVENTS = ["hashchange", "popstate", LOCATION_HASH_SYNC_EVENT];
|
|
2587
2659
|
function subscribe(onChange) {
|
|
2588
2660
|
for (const event of HASH_EVENTS) window.addEventListener(event, onChange);
|
|
@@ -2599,15 +2671,15 @@ function readHash() {
|
|
|
2599
2671
|
}
|
|
2600
2672
|
}
|
|
2601
2673
|
function useLocationHash() {
|
|
2602
|
-
return
|
|
2674
|
+
return useSyncExternalStore2(subscribe, readHash, () => "");
|
|
2603
2675
|
}
|
|
2604
2676
|
|
|
2605
2677
|
// src/hooks/use-scroll-to-hash.ts
|
|
2606
|
-
import { useEffect as
|
|
2678
|
+
import { useEffect as useEffect21 } from "react";
|
|
2607
2679
|
var MAX_POLL_FRAMES = 60;
|
|
2608
2680
|
function useScrollToHash(readyDep = true, options) {
|
|
2609
2681
|
const headerOffset = options?.headerOffset ?? 0;
|
|
2610
|
-
|
|
2682
|
+
useEffect21(() => {
|
|
2611
2683
|
if (typeof window === "undefined") return void 0;
|
|
2612
2684
|
if (readyDep === null || readyDep === false) return void 0;
|
|
2613
2685
|
let rafId = null;
|
|
@@ -2648,19 +2720,19 @@ function useScrollToHash(readyDep = true, options) {
|
|
|
2648
2720
|
}
|
|
2649
2721
|
|
|
2650
2722
|
// src/hooks/use-humanity-signals.ts
|
|
2651
|
-
import { useCallback as
|
|
2723
|
+
import { useCallback as useCallback15, useRef as useRef12, useState as useState21 } from "react";
|
|
2652
2724
|
function useHumanitySignals() {
|
|
2653
2725
|
const ref = useRef12(null);
|
|
2654
2726
|
const [mountedAt] = useState21(() => typeof performance !== "undefined" ? performance.now() : 0);
|
|
2655
2727
|
const startedAtRef = useRef12(mountedAt);
|
|
2656
|
-
const getSignals =
|
|
2728
|
+
const getSignals = useCallback15(
|
|
2657
2729
|
() => ({
|
|
2658
2730
|
[HONEYPOT_FIELD]: ref.current?.value ?? "",
|
|
2659
2731
|
[ELAPSED_MS_FIELD]: typeof performance !== "undefined" ? Math.round(performance.now() - startedAtRef.current) : 0
|
|
2660
2732
|
}),
|
|
2661
2733
|
[]
|
|
2662
2734
|
);
|
|
2663
|
-
const resetSignals =
|
|
2735
|
+
const resetSignals = useCallback15(() => {
|
|
2664
2736
|
if (ref.current) ref.current.value = "";
|
|
2665
2737
|
if (typeof performance !== "undefined") startedAtRef.current = performance.now();
|
|
2666
2738
|
}, []);
|
|
@@ -2668,7 +2740,7 @@ function useHumanitySignals() {
|
|
|
2668
2740
|
}
|
|
2669
2741
|
|
|
2670
2742
|
// src/hooks/use-form-rescue.ts
|
|
2671
|
-
import { useCallback as
|
|
2743
|
+
import { useCallback as useCallback16, useEffect as useEffect22, useMemo as useMemo7, useRef as useRef13 } from "react";
|
|
2672
2744
|
var LOCAL_DRAFT_TTL_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
2673
2745
|
var STORAGE_PREFIX = "form-rescue:v1:";
|
|
2674
2746
|
var UTM_KEYS = ["source", "medium", "campaign", "content", "term"];
|
|
@@ -2741,16 +2813,16 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
2741
2813
|
const fieldNamesRef = useRef13(fieldNames);
|
|
2742
2814
|
const onRestoreRef = useRef13(onRestore);
|
|
2743
2815
|
const getSignalsRef = useRef13(getSignals);
|
|
2744
|
-
|
|
2816
|
+
useEffect22(() => {
|
|
2745
2817
|
fieldNamesRef.current = fieldNames;
|
|
2746
2818
|
onRestoreRef.current = onRestore;
|
|
2747
2819
|
getSignalsRef.current = getSignals;
|
|
2748
2820
|
});
|
|
2749
|
-
const attemptId =
|
|
2821
|
+
const attemptId = useCallback16(() => {
|
|
2750
2822
|
if (!attemptIdRef.current) attemptIdRef.current = newAttemptId();
|
|
2751
2823
|
return attemptIdRef.current;
|
|
2752
2824
|
}, []);
|
|
2753
|
-
const send =
|
|
2825
|
+
const send = useCallback16(
|
|
2754
2826
|
(keepalive) => {
|
|
2755
2827
|
if (!formId || !draftsUrl || !dirtyRef.current || completedRef.current || !latestRef.current) return;
|
|
2756
2828
|
dirtyRef.current = false;
|
|
@@ -2781,7 +2853,7 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
2781
2853
|
},
|
|
2782
2854
|
[attemptId, draftsUrl, formId]
|
|
2783
2855
|
);
|
|
2784
|
-
|
|
2856
|
+
useEffect22(() => {
|
|
2785
2857
|
if (!formId || typeof window === "undefined") return void 0;
|
|
2786
2858
|
let cancelled = false;
|
|
2787
2859
|
const token = new URLSearchParams(window.location.search).get(FORM_RESCUE_RESUME_PARAM);
|
|
@@ -2811,7 +2883,7 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
2811
2883
|
cancelled = true;
|
|
2812
2884
|
};
|
|
2813
2885
|
}, [attemptId, draftsUrl, formId]);
|
|
2814
|
-
|
|
2886
|
+
useEffect22(() => {
|
|
2815
2887
|
if (!formId || typeof document === "undefined") return void 0;
|
|
2816
2888
|
const onHide = () => {
|
|
2817
2889
|
if (completedRef.current || !startedRef.current) return;
|
|
@@ -2838,7 +2910,7 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
2838
2910
|
if (timerRef.current) clearTimeout(timerRef.current);
|
|
2839
2911
|
};
|
|
2840
2912
|
}, [attemptId, formId, send]);
|
|
2841
|
-
const track =
|
|
2913
|
+
const track = useCallback16(
|
|
2842
2914
|
(values, lastField) => {
|
|
2843
2915
|
if (!formId || completedRef.current) return;
|
|
2844
2916
|
const names = fieldNamesRef.current;
|
|
@@ -2871,14 +2943,14 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
2871
2943
|
},
|
|
2872
2944
|
[attemptId, formId, send]
|
|
2873
2945
|
);
|
|
2874
|
-
const submitFields =
|
|
2946
|
+
const submitFields = useCallback16(() => {
|
|
2875
2947
|
if (!formId) return {};
|
|
2876
2948
|
return {
|
|
2877
2949
|
[FORM_RESCUE_ATTEMPT_FIELD]: attemptId(),
|
|
2878
2950
|
...resumeTokenRef.current ? { [FORM_RESCUE_RESUME_FIELD]: resumeTokenRef.current } : {}
|
|
2879
2951
|
};
|
|
2880
2952
|
}, [attemptId, formId]);
|
|
2881
|
-
const complete =
|
|
2953
|
+
const complete = useCallback16(() => {
|
|
2882
2954
|
if (!formId) return;
|
|
2883
2955
|
if (timerRef.current) {
|
|
2884
2956
|
clearTimeout(timerRef.current);
|
|
@@ -2896,7 +2968,7 @@ function useFormRescue({ form, fieldNames, onRestore, getSignals }) {
|
|
|
2896
2968
|
}
|
|
2897
2969
|
|
|
2898
2970
|
// src/hooks/use-rescued-form.ts
|
|
2899
|
-
import { useEffect as
|
|
2971
|
+
import { useEffect as useEffect23 } from "react";
|
|
2900
2972
|
function flattenOneLevel(values) {
|
|
2901
2973
|
const flat = {};
|
|
2902
2974
|
for (const [key, value] of Object.entries(values)) {
|
|
@@ -2920,7 +2992,7 @@ function useRescuedForm(form, { rescue, fields, getSignals, fieldPath }) {
|
|
|
2920
2992
|
}
|
|
2921
2993
|
}
|
|
2922
2994
|
});
|
|
2923
|
-
|
|
2995
|
+
useEffect23(() => {
|
|
2924
2996
|
const subscription = watch((values, { name }) => {
|
|
2925
2997
|
handle.track(flattenOneLevel(values), name ? name.split(".").pop() ?? null : null);
|
|
2926
2998
|
});
|
|
@@ -2958,6 +3030,9 @@ export {
|
|
|
2958
3030
|
useToast,
|
|
2959
3031
|
useContactSubmission,
|
|
2960
3032
|
useCopyToClipboard,
|
|
3033
|
+
resetDownloadsStore,
|
|
3034
|
+
useDownloads,
|
|
3035
|
+
useVisitorDesktopDownload,
|
|
2961
3036
|
configureBatchImageFetch,
|
|
2962
3037
|
batchFetchAuthenticatedImages,
|
|
2963
3038
|
useBatchImages,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
EmbedViewerFrame
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2P2M27EW.js";
|
|
5
5
|
import {
|
|
6
6
|
toGoogleSheetsEmbedUrl,
|
|
7
7
|
toGoogleSheetsOriginalUrl
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-4I3K6LEH.js";
|
|
9
9
|
import {
|
|
10
10
|
formatFileSize
|
|
11
11
|
} from "./chunk-IYVFSLWJ.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-NCPTID44.js";
|
|
16
16
|
import {
|
|
17
17
|
Button
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-DJ4IFQNQ.js";
|
|
19
19
|
|
|
20
20
|
// src/components/embeds/file-download-card.tsx
|
|
21
21
|
import { FileText, Download } from "lucide-react";
|