your-ai-workflow-firebase-os 2.0.2 → 2.0.3
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/AccessNotice-BZ5Gt1nP.js +40 -0
- package/dist/AccessNotice-CN7kc70o.cjs +1 -0
- package/dist/{AddressField-B2YBRXcx.js → AddressField-9Sqn8TvC.js} +3 -3
- package/dist/{AddressField-BBv8NGX8.cjs → AddressField-B7wtV8yA.cjs} +1 -1
- package/dist/Assets-DBMwZ3bN.cjs +1 -0
- package/dist/Assets-DT-NU_WO.js +296 -0
- package/dist/Attachments-Bl9_dfsu.js +46 -0
- package/dist/Attachments-UVK9SRXf.cjs +1 -0
- package/dist/Billing-0RIHayHy.cjs +1 -0
- package/dist/Billing-FNE2r3_d.js +379 -0
- package/dist/BookingCalendar-BP5kiv3d.cjs +1 -0
- package/dist/BookingCalendar-DZ2fEFja.js +309 -0
- package/dist/Button-4lzOE31p.js +48 -0
- package/dist/Button-5DlB2MCi.cjs +1 -0
- package/dist/CalendarView-BimoXy_k.cjs +1 -0
- package/dist/CalendarView-D-ykjpvI.js +664 -0
- package/dist/ConfirmModal-Di9GR-vV.cjs +1 -0
- package/dist/ConfirmModal-gKQEpd4d.js +113 -0
- package/dist/ContactPopup-BXnHrRwl.js +1114 -0
- package/dist/ContactPopup-lxmRMoIa.cjs +1 -0
- package/dist/CopyLink-BpEQWmfI.cjs +1 -0
- package/dist/CopyLink-CBAVfcm1.js +43 -0
- package/dist/DashboardNav-CXa_ci-_.cjs +1 -0
- package/dist/DashboardNav-Dmn7PVSp.js +886 -0
- package/dist/EmailAdmin-CjN_rvxT.js +318 -0
- package/dist/EmailAdmin-lAEBdY1s.cjs +1 -0
- package/dist/EventCard-46EquygT.cjs +1 -0
- package/dist/EventCard-B6xD-mk3.js +97 -0
- package/dist/FileViewerPopup-CX-J75TM.js +1283 -0
- package/dist/FileViewerPopup-D8-MmIoS.cjs +3 -0
- package/dist/FormNote-BivRNA3J.js +50 -0
- package/dist/FormNote-BtdTGpml.cjs +1 -0
- package/dist/FormsAdmin-B5PBCG2W.js +812 -0
- package/dist/FormsAdmin-BQCULvi5.cjs +1 -0
- package/dist/Inbox-BPk2ZkE5.js +779 -0
- package/dist/Inbox-DNrcBx0o.cjs +3 -0
- package/dist/Loader-Bu89fsbB.cjs +1 -0
- package/dist/Loader-D4gwgBOq.js +32 -0
- package/dist/ManagePlanButton-B0dwqZBd.cjs +1 -0
- package/dist/ManagePlanButton-BSrOHYze.js +29 -0
- package/dist/MyBookings-6qr0GgzO.cjs +1 -0
- package/dist/MyBookings-BQjGM2LQ.js +113 -0
- package/dist/PageTitle-CZhgmmDT.cjs +3 -0
- package/dist/PageTitle-D93YCiN8.js +1606 -0
- package/dist/PagesAdmin-BcHIcqM5.cjs +34 -0
- package/dist/PagesAdmin-D69P9nRb.js +5802 -0
- package/dist/PagesAdmin-DNwZOKjA.cjs +1 -0
- package/dist/PagesAdmin-HUITEcHx.js +3 -0
- package/dist/PaymentsAdmin-C2iCI9qC.js +1291 -0
- package/dist/PaymentsAdmin-CoXi2vCm.cjs +2 -0
- package/dist/{PhoneInputField-B3P_vUDW.cjs → PhoneInputField-BEwYZMB7.cjs} +1 -1
- package/dist/{PhoneInputField-D3wWs-M8.js → PhoneInputField-BG0L2djE.js} +2 -2
- package/dist/PhoneInputField-DfOtCIH_.js +2 -0
- package/dist/{PhoneInputField-CdNTvWXQ.cjs → PhoneInputField-jhWvto8C.cjs} +1 -1
- package/dist/Popup-DHYGFl2-.cjs +1 -0
- package/dist/Popup-xROLytgr.js +142 -0
- package/dist/ProviderMark-BBfaM5Yl.js +52 -0
- package/dist/ProviderMark-xLkUN3Fx.cjs +1 -0
- package/dist/PublishApp-Bm-6r3Td.js +595 -0
- package/dist/PublishApp-D4XJUkJa.cjs +2 -0
- package/dist/Said-CoC15awL.js +94 -0
- package/dist/Said-IqCNofdh.cjs +1 -0
- package/dist/ScheduleAdmin-BKfQkrR8.js +1853 -0
- package/dist/ScheduleAdmin-DwK36GAZ.cjs +1 -0
- package/dist/SchedulePicker--urIH2Eb.js +112 -0
- package/dist/SchedulePicker-nmqzUnUH.cjs +1 -0
- package/dist/Setup-CHLgd-ag.js +849 -0
- package/dist/Setup-CaDranTm.cjs +1374 -0
- package/dist/SetupPayments-CVIwh1eQ.js +411 -0
- package/dist/SetupPayments-HNXWA25X.cjs +1 -0
- package/dist/SignInAdmin-C94-A-0w.cjs +4 -0
- package/dist/SignInAdmin-Yxgv_8U4.js +766 -0
- package/dist/SupportBar-CDT0HwdP.cjs +1 -0
- package/dist/SupportBar-CN_JGC-9.js +117 -0
- package/dist/SystemTabContent-L3vGGF3P.cjs +1 -0
- package/dist/SystemTabContent-QdxxLILE.js +35 -0
- package/dist/TemplateDrive-DV8zNjYe.cjs +1 -0
- package/dist/TemplateDrive-NJY_AAvV.js +1197 -0
- package/dist/ThemeAdmin-BzFjJkLg.js +269 -0
- package/dist/ThemeAdmin-DVnPNxe7.cjs +1 -0
- package/dist/ThemeAdmin-DY7Vc4Sj.cjs +3 -0
- package/dist/ThemeAdmin-DnC-D2N3.js +2 -0
- package/dist/{ContactPopup-Dsg2ntq3.js → TimeZoneField-DkI1Bkcz.js} +3191 -5322
- package/dist/TimeZoneField-qs7NPR30.cjs +12 -0
- package/dist/TransactionsAdmin-BsZ-oQWi.js +582 -0
- package/dist/TransactionsAdmin-CTSTiPld.cjs +1 -0
- package/dist/Trouble-9es_AI4F.cjs +1 -0
- package/dist/Trouble-oWt9fMsm.js +164 -0
- package/dist/Users-CTitWXyd.cjs +1 -0
- package/dist/Users-DJjQTWJF.js +1207 -0
- package/dist/aiModels-DIP9fn8T.cjs +1 -0
- package/dist/{aiModels-BHlEfuRJ.js → aiModels-DnDhNGup.js} +29 -61
- package/dist/arrivalRoads-BJ-35vkk.js +228 -0
- package/dist/arrivalRoads-qoU-B4jt.cjs +4 -0
- package/dist/{bake-BWG3y-15.cjs → bake-n2wyFw0B.cjs} +1 -1
- package/dist/{bake-BtYOG1Du.js → bake-naZeMu98.js} +1 -1
- package/dist/bookingPages-C7a3srPG.js +102 -0
- package/dist/bookingPages-DvbFbD9X.cjs +1 -0
- package/dist/components/CustomSelect.d.ts +7 -1
- package/dist/components/RegistrationFields.d.ts +6 -1
- package/dist/components/Reveal.d.ts +12 -0
- package/dist/components/ScrollToTop.d.ts +4 -0
- package/dist/contentFallback-C9MZjdq7.cjs +1 -0
- package/dist/contentFallback-CEDY0Pwp.js +96 -0
- package/dist/contentKey-Bwry4lDa.js +13 -0
- package/dist/contentKey-DJGYYnAE.cjs +1 -0
- package/dist/email-BfnZnMwD.cjs +1 -0
- package/dist/email-Ddj8Dlu6.js +58 -0
- package/dist/{fileBytes-BdwaFKRy.cjs → fileBytes-BJPaiX9Y.cjs} +1 -1
- package/dist/{fileBytes-DuW2K-H_.js → fileBytes-bjgvCfWu.js} +2 -2
- package/dist/forms-Bvx9HTM6.js +75 -0
- package/dist/forms-CmNeTETW.cjs +1 -0
- package/dist/lib/ThemeContext.d.ts +0 -14
- package/dist/lib/bareImgWatch.d.ts +6 -1
- package/dist/lib/localEdits.d.ts +2 -0
- package/dist/lib/paymentProducts.d.ts +8 -0
- package/dist/lib/payments.d.ts +11 -1
- package/dist/notices-B7iIrIEg.js +29 -0
- package/dist/notices-upMg8UVh.cjs +1 -0
- package/dist/openOnArrival-Buwqb86D.cjs +1 -0
- package/dist/openOnArrival-S2K6v-lB.js +35 -0
- package/dist/pageFiles--Ih60ITP.js +45 -0
- package/dist/pageFiles-UtBmlOcD.cjs +1 -0
- package/dist/pages/PagesAdmin.d.ts +69 -0
- package/dist/people-2jZE_pdI.js +102 -0
- package/dist/people-BpVvIr9-.cjs +1 -0
- package/dist/personName-CFw3pxuu.js +18 -0
- package/dist/personName-CbzN_i57.cjs +1 -0
- package/dist/publishSteps-C1cDFzzB.js +88 -0
- package/dist/publishSteps-SSm8afDw.cjs +1 -0
- package/dist/recordLock-DHVvI9bP.js +61 -0
- package/dist/recordLock-DWeIxiwh.cjs +1 -0
- package/dist/recordsKey-B7QrxdeU.cjs +1 -0
- package/dist/recordsKey-D5-wC0Aw.js +141 -0
- package/dist/registrationFields-CLeR2lQJ.js +181 -0
- package/dist/registrationFields-v4pOoRdn.cjs +1 -0
- package/dist/renderer.cjs.js +1 -1
- package/dist/renderer.es.js +1 -1
- package/dist/roles-D6VaHWfV.js +147 -0
- package/dist/roles-DQUFFBQe.cjs +1 -0
- package/dist/scheduleData-ATN8w5hI.js +727 -0
- package/dist/scheduleData-Cltj0ABZ.cjs +1 -0
- package/dist/server.cjs.js +6 -6
- package/dist/server.es.js +716 -715
- package/dist/serviceStatus-TQyZO_Y_.cjs +1 -0
- package/dist/serviceStatus-vS8AI7SZ.js +125 -0
- package/dist/tabAudience-BqpN6dsR.cjs +1 -0
- package/dist/tabAudience-CRyMvv0v.js +34 -0
- package/dist/transactions-BqMQDRx3.js +343 -0
- package/dist/transactions-CufFrdAM.cjs +1 -0
- package/dist/useIsPhone-BVGx_X3e.js +13 -0
- package/dist/useIsPhone-o63tNneA.cjs +1 -0
- package/dist/{validate-DzSJWuyL.js → validate-CmC_tLK-.js} +433 -351
- package/dist/validate-DZMwqSrb.cjs +103 -0
- package/dist/vite/validate.d.ts +14 -0
- package/dist/vite.cjs.js +1 -1
- package/dist/vite.es.js +1 -1
- package/dist/your-ai-workflow-firebase-os.cjs.js +15 -1431
- package/dist/your-ai-workflow-firebase-os.css +1 -1
- package/dist/your-ai-workflow-firebase-os.es.js +8200 -32421
- package/package.json +1 -1
- package/src/index.css +122 -2
- package/dist/ContactPopup-IwBm-eqz.cjs +0 -12
- package/dist/PhoneInputField-CVamkTJg.js +0 -2
- package/dist/aiModels-BIhoTNH0.cjs +0 -1
- package/dist/validate-e48WXJdP.cjs +0 -103
- /package/dist/{address-DI1YaCI4.cjs → address-Bsb8COq2.cjs} +0 -0
- /package/dist/{address-Ca1h_UZX.js → address-C2bHNxJU.js} +0 -0
- /package/dist/{dist-BkUiTtIb.js → dist-DUPvBnOA.js} +0 -0
- /package/dist/{dist-BLGlDv1e.cjs → dist-E4jTFPs7.cjs} +0 -0
- /package/dist/{lucide-react-BYniZ3lQ.cjs → lucide-react-BwV6L6Is.cjs} +0 -0
- /package/dist/{lucide-react-ehRy1vqS.js → lucide-react-CA7GD7Nv.js} +0 -0
- /package/dist/{mediaKind-dk396a03.cjs → mediaKind-D0MWyv6b.cjs} +0 -0
- /package/dist/{mediaKind-De2Cx_kB.js → mediaKind-DmKMsjeY.js} +0 -0
- /package/dist/{pdf-u73U7-6s.js → pdf-DRXcPGkr.js} +0 -0
- /package/dist/{pdf-B24jYmSf.cjs → pdf-jLjjhvjp.cjs} +0 -0
- /package/dist/{pdf.worker.min-BPOWx2_9.js → pdf.worker.min-CfKZezeM.js} +0 -0
- /package/dist/{pdf.worker.min-BvhEiZFe.cjs → pdf.worker.min-bLgNWd7w.cjs} +0 -0
- /package/dist/{verifiedAccount-C1iCxopN.js → verifiedAccount-DRbRFJ6H.js} +0 -0
- /package/dist/{verifiedAccount-D3OeaOBo.cjs → verifiedAccount-DScyKk96.cjs} +0 -0
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
import { t as e } from "./PageTitle-D93YCiN8.js";
|
|
2
|
+
import { D as t, E as n, Rn as r, Ta as i, Vn as a, a as o, cr as s, dr as c, ka as l, kt as u, l as ee, o as te, or as ne, p as re, sr as ie, ya as d, zn as ae } from "./TimeZoneField-DkI1Bkcz.js";
|
|
3
|
+
import { S as f, a as oe, t as se, y as p } from "./DashboardNav-Dmn7PVSp.js";
|
|
4
|
+
import { h as m, p as h } from "./verifiedAccount-DRbRFJ6H.js";
|
|
5
|
+
import { C as ce, F as le, Sn as ue, _ as g, bn as de, lt as _, o as fe, vn as pe, z as me } from "./lucide-react-CA7GD7Nv.js";
|
|
6
|
+
import { n as v } from "./Loader-D4gwgBOq.js";
|
|
7
|
+
import { l as he } from "./address-C2bHNxJU.js";
|
|
8
|
+
import { a as y, i as ge } from "./transactions-BqMQDRx3.js";
|
|
9
|
+
import { i as _e, o as ve } from "./tabAudience-CRyMvv0v.js";
|
|
10
|
+
import { t as ye } from "./FileViewerPopup-CX-J75TM.js";
|
|
11
|
+
import { t as be } from "./FormNote-BivRNA3J.js";
|
|
12
|
+
import { t as xe } from "./ConfirmModal-gKQEpd4d.js";
|
|
13
|
+
import { n as Se } from "./SystemTabContent-QdxxLILE.js";
|
|
14
|
+
import { n as Ce } from "./useIsPhone-BVGx_X3e.js";
|
|
15
|
+
import { n as b } from "./contentKey-Bwry4lDa.js";
|
|
16
|
+
import { t as x } from "./Attachments-Bl9_dfsu.js";
|
|
17
|
+
import { useCallback as S, useDeferredValue as we, useEffect as C, useMemo as Te, useState as w } from "react";
|
|
18
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
19
|
+
import { collection as O, deleteDoc as Ee, doc as k, getDoc as A, onSnapshot as j, orderBy as De, query as Oe, updateDoc as M } from "firebase/firestore";
|
|
20
|
+
import { Link as N, useSearchParams as ke } from "react-router-dom";
|
|
21
|
+
//#region src/pages/Inbox.tsx
|
|
22
|
+
var P = {
|
|
23
|
+
anyone: {
|
|
24
|
+
collectionName: "user_submissions",
|
|
25
|
+
chip: "Anyone",
|
|
26
|
+
said: "Not signed in",
|
|
27
|
+
filterLabel: "From anyone"
|
|
28
|
+
},
|
|
29
|
+
signedIn: {
|
|
30
|
+
collectionName: "user_requests",
|
|
31
|
+
chip: "Signed-in user",
|
|
32
|
+
said: "Signed-in user",
|
|
33
|
+
filterLabel: "From signed-in users"
|
|
34
|
+
}
|
|
35
|
+
}, F = [
|
|
36
|
+
"id",
|
|
37
|
+
"source",
|
|
38
|
+
"uid",
|
|
39
|
+
"submittedAt",
|
|
40
|
+
"avatarUrl",
|
|
41
|
+
"isArchived",
|
|
42
|
+
"name",
|
|
43
|
+
"full_name",
|
|
44
|
+
"email",
|
|
45
|
+
"contactEmail",
|
|
46
|
+
"topic"
|
|
47
|
+
], I = (e) => e == null ? "" : typeof e == "boolean" ? e ? "Yes" : "No" : Array.isArray(e) ? e.map(I).filter(Boolean).join("\n") : typeof e == "object" ? typeof e.toDate == "function" ? R(e) : Object.entries(e).filter(([e]) => !ge(e)).map(([e, t]) => `${e}: ${I(t)}`).join(" · ") : String(e), L = (e) => {
|
|
48
|
+
let t = e.submittedAt;
|
|
49
|
+
if (!t) return 0;
|
|
50
|
+
if (typeof t.toMillis == "function") return t.toMillis();
|
|
51
|
+
if (typeof t.toDate == "function") return t.toDate().getTime();
|
|
52
|
+
let n = new Date(t).getTime();
|
|
53
|
+
return Number.isNaN(n) ? 0 : n;
|
|
54
|
+
}, R = (e) => {
|
|
55
|
+
if (!e) return "Just now";
|
|
56
|
+
let t = e.toDate ? e.toDate() : new Date(e);
|
|
57
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
58
|
+
month: "short",
|
|
59
|
+
day: "numeric",
|
|
60
|
+
hour: "numeric",
|
|
61
|
+
minute: "numeric"
|
|
62
|
+
}).format(t);
|
|
63
|
+
}, Ae = (e) => {
|
|
64
|
+
if (!e) return "now";
|
|
65
|
+
let t = e.toDate ? e.toDate() : new Date(e), n = /* @__PURE__ */ new Date();
|
|
66
|
+
return t.toDateString() === n.toDateString() ? new Intl.DateTimeFormat("en-US", {
|
|
67
|
+
hour: "numeric",
|
|
68
|
+
minute: "numeric"
|
|
69
|
+
}).format(t) : new Intl.DateTimeFormat("en-US", t.getFullYear() === n.getFullYear() ? {
|
|
70
|
+
month: "short",
|
|
71
|
+
day: "numeric"
|
|
72
|
+
} : {
|
|
73
|
+
month: "short",
|
|
74
|
+
year: "numeric"
|
|
75
|
+
}).format(t);
|
|
76
|
+
}, z = (e) => {
|
|
77
|
+
let t = new Date(e);
|
|
78
|
+
return new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime();
|
|
79
|
+
}, B = (e) => {
|
|
80
|
+
let t = L(e);
|
|
81
|
+
if (!t) return "Older";
|
|
82
|
+
let n = Math.round((z(Date.now()) - z(t)) / 864e5);
|
|
83
|
+
return n <= 0 ? "Today" : n === 1 ? "Yesterday" : n < 7 ? "This week" : n < 30 ? "This month" : "Older";
|
|
84
|
+
}, je = (e) => e.reduce((e, t) => {
|
|
85
|
+
let n = B(t), r = e[e.length - 1];
|
|
86
|
+
return r && r.label === n ? r.items.push(t) : e.push({
|
|
87
|
+
label: n,
|
|
88
|
+
items: [t]
|
|
89
|
+
}), e;
|
|
90
|
+
}, []), V = (e) => e.submitterName || e.name || e.full_name || "Anonymous", H = (e) => e.contactEmail || e.email || "", U = (e) => `${e.source}:${e.id}`, Me = (e) => {
|
|
91
|
+
let t = Object.entries(e).filter(([t]) => !F.includes(t) && !t.toLowerCase().startsWith("submitter") && t.toLowerCase() !== "formid" && !he(t, e));
|
|
92
|
+
return e.topic ? [["topic", e.topic], ...t] : t;
|
|
93
|
+
}, W = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()), Ne = (e) => {
|
|
94
|
+
let t = Me(e).filter(([e]) => e !== "topic"), n = t.find(([, e]) => !a(e) && I(e).trim()), r = t.filter(([, e]) => a(e)).reduce((e, [, t]) => e + ae(t).length, 0), i = (n ? I(n[1]) : r > 0 ? `${r} ${r === 1 ? "file" : "files"} attached` : H(e)).replace(/\s*\n+\s*/g, " · ").replace(/\s+/g, " ").trim();
|
|
95
|
+
return [e.topic ? String(e.topic).trim() : "", i].filter(Boolean).join(" — ").slice(0, 200);
|
|
96
|
+
}, Pe = (e) => e.replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase()), G = (e, t) => {
|
|
97
|
+
let n = {};
|
|
98
|
+
for (let [r, i] of t) n[r] = {
|
|
99
|
+
...i?.config || {},
|
|
100
|
+
...e[r] || {}
|
|
101
|
+
};
|
|
102
|
+
for (let [t, r] of Object.entries(e)) {
|
|
103
|
+
let i = String(r?.fileId || "");
|
|
104
|
+
i && i !== t && !e[i] ? (n[t] = {
|
|
105
|
+
...n[i] || {},
|
|
106
|
+
...r
|
|
107
|
+
}, delete n[i]) : n[t] || (n[t] = r);
|
|
108
|
+
}
|
|
109
|
+
return Object.entries(n);
|
|
110
|
+
};
|
|
111
|
+
function K(e, t = {}, n = f()) {
|
|
112
|
+
let r = b(e);
|
|
113
|
+
if (!r) return {
|
|
114
|
+
name: "Contact",
|
|
115
|
+
Icon: _
|
|
116
|
+
};
|
|
117
|
+
let i = typeof window < "u" && window.__FBOS_FORMS__ || {}, a = i[r] || i[String(e)], o = null;
|
|
118
|
+
for (let [e, i] of G(t, n)) {
|
|
119
|
+
let t = new Set([
|
|
120
|
+
e,
|
|
121
|
+
i?.contentKey,
|
|
122
|
+
i?.pageId,
|
|
123
|
+
i?.tabName,
|
|
124
|
+
i?.pageName,
|
|
125
|
+
i?.title
|
|
126
|
+
].map(b).filter((e) => e.length >= 3));
|
|
127
|
+
for (let e of t) (r === e || r.startsWith(e)) && (!o || e.length > o.key.length) && (o = {
|
|
128
|
+
key: e,
|
|
129
|
+
page: i
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
let s = o?.page;
|
|
133
|
+
return {
|
|
134
|
+
name: String(s?.tabName || s?.pageName || s?.title || a?.title || "").trim() || Pe(r),
|
|
135
|
+
Icon: p(s?.iconName) || _
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
var Fe = () => {
|
|
139
|
+
try {
|
|
140
|
+
let e = localStorage.getItem("fbos_nav_tabs"), t = e ? JSON.parse(e) : null;
|
|
141
|
+
return t && typeof t == "object" ? t : {};
|
|
142
|
+
} catch {
|
|
143
|
+
return {};
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
function Ie() {
|
|
147
|
+
let [e, t] = w(Fe);
|
|
148
|
+
return C(() => d("sys_tabs", () => O(l, "sys_tabs"), (e) => {
|
|
149
|
+
let n = {};
|
|
150
|
+
for (let t of e.docs || []) n[t.id] = t.data();
|
|
151
|
+
t(n);
|
|
152
|
+
}, () => {}), []), S((t) => K(t, e), [e]);
|
|
153
|
+
}
|
|
154
|
+
var q = "fbos_inbox_seen_at", J = "fbos_inbox_opened", Y = 500, Le = () => {
|
|
155
|
+
try {
|
|
156
|
+
let e = Number(localStorage.getItem(q));
|
|
157
|
+
if (e > 0 || localStorage.getItem(q) === "0") return e;
|
|
158
|
+
let t = Date.now();
|
|
159
|
+
return localStorage.setItem(q, String(t)), t;
|
|
160
|
+
} catch {
|
|
161
|
+
return Date.now();
|
|
162
|
+
}
|
|
163
|
+
}, Re = () => {
|
|
164
|
+
try {
|
|
165
|
+
let e = JSON.parse(localStorage.getItem(J) || "[]");
|
|
166
|
+
return new Set(Array.isArray(e) ? e.map(String) : []);
|
|
167
|
+
} catch {
|
|
168
|
+
return /* @__PURE__ */ new Set();
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
function ze() {
|
|
172
|
+
let [e, t] = w(Re);
|
|
173
|
+
return [e, S((e) => {
|
|
174
|
+
t((t) => {
|
|
175
|
+
if (t.has(e)) return t;
|
|
176
|
+
let n = new Set(t);
|
|
177
|
+
n.add(e);
|
|
178
|
+
try {
|
|
179
|
+
localStorage.setItem(J, JSON.stringify([...n].slice(-Y)));
|
|
180
|
+
} catch {}
|
|
181
|
+
return n;
|
|
182
|
+
});
|
|
183
|
+
}, [])];
|
|
184
|
+
}
|
|
185
|
+
var X = /* @__PURE__ */ new Map(), Z = (e) => {
|
|
186
|
+
let t = X.get(e);
|
|
187
|
+
return t || (t = A(k(l, "user_profiles", e)).then((e) => e.exists() ? e.data() : null).catch((t) => (console.error("Failed to fetch profile", t), X.delete(e), null)), X.set(e, t)), t;
|
|
188
|
+
};
|
|
189
|
+
function Q(e, t) {
|
|
190
|
+
let [n, r] = w([]), [i, a] = w(!0), [o, s] = w(null);
|
|
191
|
+
return C(() => {
|
|
192
|
+
let n = !1, i = P[e].collectionName, o = j(Oe(O(l, i), De("submittedAt", "desc")), async (i) => {
|
|
193
|
+
let o = i.docs.filter((e) => {
|
|
194
|
+
let t = e.data();
|
|
195
|
+
return !(t.formId === "booking" || u(t) || y(t));
|
|
196
|
+
}), c = await Promise.all(o.map(async (n) => {
|
|
197
|
+
let r = { ...n.data() }, i = "";
|
|
198
|
+
if (t && r.uid && r.uid !== "guest") {
|
|
199
|
+
let e = await Z(r.uid);
|
|
200
|
+
e && ((e.avatar || e.photoURL) && (i = e.avatar || e.photoURL), r.name ||= e.name || e.displayName, r.email ||= e.email, r.contactEmail ||= e.email);
|
|
201
|
+
}
|
|
202
|
+
return {
|
|
203
|
+
...r,
|
|
204
|
+
id: n.id,
|
|
205
|
+
source: e,
|
|
206
|
+
avatarUrl: i
|
|
207
|
+
};
|
|
208
|
+
}));
|
|
209
|
+
n || (r(c), s(null), a(!1));
|
|
210
|
+
}, (e) => {
|
|
211
|
+
console.error(`Error loading ${i}:`, e), n || (s(e), a(!1));
|
|
212
|
+
});
|
|
213
|
+
return () => {
|
|
214
|
+
n = !0, o();
|
|
215
|
+
};
|
|
216
|
+
}, [e, t]), {
|
|
217
|
+
items: n,
|
|
218
|
+
loading: i,
|
|
219
|
+
refused: o
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
var Be = [
|
|
223
|
+
.16,
|
|
224
|
+
1,
|
|
225
|
+
.3,
|
|
226
|
+
1
|
|
227
|
+
];
|
|
228
|
+
function Ve({ on: e, onClick: t, label: n, short: r, count: i }) {
|
|
229
|
+
return /* @__PURE__ */ D("button", {
|
|
230
|
+
type: "button",
|
|
231
|
+
onClick: t,
|
|
232
|
+
"aria-pressed": e,
|
|
233
|
+
"aria-label": n,
|
|
234
|
+
className: `h-7 px-2.5 inline-flex items-center gap-1.5 rounded-full text-[12.5px] font-medium border whitespace-nowrap transition-colors cursor-pointer active:scale-[0.98] ${e ? "bg-accent/10 border-accent/30 text-accent" : "border-[var(--panel-border)] text-foreground/60 hover:text-foreground hover:bg-foreground/[0.03]"}`,
|
|
235
|
+
children: [r ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("span", {
|
|
236
|
+
className: "sm:hidden",
|
|
237
|
+
children: r
|
|
238
|
+
}), /* @__PURE__ */ E("span", {
|
|
239
|
+
className: "max-sm:hidden",
|
|
240
|
+
children: n
|
|
241
|
+
})] }) : n, i ? /* @__PURE__ */ E("span", {
|
|
242
|
+
className: "tabular-nums text-[11.5px] opacity-70",
|
|
243
|
+
children: i
|
|
244
|
+
}) : null]
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
var He = "w-8 h-8 inline-flex items-center justify-center rounded-lg text-foreground/50 hover:text-foreground hover:bg-foreground/[0.06] transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-accent/50";
|
|
248
|
+
function Ue({ item: e, look: t, selected: n, unread: r, onSelect: i, onArchive: a, onDelete: o }) {
|
|
249
|
+
let s = V(e), c = t.Icon, l = !!(a || o);
|
|
250
|
+
return /* @__PURE__ */ D("div", {
|
|
251
|
+
className: "group relative px-2 md:px-3",
|
|
252
|
+
children: [/* @__PURE__ */ D("button", {
|
|
253
|
+
type: "button",
|
|
254
|
+
onClick: i,
|
|
255
|
+
"aria-current": n ? "true" : void 0,
|
|
256
|
+
"aria-label": `Show details from ${s}`,
|
|
257
|
+
"data-unread": r ? "true" : void 0,
|
|
258
|
+
className: `w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-left transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-accent/40 ${n ? "bg-accent/[0.1]" : r ? "bg-accent/[0.05] hover:bg-accent/[0.08]" : "hover:bg-foreground/[0.03]"}`,
|
|
259
|
+
children: [
|
|
260
|
+
/* @__PURE__ */ E("span", {
|
|
261
|
+
"aria-hidden": "true",
|
|
262
|
+
className: `w-1.5 h-1.5 rounded-full shrink-0 ${r ? "bg-accent" : "bg-transparent"}`
|
|
263
|
+
}),
|
|
264
|
+
/* @__PURE__ */ E(c, {
|
|
265
|
+
"aria-hidden": "true",
|
|
266
|
+
className: `w-4 h-4 shrink-0 ${n ? "text-accent" : "text-foreground/45"}`
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ E("span", {
|
|
269
|
+
className: `shrink-0 max-w-[42%] truncate text-[13.5px] ${r ? "font-semibold text-foreground" : "font-medium text-foreground/85"}`,
|
|
270
|
+
children: s
|
|
271
|
+
}),
|
|
272
|
+
/* @__PURE__ */ E("span", {
|
|
273
|
+
className: `flex-1 min-w-0 truncate text-[13px] ${r ? "text-foreground/65" : "text-foreground/50"}`,
|
|
274
|
+
children: Ne(e)
|
|
275
|
+
}),
|
|
276
|
+
/* @__PURE__ */ E("span", {
|
|
277
|
+
className: `shrink-0 text-[11.5px] tabular-nums text-foreground/40 transition-opacity ${l ? "group-hover:opacity-0" : ""}`,
|
|
278
|
+
children: Ae(e.submittedAt)
|
|
279
|
+
})
|
|
280
|
+
]
|
|
281
|
+
}), l && /* @__PURE__ */ D("div", {
|
|
282
|
+
className: "absolute right-4 md:right-5 top-1/2 -translate-y-1/2 flex items-center gap-0.5 rounded-lg bg-background/90 backdrop-blur-sm opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity",
|
|
283
|
+
children: [a && /* @__PURE__ */ E("button", {
|
|
284
|
+
type: "button",
|
|
285
|
+
onClick: a,
|
|
286
|
+
"aria-label": e.isArchived ? "Restore" : "Archive",
|
|
287
|
+
title: e.isArchived ? "Restore" : "Archive",
|
|
288
|
+
className: He,
|
|
289
|
+
children: e.isArchived ? /* @__PURE__ */ E(pe, { className: "w-4 h-4" }) : /* @__PURE__ */ E(ue, { className: "w-4 h-4" })
|
|
290
|
+
}), o && /* @__PURE__ */ E("button", {
|
|
291
|
+
type: "button",
|
|
292
|
+
onClick: o,
|
|
293
|
+
"aria-label": "Delete",
|
|
294
|
+
title: "Delete",
|
|
295
|
+
className: He,
|
|
296
|
+
children: /* @__PURE__ */ E(ce, { className: "w-4 h-4" })
|
|
297
|
+
})]
|
|
298
|
+
})]
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
function We({ item: e, look: t, canOpenProfile: n, actions: r, onOpenFile: i }) {
|
|
302
|
+
let o = V(e), s = H(e), c = Me(e), l = !!e.uid && e.uid !== "guest";
|
|
303
|
+
return /* @__PURE__ */ D("article", {
|
|
304
|
+
"aria-label": `Message from ${o}`,
|
|
305
|
+
className: "px-5 py-6 sm:px-8 sm:py-8 lg:px-10 flex flex-col gap-6 max-w-3xl",
|
|
306
|
+
children: [/* @__PURE__ */ D("header", {
|
|
307
|
+
className: "flex flex-col gap-4",
|
|
308
|
+
children: [/* @__PURE__ */ D("div", {
|
|
309
|
+
className: "flex items-start justify-between gap-4",
|
|
310
|
+
children: [/* @__PURE__ */ D("div", {
|
|
311
|
+
className: "min-w-0 flex flex-col gap-1",
|
|
312
|
+
children: [
|
|
313
|
+
/* @__PURE__ */ E("p", {
|
|
314
|
+
className: "text-[12.5px] font-medium text-foreground/50",
|
|
315
|
+
children: t.name
|
|
316
|
+
}),
|
|
317
|
+
/* @__PURE__ */ E("h2", {
|
|
318
|
+
className: "text-[22px] sm:text-2xl font-semibold tracking-tight text-foreground leading-tight [overflow-wrap:anywhere]",
|
|
319
|
+
children: o
|
|
320
|
+
}),
|
|
321
|
+
/* @__PURE__ */ E("p", {
|
|
322
|
+
className: "text-[13px] text-foreground/60 flex flex-wrap items-center gap-x-2 gap-y-0.5",
|
|
323
|
+
children: [
|
|
324
|
+
s ? /* @__PURE__ */ E("span", {
|
|
325
|
+
className: "[overflow-wrap:anywhere]",
|
|
326
|
+
children: s
|
|
327
|
+
}, "email") : null,
|
|
328
|
+
/* @__PURE__ */ E("span", { children: P[e.source].said }, "who"),
|
|
329
|
+
/* @__PURE__ */ E("span", {
|
|
330
|
+
className: "tabular-nums",
|
|
331
|
+
children: R(e.submittedAt)
|
|
332
|
+
}, "when")
|
|
333
|
+
].filter(Boolean).map((e, t) => /* @__PURE__ */ D("span", {
|
|
334
|
+
className: "inline-flex items-center gap-x-2",
|
|
335
|
+
children: [t > 0 && /* @__PURE__ */ E("span", {
|
|
336
|
+
"aria-hidden": "true",
|
|
337
|
+
className: "text-foreground/30",
|
|
338
|
+
children: "·"
|
|
339
|
+
}), e]
|
|
340
|
+
}, e.key))
|
|
341
|
+
})
|
|
342
|
+
]
|
|
343
|
+
}), r && /* @__PURE__ */ E("div", {
|
|
344
|
+
className: "flex items-center gap-1.5 shrink-0",
|
|
345
|
+
children: r
|
|
346
|
+
})]
|
|
347
|
+
}), l && n && /* @__PURE__ */ D(N, {
|
|
348
|
+
to: `/users/${e.uid}`,
|
|
349
|
+
className: "self-start inline-flex items-center gap-1.5 text-[13px] font-medium text-accent hover:underline",
|
|
350
|
+
children: [/* @__PURE__ */ E(g, {
|
|
351
|
+
className: "w-3.5 h-3.5",
|
|
352
|
+
"aria-hidden": "true"
|
|
353
|
+
}), "Open this person’s profile"]
|
|
354
|
+
})]
|
|
355
|
+
}), c.length > 0 ? /* @__PURE__ */ E("dl", {
|
|
356
|
+
className: "border-t border-[var(--panel-border)]/70 divide-y divide-[var(--panel-border)]/50",
|
|
357
|
+
children: c.map(([e, t]) => /* @__PURE__ */ D("div", {
|
|
358
|
+
className: "py-3.5 sm:grid sm:grid-cols-[minmax(7rem,11rem)_minmax(0,1fr)] sm:gap-6",
|
|
359
|
+
children: [/* @__PURE__ */ E("dt", {
|
|
360
|
+
className: "text-[13px] text-foreground/60 mb-1 sm:mb-0 sm:pt-px",
|
|
361
|
+
children: W(e)
|
|
362
|
+
}), /* @__PURE__ */ E("dd", {
|
|
363
|
+
className: "min-w-0",
|
|
364
|
+
children: a(t) ? /* @__PURE__ */ E(x, {
|
|
365
|
+
value: t,
|
|
366
|
+
onOpen: i
|
|
367
|
+
}) : /* @__PURE__ */ E("p", {
|
|
368
|
+
className: "text-[14.5px] text-foreground leading-relaxed whitespace-pre-wrap break-words [overflow-wrap:anywhere]",
|
|
369
|
+
children: I(t) || "No data provided"
|
|
370
|
+
})
|
|
371
|
+
})]
|
|
372
|
+
}, e))
|
|
373
|
+
}) : /* @__PURE__ */ E("p", {
|
|
374
|
+
className: "border-t border-[var(--panel-border)]/70 pt-4 text-[13.5px] text-foreground/50",
|
|
375
|
+
children: "This form only asked for a name and email."
|
|
376
|
+
})]
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
function Ge({ items: c, loading: l, refused: u, onArchive: d, onDelete: f, opensUsers: oe, formLook: p, initialOpen: m = null }) {
|
|
380
|
+
let h = Ce(), g = ne(), [_, he] = w("all"), [y, ge] = w("all"), [_e, ve] = w(!1), [b, x] = w(!1), [O, Ee] = w(""), k = we(O.trim().toLowerCase()), [A, j] = w(m), [De, Oe] = w(null), [M, N] = w(""), [F, R] = w(null), [Ae, z] = w(!1), [B, W] = w(null), [Ne] = w(Le), [Pe, G] = ze(), K = S((e) => L(e) > Ne && !Pe.has(U(e)), [Ne, Pe]), Fe = S((e) => {
|
|
381
|
+
let t = U(e);
|
|
382
|
+
j(t), N(""), G(t);
|
|
383
|
+
}, [G]), [Ie, q] = ke(), J = Ie.get("open");
|
|
384
|
+
C(() => {
|
|
385
|
+
if (!J || l) return;
|
|
386
|
+
let e = c.find((e) => U(e) === J);
|
|
387
|
+
e && (e.isArchived && x(!0), Fe(e), q({}, { replace: !0 }));
|
|
388
|
+
}, [
|
|
389
|
+
J,
|
|
390
|
+
l,
|
|
391
|
+
c
|
|
392
|
+
]), C(() => {
|
|
393
|
+
m && c.find((e) => U(e) === m)?.isArchived && x(!0);
|
|
394
|
+
}, [m]);
|
|
395
|
+
let Y = h && !!A;
|
|
396
|
+
C(() => {
|
|
397
|
+
if (!Y || typeof document > "u") return;
|
|
398
|
+
let e = document.body.style.overflow;
|
|
399
|
+
return document.body.style.overflow = "hidden", () => {
|
|
400
|
+
document.body.style.overflow = e;
|
|
401
|
+
};
|
|
402
|
+
}, [Y]);
|
|
403
|
+
let Re = Te(() => {
|
|
404
|
+
let e = /* @__PURE__ */ new Map();
|
|
405
|
+
for (let t of c) {
|
|
406
|
+
let n = String(t.formId || "");
|
|
407
|
+
e.has(n) || e.set(n, p(t.formId));
|
|
408
|
+
}
|
|
409
|
+
return e;
|
|
410
|
+
}, [c, p]), X = [...Re.entries()], Z = S((e) => Re.get(String(e.formId || "")) || p(e.formId), [Re, p]), Q = c.filter((e) => e.isArchived).length, He = c.filter((e) => !e.isArchived && K(e)).length, Ge = Te(() => c.filter((e) => !(!!e.isArchived !== b || _ !== "all" && e.source !== _ || y !== "all" && String(e.formId || "") !== y || _e && !K(e) || k && ![
|
|
411
|
+
V(e),
|
|
412
|
+
H(e),
|
|
413
|
+
Z(e).name,
|
|
414
|
+
...Me(e).map(([, e]) => a(e) ? ae(e).map(r).join(" ") : I(e))
|
|
415
|
+
].join("\n").toLowerCase().includes(k))), [
|
|
416
|
+
c,
|
|
417
|
+
b,
|
|
418
|
+
_,
|
|
419
|
+
y,
|
|
420
|
+
_e,
|
|
421
|
+
k,
|
|
422
|
+
K,
|
|
423
|
+
Z
|
|
424
|
+
]), $ = A && c.find((e) => U(e) === A) || null, Ke = async (e) => {
|
|
425
|
+
if (!d) return;
|
|
426
|
+
let t = U(e);
|
|
427
|
+
Oe(t), N("");
|
|
428
|
+
try {
|
|
429
|
+
await d(e), G(t), A === t && j(null);
|
|
430
|
+
} catch (e) {
|
|
431
|
+
N(i(e, "The message could not be moved."));
|
|
432
|
+
}
|
|
433
|
+
Oe(null);
|
|
434
|
+
}, qe = async () => {
|
|
435
|
+
if (!(!F || !f)) {
|
|
436
|
+
z(!0), N("");
|
|
437
|
+
try {
|
|
438
|
+
await f(F), A === U(F) && j(null), R(null);
|
|
439
|
+
} catch (e) {
|
|
440
|
+
N(i(e, "The message could not be deleted.")), R(null);
|
|
441
|
+
}
|
|
442
|
+
z(!1);
|
|
443
|
+
}
|
|
444
|
+
}, Je = [
|
|
445
|
+
{
|
|
446
|
+
key: "all",
|
|
447
|
+
label: "Everything",
|
|
448
|
+
short: "All"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
key: "anyone",
|
|
452
|
+
label: P.anyone.filterLabel,
|
|
453
|
+
short: "Anyone"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
key: "signedIn",
|
|
457
|
+
label: P.signedIn.filterLabel,
|
|
458
|
+
short: "Signed in"
|
|
459
|
+
}
|
|
460
|
+
], Ye = (e, t = !1) => {
|
|
461
|
+
let n = H(e);
|
|
462
|
+
return n ? /* @__PURE__ */ D("a", {
|
|
463
|
+
href: `mailto:${n}`,
|
|
464
|
+
title: "Reply by email",
|
|
465
|
+
"aria-label": "Reply by email",
|
|
466
|
+
className: `${o} ${t ? "max-sm:w-8 max-sm:px-0 max-sm:gap-0 max-sm:border-transparent max-sm:hover:border-transparent max-sm:hover:bg-foreground/[0.06]" : ""}`,
|
|
467
|
+
children: [/* @__PURE__ */ E(me, {
|
|
468
|
+
className: "w-3.5 h-3.5 shrink-0",
|
|
469
|
+
"aria-hidden": "true"
|
|
470
|
+
}), t ? /* @__PURE__ */ E("span", {
|
|
471
|
+
className: "max-sm:hidden",
|
|
472
|
+
children: "Reply"
|
|
473
|
+
}) : "Reply"]
|
|
474
|
+
}) : null;
|
|
475
|
+
}, Xe = (e, t = !1) => /* @__PURE__ */ D(T, { children: [
|
|
476
|
+
Ye(e, t),
|
|
477
|
+
d && /* @__PURE__ */ E(te, {
|
|
478
|
+
icon: e.isArchived ? pe : ue,
|
|
479
|
+
onClick: () => Ke(e),
|
|
480
|
+
busy: De === U(e),
|
|
481
|
+
compact: t,
|
|
482
|
+
title: e.isArchived ? "Restore" : "Archive",
|
|
483
|
+
children: e.isArchived ? "Restore" : "Archive"
|
|
484
|
+
}),
|
|
485
|
+
f && /* @__PURE__ */ E(te, {
|
|
486
|
+
icon: ce,
|
|
487
|
+
tone: "danger",
|
|
488
|
+
onClick: () => R(e),
|
|
489
|
+
compact: t,
|
|
490
|
+
title: "Delete",
|
|
491
|
+
children: "Delete"
|
|
492
|
+
})
|
|
493
|
+
] }), Ze = Ge.length === 0 ? /* @__PURE__ */ E("p", {
|
|
494
|
+
className: "px-6 py-14 text-center text-[13.5px] text-foreground/50",
|
|
495
|
+
children: b ? "Nothing archived matches." : Q > 0 && c.length === Q ? "Everything here is archived." : "Nothing matches."
|
|
496
|
+
}) : /* @__PURE__ */ E(t, {
|
|
497
|
+
className: "flex flex-col pb-3",
|
|
498
|
+
children: je(Ge).flatMap((e) => [/* @__PURE__ */ E("p", {
|
|
499
|
+
className: "px-5 md:px-6 pt-4 pb-1.5 text-[11.5px] font-medium uppercase tracking-[0.14em] text-foreground/40 select-none",
|
|
500
|
+
children: e.label
|
|
501
|
+
}, `h:${e.label}`), ...e.items.map((e) => /* @__PURE__ */ E(Ue, {
|
|
502
|
+
item: e,
|
|
503
|
+
look: Z(e),
|
|
504
|
+
selected: A === U(e),
|
|
505
|
+
unread: K(e),
|
|
506
|
+
onSelect: () => Fe(e),
|
|
507
|
+
onArchive: !h && d ? () => Ke(e) : void 0,
|
|
508
|
+
onDelete: !h && f ? () => R(e) : void 0
|
|
509
|
+
}, U(e)))])
|
|
510
|
+
}), Qe = /* @__PURE__ */ D("div", {
|
|
511
|
+
className: "p-4 md:p-5 flex flex-col gap-3 border-b border-[var(--panel-border)]/60",
|
|
512
|
+
children: [/* @__PURE__ */ D("div", {
|
|
513
|
+
className: ee,
|
|
514
|
+
children: [
|
|
515
|
+
/* @__PURE__ */ E(le, {
|
|
516
|
+
className: "w-4 h-4 mr-2.5 text-foreground/30 shrink-0",
|
|
517
|
+
"aria-hidden": "true"
|
|
518
|
+
}),
|
|
519
|
+
/* @__PURE__ */ E("input", {
|
|
520
|
+
type: "text",
|
|
521
|
+
value: O,
|
|
522
|
+
onChange: (e) => Ee(e.target.value),
|
|
523
|
+
placeholder: "Search messages",
|
|
524
|
+
"aria-label": "Search messages",
|
|
525
|
+
className: `${re} no-glow`
|
|
526
|
+
}),
|
|
527
|
+
O && /* @__PURE__ */ E("button", {
|
|
528
|
+
type: "button",
|
|
529
|
+
onClick: () => Ee(""),
|
|
530
|
+
"aria-label": "Clear search",
|
|
531
|
+
className: "ml-2 -mr-1 w-7 h-7 inline-flex items-center justify-center rounded-lg text-foreground/40 hover:text-foreground hover:bg-foreground/[0.06] transition-colors cursor-pointer",
|
|
532
|
+
children: /* @__PURE__ */ E(fe, { className: "w-3.5 h-3.5" })
|
|
533
|
+
})
|
|
534
|
+
]
|
|
535
|
+
}), /* @__PURE__ */ D("div", {
|
|
536
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
537
|
+
children: [
|
|
538
|
+
Je.map((e) => /* @__PURE__ */ E(Ve, {
|
|
539
|
+
on: _ === e.key,
|
|
540
|
+
onClick: () => he(e.key),
|
|
541
|
+
label: e.label,
|
|
542
|
+
short: e.short
|
|
543
|
+
}, e.key)),
|
|
544
|
+
/* @__PURE__ */ E("span", {
|
|
545
|
+
"aria-hidden": "true",
|
|
546
|
+
className: "w-px h-3.5 mx-0.5 bg-[var(--panel-border)]"
|
|
547
|
+
}),
|
|
548
|
+
/* @__PURE__ */ E(Ve, {
|
|
549
|
+
on: _e,
|
|
550
|
+
onClick: () => ve((e) => !e),
|
|
551
|
+
label: "Unread",
|
|
552
|
+
count: He
|
|
553
|
+
}),
|
|
554
|
+
X.length > 1 && /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("span", {
|
|
555
|
+
"aria-hidden": "true",
|
|
556
|
+
className: "w-px h-3.5 mx-0.5 bg-[var(--panel-border)]"
|
|
557
|
+
}), X.map(([e, t]) => /* @__PURE__ */ E(Ve, {
|
|
558
|
+
on: y === e,
|
|
559
|
+
onClick: () => ge((t) => t === e ? "all" : e),
|
|
560
|
+
label: t.name
|
|
561
|
+
}, e || "_"))] }),
|
|
562
|
+
Q > 0 && /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("span", {
|
|
563
|
+
"aria-hidden": "true",
|
|
564
|
+
className: "w-px h-3.5 mx-0.5 bg-[var(--panel-border)]"
|
|
565
|
+
}), /* @__PURE__ */ E(Ve, {
|
|
566
|
+
on: b,
|
|
567
|
+
onClick: () => x((e) => !e),
|
|
568
|
+
label: "Archived",
|
|
569
|
+
count: Q
|
|
570
|
+
})] })
|
|
571
|
+
]
|
|
572
|
+
})]
|
|
573
|
+
}), $e = l ? /* @__PURE__ */ E("div", {
|
|
574
|
+
className: "flex-1 min-h-0 md:grid md:grid-cols-[minmax(340px,430px)_minmax(0,1fr)]",
|
|
575
|
+
children: /* @__PURE__ */ D("div", {
|
|
576
|
+
className: "p-4 md:p-5 flex flex-col gap-3 md:border-r md:border-[var(--panel-border)]/70",
|
|
577
|
+
"aria-busy": "true",
|
|
578
|
+
children: [
|
|
579
|
+
/* @__PURE__ */ E(v, { className: "h-10 rounded-xl" }),
|
|
580
|
+
/* @__PURE__ */ D("div", {
|
|
581
|
+
className: "flex gap-1.5",
|
|
582
|
+
children: [
|
|
583
|
+
/* @__PURE__ */ E(v, { className: "h-8 w-24 rounded-full" }),
|
|
584
|
+
/* @__PURE__ */ E(v, { className: "h-8 w-28 rounded-full" }),
|
|
585
|
+
/* @__PURE__ */ E(v, { className: "h-8 w-20 rounded-full" })
|
|
586
|
+
]
|
|
587
|
+
}),
|
|
588
|
+
/* @__PURE__ */ E("div", {
|
|
589
|
+
className: "flex flex-col gap-1.5 pt-2",
|
|
590
|
+
children: [
|
|
591
|
+
0,
|
|
592
|
+
1,
|
|
593
|
+
2,
|
|
594
|
+
3,
|
|
595
|
+
4,
|
|
596
|
+
5
|
|
597
|
+
].map((e) => /* @__PURE__ */ E(v, {
|
|
598
|
+
className: "h-10 rounded-xl",
|
|
599
|
+
style: { opacity: 1 - e * .12 }
|
|
600
|
+
}, e))
|
|
601
|
+
})
|
|
602
|
+
]
|
|
603
|
+
})
|
|
604
|
+
}) : u && c.length === 0 ? /* @__PURE__ */ E("div", {
|
|
605
|
+
className: "flex-1 flex items-center justify-center p-8",
|
|
606
|
+
children: /* @__PURE__ */ E(be, {
|
|
607
|
+
tone: "error",
|
|
608
|
+
children: i(u, "The messages could not be read.")
|
|
609
|
+
})
|
|
610
|
+
}) : c.length === 0 ? /* @__PURE__ */ D("div", {
|
|
611
|
+
className: "flex-1 flex flex-col items-center justify-center text-center gap-1 px-8 py-20",
|
|
612
|
+
children: [/* @__PURE__ */ E("p", {
|
|
613
|
+
className: "text-[14px] font-medium text-foreground/70",
|
|
614
|
+
children: "Nothing here yet"
|
|
615
|
+
}), /* @__PURE__ */ E("p", {
|
|
616
|
+
className: "text-[13px] text-foreground/45",
|
|
617
|
+
children: "Everything people send you through a form on your site lands here."
|
|
618
|
+
})]
|
|
619
|
+
}) : h ? /* @__PURE__ */ D("div", {
|
|
620
|
+
className: "flex flex-col",
|
|
621
|
+
children: [Qe, Ze]
|
|
622
|
+
}) : /* @__PURE__ */ D("div", {
|
|
623
|
+
className: "flex-1 min-h-0 grid grid-cols-[minmax(340px,430px)_minmax(0,1fr)]",
|
|
624
|
+
children: [/* @__PURE__ */ D("div", {
|
|
625
|
+
className: "flex flex-col min-h-0 border-r border-[var(--panel-border)]/70",
|
|
626
|
+
children: [Qe, /* @__PURE__ */ E("div", {
|
|
627
|
+
className: "flex-1 min-h-0 overflow-y-auto",
|
|
628
|
+
children: Ze
|
|
629
|
+
})]
|
|
630
|
+
}), /* @__PURE__ */ E("div", {
|
|
631
|
+
className: "min-h-0 overflow-y-auto",
|
|
632
|
+
children: /* @__PURE__ */ E(ie.div, {
|
|
633
|
+
initial: g ? !1 : {
|
|
634
|
+
opacity: 0,
|
|
635
|
+
y: 8
|
|
636
|
+
},
|
|
637
|
+
animate: {
|
|
638
|
+
opacity: 1,
|
|
639
|
+
y: 0
|
|
640
|
+
},
|
|
641
|
+
transition: {
|
|
642
|
+
duration: .25,
|
|
643
|
+
ease: Be
|
|
644
|
+
},
|
|
645
|
+
className: "min-h-full flex flex-col",
|
|
646
|
+
children: $ ? /* @__PURE__ */ D(T, { children: [M && /* @__PURE__ */ E("div", {
|
|
647
|
+
className: "px-8 pt-6 lg:px-10",
|
|
648
|
+
children: /* @__PURE__ */ E(be, {
|
|
649
|
+
tone: "error",
|
|
650
|
+
children: M
|
|
651
|
+
})
|
|
652
|
+
}), /* @__PURE__ */ E(We, {
|
|
653
|
+
item: $,
|
|
654
|
+
look: Z($),
|
|
655
|
+
canOpenProfile: oe,
|
|
656
|
+
actions: Xe($),
|
|
657
|
+
onOpenFile: W
|
|
658
|
+
})] }) : /* @__PURE__ */ E("div", {
|
|
659
|
+
className: "flex-1 flex items-center justify-center p-8",
|
|
660
|
+
children: /* @__PURE__ */ E("p", {
|
|
661
|
+
className: "text-[13.5px] text-foreground/40",
|
|
662
|
+
children: "Select a message to read it."
|
|
663
|
+
})
|
|
664
|
+
})
|
|
665
|
+
}, $ ? U($) : "none")
|
|
666
|
+
})]
|
|
667
|
+
});
|
|
668
|
+
return /* @__PURE__ */ D("main", {
|
|
669
|
+
className: "flex-1 w-full max-w-7xl mx-auto p-4 pt-2 md:p-8 md:pt-4 z-10 flex flex-col min-h-screen",
|
|
670
|
+
children: [
|
|
671
|
+
/* @__PURE__ */ D(ie.div, {
|
|
672
|
+
initial: {
|
|
673
|
+
opacity: 0,
|
|
674
|
+
y: 20
|
|
675
|
+
},
|
|
676
|
+
animate: {
|
|
677
|
+
opacity: 1,
|
|
678
|
+
y: 0
|
|
679
|
+
},
|
|
680
|
+
className: "mb-6",
|
|
681
|
+
children: [/* @__PURE__ */ E(e, { children: "Inbox" }), /* @__PURE__ */ D("div", {
|
|
682
|
+
className: "flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]",
|
|
683
|
+
children: [/* @__PURE__ */ E("span", { className: "w-8 h-[1px] bg-foreground/10" }), "/inbox"]
|
|
684
|
+
})]
|
|
685
|
+
}),
|
|
686
|
+
/* @__PURE__ */ D("div", {
|
|
687
|
+
className: "flex flex-col gap-6 flex-1 pb-16",
|
|
688
|
+
children: [
|
|
689
|
+
/* @__PURE__ */ E("div", {
|
|
690
|
+
className: "flex justify-start",
|
|
691
|
+
children: /* @__PURE__ */ E(se, {})
|
|
692
|
+
}),
|
|
693
|
+
/* @__PURE__ */ E(Se, { tab: "inbox" }),
|
|
694
|
+
/* @__PURE__ */ E(n, {
|
|
695
|
+
as: "section",
|
|
696
|
+
className: "glass-panel border border-[var(--panel-border)] rounded-2xl md:rounded-3xl shadow-2xl bg-[var(--panel-bg)] overflow-hidden flex flex-col fbos-tab-fill min-h-[420px] md:h-[clamp(560px,calc(100dvh-14rem),960px)]",
|
|
697
|
+
children: $e
|
|
698
|
+
})
|
|
699
|
+
]
|
|
700
|
+
}),
|
|
701
|
+
/* @__PURE__ */ E(s, { children: Y && $ && /* @__PURE__ */ D(ie.div, {
|
|
702
|
+
role: "dialog",
|
|
703
|
+
"aria-label": `Message from ${V($)}`,
|
|
704
|
+
initial: g ? { opacity: 0 } : { x: "100%" },
|
|
705
|
+
animate: g ? { opacity: 1 } : { x: 0 },
|
|
706
|
+
exit: g ? { opacity: 0 } : { x: "100%" },
|
|
707
|
+
transition: {
|
|
708
|
+
duration: .28,
|
|
709
|
+
ease: Be
|
|
710
|
+
},
|
|
711
|
+
className: "fixed inset-0 z-[70] bg-background overflow-y-auto",
|
|
712
|
+
children: [
|
|
713
|
+
/* @__PURE__ */ D("div", {
|
|
714
|
+
className: "sticky top-0 z-10 flex items-center justify-between gap-2 px-3 h-14 bg-background/85 backdrop-blur-xl border-b border-[var(--panel-border)]/60",
|
|
715
|
+
children: [/* @__PURE__ */ D("button", {
|
|
716
|
+
type: "button",
|
|
717
|
+
onClick: () => j(null),
|
|
718
|
+
"aria-label": "Back to the list",
|
|
719
|
+
className: "inline-flex items-center gap-1.5 h-9 pl-2 pr-3 rounded-xl text-[13px] font-medium text-foreground/70 hover:text-foreground hover:bg-foreground/[0.05] transition-colors cursor-pointer",
|
|
720
|
+
children: [/* @__PURE__ */ E(de, {
|
|
721
|
+
className: "w-4 h-4",
|
|
722
|
+
"aria-hidden": "true"
|
|
723
|
+
}), "Inbox"]
|
|
724
|
+
}), /* @__PURE__ */ E("div", {
|
|
725
|
+
className: "flex items-center gap-1",
|
|
726
|
+
children: Xe($, !0)
|
|
727
|
+
})]
|
|
728
|
+
}),
|
|
729
|
+
M && /* @__PURE__ */ E("div", {
|
|
730
|
+
className: "px-5 pt-4",
|
|
731
|
+
children: /* @__PURE__ */ E(be, {
|
|
732
|
+
tone: "error",
|
|
733
|
+
children: M
|
|
734
|
+
})
|
|
735
|
+
}),
|
|
736
|
+
/* @__PURE__ */ E(We, {
|
|
737
|
+
item: $,
|
|
738
|
+
look: Z($),
|
|
739
|
+
canOpenProfile: oe,
|
|
740
|
+
onOpenFile: W
|
|
741
|
+
})
|
|
742
|
+
]
|
|
743
|
+
}, "phone-sheet") }),
|
|
744
|
+
/* @__PURE__ */ E(xe, {
|
|
745
|
+
isOpen: !!F,
|
|
746
|
+
title: "Delete this message?",
|
|
747
|
+
message: "This removes it for good. There is no undo — archive it instead if you only want it out of the way.",
|
|
748
|
+
onConfirm: qe,
|
|
749
|
+
onCancel: () => R(null),
|
|
750
|
+
isProcessing: Ae,
|
|
751
|
+
confirmText: "Yes, delete"
|
|
752
|
+
}),
|
|
753
|
+
/* @__PURE__ */ E(ye, {
|
|
754
|
+
open: !!B,
|
|
755
|
+
onClose: () => W(null),
|
|
756
|
+
src: B?.src || "",
|
|
757
|
+
name: B?.name
|
|
758
|
+
})
|
|
759
|
+
]
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
function $() {
|
|
763
|
+
let { userRole: e } = c(), { access: t } = oe(), n = m(e), r = _e(e, ve(t, "users")), i = n || h(e) || r, a = Q("anyone", i), o = Q("signedIn", i), s = Ie(), u = a.loading || o.loading, ee = a.refused || o.refused, te = Te(() => [...a.items, ...o.items].sort((e, t) => L(t) - L(e)), [a.items, o.items]), ne = S(async (e) => {
|
|
764
|
+
await M(k(l, P[e.source].collectionName, e.id), { isArchived: !e.isArchived });
|
|
765
|
+
}, []), re = S(async (e) => {
|
|
766
|
+
await Ee(k(l, P[e.source].collectionName, e.id));
|
|
767
|
+
}, []);
|
|
768
|
+
return /* @__PURE__ */ E(Ge, {
|
|
769
|
+
items: te,
|
|
770
|
+
loading: u,
|
|
771
|
+
refused: ee,
|
|
772
|
+
onArchive: n ? ne : void 0,
|
|
773
|
+
onDelete: n ? re : void 0,
|
|
774
|
+
opensUsers: r,
|
|
775
|
+
formLook: s
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
//#endregion
|
|
779
|
+
export { $ as Inbox };
|